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

Abstract data types to be used in specifications

Previous Chapter Next Chapter Table of Contents


Mapping Integral Values To Other Types

This module implements mappings from non-negative integers to an arbitrary type that is specified by a generic instantiation parameter. Any assignable type can be chosen.

The map is implemented by a dynamically allocated array using the obstack module via the DynSpace interface. The mapping storage can be deallocated.

The size of the mapping has to to be stated on initialization.

The module is instantiated by

   $/Adt/Map.gnrc +instance=NAME +referto=TYPE :inst
where NAME identifies the Map instance and TYPE is the target type of the mapping.

Note: The target type of the mapping TYPE must be either a type that is predefined in C, or its definition must be made available by some .head specification.

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 NAMEMap.h is imported there.

The following functions are supplied by the module:

void NAMEInitMap (int max_n)
Initializes the mapping for value between 0 and max_n.

void NAMEFinlMap (void)
Deallocates the mapping.

void NAMEInitMapValues (TYPE v)
Initializes all mappings in the range 0 to max_n to the value v.

void NAMESetMap (int n, TYPE v)
Maps n to the value v. It may override a previously set value.

TYPE NAMEGetMap (int n)
Yields the TYPE value set for n by the most recent call of NAMESetMap or InitMapValues, if any; otherwise the result is undefined.


Previous Chapter Next Chapter Table of Contents