1
#include "MathMLSolverStableHeaders.h"
2
#include "MathMLASTBinaryComparisionExpression.h"
9
//---------------------------------------------------------------------------------
10
BinaryComparisonExpression::BinaryComparisonExpression()
16
BinaryComparisonExpression::~BinaryComparisonExpression()
22
//---------------------------------------------------------------------------------
23
void BinaryComparisonExpression::accept( IVisitor* visitor ) const
25
visitor->visit( this );
28
//---------------------------------------------------------------------------------
29
BinaryComparisonExpression::Operator BinaryComparisonExpression::getOperator() const
34
//---------------------------------------------------------------------------------
35
void BinaryComparisonExpression::setOperator( Operator op )
40
//---------------------------------------------------------------------------------
41
const String& BinaryComparisonExpression::getOperatorString() const
43
return operatorString( mOperator );
46
//---------------------------------------------------------------------------------
47
const String& BinaryComparisonExpression::operatorString( Operator op )
53
return OPERATOR_COMPARE_EQ;
56
return OPERATOR_COMPARE_NEQ;
59
return OPERATOR_COMPARE_LTE;
62
return OPERATOR_COMPARE_GTE;
65
return OPERATOR_COMPARE_LT;
68
return OPERATOR_COMPARE_GT;
71
return OPERATOR_COMPARE_ILLEGAL;
74
//---------------------------------------------------------------------------------
75
void BinaryComparisonExpression::setOperator( const String& op )
77
if ( op == OPERATOR_COMPARE_EQ )
82
else if ( op == OPERATOR_COMPARE_NEQ )
87
else if ( op == OPERATOR_COMPARE_LTE )
92
else if ( op == OPERATOR_COMPARE_GTE )
97
else if ( op == OPERATOR_COMPARE_LT )
102
else if ( op == OPERATOR_COMPARE_GT )
108
//---------------------------------------------------------------------------------
109
INode* BinaryComparisonExpression::getLeftOperand() const
114
//---------------------------------------------------------------------------------
115
void BinaryComparisonExpression::setLeftOperand( INode* operand )
117
mLeftOperand = operand;
120
//---------------------------------------------------------------------------------
121
INode* BinaryComparisonExpression::getRightOperand() const
123
return mRightOperand;
126
//---------------------------------------------------------------------------------
127
void BinaryComparisonExpression::setRightOperand( INode* operand )
129
mRightOperand = operand;
132
//-----------------------------------------------------------------
133
INode* BinaryComparisonExpression::clone(CloneFlags cloneFlags) const
135
BinaryComparisonExpression* copy = new BinaryComparisonExpression();
136
copy->mOperator = mOperator;
139
copy->mLeftOperand = mLeftOperand->clone(cloneFlags);
141
copy->mLeftOperand = 0;
144
copy->mRightOperand = mRightOperand->clone(cloneFlags);
146
copy->mRightOperand = 0;