Esempio n. 1
0
 public virtual void BeforeVisit(ReturnStatement node)
 {
     this.BeforeVisitCatchAll(node);
 }
Esempio n. 2
0
        AstNodeBase ParseReturn()
        {
            HappySourceLocation location = this.AssertExpect(HappyTokenKind.KeywordReturn).Location;
            ExpressionNodeBase returnExpression = null;

            if(_lexer.PeekToken().HappyTokenKind != HappyTokenKind.EndOfStatement)
                returnExpression = this.ParseExpression(ExpressionContext.Expression);

            AstNodeBase retval = new ReturnStatement(location, returnExpression);
            return retval;
        }
Esempio n. 3
0
 public virtual void AfterVisit(ReturnStatement node)
 {
     this.AfterVisitCatchAll(node);
 }
Esempio n. 4
0
 public override void AfterVisit(ReturnStatement node)
 {
     Expression @return = node.ReturnExp == null ? Expression.Constant(null) : _expressionStack.Pop();
     _expressionStack.Push(node, Expression.Goto(_returnLabelTarget, Expression.Convert(@return, typeof(object))));
     base.AfterVisit(node);
 }