#include <parser_spec.hh>
Inheritance diagram for ParserSpec:
Public Methods | |
ParserSpec (PropRegistry ®istry_, ITokenSpec &tokens_) | |
virtual IEbnfNodeBuilder& | getEbnfNodeBuilder () |
virtual void | addProduction (const string &name, const string &retTypeName, const Position &retTypePos, const string &formalArgs, const Position &formalArgsPos, const string &exceptList, const Position &exceptListPos, const string &preambleCode, const Position &preambleCodePos, EbnfNode *expansion, const Position &pos) throw (ParseException) |
virtual void | setPreambleCode (const string &block, const Position &pos) |
virtual void | setClassName (const string &className) |
virtual void | setInheritance (const string &inheritance, const Position &pos) |
virtual void | addCodeBlock (const string &block, const Position &pos) |
bool | isProduction (const string &name) |
ProductionSpec& | getProduction (const string &name) throw (ParseException) |
virtual void | dump (ostream &os) const |
Public Attributes | |
EbnfNodeBuilder& | nodeBuilder |
string | className |
CodeChunk | preambleCode |
vector<CodeChunk> | userCode |
CodeChunk | inheritance |
ITokenSpec& | tokens |
vector<ProductionSpec> | productions |
Definition at line 59 of file parser_spec.hh.
|
Definition at line 56 of file parser_spec.cc. |
|
Returns a reference to an ebnf node builder that will create the productions' oarse trees suitable for this parser spec representation. Reimplemented from IParserSpec. Definition at line 62 of file parser_spec.cc. |
|
Adds a new production declaration to this parser spec. name is the production's name formalArgs is a string containing the list of formal arguments declarations, in the same order as they appeared into the production's declarastion, without the enclosing parentheses. exceptList is the list of exception type identifiers that can be thrown from this production. preambleCode is the first block of user code of this production. expansion the EBNF expansion's parse tree. Can be null. All the Position arguments (except the last one) represent the textual position of the previous argument in the list.
Reimplemented from IParserSpec. Definition at line 68 of file parser_spec.cc. |
|
Sets the preamble block to the given string, which must be the block of code that preceded the syntax section in the input grammar file, without the enclosing brackets. Reimplemented from IParserSpec. Definition at line 93 of file parser_spec.cc. |
|
Stes the parser's class name. Reimplemented from IParserSpec. Definition at line 99 of file parser_spec.cc. |
|
Specifies an inheritance string for the parser's class. Reimplemented from IParserSpec. Definition at line 105 of file parser_spec.cc. |
|
Adds a block of user code to the scanner spec. The block string is a block of code found inside the syntax section, without the enclosing brackets. Reimplemented from IParserSpec. Definition at line 112 of file parser_spec.cc. |
|
Returns true if the given name is a production name. Definition at line 124 of file parser_spec.cc. Referenced by NontermFixAlgo::operator()().
|
|
Returns a reference to the production with the given name.
Definition at line 131 of file parser_spec.cc. Referenced by NontermFixAlgo::operator()().
|
|
If DEBUG is enabled, this method will dump all the data currently contained into this spec into the given stream Reimplemented from IParserSpec. Definition at line 144 of file parser_spec.cc. |
|
The nodebuilder implementation used by this parser spec. Definition at line 115 of file parser_spec.hh. |
|
The name of the generated parser class. Definition at line 120 of file parser_spec.hh. |
|
The user code to be inserted before the parser's class declaration. Definition at line 125 of file parser_spec.hh. |
|
The user code that will be lumped inside parser's class. If jultiple blocks of user code are found inside the lexical section, they are concatenated into one big chunk of code and stored into this string. Definition at line 132 of file parser_spec.hh. |
|
This string contains the inheritance provided by the user for the parser class. Definition at line 138 of file parser_spec.hh. |
|
The complete list of tokens this parser will use (this list is supposed o be built according to the lexical section). Definition at line 144 of file parser_spec.hh. |
|
Definition at line 146 of file parser_spec.hh. |