OpenMW
components/compiler/context.hpp
Go to the documentation of this file.
00001 #ifndef COMPILER_CONTEXT_H_INCLUDED
00002 #define COMPILER_CONTEXT_H_INCLUDED
00003 
00004 #include <string>
00005 
00006 namespace Compiler
00007 {
00008     class Extensions;
00009 
00010     class Context
00011     {
00012             const Extensions *mExtensions;
00013 
00014         public:
00015 
00016             Context() : mExtensions (0) {}
00017 
00018             virtual ~Context() {}
00019 
00020             virtual bool canDeclareLocals() const = 0;
00022 
00023             void setExtensions (const Extensions *extensions = 0)
00024             {
00025                 mExtensions = extensions;
00026             }
00027 
00028             const Extensions *getExtensions() const
00029             {
00030                 return mExtensions;
00031             }
00032 
00033             virtual char getGlobalType (const std::string& name) const = 0;
00035 
00036             virtual char getMemberType (const std::string& name, const std::string& id) const = 0;
00038 
00039             virtual bool isId (const std::string& name) const = 0;
00041     };
00042 }
00043 
00044 #endif