public DeclarationNode(LeafParser.Var_def_vContext ctx) { Line = ctx.Start.Line; _name = ctx.Id().GetText(); Mutable = ctx.Var() != null; Reference = ctx.Ref() != null; Value = ValueNode.Create(ctx.value()); if (ctx.type(0) != 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_v"/>. /// <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_v([NotNull] LeafParser.Var_def_vContext context) { return(VisitChildren(context)); }