Beispiel #1
0
        public override Node VisitFieldLValue([NotNull] TigerParser.FieldLValueContext context)
        {
            var node   = new FieldAccessNode(context);
            var lvalue = (LValueNode)Visit(context.lvalue());

            lvalue.ByValue = true;
            node.Children.Add(lvalue); // LVALUE

            ITerminalNode id = context.ID();

            node.Children.Add( // FIELD ID
                new IdNode(
                    id.Symbol.Line,
                    id.Symbol.Column,
                    id.GetText()));

            return(node);
        }
Beispiel #2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>FieldLValue</c>
 /// labeled alternative in <see cref="TigerParser.lvalue"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitFieldLValue([NotNull] TigerParser.FieldLValueContext context)
 {
     return(VisitChildren(context));
 }