Tasks related to input processing
An Eli-generated processor treats its input as a single body of text.
The default command line interface provided by Eli assumes that the
generated processor will have one input file and no options.
If no file name is specified on the command line, stdin is used as
the input file.
A developer can change the default command line interface by including
specifications written in the CLP language
(see Specifying the command line interface of Command line processing).
The input text consists of a sequence of lines, each terminated by
a newline character.
Lines are numbered, beginning with 1.
In the simplest case, these lines are the content of a single file.
In general, however, they may be drawn from an arbitrary collection of
files, depending on the goals of the processor.
For example, a C compiler will need to replace #include directives
with the contents of the specified files.
A Java compiler may need to combine a number of files describing classes
into a single program.
In this document, we explore ways of dealing with such situations using the
Include module.
Error reporting in an Eli-generated processor is based on the line
number of the input text in which the error occurred
(see Error Reporting of Frame Library Reference Manual).
If the text has been drawn from many files, that error report must be
mapped to the corresponding line in the file containing the original text.
The CoordMap module maintains a coordinate system relating the input
text to its origins in the file system.
This module is automatically instantiated when Include is used.
(CoordMap is not intended to be used directly in specifications.)
|