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

Oil Reference Manual

Previous Chapter Next Chapter Table of Contents

A review of an example OIL Specification

The following is a complete OIL specification which we will analyze more completely later (see Relating an OIL specification to library function calls.) But we will briefly review it here to give an intuitive feel for both the syntax and the semantics of the language.

In our example below is a specification of Pascal's overloaded operator (`+'.) It can be identified with either integer addition (iAdd), real addition (rAdd) or set union (sUnion.) And we define a coercion operator (Float) to allow integer values to be used where real values may appear.

OPER iAdd( int_t, int_t ): int_t;     /* the usual '+' operators for Pascal
OPER rAdd( real_t, real_t ): real_t;
OPER sUnion( set_t, set_t ): set_t;

INDICATION Plus: iAdd, rAdd, sUnion;  /* will be identified together */

COERCION Float( int_t ): real_t;    /* usual Pascal coercion from int to real

An OIL specification defines the identifiers for use in calls to the library functions. The above specification defines these identifiers:

  • int_t, real_t, set_t to be type denotations.

  • iAdd, rAdd, sUnion to be typed binary operator denotations with the expected functional signatures.

  • Plus to be an operator indication which may be identified with iAdd, rAdd and sUnion.

  • Float is defined to be a coercion from int_t to real_t.

For a more in-depth examination of this specification see A simple example.

Previous Chapter Next Chapter Table of Contents