OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IfStatement Class Reference

If statement. More...

#include <IfStatement.h>

Inheritance diagram for IfStatement:
Inheritance graph
[legend]
Collaboration diagram for IfStatement:
Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

 IfStatement ()
 
 IfStatement (const IfStatement &)
 
void operator= (const IfStatement &)
 

Private Attributes

Statementthen_block
 
Statementelse_block
 

Additional Inherited Members

- Public Types inherited from Statement
typedef std::list< TokenTokenList
 The type of the enclosed token list. More...
 
- Protected Attributes inherited from Statement
int stat_line
 
std::string buffer_name
 
TokenList tokens
 
TokenList::iterator curr
 
TokenList::iterator keep
 

Detailed Description

If statement.

Definition at line 35 of file IfStatement.h.

Constructor & Destructor Documentation

◆ IfStatement() [1/3]

IfStatement::IfStatement ( const Parser parser,
TokenStream is 
)

Constructor.

Definition at line 35 of file IfStatement.cpp.

References Statement::append(), else_block, Token::isDel(), Token::isEOF(), Token::isKey(), TokenStream::putBack(), Parser::readStatement(), TokenStream::readToken(), and then_block.

Here is the call graph for this function:

◆ ~IfStatement()

IfStatement::~IfStatement ( )
virtual

Definition at line 73 of file IfStatement.cpp.

References else_block, and then_block.

◆ IfStatement() [2/3]

IfStatement::IfStatement ( )
private

◆ IfStatement() [3/3]

IfStatement::IfStatement ( const IfStatement )
private

Member Function Documentation

◆ execute()

void IfStatement::execute ( const Parser parser)
virtual

◆ operator=()

void IfStatement::operator= ( const IfStatement )
private

Member Data Documentation

◆ else_block

Statement* IfStatement::else_block
private

Definition at line 57 of file IfStatement.h.

Referenced by execute(), IfStatement(), and ~IfStatement().

◆ then_block

Statement* IfStatement::then_block
private

Definition at line 56 of file IfStatement.h.

Referenced by execute(), IfStatement(), and ~IfStatement().


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