#include <itoken_spec.hh>
Inheritance diagram for ITokenSpec:
Public Types | |
typedef enum ITokenSpec::t_Tkinds | Tkinds |
enum | t_Tkinds { regular, skip, more, keyword, special } |
Public Methods | |
virtual | ~ITokenSpec () |
virtual void | dump (ostream &os) const=0 |
The interface towards the scanner: | |
virtual void | setClassName (const string &className)=0 |
virtual void | setInheritance (const string &inheritance, const Position &pos)=0 |
virtual void | setPreambleCode (const string &preambleCode, const Position &pos)=0 |
virtual void | addCodeBlock (const string &block, const Position &pos)=0 |
Tokens list access | |
This interface is for the classes that need the tokens' list. | |
virtual void | addToken (const string &tokName, Tkinds tokKind, ReNode *regexp, const string &tokAction, const Position &pos)=0 throw (ParseException) |
virtual void | addToken (const string &tokname, const Position &pos)=0 throw (ParseException) |
virtual bool | isToken (const string &tokName)=0 |
virtual int | getTokenId (const string &tokName)=0 |
virtual ITokenDesc& | operator[] (int tokid)=0 |
ITokenDesc& | operator[] (const string &tokName) |
virtual int | count ()=0 |
Public Attributes | |
string | className |
CodeChunk | preambleCode |
vector<CodeChunk> | userCode |
CodeChunk | inheritance |
Definition at line 74 of file itoken_spec.hh.
|
|
|
Definition at line 78 of file itoken_spec.hh. |
|
Force virtual destructors. Definition at line 175 of file itoken_spec.hh. |
|
Sets the token's class name. Reimplemented in TokenSpec. Referenced by ITokenSpec_setClassName().
|
|
Sets the token's class inheritance. Reimplemented in TokenSpec. Referenced by ITokenSpec_setInheritance().
|
|
Sets the token's class preamble code. Reimplemented in TokenSpec. Referenced by ITokenSpec_setPreambleCode().
|
|
Adds a njew block of user code to be merged into the token's class. Reimplemented in TokenSpec. Referenced by ITokenSpec_addCodeBlock().
|
|
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 in TokenSpec. Referenced by ScannerSpec::ScannerSpec().
|
|
Adds a new special token into the list. For a special token, only the name and id are needed.
Reimplemented in TokenSpec. |
|
Returns true if a tokenwith the given name exists in the list. Reimplemented in TokenSpec. |
|
Returns the id of the oktne with the given name, or -1 if no token with that id is found into the list. Reimplemented in TokenSpec. Referenced by operator[]().
|
|
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 in TokenSpec. |
|
Definition at line 160 of file itoken_spec.hh. |
|
Returns the number of tokens. Reimplemented in TokenSpec. Referenced by ScannerSpec::dump(), and LAnalyzer::makeLa().
|
|
If DEBUG is enabled, this method will dump all the data currently contained into this spec into the given stream Reimplemented in TokenSpec. Referenced by ScannerSpec::dump().
|
|
Definition at line 189 of file itoken_spec.hh. |
|
Definition at line 191 of file itoken_spec.hh. |
|
Definition at line 193 of file itoken_spec.hh. |
|
Definition at line 195 of file itoken_spec.hh. |