#include <scanner_spec.hh>
Inheritance diagram for ScannerSpec:
Public Methods | |
ScannerSpec (ITokenSpec &tokens_, PropRegistry ®istry) | |
virtual | ~ScannerSpec () |
virtual IReNodeBuilder& | getReNodeBuilder () |
virtual void | addRegToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos) throw (ParseException) |
virtual void | addSkipToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos) throw (ParseException) |
virtual void | addMoreToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos) throw (ParseException) |
virtual void | addKeywordToken (const vector< string > &states, const string &name, ReNode *regexp, const string &tokenAction, const Position &pos) throw (ParseException) |
virtual void | addSpecialToken (const string &name, const Position &pos) throw (ParseException) |
virtual void | setPreambleCode (const string &block, const Position &pos) |
virtual void | addCodeBlock (const string &block, const Position &pos) |
virtual void | setInheritance (const string &inheritance, const Position &pos) |
virtual void | setClassName (const string &className_) |
virtual void | dump (ostream &os) const |
Public Attributes | |
string | className |
vector<LexicalStateSpec> | states |
CodeChunk | preambleCode |
vector<CodeChunk> | userCode |
CodeChunk | inheritance |
ITokenSpec& | tokens |
Private Methods | |
void | updateStates (const vector< string > &tokStates, DfaSourceRe *regexp) |
Private Attributes | |
DfaReNodeBuilder& | nodeBuilder |
DfaSourceRe* | starRe |
|
Definition at line 61 of file scanner_spec.cc. |
|
Definition at line 71 of file scanner_spec.cc. |
|
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 from IScannerSpec. Definition at line 77 of file scanner_spec.cc. |
|
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
Reimplemented from IScannerSpec. Definition at line 83 of file scanner_spec.cc. |
|
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
Reimplemented from IScannerSpec. Definition at line 101 of file scanner_spec.cc. |
|
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
Reimplemented from IScannerSpec. Definition at line 119 of file scanner_spec.cc. |
|
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
Reimplemented from IScannerSpec. Definition at line 137 of file scanner_spec.cc. |
|
Adds a new "special" token declaration to this scanner spec. name is the token's name.
Reimplemented from IScannerSpec. Definition at line 155 of file scanner_spec.cc. |
|
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 from IScannerSpec. Definition at line 165 of file scanner_spec.cc. |
|
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 from IScannerSpec. Definition at line 172 of file scanner_spec.cc. |
|
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 from IScannerSpec. Definition at line 178 of file scanner_spec.cc. |
|
Sets the scanner slass name. Reimplemented from IScannerSpec. Definition at line 186 of file scanner_spec.cc. |
|
If DEBUG is enabled, this method will dump all the data currently contained into this spec into the given stream Reimplemented from IScannerSpec. Definition at line 256 of file scanner_spec.cc. |
|
Updates the regexps for all the states whose names are in tokStates by adding the new regexp to them. Definition at line 198 of file scanner_spec.cc. |
|
The regexp node builder used by this concrete implementation of teh lexer parse tree. Definition at line 161 of file scanner_spec.hh. |
|
Here we keep the regular expression resulting from tokens that have <*> as their states list. Definition at line 168 of file scanner_spec.hh. |
|
The name of the generated scanner class. Definition at line 177 of file scanner_spec.hh. |
|
This is the actual description of the scanner: lexical states and their associated regexps. At least one entry (the DEFAULT) state is always created. Definition at line 185 of file scanner_spec.hh. |
|
The user code to be inserted before the scanner's class declaration. Definition at line 191 of file scanner_spec.hh. |
|
The user code that will be lumped inside the scanner's class. Each chunk together with its position is kept in here (in textual order). Definition at line 197 of file scanner_spec.hh. |
|
this string contains the inheritance provided by the user for the scanner class. Definition at line 203 of file scanner_spec.hh. |
|
Contains the token names, in their textual order. The position into this vector is also the token's id. Definition at line 209 of file scanner_spec.hh. |