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

A simple input statement in token form. More...

#include <SimpleStatement.h>

Inheritance diagram for SimpleStatement:
Collaboration diagram for SimpleStatement:

Public Types

typedef std::list< TokenTokenList
 The type of the enclosed token list.

Public Member Functions

 SimpleStatement (const std::string &streamName, int streamLine)
 Constructor.
 SimpleStatement (const std::string &streamName, TokenList &list)
 Constructor.
virtual ~SimpleStatement ()
 Destructor.
virtual void execute (const Parser &)
 Execute statement.
void append (const Token &)
 Append a token.
bool atEnd () const
 Test for end of command.
bool boolean (bool &value)
 Return boolean value.
bool delimiter (char c)
 Test for delimiter.
bool delimiter (const char *s)
 Test for delimiter choice.
TokengetCurrent ()
 Return current token and skip it.
bool integer (int &value)
 Return signed integer.
bool integer (unsigned &value)
 Return unsigned integer.
bool keyword (const char *s)
 Test for keyword.
bool real (double &value)
 Return real value.
bool str (std::string &value)
 Return string value.
std::string str () const
bool word (std::string &value)
 Return word value.
void mark ()
 Mark position in command.
void restore ()
 Return to marked position.
void start ()
 Return to start.
void skip ()
 Skip.
unsigned int position () const
 Return current character number in line.
virtual void print (std::ostream &os) const
 Print statement.
virtual void printWhere (Inform &msg, bool withToken) const
 Print position.

Protected Attributes

int stat_line
std::string buffer_name
TokenList tokens
TokenList::iterator curr
TokenList::iterator keep

Detailed Description

A simple input statement in token form.

Definition at line 31 of file SimpleStatement.h.

Member Typedef Documentation

◆ TokenList

typedef std::list<Token> Statement::TokenList
inherited

The type of the enclosed token list.

Definition at line 43 of file Statement.h.

Constructor & Destructor Documentation

◆ SimpleStatement() [1/2]

SimpleStatement::SimpleStatement ( const std::string & streamName,
int streamLine )

Constructor.

Definition at line 30 of file SimpleStatement.cpp.

References Statement::Statement().

Here is the call graph for this function:

◆ SimpleStatement() [2/2]

SimpleStatement::SimpleStatement ( const std::string & streamName,
TokenList & list )

Constructor.

Definition at line 35 of file SimpleStatement.cpp.

References Statement::Statement().

Here is the call graph for this function:

◆ ~SimpleStatement()

SimpleStatement::~SimpleStatement ( )
virtual

Destructor.

Definition at line 40 of file SimpleStatement.cpp.

Member Function Documentation

◆ append()

void Statement::append ( const Token & token)
inherited

Append a token.

Definition at line 45 of file Statement.cpp.

References tokens.

Referenced by LineTemplate::makeInstance(), OpalParser::parseBracketList(), OpalParser::parseTokenList(), and OpalParser::readStatement().

Here is the caller graph for this function:

◆ atEnd()

bool Statement::atEnd ( ) const
inherited

Test for end of command.

Definition at line 50 of file Statement.cpp.

References curr, and tokens.

Referenced by MacroCmd::makeTemplate(), OpalParser::parse(), Expressions::parseBracketList(), OpalParser::parseEnd(), LineTemplate::parseTemplate(), Expressions::parseTokenList(), and skip().

Here is the caller graph for this function:

◆ boolean()

bool Statement::boolean ( bool & value)
inherited

Return boolean value.

Definition at line 55 of file Statement.cpp.

References curr, tokens, and word().

Referenced by Expressions::parseRelation().

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

◆ delimiter() [1/2]

◆ delimiter() [2/2]

bool Statement::delimiter ( const char * s)
inherited

Test for delimiter choice.

Definition at line 111 of file Statement.cpp.

References curr, and tokens.

◆ execute()

void SimpleStatement::execute ( const Parser & parser)
virtual

Execute statement.

Implements Statement.

Definition at line 44 of file SimpleStatement.cpp.

References Statement::curr, Statement::keep, Parser::parse(), and Statement::tokens.

Here is the call graph for this function:

◆ getCurrent()

Token & Statement::getCurrent ( )
inherited

Return current token and skip it.

Definition at line 74 of file Statement.cpp.

References curr.

Referenced by MacroCmd::makeTemplate(), OpalParser::parse(), Macro::parseActuals(), Expressions::parseBracketList(), OpalParser::parseMacro(), LineTemplate::parseTemplate(), and Expressions::parseTokenList().

Here is the caller graph for this function:

