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

Solutions of common problems

Previous Chapter Next Chapter Table of Contents


Generating Optional Identifiers

This C module implements functions that turn their arguments into strings which then play the role of identifiers as if they occurred in the input, i.e. they are entered in the identifier table, and their symbol code is returned.

The module is instantiated by

   $/Tech/MakeName.gnrc +instance=IDENT :inst
The generic instance parameter IDENT has to be set to the terminal symbol used for identifiers.

The module can also be used to generate and store identifiers in processors that do not have a scanner and a parser. In this case the +instance parameter has to be omitted.

All entities exported by this module can be used in specifications of type .lido, .init, .finl, and .con. They can also be used in .pdl specifications or in C modules if the interface file MakeName.h is imported there.

The module exports the following functions:

int MakeName (char *c)
c is a character string that may coincide with an already existing name. The result the is the encoding of the name c.
int GenerateName (char *c)
c is a character string. The name is generated by appending a number to the prefix c such that the name is different from all others encountered so far (on input and generated).
int IdnNumb (int id, int num)
id is the encoding of an existing identifier; num is a nonnegative number. The new name is formed by appending the number to the identifier string. It may coincide with an already existing name. This function may be used to derive arbitrary names from existing ones.
int PreIdnPost (char *pre, int id, char *post)
id is the encoding of an existing identifier, pre and post are arbitrary character strings. The generated name is formed by catenation of pre, the identifier string and post. It may coincide with an already existing name. This function may be used to derive different names (e. g. for different target objects) from an existing name.


Previous Chapter Next Chapter Table of Contents