public void CheckForEmptyCoroutine(Method node) { if (this.IsEmptyCoroutine(node)) { ReturnStatement statement; ReturnStatement statement1 = statement = new ReturnStatement(LexicalInfo.Empty); statement.set_Expression(Expression.Lift(this.EmptyEnumeratorReference)); node.get_Body().Add(statement); } }
public override void OnMethod(Method node) { if (EvalAnnotation.IsMarked(node)) { this._currentMethod = this.GetEntity(node); IType evaluationContextType = this.DefineEvaluationContext(); Block block = this.PrepareEvaluationContextInitialization(evaluationContextType); this.Visit(node.get_Body()); node.get_Body().Insert(0, block); } }
public void function_body(Method method) { try { this.match(0x3f); switch (this.LA(1)) { case 12: case 0x10: case 0x21: case 0x3b: case 0x63: this.parameter_declaration_list(method); break; case 0x40: break; default: throw new NoViableAltException(this.LT(1), this.getFilename()); } this.match(0x40); switch (this.LA(1)) { case 0x42: { this.match(0x42); TypeReference reference = this.type_reference(); if (base.inputState.guessing == 0) { method.set_ReturnType(reference); } break; } case 0x3d: break; default: throw new NoViableAltException(this.LT(1), this.getFilename()); } this.compound_statement(method.get_Body()); if (base.inputState.guessing == 0) { method.set_EndSourceLocation(method.get_Body().get_EndSourceLocation()); } } catch (RecognitionException exception) { if (base.inputState.guessing != 0) { throw; } this.reportError(exception); this.recover(exception, tokenSet_33_); } }
public ExpressionStatement LastExpressionStatement(Method method) { StatementCollection statements = method.get_Body().get_Statements(); return ((statements.Count != 0) ? (statements.get_Item(-1) as ExpressionStatement) : null); }