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

Tasks related to generating output

Next Chapter Table of Contents


PTG Output for Leaf Nodes

The module LeafPtg provides some standard translations of terminal input strings into output strings. They may be attached to nonterminal symbols having an int valued attribute Sym which represents a string, an identifier or a number. That symbol usually derives to a terminal symbol which is used to compute the value of the Sym attribute.

The module does not have generic parameters. It is used by writing

   $/Output/LeafPtg.fw
in a .specs file.

The computations of this module yield an attribute Ptg of type PTGNode representing the desired output string. It may be used to compose more complex output structures.

The required computation of the Sym attribute can be specified by (if not already done for other purposes):

   ATTR Sym: int;
   SYMBOL T COMPUTE SYNT.Sym = TERM; END;

There are the following symbol roles for different output representations:

   SYMBOL T INHERITS  IdPtg  END;
T.Sym must refer to an identifier or a string then T.Ptg represents the same identifier or character sequence of the string in the output.

   SYMBOL T INHERITS  CStringPtg  END;
T.Sym must refer to a string, then T.Ptg represents its value as a C string literal.

   SYMBOL T INHERITS  PStringPtg  END;
T.Sym must refer to a string, then T.Ptg represents its value as a Pascal string literal.

   SYMBOL T INHERITS  NumPtg  END;
T.Sym must represent an integral number, then T.Ptg represents that number.

The module uses some PTG patterns from the module PtgCommon.

Please note that this module may become outdated in future Eli-Versions. In new specifications use the module PtgCommon directly to create PTG representations for terminal symbols. The module PtgCommon is described in the next section.


Next Chapter Table of Contents