42 lines
915 B
C++
42 lines
915 B
C++
/*
|
|
* ConstantExpression.cpp
|
|
*
|
|
* Created on: Dec 5, 2012
|
|
* Author: attero
|
|
*/
|
|
|
|
#include "ConstantExpression.h"
|
|
|
|
ConstantExpression::ConstantExpression(ASTNode * parent) {
|
|
// TODO Auto-generated constructor stub
|
|
this->parent = parent;
|
|
value = SenchaObject();
|
|
}
|
|
|
|
ConstantExpression::~ConstantExpression() {
|
|
// TODO Auto-generated destructor stub
|
|
}
|
|
|
|
SenchaObject ConstantExpression::evaluate()
|
|
{
|
|
return value;
|
|
}
|
|
|
|
ConstantExpression::ConstantExpression(ASTNode * parent, int number)
|
|
{
|
|
this->parent = parent; value = SenchaObject(number);
|
|
}
|
|
|
|
ConstantExpression::ConstantExpression(ASTNode * parent, double number)
|
|
{
|
|
this->parent = parent;
|
|
value = SenchaObject(number);
|
|
}
|
|
|
|
ConstantExpression::ConstantExpression(ASTNode * parent, std::string text)
|
|
{
|
|
this->parent = parent; value = SenchaObject(text);
|
|
}
|
|
|
|
std::string ConstantExpression::debug() { return "Constant expression:\n" + value.repr() + "\n"; }
|