Example #1
0
        public override object VisitReturnStatement([NotNull] CMinusParser.ReturnStatementContext context)
        {
            if (context.logicalOrExpression() != null)
            {
                this.Visit(context.logicalOrExpression());
            }

            this.writer.WriteFunctionReturn();

            return(null);
        }
Example #2
0
        public override object VisitReturnStatement([NotNull] CMinusParser.ReturnStatementContext context)
        {
            if (context.logicalOrExpression() != null)
            {
                this.Visit(context.logicalOrExpression());
            }

            this.WriteAllContextsExit();
            this.writer.WriteUnconditionalJump(this.labelGenerator.FunctionReturnLabel());

            return(null);
        }