Here is a template of how your code must be organized.
For this portion of the assignment you must modify the last version of the grammar in the following way:
< statement > ::= id := < expression > ; | < if_statement > | < while_statement > | < null_statement >
< primary > ::= id | unsignedint | unsignedreal | bool | ( < expression > )
You are to complete the elaboration of the language definition so that it includes all necessary semantic information. Again, use the Algol-60 and Scheme reports as guides, both are available on line. This completed definition should match your implementation exactly. For instance, if it is legal in your implementation to add real values with integer values, but not real values with boolean values, then this must be stated somewhere in the definition.
The purpose of the language definition is to let prospective users of the language know what a legal program looks like. Nowhere in the language definition should the notion of quads or anything having to do with the PCCTS implementation of the language appear. This definition is not documentation to support your implementation. Rather, it is the definition on which your implementation is based. You are to determine and define the semantic conventions of the language. Remember, it is generally the case that the stricter a language definition is the less complicated the compiler is. There is no right way to do this and there are an infinite number of wrong ways to do it. If you don't believe me, check out perl.After altering the productions to match the change in the grammar you will need to extend your PCCTS specification file according to the handout given in class.
You are to come up with your own set of intermediate code operators and include documentation, separate from the language definition, that explains your choices.
Your PCCTS specification file must be modified to include semantic actions necessary to generate the intermediate code. For a hint on how to add semantic actions to the file see the calculator example and remember that it is an interpreter not a compiler. You may find it helpful to alter the presentation of the productions in the specification file to make backpatching easier. However, do not alter the language or the language definition.
You are to email as an attachment the file containing your PCCTS specifications to mgr@louisiana.edu. A folder containing a printout of the file and your completed language definition should be turned in at the start of class.