// -*- C++ -*-
-#ifndef MATHMACROTABLE
-#define MATHMACROTABLE
+#ifndef MATH_MACROTABLE_H
+#define MATH_MACROTABLE_H
-#include <vector>
+#include <map>
#include "LString.h"
+#include "math_atom.h"
-class MathMacroTemplate;
-class MathMacro;
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class MathArray;
///
-class MathMacroTable {
+struct MathMacroTable {
public:
- ///
- void addTemplate(MathMacroTemplate *);
- ///
- MathMacro * getMacro(string const &) const;
- ///
- MathMacroTemplate * getTemplate(string const &) const;
- ///
- void builtinMacros();
- ///
- static MathMacroTable mathMTable;
- ///
- static bool built;
+ ///
+ static void create(string const &, int, string const &);
+ ///
+ static void create(string const &, int, MathArray const &);
+ ///
+ static MathAtom & provide(string const &);
+ ///
+ static bool has(string const &);
+ ///
+ static void builtinMacros();
private:
- ///
- typedef std::vector<MathMacroTemplate *> table_type;
- ///
- typedef table_type::size_type size_type;
- ///
- table_type macro_table;
+ ///
+ typedef std::map<string, MathAtom> table_type;
+ //
+ static table_type macro_table;
+public:
+ ///
+ static void dump();
};
#endif