next up previous
Next: Expressions Up: Relating Phrase Structure to Previous: Relating Phrase Structure to


Some type errors can be detected when the program is parsed, by using distinct grammar symbols to represent different subsets of the type universe. Once parsing is complete, however, there is no need to retain these distinctions as different kinds of tree node. Every type name is therefore represented in the tree by a Type node that has a TypeKey attribute to hold the definition table key representing that type internally:


PrimitiveType ::= NumericType IntegralType FloatingPointType .

Type ::= Void .

TypeName ::= ClassType .

TypeDeclaration ::= ClassDeclaration InterfaceDeclaration .

Interfaces ::= ExtendsInterfaces .
This macro is invoked in definition 22.