/// <summary> /// Does /// <code>pattern</code> /// matched as rule patternRuleIndex match tree? Pass in a /// compiled pattern instead of a string representation of a tree pattern. /// </summary> public virtual bool Matches(IParseTree tree, ParseTreePattern pattern) { MultiMap <string, IParseTree> labels = new MultiMap <string, IParseTree>(); IParseTree mismatchedNode = MatchImpl(tree, pattern.GetPatternTree(), labels); return(mismatchedNode == null); }
public virtual ParseTreeMatch Match(IParseTree tree, ParseTreePattern pattern) { MultiMap <string, IParseTree> labels = new MultiMap <string, IParseTree>(); IParseTree mismatchedNode = MatchImpl(tree, pattern.GetPatternTree(), labels); return(new ParseTreeMatch(tree, pattern, labels, mismatchedNode)); }