public override ASTNode VisitLetIn([NotNull] CoolParser.LetInContext context) { return(new LetNode(context.Start.Line, context.Start.Column) { Sentences = (from p in context.property() select Visit(p) as AttributeNode).ToList(), Body = Visit(context.expr()) as ExpressionNode }); }
public override ASTNode VisitLetIn([NotNull] CoolParser.LetInContext context) { LetNode node = new LetNode(context) { Initialization = (from x in context.property() select Visit(x) as AttributeNode).ToList(), ExpressionBody = Visit(context.expression()) as ExpressionNode }; return(node); }
/// <summary> /// Visit a parse tree produced by the <c>letIn</c> /// labeled alternative in <see cref="CoolParser.expr"/>. /// <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 VisitLetIn([NotNull] CoolParser.LetInContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by the <c>letIn</c> /// labeled alternative in <see cref="CoolParser.expr"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitLetIn([NotNull] CoolParser.LetInContext context) { }