OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
TrackParser Class Reference

#include <TrackParser.h>

Inheritance diagram for TrackParser:
Collaboration diagram for TrackParser:

Public Member Functions

 TrackParser ()
virtual ~TrackParser ()
virtual void parse (Statement &) const
 Parse and execute current statement.
virtual StatementreadStatement (TokenStream *) const
 Read complete statement from a token stream.
virtual void run () const
 Read current stream.
virtual void run (TokenStream *) const
 Read given stream.
void stop () const
 Set stop flag.

Static Public Member Functions

static Token readToken ()
 Return next input token.

Protected Member Functions

virtual Objectfind (const std::string &) const
 Find object by name in the track command directory.
void execute (Object *, const std::string &) const
 Execute or check the current command.
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 std::string &name, Statement &) const
 Parse macro definition or call.
virtual void printHelp (const std::string &) const
 Print help on named command.

Private Member Functions

 TrackParser (const TrackParser &)
void operator= (const TrackParser &)

Static Private Member Functions

static void parseBracketList (char close, Statement &)
static void parseTokenList (Statement &)
static std::string getHint (const std::string &, const std::string &="attribute")

Private Attributes

Directory trackDirectory
bool stopFlag

Static Private Attributes

static std::vector< std::shared_ptr< TokenStream > > inputStack

Detailed Description

Definition at line 28 of file TrackParser.h.

Constructor & Destructor Documentation

◆ TrackParser() [1/2]

TrackParser::TrackParser ( )

Definition at line 25 of file TrackParser.cpp.

References trackDirectory.

Referenced by operator=(), and TrackParser().

Here is the caller graph for this function:

◆ ~TrackParser()

TrackParser::~TrackParser ( )
virtual

Definition at line 32 of file TrackParser.cpp.

◆ TrackParser() [2/2]

TrackParser::TrackParser ( const TrackParser & )
private

References TrackParser().

Here is the call graph for this function:

Member Function Documentation

◆ execute()

void OpalParser::execute ( Object * object,
const std::string & name ) const
protectedinherited

Execute or check the current command.

Definition at line 119 of file OpalParser.cpp.

References OpalData::getInstance(), gmsg, Options::mtrace, Object::shouldTrace(), Object::shouldUpdate(), and OpalData::update().

Referenced by parseAction(), parseDefine(), and parseMacro().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

Object * TrackParser::find ( const std::string & name) const
protectedvirtual

Find object by name in the track command directory.

Reimplemented from OpalParser.

Definition at line 36 of file TrackParser.cpp.

References trackDirectory.

◆ getHint()

std::string OpalParser::getHint ( const std::string & name,
const std::string & type = "attribute" )
staticprivateinherited

Definition at line 620 of file OpalParser.cpp.

References AttributeHandler::COMMAND, AttributeHandler::ELEMENT, AttributeHandler::getOwner(), AttributeHandler::STATEMENT, and AttributeHandler::SUB_COMMAND.

Referenced by parse(), and parseAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void TrackParser::operator= ( const TrackParser & )
private

References TrackParser().

Here is the call graph for this function:

◆ parse()

void OpalParser::parse ( Statement & stat) const
virtualinherited

Parse and execute current statement.

Implements Parser.

Reimplemented in SequenceParser.

Definition at line 63 of file OpalParser.cpp.

References Statement::atEnd(), Statement::delimiter(), find(), Statement::getCurrent(), getHint(), OpalData::getInstance(), Token::getLex(), Statement::keyword(), Statement::mark(), parseAction(), parseAssign(), parseDefine(), parseMacro(), Expressions::parseString(), Statement::position(), Statement::print(), printHelp(), Statement::restore(), and Statement::start().

Here is the call graph for this function:

◆ parseAction()

void OpalParser::parseAction ( Statement & stat) const
protectedvirtualinherited

Parse executable command.

Definition at line 147 of file OpalParser.cpp.

References Object::clone(), Statement::delimiter(), execute(), find(), getHint(), Object::parse(), parseEnd(), Expressions::parseString(), printHelp(), Statement::start(), and stopFlag.

Referenced by parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseAssign()

void OpalParser::parseAssign ( Statement & stat) const
protectedvirtualinherited

Parse assignment statement.

Definition at line 180 of file OpalParser.cpp.

References Object::clone(), OpalData::define(), Statement::delimiter(), OpalData::find(), find(), Object::findAttribute(), OpalData::getInstance(), Object::isTreeMember(), Statement::keyword(), OpalData::makeDirty(), Expressions::parseDelimiter(), parseEnd(), Expressions::parseRealConst(), Expressions::parseString(), and Statement::start().

