class
MadParser
: public Parser
(Return to index)
The default parser for MAD-9.
The parser reads a command name and keyword and looks up the keyword
in the directory. If it finds an object, it makes a clone with the
name read and calls the parser for the cloned object. If that parser
succeeds, it calls the clone's execute() function. As required, it
first updates the data structure to ensure that everything is up-to-date.
Optionally, command execution is also traced.
Type: |
Instantiable |
Superclasses: |
public Parser |
Include file: |
./MadParser/MadParser.hh |
Inheritance
Synopsis (including inherited members):
- Public members:
-
MadParser
()
;
-
virtual ~MadParser
()
;
-
virtual void parse
(Statement&)const
;
-
virtual Statement* readStatement
(TokenStream*)const
;
-
virtual void run
()const
;
-
virtual void run
(TokenStream*)const
;
-
void stop
()const
;
-
static Token readToken
()
;
- Protected Members:
-
void execute
(Object*,const string&)const
;
-
virtual Object* find
(const string&)const
;
-
virtual void parseAction
(Statement&)const
;
-
virtual void parseAssign
(Statement&)const
;
-
virtual void parseDefine
(Statement&)const
;
-
virtual void parseEnd
(Statement&)const
;
-
virtual void parseMacro
(const string&,Statement&)const
;
-
virtual void printHelp
(const string&)const
;
Documentation:
- Public members:
-
virtual void parse
(Statement&)const
;
- Parse and execute current statement.
-
virtual Statement* readStatement
(TokenStream*)const
;
- Read complete statement from a token stream.
-
static Token readToken
()
;
- Return next input token.
-
virtual void run
()const
;
- Read current stream.
Read, parse, and execute statements one at a time.
-
virtual void run
(TokenStream*)const
;
- Read given stream.
Switch to given stream, then read, parse, and execute statements
one at a time. Used for CALL statements and macros.
-
void stop
()const
;
- Set stop flag.
Causes run() to return when the next statement should be
read.
- Protected members:
-
void execute
(Object*,const string&)const
;
- Execute or check the current command.
-
virtual Object* find
(const string&)const
;
- Find object by name in the main directory.
-
virtual void parseAction
(Statement&)const
;
- Parse executable command.
-
virtual void parseAssign
(Statement&)const
;
- Parse assignment statement.
-
virtual void parseDefine
(Statement&)const
;
- Parse definition.
-
virtual void parseEnd
(Statement&)const
;
- Check for end of statement.
-
virtual void parseMacro
(const string&,Statement&)const
;
- Parse macro definition or call.
-
virtual void printHelp
(const string&)const
;
- Print help on named command.
Documentation generated by fci on Mon Feb 7 12:30:00 2000