00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SHEEP_MESHIO_KEYWORDTABLE_H
00024 #define SHEEP_MESHIO_KEYWORDTABLE_H
00025
00026 #include "common/misc/config.h"
00027
00028 #include <cassert>
00029 #include <map>
00030 #include <string>
00031
00032 namespace sheep {
00033
00034 class KeywordTable {
00035 public:
00036 void Insert(const std::string &keyword, int symbol);
00037
00038
00039 int GetSymbol(const std::string &keyword) const;
00040
00041 const std::string &GetKeyword(int symbol) const;
00042
00043 bool IsKeyword(int symbol) const;
00044
00045 private:
00046 std::map<std::string, int> m_symbols;
00047 std::map<int, std::string> m_keywords;
00048 std::map<int, bool> m_iskeyword;
00049 };
00050
00051 #include "keywordtable.inl"
00052
00053 }
00054
00055 #endif // !SHEEP_MESHIO_KEYWORDTABLE_H