DelSubGraph() 공개 정적인 메소드

public static DelSubGraph ( Node p ) : bool
p Node
리턴 bool
예제 #1
0
파일: DFA.cs 프로젝트: omaragb/tlp182
        void Step(State from, Node p, BitArray stepped)
        {
            if (p == null)
            {
                return;
            }
            stepped[p.n] = true;
            switch (p.typ)
            {
            case Node.clas:
            case Node.chr: {
                NewTransition(from, TheState(p.next), p.typ, p.val, p.code);
                break;
            }

            case Node.alt: {
                Step(from, p.sub, stepped); Step(from, p.down, stepped);
                break;
            }

            case Node.iter: {
                if (Tab.DelSubGraph(p.sub))
                {
                    parser.SemErr("contents of {...} must not be deletable");
                    return;
                }
                if (p.next != null && !stepped[p.next.n])
                {
                    Step(from, p.next, stepped);
                }
                Step(from, p.sub, stepped);
                if (p.state != from)
                {
                    Step(p.state, p, new BitArray(tab.nodes.Count));
                }
                break;
            }

            case Node.opt: {
                if (p.next != null && !stepped[p.next.n])
                {
                    Step(from, p.next, stepped);
                }
                Step(from, p.sub, stepped);
                break;
            }
            }
        }