Eli   Documents

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 Scope Graphs
 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

LIDO - Reference Manual

Previous Chapter Next Chapter Table of Contents


Symbol Specifications

A symbol specification associates computations with a symbol. They are executed for every node which represents that symbol in a particular tree.

Symbols may be introduced which do not occur in the tree grammar. They are called CLASS symbols and represent a computational role. Their computations may be inherited directly or indirectly by grammar symbols. Symbols that do occur in the tree grammar are called TREE symbols.

Syntax

    SymComp    ::= SymbKind SymbName [ Inheritance ] Computations 'END'

    SymbKind   ::= 'SYMBOL' | 'CLASS' 'SYMBOL' | 'TREE' 'SYMBOL'






Example:

    TREE SYMBOL Expr COMPUTE
      SYNT.coercion = coerce (THIS.preType, THIS.postType);
      INH.IsValContext = true;
      Compatible (THIS.preType, THIS.postType);
    END;

A symbol specified TREE occurs in a tree grammar production, a symbol specified CLASS does not. If neither is specified the symbol kind is determined by its occurrence in the tree grammar. (Only the computations of CLASS symbols may be inherited by other symbols.)

The CLASS symbol ROOTCLASS is predefined. It is implicitly inherited by the root of the tree grammar. Hence, any computation associated with ROOTCLASS is inherited by the root context. This facility is to be used to specify computational roles for the root which are grammar independent, and which need not be inherited explicitly.

Note: There may be TREE symbols that do not occur in the user supplied rules, but only in those generated from the concrete grammar. In those cases it is recommended to explicitly specify their kind to be TREE, in order to get more specific error reports in cases of accidental mismatches.

Two sets of computations are associated with a symbol: the lower computations, which are executed in every lower context of the symbol, i. e. in a context whose production has the symbol on its left-hand side, and the upper computations, which are executed in every upper context, i. e. in a context whose production has the symbol on its right-hand side. The upper computations are executed once for each right-hand side occurrence of the symbol.

Each symbol has two disjoint sets of attributes: synthesized (SYNT) attributes that are defined by computations in lower contexts of the symbol, and inherited (INH) attributes that are defined by computations in upper contexts of the symbol.

In a symbol computation only attributes of that symbol may be used or defined (except the use of remote attributes). Those attributes are denoted SYNT.a if a is a synthesized attribute, INH.b if b is an inherited attribute. An attribute of the symbol may also be denoted THIS.c. In this case the attribute class must be specified in another occurrence of that attribute.

A computation that defines a synthesized (an inherited) attribute of the symbol belongs to the set of lower (upper) computations. A plain computation defining no attribute belongs to the set of lower computations (see Computations).

There may be several symbol specifications for one symbol. In that case the associated computations are accumulated.

If both a symbol computation and a rule computation define the same attribute of that symbol, the rule computation will be executed in that context, overriding the symbol computation.

Plain computations can not be overridden.

Restrictions

The kind of a symbol, TREE or CLASS may not be specified contradictory.

CLASS SYMBOLs may not be used in productions.

TREE SYMBOLs may not be used in INHERITS clauses (see Inheritance of Computations).


Previous Chapter Next Chapter Table of Contents