Eli   Documents Get Eli: Translator Construction Made Easy at SourceForge.net.
    Fast, secure and Free Open Source software downloads

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 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

Pattern-based Text Generator

Previous Chapter Next Chapter Table of Contents


Syntax of PTG Specifications

PTGSpec:        PatternSpec+

PatternSpec:    PatternName ':' (Item | Optional)* 

PatternName:    Identifier

Item:           CString | Insertion | FunctionCall

Insertion:      '$' [ Number ] [ Type ]

FunctionCall:   '[' Identifier Arguments ']'

Arguments:      Insertion*

Type:           'int' | 'string' | 'pointer' | 'long' | 'short'
                | 'char' | 'float' | 'double' 

Optional:       '{' Item+ '}'

Identifier and CString tokens are denoted as in C. Number tokens consist of decimal digits. Comments are written in C style. Line comments starting with # are also accepted.

Note: A CString token may only extend over several lines if all but the last line end with a backslash character. An error message like illegal newline in string literal indicates a violation of that rule.

The following additional alternative for PatternSpec defines leaf patterns. This construct is outdated and is no longer accepted by PTG:

PatternSpec:    PatternName ':' Type+ '[' [ Identifier ] ']'
If you have old specifications that use this pattern style, rewrite them by pattern specifications as describe above, e.g.

   MyLeaf:   int string []
   YourLeaf: int string [YourFct]
should be rewritten into

   MyLeaf:   $ int $ string
   YourLeaf: [YourFct $ int $ string]


Previous Chapter Next Chapter Table of Contents