OpenMW
components/compiler/locals.hpp
Go to the documentation of this file.
00001 #ifndef COMPILER_LOCALS_H_INCLUDED
00002 #define COMPILER_LOCALS_H_INCLUDED
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <iosfwd>
00007 
00008 namespace Compiler
00009 {
00011     
00012     class Locals
00013     {
00014             std::vector<std::string> mShorts;
00015             std::vector<std::string> mLongs;
00016             std::vector<std::string> mFloats;
00017     
00018             int searchIndex (char type, const std::string& name) const;
00019 
00020             bool search (char type, const std::string& name) const;
00021             
00022             std::vector<std::string>& get (char type);   
00023     
00024         public:
00025     
00026             char getType (const std::string& name) const;
00028             
00029             int getIndex (const std::string& name) const;
00031             
00032             const std::vector<std::string>& get (char type) const;
00033 
00034             void write (std::ostream& localFile) const;
00036             
00037             void declare (char type, const std::string& name);
00039             
00040             void clear();
00042     };
00043 }
00044 
00045 #endif