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

Library Reference

Previous Chapter Next Chapter Table of Contents


Unique Identifier Management

#include "idn.h"

int dofold;

prtidnv(FILE *d, int i)

saveidn(FILE *d)

dmpidn(FILE *d)

mkidn(char *c, int l, int *t, int *s)

These functions implement the concept of unique identifiers. The representation is an integer, the index of the identifier's string in the character string memory (see Character String Storage).

`idn.h' defines the constant NoIdn to be a unique integer that is never used to represent an identifier. The identifier string represented by NoIdn contains no characters.

Prtidnv prints the string for identifier i on the current line of file d. This function can be omitted from the module by compiling with the C flag -DNOPRINT. Dmpidn prints the current state of the lookup mechanism on file d as a sequence of lines. This function can also be omitted from the module by compiling with the C flag -DNOPRINT.

Saveidn writes the current state of the module on file d, in the form of C initialized variables. This file can be used to create a copy of the module initialized to the current state by naming it `idntbl.h' and recompiling with the C flag -DINIT. The save function is available only if the module was compiled with the C flag -DSAVE, and if the printing routines were not omitted. An initial state is usually created by adtinit.

Mkidn determines the unique identifier for a string c of length l. If the string has not been previously passed to mkidn then it is assigned the first available location in the character string memory, and the index of that position is stored in the location pointed to by s . The value pointed to by t is noted but not changed. If the string has previously been passed to mkidn then the character string memory index assigned when it was first passed to mkidn is stored in the location pointed to by s, and the value of t noted at that time is stored in the location pointed to by t. Mkidn can be used as a processor by the lexical analysis portion of an Eli-generated program (see Token Processors of Lexical Analysis.)

The variable dofold controls the interpretation of upper and lower case alphabetic characters by mkidn: If dofold contains 0 then upper and lower case versions of the same letter are considered to be distinct; otherwise no distinction is made between upper and lower case versions of the same letter. This variable is initially 0, and must be explicitly set nonzero if desired. If it is known that upper and lower case letters must always be distinct, the variable and associated folding code can be removed from the module by compiling it with the C flag -DNOFOLD.


Previous Chapter Next Chapter Table of Contents