Iam using c lexer that is flex generated and a c++ parser that is bison generated. i have modified the parser to acccept only string input.
I am calling the parser function yyparse in a loop and reading line by line of user input. I stop the loop if the input is "quit".
The problem i am facing is that when input does'nt match any rule then, the parser stops abruptly, and at next iteration starts off
at same...
User Profile
Collapse
-
Clearing parser state of a bison generated parser
-
Although Lex and YACC predate C++, it is possible to generate a C++ parser. While Flex includes an option to generate a C++ lexer, we won't be using that, as YACC doesn't know how to deal with it directly.
It is possible to make the yacc generate a c++ file, but the lex outputs a c file. so in order for the yacc generated file to recoginize the c functions and variables,
To do so, make a C header in YACC like this:
...
No activity results to display
Show More
Leave a comment: