AddArc() public method

public AddArc ( char ch, NfaNode next ) : void
ch char
next NfaNode
return void
Esempio n. 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.AddArc(m_str[j], p);
            }
            pp.AddEps(nfa.m_end);
        }
Esempio n. 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.AddArc(this.m_str[index], next);
                nfaNode = next;
            }
            nfaNode.AddEps(nfa.m_end);
        }