00001 00002 00003 00004 00005 00006
00007 #ifndef skINTERPRETER_H
00008 #define skINTERPRETER_H
00009
00010 #include "skRValue.h"
00011 #include "skExecutable.h"
00012 #include "skNull.h"
00013
00014 class skRValueArray;
00015 class skParseNode;
00016 class skStringList;
00017 class skMethodDefNode;
00018
00019
00027 class skInterpreter : public skExecutable
00028 {
00029 public:
00030
00031
00032
00033
00043 skMethodDefNode * parseString(const skString& location,const skString& code);
00054 skMethodDefNode * parseExternalParams(const skString& location,skStringList& paramNames,const skString& code);
00067 void executeString(const skString& location,skExecutable * obj,const skString& code,skRValueArray& args,skRValue& return_value,skMethodDefNode ** parseTree);
00068
00081 void executeStringExternalParams(const skString& location,skExecutable * obj,skStringList& paramNames,const skString& code,skRValueArray& args,skRValue& r,skMethodDefNode ** keepParseTree);
00082
00092 void executeParseTree(const skString& location,skExecutable * obj,skMethodDefNode * parseTree,skRValueArray& args,skRValue& return_value);
00093
00094
00095
00096
00102 void addGlobalVariable(const skString& name,skRValue value);
00107 void removeGlobalVariable(const skString& name);
00114 bool findGlobalVariable(const skString& name,skRValue& return_value);
00115
00116
00117
00118
00119
00124 bool setValue(const skString& s,const skString& attribute,const skRValue& v);
00125
00126
00127
00128
00129
00133 static skInterpreter * getInterpreter();
00137 static void setInterpreter(skInterpreter *);
00138
00139
00140
00141
00142
00146 skInterpreter();
00150 ~skInterpreter();
00151
00152 class P_Interpreter * pimp;
00153
00157 static skNull g_Null;
00158
00159 private:
00160
00161
00162
00163
00164
00168 skInterpreter(const skInterpreter&);
00172 skInterpreter& operator=(const skInterpreter&);
00173 };
00174
00175
00176 #endif
00177
00178