Eli   Documents Get Eli: Translator Construction Made Easy at SourceForge.net.
    Fast, secure and Free Open Source software downloads

General Information

 o Eli: Translator Construction Made Easy
 o Global Index
 o Frequently Asked Questions
 o Typical Eli Usage Errors

Tutorials

 o Quick Reference Card
 o Guide For new Eli Users
 o Release Notes of Eli
 o Tutorial on Name Analysis
 o Tutorial on Type Analysis
 o Typical Eli Usage Errors

Reference Manuals

 o User Interface
 o Eli products and parameters
 o LIDO Reference Manual
 o Typical Eli Usage Errors

Libraries

 o Eli library routines
 o Specification Module Library

Translation Tasks

 o Lexical analysis specification
 o Syntactic Analysis Manual
 o Computation in Trees

Tools

 o LIGA Control Language
 o Debugging Information for LIDO
 o Graphical ORder TOol

 o FunnelWeb User's Manual

 o Pattern-based Text Generator
 o Property Definition Language
 o Operator Identification Language
 o Tree Grammar Specification Language
 o Command Line Processing
 o COLA Options Reference Manual

 o Generating Unparsing Code

 o Monitoring a Processor's Execution

Administration

 o System Administration Guide

Mail Home

Tutorial on Type Analysis

Previous Chapter Table of Contents


Appendix: Syntax

Concrete Kernel Syntax

Concrete 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).

Factor and Operand are represented by Expression contexts in the tree grammar:

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 Syntax

Expression 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 BinOpr of the abstract syntax.

Operators[139]==

BinOpr ::= AddOpr MulOpr.
UnOpr ::= MonOpr.
This macro is invoked in definition 33.

Concrete Function Syntax

Function 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 productions

Concrete 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.


Previous Chapter Table of Contents