1. You will be using Bison parser generator.
2. Use this grammar with bison, together with your previous lexer.
3. At that point of the project, you need to generate the following:
Compiler-Parser-lastname-firstname, lastname is your last name in lower case and firstname is your first name in lower case.
A useful comment about Bison:
There is an array called yytoknum, and
you need to pass the index from yytname to yytoknum to get the actual value of
the token. This is not documented in the Bison 1.875 manual.
You have to specify
"#define YYPRINT" in order for the yytoknum array to be created. Here is the link to the bug report I found:
You can call bison with flag –d to create header file containing token numbers (used in flex). Since bison creates token numbers, bisonshould be called before flex
You can also call bison with –v flag to dump output file showing resulting LR state machine and any shift-reduce, reduce-reduceerrors.