1#ifndef OPALX_Statement_HH
2#define OPALX_Statement_HH 1
28#include "Utility/Inform.h"
44 Statement(
const std::string& name,
int line);
118 bool real(
double& value);
127 bool str(std::string& value);
136 bool word(std::string& value);
159 virtual void print(std::ostream& os)
const;
164 virtual void printWhere(Inform& msg,
bool withToken)
const;
166 std::string
str()
const;
188 std::ostringstream msg;
189 statement.
print(msg);
std::ostream & operator<<(std::ostream &os, const Statement &statement)
Interface for abstract language parser.
Interface for statements.
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.