29#include "Utility/IpplInfo.h"
42 token = is.readToken();
45 while (!token.isEOF()) {
48 if (token.isDel(
'(')) {
50 } else if (token.isDel(
')')) {
56 token = is.readToken();
63 else_block = parser.readStatement(&is);
68 throw ParseError(
"IfStatement::IfStatement()",
"Invalid \"IF\" statement.");
82 condition.
parse(*
this,
false);
91 std::ostringstream oss;
93 *ippl::Error <<
"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()
virtual void execute(const Parser &)
Execute.
Interface for abstract language parser.
virtual Statement * readStatement(TokenStream *ts) const =0
Read complete statement from token stream.
Statement(const std::string &name, int line)
Constructor.
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.
virtual Token readToken()=0
Read single token from stream.