]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TDictionary.hh
* this is a large commit
[helm.git] / helm / DEVEL / mathml_editor / src / TDictionary.hh
index b769aaa4ed32e18d205bbc6e05d5791c6990809f..5349cf00475d5b9debee02353f1bfe2f80a24064 100644 (file)
@@ -2,16 +2,19 @@
 #ifndef __TDictionary_hh__
 #define __TDictionary_hh__
 
+#include <config.h>
+
 #include <string>
 #include <vector>
 #include <hash_map>
 
+#include "dom.hh"
 #include "TToken.hh"
 
 class TDictionary
 {
 public:
-  TDictionary(void) { };
+  TDictionary(class ALogger& l) : logger(l) { };
   ~TDictionary() { };
 
   enum Form
@@ -35,7 +38,6 @@ public:
     Entry(void)
     { 
       cls = UNDEFINED;
-      infix = prefix = postfix = 0;
       table = delimiter = limits = embellishment = leftOpen = rightOpen = 0;
     };
 
@@ -49,9 +51,6 @@ public:
     unsigned previousParam(unsigned) const;
 
     EntryClass cls;
-    unsigned infix : 8;
-    unsigned prefix : 8;
-    unsigned postfix : 8;
     unsigned delimiter : 1;
     unsigned limits : 1;
     unsigned embellishment : 1;
@@ -60,7 +59,8 @@ public:
     unsigned table : 1;
   };
 
-  void load(const char* uri);
+  void load(const std::string& uri);
+  void load(const DOM::Document& doc);
   const Entry& find(const std::string&) const;
 
 private:
@@ -72,7 +72,14 @@ private:
   { bool operator()(const std::string&, const class String*) const; };
 #endif
 
+  class ALogger& logger;
+#if defined(HAVE_EXT_HASH_MAP)
+  typedef __gnu_cxx::hash_map< std::string, Entry, StringHash > Dictionary;
+#elif defined(HAVE_HASH_MAP)
   typedef std::hash_map< std::string, Entry, StringHash > Dictionary;
+#else
+#error "no hash_map could be found"
+#endif
   Dictionary entries;
 };