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

Name analysis according to scope rules

Previous Chapter Next Chapter Table of Contents


Name Analysis Test

This module augments the specified processor such that it produces output that makes the results of name analysis visible. For each identifier occurrence that has one of the identifier roles of the name analysis modules a line of the form

   m in line 23 bound in line 4 of scope in line 3
is written to the standard output file. The first line number is that of the identifier occurrence, the second states where its binding was established by a defining occurrence, and the third where the scope of the binding has been created, i.e. usually the begin of the range. For unbound identifier occurrences a line of the form
   m unbound in line 35
is written. The output is produced in left to right order of the identifier occurrence, independent of the order in which the bindings are found. The computations for producing that output are scheduled after the bindings are computed at all identifier occurrences, in order to avoid problems of evaluation order scheduling.

The output of the processors specified in $/Name/Examples is produced by using this module.

To achieve the effect of this module it is simply instantiated. No inheritance of any roles is necessary.

The module is instantiated by

   $/Name/ShowBinding.gnrc+instance=NAME :inst
The instance parameter must have the same value as that of the instantiation of the basic name analysis module, i.e. AlgScope, CScope, or BuScope. Several instances may be used for testing the bindings in different name spaces. Unfortunately, this module is NOT usable if the name analysis module is instantiated with a referto parameter that modifies the key attribute name.

The module makes use of the facility to associate a DefTableKey to scopes: for each
NAMERangeScope a new key, and for each NAMERangeScopeProp its ScopeKey.
NAMERootScope.NAMEGotEnvKey indicates that all those keys are associated. If that facility is also used independent of the ShowBinding module, the computations of NAMERangeScope.NAMEGotEnvKey and
NAMERangeScopeProp.NAMEGotPropEnvKey have to be overridden to avoid interference with the intended computations.

The module associates a property named NAMELine to each identifier key, and to each key of a scope. Its value is the line number where the binding is established. An instance of the NAMESetFirst module is used for that purpose. Line number 0 is shown for definitions of identifiers and for scopes if they are not established by roles of name analysis modules. That holds in particular for predefined identifiers and for the root environment.


Previous Chapter Next Chapter Table of Contents