#include <matcher.h>
Inheritance diagram for math::TMatcher< T >:
Public Types | |
typedef std::map< std::string, TNode< T > > | TResult |
Static Public Member Functions | |
bool | matchExact (const TMatch< T > *AMatch, const TNode< T > *AExpr, TMatchRegistry< T > *AReg=0) |
bool | match (const TMatch< T > *AMatch, const TNode< T > *AExpr, TMatchRegistry< T > *AReg=0) |
unsigned | match (const std::string &AMatch, const TNode< T > *AExpr, TResult &AResult) |
TMatcher<> class is really to be done. But it will rock then. Example:
TMatcher<T>::TResult matchResult; if (TMatcher<T>::match("a+a", expr, machResult)) return transform(expr, machResult, "2*a+$");
the "$" means the remaining part not matched using given template match, here "a+a". Example: if you've a+b+a and want match a+a, then the remaining part is b; if you've a^2+b^(sin(2x)+2)+c^2+c*2*a and want to match a^2+2ab+b^2, then the matched parts is: "a^2+c^2+c*2*a" and the remaining part will be: "b^(sin(2x)+2)".
Definition at line 176 of file matcher.h.
|
match matches a given expression template on expression AExpr and puts its result into AResult. |
|
returns true when given pattern (AMatch) was matched in given expression (AExpr). The result data is stored into the registry on success only. |
|
matchExact returns true when the template (AMatch) represents exactly the test expression (AExpr). |