ported the lexer and the parser to C++