23 #ifndef libmath_matcher_h
24 #define libmath_matcher_h
42 bool defined(
const std::string& AId)
const;
44 const TNode<T> *
get(
const std::string& AId)
const;
53 typedef std::map<std::string, const TNode<T> *> TAnyMap;
54 typedef std::list<const TNode<T> *> TNodeList;
102 typedef std::list<TMatch<T> *> TList;
131 std::auto_ptr<TMatch<T> > FNode;
142 std::auto_ptr<TMatch<T> > FLeft;
143 std::auto_ptr<TMatch<T> > FRight;
154 std::auto_ptr<TMatch<T> > FBase;
155 std::auto_ptr<TMatch<T> > FExp;
178 typedef std::map<std::string, TNode<T> > TResult;
196 static unsigned match(
const std::string& AMatch,
const TNode<T> *AExpr,
239 #include <math++/matcher.tcc>
bool defined(const std::string &AId) const
checks whether given id is defined or not.
static bool match(const TMatch< T > *AMatch, const TNode< T > *AExpr, TMatchRegistry< T > *AReg=0)
static bool matchExact(const TMatch< T > *AMatch, const TNode< T > *AExpr, TMatchRegistry< T > *AReg=0)
void define(const std::string &AId, const TNode< T > *ANode)
defines given expression node as given id.
bool contains(const TNode< T > *ANode) const
returns true when ANode is either marked as used or is defined as any
void mark(const TNode< T > *ANode)
marks given node as used