43 "This object defines a beamsequence list with arguments.\n"
50 Macro(name, parent), body(name)
60 "You cannot use this object without attributes.");
71 parseActuals(statement);
72 if(formals.size() != actuals.size()) {
74 "Inconsistent number of macro arguments.");
79 Token token = body.readToken();
81 while(! token.
isEOF()) {
84 std::string word = token.
getWord();
85 for(std::vector<std::string>::size_type i = 0;
86 i < formals.size(); i++) {
87 if(word == formals[i]) {
88 std::vector<Token> act = actuals[i];
97 if(! found) expansion->
append(token);
98 token = body.readToken();
103 instance = model->
clone(name);
107 parser.
run(&*expansion);
128 bool isSequence = statement.
keyword(
"SEQUENCE");
138 while(! token.
isEOF()) {
140 if(token.
isKey(
"ENDSEQUENCE")) {
143 while(! token.
isEOF()) {
145 if(token.
isDel(
';'))
break;
static OpalData * getInstance()
virtual void parse(Statement &)
Parse the object.
bool isEOF() const
Test for end of file.
The parser for SEQUENCE members.
The base class for all OPAL objects.
units but all components up to the maximum must be even if they are zero item[MAXFORDER] The order of the maximum function $f_n used in the field expansion(default:5).See the scalar magnetic potential below.This sets for example the maximum power of $z $in the field expansion of vertical component $B_z $to $2\cdot\text
void copyAttributes(const Object &)
Copy attributes from another object.
virtual Token readToken()=0
Read single token from stream.
Abstract base class for macros.
void start()
Reset stream to start.
virtual Object * makeInstance(const std::string &name, Statement &, const Parser *)
Make line instance.
virtual Object * makeTemplate(const std::string &name, TokenStream &, Statement &)
Make a sequence template.
virtual ~SequenceTemplate()
virtual SequenceTemplate * clone(const std::string &name)
Make clone.
std::string getWord() const
Return word value.
Abstract interface for a stream of input tokens.
void append(Token &)
Append a token to the stream.
virtual Sequence * clone(const std::string &name)
Make clone.
Representation of a single input token.
Interface for statements.
An input buffer for macro commands.
virtual void parseFormals(Statement &)
Parse formal arguments.
bool isKey(const char *key) const
Test for keyword.
b mention the algorithm in the References section The appropriate citation is
bool keyword(const char *s)
Test for keyword.
Object * find(const std::string &name)
Find entry.
bool isDel(char del) const
Test for delimiter.
Interface for abstract language parser.
void parseTemplate(TokenStream &, Statement &)
Parse the sequence template.
virtual void run() const
Read current stream.
bool isWord() const
Test for word.