29 : stat_line(line), buffer_name(name), tokens() {}
32 : stat_line(1), buffer_name(name), tokens() {
51 }
else if (
word ==
"FALSE") {
75 value =
curr->getInteger();
84 if (
curr !=
tokens.end() && (*curr).isDel(c)) {
93 if (
curr !=
tokens.end() && (*curr).isDel(s)) {
102 if (
curr !=
tokens.end() && (*curr).isKey(key)) {
112 if (
curr->isReal()) {
113 value =
curr->getReal();
116 }
else if (
curr->isInteger()) {
117 value = double(
curr->getInteger());
128 value =
curr->getLex();
138 value =
curr->getLex();
153 while (!
atEnd() && !(*curr).isDel(
','))
158 std::ostringstream os;
161 for (TokenList::const_iterator c =
tokens.begin(); c !=
curr; ++c) {
162 if (white && !c->isDel()) os <<
' ';
166 if (white && !std::next(
curr)->isDel()) os <<
' ';
168 return os.str().length() - 1;
174 for (TokenList::const_iterator c =
tokens.begin(); c !=
tokens.end(); ++c) {
175 if (white && !c->isDel()) msg <<
' ';
180 msg <<
';' << std::endl;
187 if (TokenList::const_iterator(
curr) ==
tokens.end()) {
188 msg <<
" at end of statement:" << endl;
190 msg <<
" before token \"" << *
curr <<
"\":" << endl;
198 std::ostringstream
str;
Statement(const std::string &name, int line)
Constructor.
Token & getCurrent()
Return current token and skip it.
void append(const Token &)
Append a token.
std::list< Token > TokenList
The type of the enclosed token list.
unsigned int position() const
Return current character number in line.
void restore()
Return to marked position.
virtual void printWhere(Inform &msg, bool withToken) const
Print position.
bool keyword(const char *s)
Test for keyword.
void mark()
Mark position in command.
bool integer(int &value)
Return signed integer.
bool word(std::string &value)
Return word value.
bool boolean(bool &value)
Return boolean value.
bool real(double &value)
Return real value.
virtual void print(std::ostream &os) const
Print statement.
bool atEnd() const
Test for end of command.
bool delimiter(char c)
Test for delimiter.
void start()
Return to start.
Representation of a single input token.
int getInteger() const
Return integer value.