#include <include/EST_Token.h>
Public Member Functions | |
| EST_Token () | |
| EST_Token (const EST_String p) | |
| void | init () |
| void | set_row (int r) |
| void | set_col (int c) |
| void | set_filepos (EST_FilePos c) |
| Set file position in original EST_TokenStream. More... | |
| EST_String | lstring () |
| Return lower case version of token name. More... | |
| EST_String | ustring () |
| Return upper case version of token name. More... | |
| int | row (void) const |
| Line number in original EST_TokenStream. More... | |
| int | col (void) const |
| Line position in original EST_TokenStream. More... | |
| EST_FilePos | filepos (void) const |
| file position in original EST_TokenStream. More... | |
| const EST_String | pos_description () const |
| A string describing current position, suitable for error messages. More... | |
| EST_Token & | operator= (const EST_Token &a) |
| EST_Token & | operator= (const EST_String &a) |
| int | operator== (const EST_String &a) |
| int | operator!= (const EST_String &a) |
| int | operator== (const char *a) |
| int | operator!= (const char *a) |
Basic access to fields | |
| void | set_token (const EST_String &p) |
| set token from a string More... | |
| void | set_token (const char *p) |
| void | set_whitespace (const EST_String &p) |
| set whitespace of token. More... | |
| void | set_whitespace (const char *p) |
| void | set_punctuation (const EST_String &p) |
| set (post) punctuation of token. More... | |
| void | set_punctuation (const char *p) |
| void | set_prepunctuation (const EST_String &p) |
| set prepunction More... | |
| void | set_prepunctuation (const char *p) |
| const EST_String & | whitespace () |
| const EST_String & | punctuation () |
| const EST_String & | prepunctuation () |
Access token as a string | |
| const EST_String & | string () const |
| const EST_String & | S () const |
| Access token as a string. More... | |
| const EST_String & | String () const |
| Access token as a string. More... | |
| operator EST_String () const | |
| For automatic coercion to EST_String. More... | |
Access token as a int | |
| int | Int (bool &valid) const |
| int | Int () const |
| int | I (bool &valid) const |
| int | I () const |
| operator int () const | |
Access token as a long | |
| long | Long (bool &valid) const |
| long | Long () const |
| long | L (bool &valid) const |
| long | L () const |
| operator long () const | |
Access token as a float | |
| float | Float (bool &valid) const |
| float | Float () const |
| float | F (bool &valid) const |
| float | F () const |
| operator float () const | |
Access token as a double | |
| double | Double (bool &valid) const |
| double | Double () const |
| double | D (bool &valid) const |
| double | D () const |
| operator double () const | |
Quotation related methods | |
| void | set_quoted (int q) |
| Note that this token was quoted (or not) More... | |
| int | quoted () const |
| TRUE is token was quoted. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const EST_Token &p) |
This class is similar to EST_String but also maintains the original punctuation and whitespace found around the token.
EST_Token 's primary use is with EST_TokenStream class which allows easy tokenizing of ascii files.
A token consists of four parts, any of which may be empty: a name, the actual token, preceding whitespace, preceding punctuation, the name and succeeding punctuation.
Definition at line 74 of file EST_Token.h.
|
inline |
Definition at line 87 of file EST_Token.h.
|
inline |
Definition at line 89 of file EST_Token.h.
|
inline |
Definition at line 91 of file EST_Token.h.
|
inline |
set token from a string
Definition at line 96 of file EST_Token.h.
|
inline |
Definition at line 98 of file EST_Token.h.
|
inline |
set whitespace of token.
Definition at line 100 of file EST_Token.h.
|
inline |
Definition at line 102 of file EST_Token.h.
|
inline |
set (post) punctuation of token.
Definition at line 104 of file EST_Token.h.
|
inline |
Definition at line 106 of file EST_Token.h.
|
inline |
set prepunction
Definition at line 108 of file EST_Token.h.
|
inline |
Definition at line 110 of file EST_Token.h.
|
inline |
Definition at line 112 of file EST_Token.h.
|
inline |
Definition at line 114 of file EST_Token.h.
|
inline |
Definition at line 116 of file EST_Token.h.
|
inline |
Definition at line 120 of file EST_Token.h.
|
inline |
Access token as a string.
Definition at line 122 of file EST_Token.h.
|
inline |
Access token as a string.
Definition at line 124 of file EST_Token.h.
|
inline |
For automatic coercion to EST_String.
Definition at line 126 of file EST_Token.h.
Definition at line 131 of file EST_Token.h.
|
inline |
Definition at line 132 of file EST_Token.h.
Definition at line 133 of file EST_Token.h.
|
inline |
Definition at line 134 of file EST_Token.h.
|
inline |
Definition at line 135 of file EST_Token.h.
|
inline |
Definition at line 140 of file EST_Token.h.
|
inline |
Definition at line 141 of file EST_Token.h.
|
inline |
Definition at line 142 of file EST_Token.h.
|
inline |
Definition at line 143 of file EST_Token.h.
|
inline |
Definition at line 144 of file EST_Token.h.
|
inline |
Definition at line 149 of file EST_Token.h.
|
inline |
Definition at line 150 of file EST_Token.h.
|
inline |
Definition at line 151 of file EST_Token.h.
|
inline |
Definition at line 152 of file EST_Token.h.
|
inline |
Definition at line 153 of file EST_Token.h.
|
inline |
Definition at line 158 of file EST_Token.h.
|
inline |
Definition at line 159 of file EST_Token.h.
|
inline |
Definition at line 160 of file EST_Token.h.
|
inline |
Definition at line 161 of file EST_Token.h.
|
inline |
Definition at line 162 of file EST_Token.h.
|
inline |
Note that this token was quoted (or not)
Definition at line 170 of file EST_Token.h.
|
inline |
TRUE is token was quoted.
Definition at line 172 of file EST_Token.h.
|
inline |
Definition at line 175 of file EST_Token.h.
|
inline |
Definition at line 177 of file EST_Token.h.
|
inline |
Set file position in original EST_TokenStream.
Definition at line 179 of file EST_Token.h.
|
inline |
Return lower case version of token name.
Definition at line 181 of file EST_Token.h.
|
inline |
Return upper case version of token name.
Definition at line 183 of file EST_Token.h.
|
inline |
Line number in original EST_TokenStream.
Definition at line 185 of file EST_Token.h.
|
inline |
Line position in original EST_TokenStream.
Definition at line 187 of file EST_Token.h.
|
inline |
file position in original EST_TokenStream.
Definition at line 189 of file EST_Token.h.
| const EST_String EST_Token::pos_description | ( | ) | const |
A string describing current position, suitable for error messages.
Definition at line 109 of file EST_Token.cc.
Definition at line 96 of file EST_Token.cc.
| EST_Token & EST_Token::operator= | ( | const EST_String & | a | ) |
Definition at line 114 of file EST_Token.cc.
|
inline |
Definition at line 202 of file EST_Token.h.
|
inline |
Definition at line 204 of file EST_Token.h.
|
inline |
Definition at line 206 of file EST_Token.h.
|
inline |
Definition at line 208 of file EST_Token.h.
|
friend |