Intermediate Code Generation
Intermediate Code Generation
Generation
Logical structure of a compiler front end
o Translation Applications
Type information is also needed to calculate the address (storage)
Type Expressions
Type Expressions represent the structure of types
A type expression is
o either a basic type
o or is formed by applying an operator called a type constructor
Following definition of type expressions
o A basic type is a type expression. int, void, char, etc..
o A type name is a type expression.
o Array: applying the array type constructor to a number is a type
expression.
o A record: record type constructor to the field names and their types.
o Function: type constructor
o If s and t are type expressions, then their Cartesian product s x t is a
type expression.
o Type expressions may contain variables whose values are type
expressions.
Type Expressions
Type expression for int [2][3]