The grammar is either read from the file given as argument or from standard input. The output is written to the files Parser.md and Parser.mi (Modula-2) or Parser.h and Parser.c (C). Errors detected during the analysis of the grammar are reported on standard error.
The generated parser needs a few additional modules:
First, a scanner (Scanner.md/Scanner.c, Scanner.mi/Scanner.h) containing
the function GetToken () and the global variable Attribute.
A very primitive Scanner can be requested with the option -s.
Second, a main program.
Option -p will provide a simple parser driver (ParsDrv.mi/ParsDrv.c).
Third, an error handling module called Errors has to provide the
procedures ErrorMessage and ErrorMessageI. A prototype
error handler can be requested with the option -e .
if output is in Modula-2: Parser.md definition file of the produced parser Parser.mi implementation file of the produced parser ParsDrv.mi implementation file of simple parser driver Errors.md definition file of simple error handler Errors.mi implementation file of simple error handler Scanner.md definition file of simple scanner Scanner.mi implementation file of simple scanner Pars.Tab Contains sets, to be read when parsing starts if output is in C: Parser.h specification of the produced parser Parser.c body of the produced parser ParsDrv.mi implementation file of simple parser driver Errors.h body simple error handler Errors.c implementation file of simple error handler Scanner.h body simple scanner Scanner.c implementation file of simple scanner
J. Grosch: "Efficient and Comfortable Error Recovery in Recursive Descent Parsers", Structured Programming, 11, 129-140 (1990)