Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Project4

: Compiler function checklist


學號: 姓名:

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.

You might also like