Abstract Machines produced by the tool are standard library specifications for use in other constructs, therefore they are guaranteed to be syntactically correct, well-typed and internally consistent.
The purpose of the Enumerator is to provide basic teletype i/o operations for enumerated sets present in a development.
The general form of an enumeration description is given in a BNF-like
syntax as follows:
the syntax << exp >> indicates zero or more occurrences
of exp (repetition):
enumeration_description ::= ENUMERATION enumeration_name SEES sees_list SETS set_list END enumeration_name ::= Identifier sees_list ::= Identifier << , Identifier >> sets_list ::= Identifier << ; Identifier >>The SEES clause identifies those specifications that are `in scope' for the enumeration and the SETS clause identifies those enumerated sets for which operations are to be generated; each set should be defined in one of the machines in scope.
An example enumeration is:
ENUMERATION fifi SEES mimi, gigi SETS SET1; SET2 ENDThis defines a construct comprising two enumerated sets (SET1 being an enumerated set of mimi, and SET2 being an enumerated set of gigi). When submitted to the generator it produces a machine (and code) which may be employed in i/o operations. Three operations for each enumerated set are provided:
having a single input parameter, which value can range over the enumerated set; the operation is an output operation to standard terminal output and might be used in an interactive application to output the value of a particular variable which ranges over the enumerated set.
having a single output parameter, which value ranges over the enumerated set; the operation is an input operation which takes its input from standard keyboard input and can be used to input a particular value ranging over the enumerated set. The generated code is robust and features a small help facility.
having an input parameter, with precondition that it is a string, and output parameter, which value ranges over the enumerated set; the operation is an input operation which takes its input from standard keyboard input and can be used to prompt for a particular value ranging over the enumerated set. Again the generated code is robust and features a small help facility.