summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/VariableExpression.cpp
blob: 6ebf0dd011aba19ac0624569fddbd2b63f578f02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * VariableExpression.cpp
 *
 *  Created on: Dec 17, 2012
 *      Author: att
 */

#include "VariableExpression.h"

VariableExpression::VariableExpression(Context * context, std::string name) {
	this->name = name;
	this->context = context;
	this->type = "VariableExpression";
}

VariableExpression::~VariableExpression() {
	// Do nothing
}

SenchaObject VariableExpression::evaluate()
{
	SenchaObject result = context->get(name);
	result.name = name;
	return result;
}

void  VariableExpression::execute()
{
	std::cout <<  evaluate().repr() << std::endl;
}

void VariableExpression::execute_quietly()
{
	evaluate();
}