Your new grammar should be unambiguous and should still permit computation of a length attribute. The output attribute should be a list containing the values given by the print statements, in order. It is likely that you will need other attributes, such as a symbol table . Evaluation Extend the grammar from the previous problem so that it does not permit reassignment to variables. An attempt to reassign to a variable is considered an error.
Type Checking Consider the following simplified grammar of expressions over strings and integers.
The grammar is overloaded in that the plus sign is used to add integers and to concatenate strings. If a string and an integer are added, the results should be a string. Note that valid types are string , integer , and error . Modified from a problem in chapter five of Appel . The Tiger language definition states that every cycle of type definitions must go through a record or array.