summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/PostfixExpression.cpp
blob: fb2345e13547f809e8e92e30255dc0e55c7ea041 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * PostfixExpression.cpp
 *
 *  Created on: Dec 5, 2012
 *      Author: attero
 */

#include "PostfixExpression.h"

PostfixExpression::PostfixExpression(ASTNode * parent, Context * context) {
	this->parent = parent;
	this->context = context;
	name = "";
	native = false;
	this->type = "PostfixExpression";
}

PostfixExpression::~PostfixExpression() {
	for(auto i = arguments.begin(); i != arguments.end();)
	{
		delete *i;
		i = arguments.erase(i);
	}
}


void PostfixExpression::set_name(std::string name)
{
	this->name = name;
}

void PostfixExpression::add_argument(ASTExpression * expression)
{
	arguments.push_back(expression);
}


SenchaObject PostfixExpression::evaluate()
{
	return context->execute_native_function(name, arguments);
}

void PostfixExpression::execute() {
	context->execute_native_function(name, arguments);

}



std::string PostfixExpression::debug()
{
	//TODO implement it or something
	return "Postfix expression tadadah!";
}