#include <token_spec.hh>
Inheritance diagram for TokenSpec:
Public Methods | |
virtual void | setClassName (const string &className) |
virtual void | setInheritance (const string &inheritance, const Position &pos) |
virtual void | setPreambleCode (const string &preambleCode, const Position &pos) |
virtual void | addCodeBlock (const string &block, const Position &pos) |
virtual void | addToken (const string &tokName, Tkinds tokKind, ReNode *regexp, const string &tokAction, const Position &pos) throw (ParseException) |
virtual void | addToken (const string &tokName, const Position &pos) throw (ParseException) |
virtual bool | isToken (const string &tokName) |
virtual int | getTokenId (const string &tokName) |
virtual TokenDesc& | operator[] (int tokid) |
virtual int | count () |
virtual void | dump (ostream &os) const |
Private Attributes | |
vector<TokenDesc> | tokens |
|
Sets the token's class name. Reimplemented from ITokenSpec. Definition at line 49 of file token_spec.cc. |
|
Sets the token's class inheritance. Reimplemented from ITokenSpec. Definition at line 55 of file token_spec.cc. |
|
Sets the token's class preamble code. Reimplemented from ITokenSpec. Definition at line 63 of file token_spec.cc. |
|
Adds a njew block of user code to be merged into the token's class. Reimplemented from ITokenSpec. Definition at line 71 of file token_spec.cc. |
|
Adds a new regular or skip token into the list. The token's id will be set to its position into the list. It is VERY important that the list keeps the tokens in their textual order (as they appeared into the input source), and thtat their ids are given in the same order.
Reimplemented from ITokenSpec. Definition at line 76 of file token_spec.cc. |
|
Adds a new special token into the list. For a special token, only the name and id are needed.
Reimplemented from ITokenSpec. Definition at line 88 of file token_spec.cc. |
|
Returns true if a tokenwith the given name exists in the list. Reimplemented from ITokenSpec. Definition at line 103 of file token_spec.cc. |
|
Returns the id of the oktne with the given name, or -1 if no token with that id is found into the list. Reimplemented from ITokenSpec. Definition at line 109 of file token_spec.cc. |
|
Returns a reference to an implementation-defined TokenDesc object that contains data about he token with the given id. invariant: &this[i].id() == i, for any vaild i. Reimplemented from ITokenSpec. Definition at line 118 of file token_spec.cc. |
|
Returns the number of tokens. Reimplemented from ITokenSpec. Definition at line 125 of file token_spec.cc. Referenced by ScannerDfaWriter::writeScanner(), and TokenWriter::writeTokenClass().
|
|
If DEBUG is enabled, this method will dump all the data currently contained into this spec into the given stream Reimplemented from ITokenSpec. Definition at line 134 of file token_spec.cc. |
|
Definition at line 169 of file token_spec.hh. |