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

IScannerSpec Class Reference

#include <iscanner_spec.hh>

Inheritance diagram for IScannerSpec:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~IScannerSpec ()
virtual IReNodeBuildergetReNodeBuilder ()=0
virtual void addRegToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos)=0 throw (ParseException)
virtual void addSkipToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos)=0 throw (ParseException)
virtual void addMoreToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos)=0 throw (ParseException)
virtual void addKeywordToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos)=0 throw (ParseException)
virtual void addSpecialToken (const string &name, const Position &pos)=0 throw (ParseException)
virtual void setPreambleCode (const string &block, const Position &pos)=0
virtual void addCodeBlock (const string &block, const Position &pos)=0
virtual void setInheritance (const string &inheritance, const Position &pos)=0
virtual void setClassName (const string &className)=0
virtual void dump (ostream &os) const=0

Detailed Description

This class is the builder interface for the root of a scanner's parse tree. All the data frmo a garmmar file's lexical secton will get here. Such an object must be created and passed to the an IParser implementation which will fill in the scanner data by callin the appropriate methods of this interface and those of IReNodeInterface.

All the methods that are called from the parser in order to add information to the parse treee receive the position inside the input file where the information was found.

Definition at line 70 of file iscanner_spec.hh.


Constructor & Destructor Documentation

IScannerSpec::~IScannerSpec ( ) [inline, virtual]
 

Definition at line 74 of file iscanner_spec.hh.


Member Function Documentation

IReNodeBuilder & IScannerSpec::getReNodeBuilder ( ) [pure virtual]
 

Returns a referece to the regexps node builder that should be used bu the parser to create the parse tree ndoes of the regular expressions of this scanner.

Reimplemented in ScannerSpec.

Referenced by LexYaccParser::parse().

void IScannerSpec::addRegToken ( const vector< string > & states,
const string & name,
ReNode * regexp,
const string & tokenAction,
const Position & pos ) throw (ParseException) [pure virtual]
 

Adds a new regular token declaratino to this scanner spec.

states is the list of lexical states into which this token will be accepted. name is the name of the token regexp points to the root of the parse tree that describes the token's regexp. tokenAction contains the user code to be executed after a token of this type is matched

Exceptions:
ParseException   if the token was not added (duplicate token, aso).

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addRegToken().

void IScannerSpec::addSkipToken ( const vector< string > & states,
const string & name,
ReNode * regexp,
const string & tokenAction,
const Position & pos ) throw (ParseException) [pure virtual]
 

Adds a new "skip" token declaratino to this scanner spec.

states is the list of lexical states into which this token will be accepted. name is the name of the token regexp points to the root of the parse tree that describes the token's regexp. tokenAction contains the user code to be executed after a token of this type is matched

Exceptions:
ParseException   if the token was not added (duplicate token, aso).

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addSkipToken().

void IScannerSpec::addMoreToken ( const vector< string > & states,
const string & name,
ReNode * regexp,
const string & tokenAction,
const Position & pos ) throw (ParseException) [pure virtual]
 

Adds a new "more" token declaratino to this scanner spec.

states is the list of lexical states into which this token will be accepted. name is the name of the token regexp points to the root of the parse tree that describes the token's regexp. tokenAction contains the user code to be executed after a token of this type is matched

Exceptions:
ParseException   if the token was not added (duplicate token, aso).

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addMoreToken().

void IScannerSpec::addKeywordToken ( const vector< string > & states,
const string & name,
ReNode * regexp,
const string & tokenAction,
const Position & pos ) throw (ParseException) [pure virtual]
 

Adds a new "keyword" token declaratino to this scanner spec.

states is the list of lexical states into which this token will be accepted. name is the name of the token regexp points to the root of the parse tree that describes the token's regexp. tokenAction contains the user code to be executed after a token of this type is matched

Exceptions:
ParseException   if the token was not added (duplicate token, aso).

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addKeywordToken().

void IScannerSpec::addSpecialToken ( const string & name,
const Position & pos ) throw (ParseException) [pure virtual]
 

Adds a new "special" token declaration to this scanner spec.

name is the token's name.

Exceptions:
ParseException   if the token was not added (duplicate token, aso).

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addSpecialToken().

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

Sets the preamble code string for this scanner spwecification. The \s block string contains the block of code that precceded the lexical section without the enclosing brackets.

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_setPreambleCode().

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

Adds a new block of user code to this scanner spec. The block string contains a block of userr code that was found inside the lexical section, without the enclosing brackets.

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_addCodeBlock().

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

Sets the inheritance string for this scanner spec. The inheritance string contains the string that followed the ":" after the scanner's class name, up to the "{".

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_setInheritance().

void IScannerSpec::setClassName ( const string & className_ ) [pure virtual]
 

Sets the scanner slass name.

Reimplemented in ScannerSpec.

Referenced by IScannerSpec_setClassName().

void IScannerSpec::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 ScannerSpec.

Referenced by LexYaccParser::parse().


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