61 if(ch ==
'"' || ch ==
'\'') {
64 }
else if(isalpha(ch)) {
67 }
else if(isdigit(ch) ||
126 return Token(
"string", 1, lexeme,
int(value + 0.5));
141 if(! digit) eflag =
true;
160 if(! digit) eflag =
true;
165 while(! isspace(ch) && ! ispunct(ch)) {
177 "Invalid numeric token \"" + lexeme +
"\".");
179 int power = expsig * expval - places;
182 for(places = power; places > 0; places--)
185 for(places = - power; places > 0; places--)
189 return Token(
"string", 1, lexeme, value);
204 "String not terminated.");
227 lexeme += toupper(ch);
230 while(isalnum(ch) || ch ==
'_' || ch ==
'.' || ch ==
'\'') {
231 lexeme += toupper(ch);
std::string::size_type currentChar_m
virtual Token readToken()
Read single token from file.
Representation of a single input token.
Abstract interface for a stream of input tokens.