public override Node VisitAttr([NotNull] coolgrammarParser.AttrContext context)
        {
            var a = (Formal)Visit(context.formal());

            if (context.ChildCount > 1)
            {
                var exp = (Expr)Visit(context.expr());
                return(new Attr_Def(a.name, a.type, exp));
            }
            return(new Attr_Def(a.name, a.type, null));
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="coolgrammarParser.attr"/>.
 /// <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 VisitAttr([NotNull] coolgrammarParser.AttrContext context)
 {
     return(VisitChildren(context));
 }