Referenced by parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseBracketList()

void OpalParser::parseBracketList ( char close,
Statement & stat )
staticprivateinherited

Definition at line 438 of file OpalParser.cpp.

References Statement::append(), Token::isDel(), Token::isEOF(), parseBracketList(), and readToken().

Referenced by parseBracketList(), parseTokenList(), and readStatement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseDefine()

void OpalParser::parseDefine ( Statement & stat) const
protectedvirtualinherited

Parse definition.

Definition at line 313 of file OpalParser.cpp.

References Object::clone(), OpalData::define(), Statement::delimiter(), execute(), find(), OpalData::getInstance(), Statement::keyword(), Object::makeInstance(), Object::parse(), parseEnd(), Expressions::parseString(), Object::setShared(), and Statement::start().

Referenced by parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseEnd()

void OpalParser::parseEnd ( Statement & stat) const
protectedvirtualinherited

Check for end of statement.

Definition at line 360 of file OpalParser.cpp.

References Statement::atEnd(), Statement::delimiter(), Statement::position(), and Statement::print().

Referenced by SequenceParser::parse(), parseAction(), parseAssign(), parseDefine(), and SequenceParser::parseMember().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseMacro()

void OpalParser::parseMacro ( const std::string & name,
Statement & stat ) const
protectedvirtualinherited

Parse macro definition or call.

Definition at line 373 of file OpalParser.cpp.

References OpalData::define(), Statement::delimiter(), execute(), find(), Statement::getCurrent(), OpalData::getInstance(), inputStack, Object::makeInstance(), Object::makeTemplate(), Statement::mark(), Expressions::parseString(), and Statement::restore().

Referenced by parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseTokenList()

void OpalParser::parseTokenList ( Statement & stat)
staticprivateinherited

Definition at line 458 of file OpalParser.cpp.

References Statement::append(), Token::isDel(), Token::isEOF(), parseBracketList(), and readToken().

Referenced by readStatement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printHelp()

void OpalParser::printHelp ( const std::string & cmdName) const
protectedvirtualinherited

Print help on named command.

Definition at line 428 of file OpalParser.cpp.

References find(), and gmsg.

Referenced by parse(), and parseAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStatement()

Statement * OpalParser::readStatement ( TokenStream * is) const
virtualinherited

Read complete statement from a token stream.

Todo
check this /stat->printWhere(*IpplInfo::Error, true);

Implements Parser.

Definition at line 487 of file OpalParser.cpp.

References Statement::append(), Token::getFile(), Token::getLine(), gmsg, inputStack, Token::isDel(), Token::isEOF(), Token::isKey(), Token::isString(), Token::isWord(), parseBracketList(), parseTokenList(), readStatement(), TokenStream::readToken(), Statement::start(), and ClassicException::what().

Referenced by readStatement(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readToken()

Token OpalParser::readToken ( )
staticinherited

Return next input token.

Definition at line 479 of file OpalParser.cpp.

References inputStack, and Token::IS_EOF.

Referenced by parseBracketList(), and parseTokenList().

Here is the caller graph for this function:

◆ run() [1/2]

void OpalParser::run ( ) const
virtualinherited

Read current stream.

Definition at line 581 of file OpalParser.cpp.

References inputStack, readStatement(), stopFlag, ClassicException::what(), and ClassicException::where().

Referenced by Call::execute(), main(), SequenceTemplate::makeInstance(), Sequence::parse(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run() [2/2]

void OpalParser::run ( TokenStream * is) const
virtualinherited

Read given stream.

Implements Parser.

Definition at line 610 of file OpalParser.cpp.

References inputStack, and run().

Here is the call graph for this function:

◆ stop()

void OpalParser::stop ( ) const
inherited

Set stop flag.

Definition at line 616 of file OpalParser.cpp.

References stopFlag.

Referenced by SequenceParser::parse().

Here is the caller graph for this function:

Member Data Documentation

◆ inputStack

std::vector< std::shared_ptr< TokenStream > > OpalParser::inputStack
staticprivateinherited

Definition at line 119 of file OpalParser.h.

Referenced by parseMacro(), readStatement(), readToken(), run(), and run().

◆ stopFlag

bool OpalParser::stopFlag
mutableprivateinherited

Definition at line 116 of file OpalParser.h.

Referenced by OpalParser(), parseAction(), run(), and stop().

◆ trackDirectory

Directory TrackParser::trackDirectory
private

Definition at line 47 of file TrackParser.h.

Referenced by find(), and TrackParser().


The documentation for this class was generated from the following files: