36 Statement(
"", 0), then_block(0), else_block(0) {
45 while(! token.
isEOF()) {
48 if(token.
isDel(
'(')) {
50 }
else if(token.
isDel(
')')) {
68 "Invalid \"IF\" statement.");
84 condition.
parse(*
this,
false);
93 std::ostringstream oss;
95 ERRORMSG(
"Invalid IF condition '" + oss.str() +
"'");
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
bool getBool(const Attribute &attr)
Return logical value.
A representation of an Object attribute.
void parse(Statement &stat, bool eval)
Parse attribute.
void update()
Update all objects.
static OpalData * getInstance()
Interface for abstract language parser.
virtual Statement * readStatement(TokenStream *ts) const =0
Read complete statement from token stream.
Interface for statements.
void append(const Token &)
Append a token.
virtual void execute(const Parser &)=0
Execute.
virtual void print(std::ostream &os) const
Print statement.
void start()
Return to start.
Representation of a single input token.
bool isDel(char del) const
Test for delimiter.
bool isEOF() const
Test for end of file.
bool isKey(const char *key) const
Test for keyword.
Abstract interface for a stream of input tokens.
void putBack(const Token &token)
Put token back to stream.
virtual Token readToken()=0
Read single token from stream.
virtual void execute(const Parser &)
Execute.