◆ integer() [1/2]

bool Statement::integer ( int & value)
inherited

Return signed integer.

Definition at line 79 of file Statement.cpp.

References curr, and tokens.

Referenced by Line::parseList().

Here is the caller graph for this function:

◆ integer() [2/2]

bool Statement::integer ( unsigned & value)
inherited

Return unsigned integer.

Definition at line 90 of file Statement.cpp.

References curr, and tokens.

◆ keyword()

bool Statement::keyword ( const char * s)
inherited

Test for keyword.

Definition at line 121 of file Statement.cpp.

References curr, and tokens.

Referenced by MacroCmd::makeTemplate(), OpalParser::parse(), SequenceParser::parse(), Expressions::parseArrayPrimary(), OpalParser::parseAssign(), OpalParser::parseDefine(), Expressions::parsePlace(), SequenceParser::parsePosition(), Expressions::parseRange(), LineTemplate::parseTemplate(), and SequenceTemplate::parseTemplate().

Here is the caller graph for this function:

◆ mark()

void Statement::mark ( )
inherited

Mark position in command.

Definition at line 170 of file Statement.cpp.

References curr, and keep.

Referenced by OpalParser::parse(), OpalParser::parseMacro(), Expressions::parseRelation(), Object::parseShortcut(), and Expressions::parseTokenList().

Here is the caller graph for this function:

◆ position()

unsigned int Statement::position ( ) const
inherited

Return current character number in line.

Definition at line 190 of file Statement.cpp.

References curr, and tokens.

Referenced by OpalParser::parse(), and OpalParser::parseEnd().

Here is the caller graph for this function:

◆ print()

void Statement::print ( std::ostream & os) const
virtualinherited

Print statement.

Definition at line 204 of file Statement.cpp.

References tokens.

Referenced by IfStatement::execute(), WhileStatement::execute(), operator<<(), operator<<(), OpalParser::parse(), OpalParser::parseEnd(), and str().

Here is the caller graph for this function:

◆ printWhere()

void Statement::printWhere ( Inform & msg,
bool withToken ) const
virtualinherited

Print position.

Definition at line 217 of file Statement.cpp.

References buffer_name, curr, stat_line, and tokens.

◆ real()

bool Statement::real ( double & value)
inherited

Return real value.

Definition at line 131 of file Statement.cpp.

References curr, and tokens.

Referenced by Expressions::parseArrayPrimary(), and Expressions::parsePrimary().

Here is the caller graph for this function:

◆ restore()

void Statement::restore ( )
inherited

Return to marked position.

Definition at line 175 of file Statement.cpp.

References curr, and keep.

Referenced by OpalParser::parse(), OpalParser::parseMacro(), Expressions::parseRelation(), and Expressions::parseTokenList().

Here is the caller graph for this function:

◆ skip()

void Statement::skip ( )
inherited

Skip.

Definition at line 185 of file Statement.cpp.

References atEnd(), and curr.

Here is the call graph for this function:

◆ start()

void Statement::start ( )
inherited

Return to start.

Definition at line 180 of file Statement.cpp.

References curr, and tokens.

Referenced by IfStatement::execute(), LineTemplate::makeInstance(), OpalParser::parse(), SequenceParser::parse(), OpalParser::parseAction(), OpalParser::parseAssign(), OpalParser::parseDefine(), and OpalParser::readStatement().

Here is the caller graph for this function:

◆ str() [1/2]

std::string Statement::str ( ) const
inherited

Definition at line 232 of file Statement.cpp.

References print(), and str().

Here is the call graph for this function:

◆ str() [2/2]

bool Statement::str ( std::string & value)
inherited

Return string value.

Definition at line 148 of file Statement.cpp.

References curr, and tokens.

Referenced by Expressions::parseString(), Expressions::parseStringValue(), and str().

Here is the caller graph for this function:

◆ word()

bool Statement::word ( std::string & value)
inherited

Return word value.

Definition at line 159 of file Statement.cpp.

References curr, and tokens.

Referenced by boolean(), Expressions::parseRelation(), Object::parseShortcut(), Expressions::parseString(), and Expressions::parseStringValue().

Here is the caller graph for this function:

Member Data Documentation

◆ buffer_name

std::string Statement::buffer_name
protectedinherited

◆ curr

◆ keep

TokenList::iterator Statement::keep
protectedinherited

Definition at line 181 of file Statement.h.

Referenced by SimpleStatement::execute(), WhileStatement::execute(), mark(), and restore().

◆ stat_line

int Statement::stat_line
protectedinherited

◆ tokens


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