public object Match(RxMatch <TLetter> node, Func <RangeSet <TLetter>, object, RangeSet <TLetter> > context) { Id <RxMatch <TLetter> > id; if (!this.idMap.TryGetValue(node, out id)) { id = new Id <RxMatch <TLetter> >(this.idMap.Count + 1); this.idMap.Add(node, id); } this.charsets.Add(id, new KeyValuePair <RangeSet <TLetter>, ICollection <LetterId> >(context(node.Letters, null), new HashSet <LetterId>())); return(null); }
public RxNode <LetterId> Match(RxMatch <TLetter> node, Func <RxMatch <TLetter>, ICollection <LetterId> > context) { return(new RxMatch <LetterId>(context(node))); }
NfaState <TLetter> IRegexVisitor <TLetter, NfaState <TLetter>, NfaState <TLetter> > .Match(RxMatch <TLetter> node, NfaState <TLetter> context) { var target = this.Create(); foreach (var range in node.Letters) { context.AddMatchTransition(range, target); } return(target); }
public Id <RxMatch <TLetter> > GetId(RxMatch <TLetter> node) { return(this.idMap[node]); }
RxNode <TLetter> IRegexVisitor <TLetter, SymbolId, RxNode <TLetter> > .Match(RxMatch <TLetter> node, SymbolId context) { return(null); }