General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
Tutorial on Type AnalysisAppendix: Syntax
Concrete Kernel SyntaxConcrete Kernel syntax[135]== Declarations: Declaration*. Declaration: 'var' ObjDecls ';'. ObjDecls: [ObjDecl // ',']. Statements: Statement*. Expression: Factor. Factor: Operand. Operand: IntNumber. Operand: RealNumber. Operand: 'true'. Operand: 'false'. Operand: Variable. This macro is invoked in definition 18. The expression syntax is prepared to introduce operators of different precedences (2 for binary and 1 for unary operators).
Expression mapping[136]== Expression ::= Factor Operand. This macro is invoked in definition 19. The notation of identifiers, numbers, and comments is chosen as in Pascal: Token notation[137]== Ident: PASCAL_IDENTIFIER IntNumber: PASCAL_INTEGER RealNumber: PASCAL_REAL PASCAL_COMMENT This macro is invoked in definition 17.
Concrete Expression SyntaxExpression syntax[138]== Expression: Expression AddOpr Factor. Factor: Factor MulOpr Operand. Operand: MonOpr Operand. Operand: '(' Expression ')'. AddOpr: '+' / '-'. MulOpr: '*' / '/'. MonOpr: '+' / '-' / '!'. This macro is invoked in definition 32.
The following specification unifies the binary operators that have
different precedences into one symbol class Operators[139]== BinOpr ::= AddOpr MulOpr. UnOpr ::= MonOpr. This macro is invoked in definition 33.
Concrete Function SyntaxFunction declaration syntax[140]== Parameters: [Parameter // ',']. This macro is invoked in definition 101. Call syntax[141]== Arguments: [Argument // ',']. This macro is invoked in definition 101. Function type syntax[142]== ParamTypes: [ParamType // ',']. This macro is invoked in definition 134.
Other concrete productionsConcrete pointer syntax[143]== Operand: 'nil'. This macro is invoked in definition 126. Concrete notations are stated for the comma separated sequence of type denoters. The specific precedence of the cast expression and its parentheses avoid a parsing conflict. Concrete union syntax[144]== UnitedTypes: UnitedTypes ',' UnitedType. UnitedTypes: UnitedType. Operand: '<' TypeDenoter '>' Operand. This macro is invoked in definition 89.
|