Tasks related to input processing



Using this module introduces processing of a command line option
into the generated processor: If the processor is called
processor.exe -Idirname filename
then files to be included are searched in the current directory and
in dirname.
This module provides specifications for the Eli's CLP tool
to achieve the effect.
This module is instantiated without generic parameters by
$/Input/CmdLineIncl.gnrc:inst
The module provides a function that can be used together with
calls of the NewInput function:
char * FindFile (char *name)
- It searches the file named
name in the current directory
and in the directories given by -I command line arguments.
In order to use this facility the FindFile function has to be applied
to the argument of the function NewInput.
Hence, the examples of the two previous sections had to be rewritten
as
ATTR InpFileEx: int;
RULE: FileInclusion ::= 'include' FileName COMPUTE
.InpFileEx = NewInput (FindFile (StringTable (FileName))) BOTTOMUP;
IF (NOT (.InpFileEx),
message (ERROR, CatStrInd ("can not open file ", FileName),
0, COORDREF));
END;
for the case of the .lido specification of input switching
as shown in (see Insert a File into the Input Stream), or
Declaration: 'include' &'NewInput(FindFile (GetCurrTok()));' FileName ';'.
for the case of the concrete grammar specification of input switching
as shown in (see Accessing the Current Token).



|