1#ifndef MAD_Statement_HH
2#define MAD_Statement_HH 1
121 bool real(
double &value);
130 bool str(std::string &value);
139 bool word(std::string &value);
162 virtual void print(std::ostream &os)
const;
169 std::string
str()
const;
192 std::ostringstream msg;
193 statement.
print(msg);
std::ostream & operator<<(std::ostream &os, const Statement &statement)
constexpr double c
The velocity of light in m/s.
std::string::iterator iterator
Interface for abstract language parser.
Interface for statements.
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.
virtual void execute(const Parser &)=0
Execute.
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.