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


Bit Sets of Integer Size

This C module implements sets of small nonnegative integral values by values of an unsigned type that is determined on instantiation of the module. The maximal element value depends on the number of bits used for the representation of the chosen unsigned type. The operations provided by this module may be used for computations on kind set values (or any other suitable application). In the following description of the set operations we assume that el stands for an expression that yields an integer being a set element, and s, s1, s2 stand for expressions yielding sets.

The module is instantiated by

   $/Adt/IntSet.gnrc +instance=NAME +referto=TYPE :inst
where NAME identifies the IntSet instance and TYPE specifies the type used for representing set values. If the referto parameter is specified to be TYPE, then unsigned TYPE has to be a valid integral C type. Examples for the referto parameter are short, int, or 'long int'. If the referto parameter is omitted int is assumed. The instance parameter may be omitted if there is only one instance of this module.

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

The module exports the following type names and macros (all names are prefixed by the value NAME of the instance parameter):

NAMEIntSet
the type representing sets.

NAMENULLIS
the unique value for an empty set.
NAMENullIS()
a macro with no arguments for the unique value for an empty set, to be used where a functional notation is required as in WITH clauses of CONSTITUENTS.

The following operations for set processing are supplied by the module. It is indicated whether an operation is implemented by a function or by a macro. The macros do not evaluate any argument repeatedly.

NAMEIntSet NAMESingleIS (int el)
Yields a singleton set containing el; a message is issued if el is not a valid element. (function)
NAMEIntSet NAMEAddElIS (int el, NAMEIntSet s)
Yields the union of NAMESingleIS(el) and s; a message is issued if el is not a valid element. (function)
NAMEIntSet NAMEConsIS (int el, NAMEIntSet s)
Yields the union of NAMESingleIS(el) and s; validity of el is not checked. (macro)
int NAMEInIS (int el, NAMEIntSet s)
Yields 1 iff el is in s; a message is issued if el is not a valid element. (function)
NAMEIntSet NAMEUniteIS (NAMEIntSet s1, NAMEIntSet s2)
Yields the union of s1 and s2. (macro)
NAMEIntSet NAMESubIS (NAMEIntSet s1, NAMEIntSet s2)
Yields s1 minus s2. (macro)
NAMEIntSet NAMEInterIS (NAMEIntSet s1, NAMEIntSet s2)
Yields the intersection of s1 and s2. (macro)
int NAMEDisjIS (NAMEIntSet s1, NAMEIntSet s2)
Yields 1 iff s1 and s2 are disjoint. (macro)
int NAMEInclIS (NAMEIntSet s1, NAMEIntSet s2)
Yields 1 iff s1 is a subset of s2. (function)
int NAMEEqualIS (NAMEIntSet s1, NAMEIntSet s2)
Yields 1 iff s1 is equal to s2. (macro)
int NAMEEmptyIS (NAMEIntSet s)
Yields 1 iff s is empty. (macro)
int NAMECardIS (NAMEIntSet s)
Yields the number of elements in s. (function)


Previous Chapter Next Chapter Table of Contents