class
Token
(Return to index)
Representation of a single input token.
All tokens contain the name of the input stream and the line number
where they came from.
Type: |
Instantiable |
Include file: |
./Parser/Token.hh |
Synopsis (including inherited members):
- Public members:
-
enum Type
;
-
Token
()
;
-
Token
(const string&,int,Type,char)
;
-
Token
(const string&,int,Type,const char*)
;
-
Token
(const string&,int,Type,const string&)
;
-
Token
(const string&,int,const string&,double)
;
-
Token
(const string&,int,const string&,int)
;
-
Token
(const Token&)
;
-
~Token
()
;
-
const Token& operator=
(const Token&)
;
-
bool isDel
(char)const
;
-
bool isDel
(const char*)const
;
-
bool isDel
()const
;
-
bool isEOF
()const
;
-
bool isError
()const
;
-
bool isInteger
()const
;
-
bool isReal
()const
;
-
bool isWord
()const
;
-
bool isString
()const
;
-
bool isKey
(const char*)const
;
-
bool getBool
()const
;
-
int getInteger
()const
;
-
double getReal
()const
;
-
string getString
()const
;
-
string getWord
()const
;
-
const string& getLex
()const
;
-
Type getType
()const
;
-
const string& getFile
()const
;
-
int getLine
()const
;
Documentation:
- Public members:
-
Token
()
;
- Constructor.
Construct empty token.
-
Token
(const string&,int,Type,char)
;
- Constructor.
Construct character token with type type and value c.
-
Token
(const string&,int,Type,const char*)
;
- Constructor.
Construct string token with type type and value s.
-
Token
(const string&,int,Type,const string&)
;
- Constructor.
Construct string token with type type and value lex.
-
Token
(const string&,int,const string&,double)
;
- Constructor.
Construct real numeric token with lexeme lex and value
value.
-
Token
(const string&,int,const string&,int)
;
- Constructor.
Construct integer token with lexeme lex and value value.
-
enum Type
;
- Possible token types.
-
bool getBool
()const
;
- Return boolean value.
Throw ParseError, if token is not boolean.
-
const string& getFile
()const
;
- Return the token's file name.
-
int getInteger
()const
;
- Return integer value.
Throw ParseError, if token is not numeric.
-
const string& getLex
()const
;
- Return the lexeme.
-
int getLine
()const
;
- Return the token's line number.
-
double getReal
()const
;
- Return real value.
Throw ParseError, if token is not numeric.
-
string getString
()const
;
- Return string value.
Throw ParseError, if token is not string.
-
Type getType
()const
;
- Return the token type.
-
string getWord
()const
;
- Return word value.
Throw ParseError, if token is not word.
-
bool isDel
(char)const
;
- Test for delimiter.
Return true, if token is single character del.
-
bool isDel
(const char*)const
;
- Test for delimiter.
Return true, if token is character string del.
-
bool isDel
()const
;
- Test for any delimiter.
-
bool isEOF
()const
;
- Test for end of file.
-
bool isError
()const
;
- Test for error.
-
bool isInteger
()const
;
- Test for integer.
-
bool isKey
(const char*)const
;
- Test for keyword.
-
bool isReal
()const
;
- Test for real number.
-
bool isString
()const
;
- Test for string.
-
bool isWord
()const
;
- Test for word.
Documentation generated by fci on Mon Feb 7 11:41:55 2000