Output Format for Parser

Production Rules

For grading purposes, we would like your parser to output the list of productions taken while parsing an inputted sequence of lexical tokens. These productions should be outputted in the order in which they are actually taken during parsing. The general format of each production should be as follows:

LEFT-HAND-SIDE -> RIGHT-HAND-SIDE

We do not specify the detailed format for each production (such as the names of the terminals and non-terminals used, and which symbols are present in each production). This is because these details will depend upon the particular grammar you create. However, we ask that you pay attention to precendence so that the relative order of the taken productions adheres to precedence rules (such as "+" and "-" having lower precendence than "*" and "/"). Although precedence will not really be important until the next phase of the project, this will make it easier for us during grading of the current phase.

For example, for program mytest.min (which is syntactically correct), the outputted list of productions taken during parsing might look like this (you are not required to number each production or label each non-terminal with the corresponding production number). The actual output of your parser may differ depending upon the grammar you write.