AddUArc() public method

public AddUArc ( char ch, NfaNode next ) : void
ch char
next NfaNode
return void
Beispiel #1
0
        public override void Build(Nfa nfa)
        {
            int     j, n = m_str.Length;
            NfaNode p, pp = nfa;

            for (j = 0; j < n; pp = p, j++)
            {
                p = new NfaNode(nfa.m_tks);
                pp.AddUArc(m_str[j], p);
            }
            pp.AddEps(nfa.m_end);
        }
Beispiel #2
0
        public override void Build(Nfa nfa)
        {
            int     length  = this.m_str.Length;
            NfaNode nfaNode = (NfaNode)nfa;

            for (int index = 0; index < length; ++index)
            {
                NfaNode next = new NfaNode(nfa.m_tks);
                nfaNode.AddUArc(this.m_str[index], next);
                nfaNode = next;
            }
            nfaNode.AddEps(nfa.m_end);
        }