summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/VariableExpression.cpp
blob: fafec2e4ac02ac00f3a226fcfa14869366399a54 (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(std::string name, Context * context) {
	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();
}