29 stat_line(line), buffer_name(name), tokens()
34 stat_line(1), buffer_name(name), tokens() {
51 return TokenList::const_iterator(
curr) ==
tokens.end();
63 }
else if(word ==
"FALSE") {
81 value =
curr->getInteger();
92 value =
curr->getInteger();
102 if(
curr !=
tokens.end() && (*curr).isDel(c)) {
112 if(
curr !=
tokens.end() && (*curr).isDel(s)) {
122 if(
curr !=
tokens.end() && (*curr).isKey(key)) {
134 value =
curr->getReal();
137 }
else if(
curr->isInteger()) {
138 value = double(
curr->getInteger());
150 value =
curr->getLex();
161 value =
curr->getLex();
186 while(!
atEnd() && !(*curr).isDel(
','))
191 std::ostringstream os;
194 for(TokenList::const_iterator
c =
tokens.begin();
c !=
curr; ++
c) {
195 if(white && !
c->isDel()) os <<
' ';
199 if(white && !std::next(
curr)->isDel()) os <<
' ';
201 return os.str().length() - 1;
207 for(TokenList::const_iterator
c =
tokens.begin();
c !=
tokens.end(); ++
c) {
208 if(white && !
c->isDel()) msg <<
' ';
222 if(TokenList::const_iterator(
curr) ==
tokens.end()) {
223 msg <<
" at end of statement:" <<
endl;
225 msg <<
" before token \"" << *
curr <<
"\":" <<
endl;
233 std::ostringstream
str;
constexpr double c
The velocity of light in m/s.
void append(const Token &)
Append a token.
void start()
Return to start.
Statement(const std::string &name, int line)
Constructor.
virtual void print(std::ostream &os) const
Print statement.
bool atEnd() const
Test for end of command.
unsigned int position() const
Return current character number in line.
void mark()
Mark position in command.
void restore()
Return to marked position.
Inform & endl(Inform &inf)
Token & getCurrent()
Return current token and skip it.
bool boolean(bool &value)
Return boolean value.
bool word(std::string &value)
Return word value.
Representation of a single input token.
bool delimiter(char c)
Test for delimiter.
virtual void printWhere(Inform &msg, bool withToken) const
Print position.
bool real(double &value)
Return real value.
bool keyword(const char *s)
Test for keyword.
bool integer(int &value)
Return signed integer.
std::list< Token > TokenList
The type of the enclosed token list.