Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skInterpreter.h

00001 /*
00002   Copyright 1996-2001
00003   Simon Whiteside
00004 
00005 * $Id: skInterpreter_h-source.html,v 1.8 2001/05/14 07:43:34 sdw Exp $
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   // Parsing and Executing methods
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   // Global Variable methods
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   // Interpreter is an Executable which exposes some fields
00118   //--------------------------------------------------------
00119     
00124   bool setValue(const skString& s,const skString& attribute,const skRValue& v);
00125     
00126   //---------------------------------
00127   // accessing the global interpreter
00128   //---------------------------------
00129 
00133   static skInterpreter * getInterpreter();
00137   static void setInterpreter(skInterpreter *);
00138     
00139   //---------------------------
00140   // Constructor and Destructor
00141   //---------------------------
00142     
00146   skInterpreter();
00150   ~skInterpreter();
00151     
00152   class P_Interpreter * pimp;
00153 
00157   static skNull g_Null;
00158 
00159  private:
00160 
00161   //--------------------
00162   // copying not allowed
00163   //--------------------
00164 
00168   skInterpreter(const skInterpreter&);
00172   skInterpreter& operator=(const skInterpreter&);
00173 };      
00174 
00175 
00176 #endif
00177 
00178 

Generated at Mon May 14 08:43:08 2001 for Simkin by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000