The document outlines the checklist of functions for a compiler project, including filtering comments, using longest-match rule in scanning, checking for duplicated declarations, handling different variable types like integers and arrays, arithmetic and comparison operations, constant expressions, assignment statements, if/while statements, nested loops, subprograms, parameters, return values, checking for initialized variables, and constant folding.
Original Description:
Check list for a check list, so that list can be checked
The document outlines the checklist of functions for a compiler project, including filtering comments, using longest-match rule in scanning, checking for duplicated declarations, handling different variable types like integers and arrays, arithmetic and comparison operations, constant expressions, assignment statements, if/while statements, nested loops, subprograms, parameters, return values, checking for initialized variables, and constant folding.
The document outlines the checklist of functions for a compiler project, including filtering comments, using longest-match rule in scanning, checking for duplicated declarations, handling different variable types like integers and arrays, arithmetic and comparison operations, constant expressions, assignment statements, if/while statements, nested loops, subprograms, parameters, return values, checking for initialized variables, and constant folding.
p Filter out comments. p Use the longest-match rule in scanning p check for duplicated declarations. p variables of integer type. p variables of real type. p variables of simple array types, such as l array [ 23 .. 57 ] of integer l array [ 12 .. 34 ] of real p variables of multi-dimension arrays, such as l array [ 23 .. 57 ] of array [ 12 .. 34 ] of integer l array [ 12 .. 34 ] of array [ 23 .. 57 ] of real p Addition and subtraction operations. p Multiplication and division operations. p Comparision operations. p Evaluate constant expressions in the compiler. p assignment statements of simple types (integer and real) p assignment of 1-dimensional arrays p assignment of multi-dimensional arrays p check out-of-bound array indices at compile time p Generate code to check out-of-bound array indices at run time p simple if statements p simple while loops p nested if statements p nested while loops p arbitrary combination of assignment statements, if statements, and while loops p subprograms (procedures and functions) without parameters and without return values p recursive subprograms without parameters and without return values. p subprograms with (integer and real) parameters and with (integer and real) return values p recursive subprograms with (integer and real) parameters and with (integer and real) return values p PrintInt, PrintReal, and PrintString. p Check if a variable is initialized. p There could be constant folding of various degrees of difficulty.