General Information

 o Eli: Translator Construction Made Easy
 o Global Index
 o Frequently Asked Questions

Tutorials

 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

Reference Manuals

 o User Interface
 o Eli products and parameters
 o LIDO Reference Manual

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

 Questions, Comments, ....

Tutorial on Type Analysis

Previous Chapter Next Chapter Table of Contents


Messages on Scope Rule Violations

Erroneous programs may violate the scope rules in one of two cases:

  • A particular applied identifier occurrence has no valid defining identifier occurrence.

  • There are more than one defining identifier occurrences for one identifier in one range.

Such situations shall be indicated by error messages. Furthermore, we want every defining occurrence of a multiply defined identifier be marked by a message.

For that purpose we use the following two library modules:

CoreChk.specs[8]==


$/Tech/Strings.specs
$/Prop/OccCnt.gnrc:inst

This macro is attached to a product file.

The Strings module provides a function that concatenates a error message string and an identifier for error messages related to identifiers.

The OccCnt module provides computations that count how often an object identified by a Key attribute occurs in certain contexts, in our case in a defining context.

The check for existence of a definition is directly obtained from the module role ChkIdUse. For the second check we specify a computational role ChkUnique in order to reuse it for several grammar symbols. If an object occurs more than once in the ChkUnique context it is multiply defined.

CoreChk.lido[9]==


SYMBOL UseIdent INHERITS ChkIdUse END;
SYMBOL TypeUseIdent INHERITS ChkIdUse END;
SYMBOL DefIdent INHERITS ChkUnique END;

SYMBOL ChkUnique INHERITS Count, TotalCnt COMPUTE
  IF (GT (THIS.TotalCnt, 1),
  message (ERROR, 
           CatStrInd ("identifier is multiply defined: ", 
                      THIS.Sym),
           0, COORDREF));
END;

This macro is attached to a product file.


Previous Chapter Next Chapter Table of Contents