43 while(! token.
isEOF()) {
46 if(token.
isDel(
'(')) {
48 }
else if(token.
isDel(
')')) {
58 throw ParseError(
"WhileStatement::WhileStatement()",
59 "Invalid \"WHILE\" statement.");
75 condition.
parse(*
this,
false);
83 std::ostringstream oss;
85 ERRORMSG(
"Invalid WHILE condition '" + oss.str() +
"'");
bool isEOF() const
Test for end of file.
Abstract interface for a stream of input tokens.
void update()
Update all objects.
virtual Statement * readStatement(TokenStream *ts) const =0
Read complete statement from token stream.
virtual void execute(const Parser &)
Execute.
bool getBool(const Attribute &attr)
Return logical value.
Interface for abstract language parser.
static OpalData * getInstance()
virtual Token readToken()=0
Read single token from stream.
A representation of an Object attribute.
Interface for statements.
Representation of a single input token.
virtual void print(std::ostream &os) const
Print statement.
void append(const Token &)
Append a token.
virtual void execute(const Parser &)=0
Execute.
virtual ~WhileStatement()
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
bool isKey(const char *key) const
Test for keyword.
bool isDel(char del) const
Test for delimiter.
void parse(Statement &stat, bool eval)
Parse attribute.