javamonn has left the following comment at Create a flex+bison tutorial
To avoid confusion, these are the files that are ready for review:
Bison_Flex_Tutorial.txt, calculator.lex, and calculator2.yacc. I missed a
small formatting issue on the original upload of calculator.yacc so I fixed
it and reuploaded.
The tutorial has been edited to include a section on compiling and running
the calculator. I also reworked a large portion of the rules section of the
lex file, instead of simply returning operators and parenthesis, they are
now returned as tokens to better illustrate that concept.
The point of the [ \t] rule is so the calculator can pick up different ways
of formatting input. If a user wants to seperate numbers and operators with
spaces, the lexer will match the spaces and perform no action when it finds
one. Without this rule those spaces and tabs would get echoed back out
since Flex sees it as a lack of comprehensive token definitions.
Let me know if there are any other issues or changes you would like me to
The Google Open Source Programs Team
You are receiving this message because you are subscribed to Create a
To stop receiving these messages, go to: