35 "This object defines a beamsequence list with arguments.\n"
42 Macro(name, parent), body(name)
52 "You cannot use this object without attributes.");
63 parseActuals(statement);
64 if(formals.size() != actuals.size()) {
66 "Inconsistent number of macro arguments.");
71 Token token = body.readToken();
73 while(! token.
isEOF()) {
76 std::string word = token.
getWord();
77 for(std::vector<std::string>::size_type i = 0;
78 i < formals.size(); i++) {
79 if(word == formals[i]) {
80 std::vector<Token> act = actuals[i];
89 if(! found) expansion->
append(token);
90 token = body.readToken();
95 instance = model->
clone(name);
99 parser.
run(&*expansion);
120 assert(statement.
keyword(
"SEQUENCE"));
129 while(! token.
isEOF()) {
131 if(token.
isKey(
"ENDSEQUENCE")) {
134 while(! token.
isEOF()) {
136 if(token.
isDel(
';'))
break;
virtual ~SequenceTemplate()
bool isEOF() const
Test for end of file.
bool keyword(const char *s)
Test for keyword.
void copyAttributes(const Object &)
Copy attributes from another object.
void parseTemplate(TokenStream &, Statement &)
Parse the sequence template.
Abstract interface for a stream of input tokens.
bool isWord() const
Test for word.
An ``archetype'' for a SEQUENCE with arguments.
Interface for abstract language parser.
static OpalData * getInstance()
virtual Token readToken()=0
Read single token from stream.
virtual void parseFormals(Statement &)
Parse formal arguments.
Interface for statements.
virtual Object * makeTemplate(const std::string &name, TokenStream &, Statement &)
Make a sequence template.
Representation of a single input token.
void start()
Reset stream to start.
void append(Token &)
Append a token to the stream.
The parser for SEQUENCE members.
virtual Sequence * clone(const std::string &name)
Make clone.
virtual void run() const
Read current stream.
An input buffer for macro commands.
Abstract base class for macros.
Object * find(const std::string &name)
Find entry.
The base class for all OPAL objects.
virtual SequenceTemplate * clone(const std::string &name)
Make clone.
virtual Object * makeInstance(const std::string &name, Statement &, const Parser *)
Make line instance.
bool isKey(const char *key) const
Test for keyword.
bool isDel(char del) const
Test for delimiter.
virtual void parse(Statement &)
Parse the object.
std::string getWord() const
Return word value.