C++ main module for gpm Package  1.0
MATH_EndBlock.h
Go to the documentation of this file.
1 #ifndef MATH_EndBlock_H
2 #define MATH_EndBlock_H
3 
4 #include "MATH_Block.h"
5 
6 class MATH_Operator;
7 
17 class MATH_EndBlock : public MATH_Block {
18  SP_OBJECT(MATH_EndBlock);
19 
20  // ATTRIBUTES
21 
22 private:
23 
24 protected:
25  // METHODS
26 
27  // CONSTRUCTORS
28 
31  MATH_EndBlock(void);
32 
33 
34 
35  // DESTRUCTORS
36 
37 
40  virtual ~MATH_EndBlock(void);
41 
42 private:
43 
44 public:
47  static inline SP::MATH_EndBlock New() {
48  SP::MATH_EndBlock p(new MATH_EndBlock(),MATH_EndBlock::Delete());
49  p->setThis(p);
50  return p;
51  }
52 
55  virtual SP::MATH_NodeExpression newInstance() const {
56  return New();
57  }
58 
59 
60 
61  // SET methods
62 
63 
64 
65  // GET methods
66 
67 public:
68  // OTHERS methods
71  inline tBoolean isCompatible(const MATH_Block& bb) const {
72  const char &bc=bb.getBlockString();
73  const char &ec=getBlockString();
74  return ( ( (bc=='{') && (ec=='}') ) ||
75  ( (bc=='(') && (ec==')') ) ||
76  ( (bc=='[') && (ec==']') ) );
77 
78  }
86  virtual int evaluate(const tFlag& action,MATH_Environment& symbols,MATH_Variable& var) const {
87  return SUCCESS;
88  }
112 
113 private:
118  tBoolean searchBlock(MATH_ChildExpression*& current);
119 
120 
121 };
122 
123 #endif
virtual MATH_ChildExpression * insertInTree(MATH_Expression *tree, MATH_Environment &symbols, tString &expr)
insert the node This in tree & erase the This corresponding character in expr
Definition: MATH_EndBlock.cpp:37
This class decribes a variable class for evaluation.
Definition: MATH_Variable.h:16
virtual const char & getBlockString() const
get the block expression character
Definition: MATH_Block.h:64
tBoolean isCompatible(const MATH_Block &bb) const
test if the end block This is compatible with the begin block
Definition: MATH_EndBlock.h:71
virtual ~MATH_EndBlock(void)
destroy
Definition: MATH_EndBlock.cpp:12
This class is the base class of a math expression.
Definition: MATH_Expression.h:24
This class decribes an operator with a name.
Definition: MATH_Operator.h:15
#define tBoolean
Definition: types.h:35
MATH_EndBlock(void)
create
Definition: MATH_EndBlock.cpp:7
virtual int evaluate(const tFlag &action, MATH_Environment &symbols, MATH_Variable &var) const
void evaluate the expression
Definition: MATH_EndBlock.h:86
This class decribes a block.
Definition: MATH_Block.h:18
DEFINE_SPTR(MATH_EndBlock)
This class is a children of a parent expression.
Definition: MATH_ChildExpression.h:23
#define tString
Definition: types.h:36
static SP::MATH_EndBlock New()
create a node expression
Definition: MATH_EndBlock.h:47
Definition: MATH_EndBlock.h:17
This class decribes an environment class.
Definition: MATH_Environment.h:14
static const int SUCCESS
Definition: MATH_Expression.h:41
virtual SP::MATH_NodeExpression newInstance() const
create a node expression
Definition: MATH_EndBlock.h:55
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14