2012-12-05 19:32:43 +00:00
|
|
|
/*
|
|
|
|
* ConstantExpression.cpp
|
|
|
|
*
|
|
|
|
* Created on: Dec 5, 2012
|
|
|
|
* Author: attero
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ConstantExpression.h"
|
|
|
|
|
2012-12-28 10:01:48 +00:00
|
|
|
ConstantExpression::ConstantExpression() //Constructor which sets value to null SenchaObject.
|
2012-12-17 11:47:05 +00:00
|
|
|
{
|
2012-12-05 20:31:06 +00:00
|
|
|
value = SenchaObject();
|
2012-12-22 10:06:55 +00:00
|
|
|
this->type = "ConstantExpression";
|
2012-12-05 19:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ConstantExpression::~ConstantExpression() {
|
|
|
|
|
2012-12-07 15:58:27 +00:00
|
|
|
}
|
|
|
|
|
2012-12-28 10:01:48 +00:00
|
|
|
ConstantExpression::ConstantExpression(SenchaObject value) : value(value)
|
2012-12-09 16:42:13 +00:00
|
|
|
{
|
2012-12-21 15:16:39 +00:00
|
|
|
this->type = "ConstantExpression";
|
2012-12-09 16:42:13 +00:00
|
|
|
}
|
|
|
|
|
2012-12-06 17:41:16 +00:00
|
|
|
SenchaObject ConstantExpression::evaluate()
|
2012-12-05 20:31:06 +00:00
|
|
|
{
|
|
|
|
return value;
|
|
|
|
}
|
2012-12-06 17:41:16 +00:00
|
|
|
|
2012-12-31 16:10:37 +00:00
|
|
|
SenchaObject ConstantExpression::execute()
|
2012-12-09 11:57:51 +00:00
|
|
|
{
|
2012-12-31 16:10:37 +00:00
|
|
|
SenchaObject result = evaluate();
|
|
|
|
return result;
|
2012-12-09 11:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-18 20:22:33 +00:00
|
|
|
void ConstantExpression::accept(Visitor * visitor)
|
|
|
|
{
|
|
|
|
visitor->visit(this);
|
|
|
|
}
|
|
|
|
|
2012-12-28 10:01:48 +00:00
|
|
|
ConstantExpression::ConstantExpression( int number)
|
2012-12-06 17:41:16 +00:00
|
|
|
{
|
2012-12-28 10:01:48 +00:00
|
|
|
value = SenchaObject(number);
|
2012-12-22 10:06:55 +00:00
|
|
|
this->type = "ConstantExpression";
|
2012-12-06 17:41:16 +00:00
|
|
|
}
|
|
|
|
|
2012-12-28 10:01:48 +00:00
|
|
|
ConstantExpression::ConstantExpression( double number)
|
2012-12-06 17:41:16 +00:00
|
|
|
{
|
2012-12-28 10:01:48 +00:00
|
|
|
|
2012-12-22 10:06:55 +00:00
|
|
|
this->type = "ConstantExpression";
|
2012-12-06 17:41:16 +00:00
|
|
|
value = SenchaObject(number);
|
|
|
|
}
|
|
|
|
|
2012-12-28 10:01:48 +00:00
|
|
|
ConstantExpression::ConstantExpression( std::string text)
|
2012-12-06 17:41:16 +00:00
|
|
|
{
|
2012-12-22 10:06:55 +00:00
|
|
|
this->type = "ConstantExpression";
|
2012-12-28 10:01:48 +00:00
|
|
|
value = SenchaObject(text);
|
2012-12-06 17:41:16 +00:00
|
|
|
}
|