/*
 * PostfixExpression.cpp
 *
 *  Created on: Dec 5, 2012
 *      Author: attero
 */

#include "PostfixExpression.h"

PostfixExpression::PostfixExpression(std::string name, ContextManager * context_manager):
	 name(name), context_manager(context_manager), native(false)
{
		type= "PostfixExpression";
}

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


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


SenchaObject PostfixExpression::evaluate()
{
	return context_manager->execute_function(name, arguments);
}

SenchaObject PostfixExpression::execute() {
	return context_manager->execute_function(name, arguments);

}


