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

Tasks related to generating output

Previous Chapter Next Chapter Table of Contents


Processing Ptg-Output into String Buffers

The module StringOut provides a possibility of processing the output associated to a PTG node structure recursively into a string buffer. The buffer is maintained by calls to Obstack-module-functions. The module PtgOutput is used to coordinate overrides of the PTG output functions.

This module supplies two C functions:

char *PTG_StringOut(PTGNode root);
Takes the root to a PTG node structure as argument. Invokes the PTG printing functions and processes the output into an automatically allocated and growing string buffer. Upon termination, a pointer to to the start of this buffer is returned.
void FreeStringOut();
Invocations of the PTG_StringOut() function can consume quite a lot of memory. It is possible, that at some time, the string buffers created by this functions are no longer needed. The memory consumed by this buffers can be returned to the system by an invocation of the FreeStringOut() function. Please note, that this function frees the space used by all invocations of PTG_StringOut() together.

Additional information about this module and it's implementation can be obtained by the derivation

   $elipkg/Output/StringOut.fw :fwTexinfo :display

Usage of Module

To include this module into your specification, simply add the following line to one of your `.specs'-files:

   $/Output/StringOut.fw

Restrictions

This module can be included to a specification together with other applications of the PtgOutput module functions, e.g. PrettyPrint and BlockPrint. By doing so, it is possible to pretty print a PTG node structure into a file or to process it into a string buffer. A combination, for example to pretty print a PTG node structure into character buffer, is not possible.


Previous Chapter Next Chapter Table of Contents