示例#1
0
        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)));
 }
示例#3
0
        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);
        }
示例#4
0
 public Id <RxMatch <TLetter> > GetId(RxMatch <TLetter> node)
 {
     return(this.idMap[node]);
 }
示例#5
0
 RxNode <TLetter> IRegexVisitor <TLetter, SymbolId, RxNode <TLetter> > .Match(RxMatch <TLetter> node, SymbolId context)
 {
     return(null);
 }