AddActions() private method

private AddActions ( ) : void
return void
示例#1
0
        internal Dfa Target(char ch)
        {         // construct or lookup the target for a new arc
            Dfa n = new Dfa(m_tks);

            for (NList pos = m_nfa; !pos.AtEnd; pos = pos.m_next)
            {
                pos.m_node.AddTarget(ch, n);
            }
            // check we actually got something
            if (n.m_nfa.AtEnd)
            {
                return(null);
            }
            n.Closure();
            // now check we haven't got it already
            for (int pos1 = 0; pos1 < m_tks.states.Count; pos1++)
            {
                if (((Dfa)m_tks.states[pos1]).SameAs(n))
                {
                    return((Dfa)m_tks.states[pos1]);
                }
            }
            // this is a brand new Dfa node so recursively build it
            n.AddActions();
            return(n);
        }
示例#2
0
文件: Dfa.cs 项目: m33p/radegast
        internal Dfa Target(char ch)
        {
            Dfa dfa = new Dfa(this.m_tks);

            for (NList nlist = this.m_nfa; !nlist.AtEnd; nlist = nlist.m_next)
            {
                nlist.m_node.AddTarget(ch, dfa);
            }
            if (dfa.m_nfa.AtEnd)
            {
                return((Dfa)null);
            }
            dfa.Closure();
            for (int index = 0; index < this.m_tks.states.Count; ++index)
            {
                if (((Dfa)this.m_tks.states[index]).SameAs(dfa))
                {
                    return((Dfa)this.m_tks.states[index]);
                }
            }
            dfa.AddActions();
            return(dfa);
        }
示例#3
0
文件: dfa.cs 项目: hdinh/OmahaBot
        /// <exclude/>
        internal Dfa Target(char ch)
        {
            // construct or lookup the target for a new arc
            Dfa n = new Dfa(m_tks);

            for (NList pos = m_nfa; !pos.AtEnd; pos=pos.m_next)
                pos.m_node.AddTarget(ch,n);
            // check we actually got something
            if (n.m_nfa.AtEnd)
                return null;
            n.Closure();
            // now check we haven't got it already
            for (int pos1=0;pos1<m_tks.states.Count;pos1++)
                if (((Dfa)m_tks.states[pos1]).SameAs(n))
                    return (Dfa)m_tks.states[pos1];
            // this is a brand new Dfa node so recursively build it
            n.AddActions();
            return n;
        }