Next: Syntax class
Up: Lexer and Parser
Previous: Class IOLexerStack
Parsers are specified as a two phase process:
- First a syntax class is defined. A syntax class
declaration is like a normal C++ class declaration and has a similar
syntax, except that Prop will also generate the interface of the parser.
All parsers that Prop generates are encapsulated within a class. This
makes it easy for the programmer to add additional data for parsing
use, and to have multiple instances of a parser.
- Secondly, the grammar of the language is defined in a
syntax declaration as a set of productions,
in a syntax similar to that of yacc.
We'll describe these two phases.
Allen Leung
Mon Apr 7 14:33:55 EDT 1997