OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
IfStatement.h
Go to the documentation of this file.
1 #ifndef OPAL_IfStatement_HH
2 #define OPAL_IfStatement_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: IfStatement.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: IfStatement
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:43 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Parser/Statement.h"
23 
24 class Parser;
25 class TokenStream;
26 
27 
28 // class "IfStatement":
29 // ------------------------------------------------------------------------
31 // A statement of the form "IF ( <condition> ) <statement>".
32 // The condition is stored in the Token list inherited from Statement,
33 // the then and else blocks are stored in two Statements.
34 
35 class IfStatement: public Statement {
36 
37 public:
38 
40  // Parse the statement on the given token stream, using the given parser.
41  IfStatement(const Parser &, TokenStream &);
42 
43  virtual ~IfStatement();
44 
46  // Use the given parser to execute the controlled statements.
47  virtual void execute(const Parser &);
48 
49 private:
50 
51  // Not implemented.
52  IfStatement();
53  IfStatement(const IfStatement &);
54  void operator=(const IfStatement &);
55 
58 };
59 
60 #endif // OPAL_IfStatement_HH
virtual void execute(const Parser &)
Execute.
Definition: IfStatement.cpp:78
Abstract interface for a stream of input tokens.
Definition: TokenStream.h:33
Interface for abstract language parser.
Definition: Parser.h:31
Interface for statements.
Definition: Statement.h:38
virtual ~IfStatement()
Definition: IfStatement.cpp:72
Statement * else_block
Definition: IfStatement.h:57
Statement * then_block
Definition: IfStatement.h:56
void operator=(const IfStatement &)
If statement.
Definition: IfStatement.h:35