コード例 #1
0
        void IDENTIFIER(out AST e)
        {
            e = null; List <AST> elist = new List <AST>(); AST ei = null;
            Expect(3);
            string id = t.val; e = new SymReferencing(id);

            if (la.kind == 25 || la.kind == 26)
            {
                if (la.kind == 25)
                {
                    Get();
                    IDENTIFIER(out ei);
                    e = new DotReferencing(e, ei);
                }
                else
                {
                    Get();
                    EXPR(out ei);
                    Expect(27);
                    elist.Add(ei);
                    while (la.kind == 26)
                    {
                        Get();
                        EXPR(out ei);
                        Expect(27);
                        elist.Add(ei);
                    }
                    e = new ListReferencing(e, elist);
                    if (la.kind == 25)
                    {
                        Get();
                        IDENTIFIER(out ei);
                        e = new DotReferencing(e, ei);
                    }
                }
            }
        }
コード例 #2
0
ファイル: Visitor.cs プロジェクト: mkju19/P4
 public abstract void Visit(ListReferencing n);