Example #1
0
        static void TokenTerm(out Graph g)
        {
            Graph g2;

            TokenFactor(out g);
            while (StartOf(16))
            {
                TokenFactor(out g2);
                Graph.MakeSequence(g, g2);
            }
            if (la.kind == 37)
            {
                Get();
                Expect(28);
                TokenExpr(out g2);
                Graph.SetContextTrans(g2.l); Graph.MakeSequence(g, g2);
                Expect(29);
            }
        }
Example #2
0
        static void Term(out Graph g)
        {
            Graph    g2;
            Position pos;
            Node     rslv = null;

            g = null;

            if (StartOf(18))
            {
                if (la.kind == 35)
                {
                    rslv = new Node(Node.rslv, null, la.line);
                    ResolveExpr(out pos);
                    rslv.pos = pos;
                    g        = new Graph(rslv);
                }
                Factor(out g2);
                if (rslv != null)
                {
                    Graph.MakeSequence(g, g2);
                }
                else
                {
                    g = g2;
                }

                while (StartOf(19))
                {
                    Factor(out g2);
                    Graph.MakeSequence(g, g2);
                }
            }
            else if (StartOf(20))
            {
                g = new Graph(new Node(Node.eps, null, 0));
            }
            else
            {
                SynErr(51);
            }
        }