public DeclarationNode(LeafParser.Var_def_tContext ctx) { Line = ctx.Start.Line; _name = ctx.Id().GetText(); Mutable = ctx.Var() != null; Type = TypeNode.Create(ctx.type(0)); if (ctx.type(1) != null) { Allocator = TypeNode.Create(ctx.type(1)); } }
/// <summary> /// Visit a parse tree produced by <see cref="LeafParser.var_def_t"/>. /// <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 VisitVar_def_t([NotNull] LeafParser.Var_def_tContext context) { return(VisitChildren(context)); }