sencha-lang/Sencha-lang/AST/DeclarationStatement.h

44 lines
1.0 KiB
C++

/*
* DeclarationStatement.h
*
* Created on: Dec 9, 2012
* Author: attero
*/
#ifndef DECLARATIONSTATEMENT_H_
#define DECLARATIONSTATEMENT_H_
#include "ASTStatement.h"
#include "ASTExpression.h"
#include "ConstantExpression.h"
#include "../ContextManager.h"
/**
* DeclarationStatement is abstraction of declaration/definition
* You can declare new variables and functions. And they will be added to
* your world aka context. And you could use them later.
*/
class DeclarationStatement: public ASTStatement {
public:
std::string name;
ContextManager * context_manager;
std::string name_of_context;
SenchaObject right_value;
ASTStatement * body;
std::vector<std::string> arguments;
bool is_function;
void add_right_value(ASTExpression * right);
DeclarationStatement(ContextManager * context);
void add_name(std::string);
void add_argument(std::string name);
void add_body(ASTStatement * statement);
virtual SenchaObject execute();
virtual ~DeclarationStatement();
};
#endif /* DECLARATIONSTATEMENT_H_ */