sencha-lang/Sencha-lang/AST/PostfixExpression.cpp

42 lines
733 B
C++

/*
* PostfixExpression.cpp
*
* Created on: Dec 5, 2012
* Author: attero
*/
#include "PostfixExpression.h"
PostfixExpression::PostfixExpression(std::string name, ContextManager * context):
name(name), context(context), 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->execute_native_function(name, arguments);
}
void PostfixExpression::execute() {
context->execute_native_function(name, arguments);
}