OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
context.hpp
Go to the documentation of this file.
1 #ifndef COMPILER_CONTEXT_H_INCLUDED
2 #define COMPILER_CONTEXT_H_INCLUDED
3 
4 #include <string>
5 
6 namespace Compiler
7 {
8  class Extensions;
9 
10  class Context
11  {
13 
14  public:
15 
16  Context() : mExtensions (0) {}
17 
18  virtual ~Context() {}
19 
20  virtual bool canDeclareLocals() const = 0;
22 
23  void setExtensions (const Extensions *extensions = 0)
24  {
25  mExtensions = extensions;
26  }
27 
28  const Extensions *getExtensions() const
29  {
30  return mExtensions;
31  }
32 
33  virtual char getGlobalType (const std::string& name) const = 0;
35 
36  virtual std::pair<char, bool> getMemberType (const std::string& name,
37  const std::string& id) const = 0;
42 
43  virtual bool isId (const std::string& name) const = 0;
45 
46  virtual bool isJournalId (const std::string& name) const = 0;
48  };
49 }
50 
51 #endif
virtual std::pair< char, bool > getMemberType(const std::string &name, const std::string &id) const =0
virtual bool isId(const std::string &name) const =0
Does name match an ID, that can be referenced?
Definition: context.hpp:10
const Extensions * mExtensions
Definition: context.hpp:12
const Extensions * getExtensions() const
Definition: context.hpp:28
Context()
Definition: context.hpp:16
Collection of compiler extensions.
Definition: extensions.hpp:39
virtual ~Context()
Definition: context.hpp:18
virtual char getGlobalType(const std::string &name) const =0
'l: long, 's': short, 'f': float, ' ': does not exist.
virtual bool canDeclareLocals() const =0
Is the compiler allowed to declare local variables?
void setExtensions(const Extensions *extensions=0)
Definition: context.hpp:23
const char * name
Definition: crashcatcher.cpp:59
virtual bool isJournalId(const std::string &name) const =0
Does name match a journal ID?