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

Tutorial on Name Analysis

Previous Chapter Next Chapter Table of Contents


Predefined Identifiers

Allmost all languages have certain identifiers that are predefined for any program. This facility is demonstrated by introducing typed variable declarations to our language:

Predef.con[11]==

Declaration:    'var' VarDecls ';'.
VarDecls:       VarDecl // ','.
VarDecl:        TypeUseIdent DefIdent.
TypeUseIdent:   Ident.
This macro is attached to a product file.

The type of a declared variable is given by a TypeUseIdent. A TypeUseIdent has the same computational roles which we associated with applied identifier occurrences, except that it is not checked for being defined since we assume that only predefined type identifiers are used:

Predef.lido[12]==

SYMBOL TypeUseIdent INHERITS IdUseEnv, IdentOcc END;
This macro is attached to a product file.

The technique for predefining identifiers is provided by the library modules PreDefine and PreDefId, see See Predefined Identifiers of Specification Module Library: Name Analysis. PreDefine is instantiated with the Ident symbol name as generic parameter. PreDefId is instantiated with the file name Predef.d. That file contains a sequence of macro calls, like PreDefKey ("int", intKey). Each introduces a string and the name of a key. The identifier is then bound to that key in the outermost environment of each program. Those Keys could be used in computations, e.g. for type checking (We do not make use of this facility here.)

Predef.specs[13]==

$/Name/PreDefine.gnrc+referto=Ident:inst
$/Name/PreDefId.gnrc+referto=(Predef.d):inst
This macro is attached to a product file.

Predef.d[14]==

PreDefKey ("int", intKey)
PreDefKey ("real", realKey)
PreDefKey ("bool", boolKey)
PreDefKey ("true", trueKey)
PreDefKey ("false", falseKey)
This macro is attached to a product file.


Previous Chapter Next Chapter Table of Contents