OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptmanagerimp.hpp
Go to the documentation of this file.
1 #ifndef GAME_SCRIPT_SCRIPTMANAGER_H
2 #define GAME_SCRIPT_SCRIPTMANAGER_H
3 
4 #include <map>
5 #include <string>
6 
9 
12 
13 #include "../mwbase/scriptmanager.hpp"
14 
15 #include "globalscripts.hpp"
16 
17 namespace MWWorld
18 {
19  class ESMStore;
20 }
21 
22 namespace Compiler
23 {
24  class Context;
25 }
26 
27 namespace Interpreter
28 {
29  class Context;
30  class Interpreter;
31 }
32 
33 namespace MWScript
34 {
36  {
39  bool mVerbose;
44 
45  typedef std::pair<std::vector<Interpreter::Type_Code>, Compiler::Locals> CompiledScript;
46  typedef std::map<std::string, CompiledScript> ScriptCollection;
47 
50  std::map<std::string, Compiler::Locals> mOtherLocals;
51  std::vector<std::string> mScriptBlacklist;
52 
53  public:
54 
55  ScriptManager (const MWWorld::ESMStore& store, bool verbose,
56  Compiler::Context& compilerContext, int warningsMode,
57  const std::vector<std::string>& scriptBlacklist);
58 
59  virtual void run (const std::string& name, Interpreter::Context& interpreterContext);
61 
62  virtual bool compile (const std::string& name);
65 
66  virtual std::pair<int, int> compileAll();
69 
70  virtual const Compiler::Locals& getLocals (const std::string& name);
72 
74  };
75 }
76 
77 #endif
bool mVerbose
Definition: scriptmanagerimp.hpp:39
virtual bool compile(const std::string &name)
Definition: scriptmanagerimp.cpp:40
Interpreter()
Definition: interpreter.cpp:162
Compiler::Context & mCompilerContext
Definition: scriptmanagerimp.hpp:40
std::map< std::string, CompiledScript > ScriptCollection
Definition: scriptmanagerimp.hpp:46
Definition: globalscripts.hpp:38
ScriptManager()
Definition: scriptmanager.hpp:34
virtual void run(const std::string &name, Interpreter::Context &interpreterContext)
Run the script with the given name (compile first, if not compiled yet)
Definition: scriptmanagerimp.cpp:94
Definition: context.hpp:10
Interpreter::Interpreter mInterpreter
Definition: scriptmanagerimp.hpp:42
Error handler implementation: Write errors into stream.
Definition: streamerrorhandler.hpp:12
GlobalScripts mGlobalScripts
Definition: scriptmanagerimp.hpp:49
bool mOpcodesInstalled
Definition: scriptmanagerimp.hpp:43
Definition: interpreter.hpp:16
std::pair< std::vector< Interpreter::Type_Code >, Compiler::Locals > CompiledScript
Definition: scriptmanagerimp.hpp:45
virtual const Compiler::Locals & getLocals(const std::string &name)
Return locals for script name.
Definition: scriptmanagerimp.cpp:155
virtual std::pair< int, int > compileAll()
Definition: scriptmanagerimp.cpp:134
ScriptCollection mScripts
Definition: scriptmanagerimp.hpp:48
Definition: context.hpp:9
Definition: esmstore.hpp:17
const MWWorld::ESMStore & mStore
Definition: scriptmanagerimp.hpp:38
std::vector< std::string > mScriptBlacklist
Definition: scriptmanagerimp.hpp:51
Compiler::FileParser mParser
Definition: scriptmanagerimp.hpp:41
Compiler::StreamErrorHandler mErrorHandler
Definition: scriptmanagerimp.hpp:37
Definition: fileparser.hpp:13
Interface for script manager (implemented in MWScript)
Definition: scriptmanager.hpp:24
virtual GlobalScripts & getGlobalScripts()
Definition: scriptmanagerimp.cpp:196
Definition: scriptmanagerimp.hpp:35
Local variable declarations.
Definition: locals.hpp:12
std::map< std::string, Compiler::Locals > mOtherLocals
Definition: scriptmanagerimp.hpp:50
const char * name
Definition: crashcatcher.cpp:59