OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
SimpleStatement.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: SimpleStatement.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.1.1.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class: SimpleStatement
10// Concrete representation for a standard input language statement.
11//
12// ------------------------------------------------------------------------
13// Class category: Parser
14// ------------------------------------------------------------------------
15//
16// $Date: 2000/03/27 09:32:37 $
17// $Author: fci $
18//
19// ------------------------------------------------------------------------
20
22#include "OpalParser/Parser.h"
23#include "OpalParser/Token.h"
25
26// class SimpleStatement
27// ------------------------------------------------------------------------
28
29SimpleStatement::SimpleStatement(const std::string& name, int line) : Statement(name, line) {}
30
31SimpleStatement::SimpleStatement(const std::string& name, TokenList& list)
32 : Statement(name, list) {}
33
35
36void SimpleStatement::execute(const Parser& parser) {
37 curr = keep = tokens.begin();
38 if (curr != tokens.end()) parser.parse(*this);
39}
Interface for abstract language parser.
Definition Parser.h:30
virtual void parse(Statement &stat) const =0
Parse and execute the statement.
SimpleStatement(const std::string &streamName, int streamLine)
Constructor.
virtual ~SimpleStatement()
Destructor.
virtual void execute(const Parser &)
Execute statement.
Interface for statements.
Definition Statement.h:37
TokenList::iterator keep
Definition Statement.h:178
std::list< Token > TokenList
The type of the enclosed token list.
Definition Statement.h:40
TokenList tokens
Definition Statement.h:176
TokenList::iterator curr
Definition Statement.h:177