summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/Context.h
diff options
context:
space:
mode:
authorJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-31 17:10:37 +0100
committerJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-31 17:10:37 +0100
commit6296524bec2e2254f816b944ecc8cf28686f1fa8 (patch)
tree69b4f25c77502cd4fbcd14c28a9ad04aac28acd3 /Sencha-lang/Context.h
parente01bc95615b24e8e122942f3701b6b4197ec16b7 (diff)
downloadsencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.tar.gz
sencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.tar.bz2
sencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.zip
Functions work if given right arguments ^^.
Diffstat (limited to 'Sencha-lang/Context.h')
-rw-r--r--Sencha-lang/Context.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/Sencha-lang/Context.h b/Sencha-lang/Context.h
index 53e7888..92187f0 100644
--- a/Sencha-lang/Context.h
+++ b/Sencha-lang/Context.h
@@ -7,7 +7,15 @@
#ifndef CONTEXT_H_
#define CONTEXT_H_
+#include <map>
+#include <string>
#include "Utils/to_string.h"
+#include "Elements/SenchaObject.h"
+#include "Elements/SenchaFunction.h"
+#include "AST/ASTExpression.h"
+
+
+
class Context {
public:
@@ -15,24 +23,19 @@ public:
unsigned int index;
std::string name;
- std::map<ObjectIndex, SenchaObject> object_store;
- ObjectIndex add_to_store(SenchaObject & object);
- SenchaObject get_from_store(ObjectIndex index);
-
+ std::map<std::string, SenchaObject> object_store;
+ unsigned int add_to_store(SenchaObject & object);
+ SenchaObject get_from_store(unsigned int index);
typedef SenchaObject (*PointerToNativeFunction)(std::vector<ASTExpression *>);
std::map<std::string, PointerToNativeFunction> registered_functions;
+ std::map<std::string, SenchaFunction *> registered_sfunctions;
void register_function(std::string name, PointerToNativeFunction f);
-
+ void register_function(std::string name, SenchaFunction * f);
SenchaObject execute_native_function(std::string name, std::vector<ASTExpression *> arguments);
- //Overload it to use contexts
-
- typedef std::map<std::string, ObjectIndex> ExecutionContext;
- ExecutionContext interpreter_context;
-
std::string debug() ;
void add(std::string name, SenchaObject object);
void set(std::string name, SenchaObject object);