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
Open PDF File

Abstract Syntax Tree Unparsing

Parsing is the process of constructing a tree from a string of characters; unparsing is the reverse: constructing a string of characters from a tree.

A so-called "pretty-printer" is an example of a processor that incorporates an unparser: It reads arbitrarily-formatted text, builds a tree representing the text's structure, and then unparses that tree using appropriate formatting rules to lay out the text in a standard way.

An unparser is also used to produce a textual representation of a tree-structured data object. One example of such a textual representation is the XML file used to transmit a data object over the Internet; another is a Java program that can be executed to re-build the object.

Arbitrary unparsers can be specified by means of a combination of attribute computations and PTG (see Pattern Specifications of PTG: Pattern-Based Text Generator) patterns. Writing these specifications by hand is a tedious process for a large tree grammar.

Given a specification of the LIDO rules defining a tree grammar, Eli can derive the specifications of certain common unparsings. The result is a FunnelWeb file (see Introduction of FunnelWeb) that is used directly to produce output routines for a generated processor. Each of the common unparsings has certain characteristics that must be understood to use it effectively.

Although a pre-packaged unparsing may suffice for almost all of the rules of a particular tree grammar, a user may need to make a few changes in structure or representation. The unparser generator provides facilities for specifying such changes, while retaining the bulk of the generated attribute computations and PTG patterns.

Finally, an unparser must be derived from a specification of the tree grammar to be unparsed together with specifications of any changes in representation. The resulting FunnelWeb file must either be extracted or incorporated into the derivation of the processor using it.