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


 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


 o Eli library routines
 o Specification Module Library

Translation Tasks

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


 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


 o System Administration Guide

Mail Home

Introduction of specification modules

Next Chapter Table of Contents

Running Example

In this section we introduce an example for a language implementation task. It is used in the descriptions of the library modules of this document wherever possible. It shall serve to demonstrate the use of the modules in the context of a complete specification. Of course, such examples can only show certain aspects of the modules. They can not demonstrate their complete functionality and the variety and flexibility of possible applications.

Although the example is taken from the area of programming language implementation, similar tasks are to be solved if languages for other purposes than programming, or programming languages with other characteristics are implemented.

Complete executable specifications for this running example are available in the directories $/Name/Examples and in $/Type/Examples.

For the purpose of this example we assume that a small artificial programming language is to be implemented. The basic constructs of the language are nested blocks, declarations of variables and of names for values, assignment statements and expressions as specified by the following concrete grammar.

The overall program structure is given by

   Program:        Source.
   Source:         Block.
   Block:          Compound.
   Compound:       'begin' Declaration* Statement* 'end'.
Variable declarations specify the types of the declared variables:
   Declaration:    'var' ObjDecls ';'.
   ObjDecls:       ObjDecl // ','.
   ObjDecl:        TypeDenoter Ident.
   TypeDenoter:    Ident.
For the start of this example there is only a set of predefined type identifiers. In the type analysis section the language is extended by introduction of further types and denoters for them.

For the time being there are only three forms of statements:

   Statement:      Expression ';'.
   Statement:      Variable '=' Expression ';'
   Statement:      Block.
Further statements are added when necessary to explain aspects of module use.

The expression syntax is left incomplete here in order to introduce operators of different precedence levels (see `Operator Identification' of Type analysis tasks). If one wants to complete this grammar without adding operators one should add the production

   Expression:     Operand.
The basic operands are
   Operand:        IntNumber.
   Operand:        RealNumber.
   Operand:        Variable.
   Variable:       Ident.

The non-literal tokens are defined by

IntNumber:      PASCAL_INTEGER
RealNumber:     PASCAL_REAL

The above grammar is chosen such that the solution of language implementation tasks of name analysis, type analysis, and translation by using library modules can be demonstrated. It is also prepared to demonstrate the combination of different module uses. The grammar is extended where necessary in the examples of subsequent sections.

Next Chapter Table of Contents