OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptcontext.hpp
Go to the documentation of this file.
1 #ifndef CSM_WORLD_SCRIPTCONTEXT_H
2 #define CSM_WORLD_SCRIPTCONTEXT_H
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 
10 
11 namespace CSMWorld
12 {
13  class Data;
14 
16  {
17  const Data& mData;
18  mutable std::vector<std::string> mIds;
19  mutable bool mIdsUpdated;
20  mutable std::map<std::string, Compiler::Locals> mLocals;
21 
22  public:
23 
24  ScriptContext (const Data& data);
25 
26  virtual bool canDeclareLocals() const;
28 
29  virtual char getGlobalType (const std::string& name) const;
31 
32  virtual std::pair<char, bool> getMemberType (const std::string& name,
33  const std::string& id) const;
38 
39  virtual bool isId (const std::string& name) const;
41 
42  virtual bool isJournalId (const std::string& name) const;
44 
45  void invalidateIds();
46 
47  void clear();
49 
51  bool clearLocals (const std::string& script);
52  };
53 }
54 
55 #endif
Definition: scriptcontext.hpp:15
virtual std::pair< char, bool > getMemberType(const std::string &name, const std::string &id) const
Definition: scriptcontext.cpp:39
Definition: context.hpp:10
std::vector< std::string > mIds
Definition: scriptcontext.hpp:18
void invalidateIds()
Definition: scriptcontext.cpp:110
virtual bool canDeclareLocals() const
Is the compiler allowed to declare local variables?
Definition: scriptcontext.cpp:15
const Data & mData
Definition: scriptcontext.hpp:17
Definition: data.hpp:77
virtual bool isJournalId(const std::string &name) const
Does name match a journal ID?
Definition: scriptcontext.cpp:105
bool clearLocals(const std::string &script)
Definition: scriptcontext.cpp:122
virtual bool isId(const std::string &name) const
Does name match an ID, that can be referenced?
Definition: scriptcontext.cpp:90
ScriptContext(const Data &data)
Definition: scriptcontext.cpp:13
virtual char getGlobalType(const std::string &name) const
'l: long, 's': short, 'f': float, ' ': does not exist.
Definition: scriptcontext.cpp:20
void clear()
Remove all cached data.
Definition: scriptcontext.cpp:115
std::map< std::string, Compiler::Locals > mLocals
Definition: scriptcontext.hpp:20
bool mIdsUpdated
Definition: scriptcontext.hpp:19
const char * name
Definition: crashcatcher.cpp:59