General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
LIDO -- Computations in TreesInteractions within EliThis section gives initial information how specifications of computations in trees interact with other Eli facilities. It should be sufficient for getting started. Other documents have to be consulted for a deeper understanding of those facilities and the interaction.
Supplying Tree Computation Specifications to Eli
Specifications as described in this document are written in files named
Further contributions to LIDO
specifications are obtained from instantiation of library modules. The
components of a LIDO specification are comprised by enumerating
their names in a
It should be pointed out that
It is highly recommended to simplify the development of specifications
by the use of precoined solutions provided by the library of
specification modules. For that purpose applicable tasks can be
identified in the module library, see
Specification Module Library.
The inheritance mechanism as
introduced in section Reuse of Symbol Computations is applied, and the
use of the module
is stated in a
Tree ConstructionThe specification of computations in trees assume that a tree according to the tree grammar exists. Usually it is constructed by the structuring phase (scanner and parser) of the language processor. There are two different starting points for the design of the tree structure specifications: the tree grammar or the concrete grammar for the input language.
In general there may be parts of the language that need more
attention to the concrete grammar and others where the computations in the
tree grammar should be considered first. That may give rise to a mixed
strategy: Supply the concrete grammar specification ( An Eli tool (Maptool, see Syntactic Analysis Manual) combines both grammar specification fragments, completes each of them, and relates concrete productions to tree grammar rules such that the parser builds the required tree. That relation is usually not a 1:1 mapping: Some concrete chain productions are left out in the tree grammar, e. g. those which describe operators precedences in expressions. The tree grammar may have chain context which have no correspondence in the concrete grammar, e. g. those which distinguish different classes of identifier occurrences. The latter may even be introduced to the tree grammar when they are needed during the refinement of the computations without updating the concrete grammar specification.
Both the concrete and the tree grammar distinguish literal terminals and
named terminals. If the scanner is generated by Eli no further specification
is needed for literal terminals, like
TERM Name: int;
Since GLA generated scanners pass such token information by
values of type
Implementing Tree Computations
The implementation of functions, types, constants, and variables
used in tree computations is
not specified within the
It is recommended to apply a modular style for those implementations:
Supply C modules consisting of a
The file names
#include "m.h"
for each module
If a module needs some operations for initialization or finalization
they can be written (as function calls) into files
Specification ErrorsEli checks the whole set of specifications extensively. It generates a language processor only if no errors are found. Error reports and warnings are obtained by a derivation like
x.specs:exe:warning The error reports are related to the specification file (and line and column coordinates in it) where Eli found the error symptom, if that is possible. In the following we give hints how to react on the most common classes of errors. As a general rule one can obtain more information about an error symptom by applying the derivation
x.specs:exe:help
Violations of the LIDO specification language definition are reported
with references to the
A report saying
VOID attribute not allowed here
in most cases indicates that an attribute is used without specifying its
type, It may be helpful to derive
x.specs:showFe
and look at the file
A report saying
attribute class in conflict indicates that computations in lower contexts and in upper contexts define that attribute. One has to rewrite them such that only one class is used. If problems are reported with remote dependencies one should check the use of those constructs within the tree grammar structure. In special difficult cases more information can be obtained by deriving
x.specs:ExpInfo That file describes how each remote access construct can be replaced by a set of equivalent computations propagating the accessed values through adjacent contexts. LIGA also checks whether the dependencies between the computations are acyclic for any tree, and reports if they are cyclic. In that case more information can be obtained by deriving
x.specs:OrdInfo
or by using the tool
In rather seldom cases LIGA may report that it could not find an
evaluation order, although the dependencies are acyclic. If such a
situation occurs it is usually caused by several sets of far ranging
dependencies where the computations in one set are independent of those
of the other sets. Adding additional dependencies that specify some
computation sets to depend on others often solves the problem. More
information on the problem is obtained by using
LIGA can not perform type checking on user functions that are
called in LIDO expressions. Hence, typing errors and errors on
undefined names may be reported when the generated evaluator
is compiled. Those reports originally refer to C file named
In case of undefined type names often avalanche errors are reported by the C compiler with respect to several product files. They can not be traced back to some specification file.
If functions are used in a
|