Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

IParserSpec Class Reference

#include <iparser_spec.hh>

Inheritance diagram for IParserSpec:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual IEbnfNodeBuildergetEbnfNodeBuilder ()=0
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)=0 throw (ParseException)
virtual void setPreambleCode (const string &block, const Position &pos)=0
virtual void setClassName (const string &className)=0
virtual void setInheritance (const string &inheritance, const Position &pos)=0
virtual void addCodeBlock (const string &block, const Position &pos)=0
virtual void dump (ostream &os) const=0

Detailed Description

This class is the builder interface for the root of a parser's parse tree. All the data from a grammar's file syntax section will get here.

An object the implements this inetrface must be created and passed to an IParser implementation which will fill in the parser's data by calling the appropriate methods of this interface and those of IEbnfNodeBuilder.

Definition at line 71 of file iparser_spec.hh.


Member Function Documentation

IEbnfNodeBuilder & IParserSpec::getEbnfNodeBuilder ( ) [pure virtual]
 

Returns a reference to an ebnf node builder that will create the productions' oarse trees suitable for this parser spec representation.

Reimplemented in ParserSpec.

Referenced by LexYaccParser::parse().

void IParserSpec::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) [pure virtual]
 

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.

Exceptions:
ParseException   if the production could not be added (duplicate name, aso).

Reimplemented in ParserSpec.

Referenced by IParserSpec_addProduction().

void IParserSpec::setPreambleCode ( const string & block,
const Position & pos ) [pure virtual]
 

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 in ParserSpec.

Referenced by IParserSpec_setPreambleCode().

void IParserSpec::setClassName ( const string & className ) [pure virtual]
 

Stes the parser's class name.

Reimplemented in ParserSpec.

Referenced by IParserSpec_setClassName().

void IParserSpec::setInheritance ( const string & inheritance,
const Position & pos ) [pure virtual]
 

Specifies an inheritance string for the parser's class.

Reimplemented in ParserSpec.

Referenced by IParserSpec_setInheritance().

void IParserSpec::addCodeBlock ( const string & block,
const Position & pos ) [pure virtual]
 

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 in ParserSpec.

Referenced by IParserSpec_addCodeBlock().

void IParserSpec::dump ( ostream & os ) const [pure virtual]
 

If DEBUG is enabled, this method will dump all the data currently contained into this spec into the given stream

Reimplemented in ParserSpec.

Referenced by LexYaccParser::parse().


The documentation for this class was generated from the following file:
Generated at Tue Jul 9 21:07:09 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001