GroovyControlFlow (GroovyPsiElement scope) { if (scope instanceof GrLambdaExpression) { GrLambdaBody body = ((GrLambdaExpression)scope).getBody(); Instruction[] flow = body != null ? body.getControlFlow() : Instruction.EMPTY_ARRAY; return new GroovyControlFlow(flow, getDescriptorMapping()); } myFinallyCount = 0; myInstructionNumber = 0; myScope = scope; startNode(null); if (scope instanceof GrClosableBlock) { addFunctionalExpressionParameters((GrFunctionalExpression)scope); addControlFlowInstructions((GrStatementOwner)scope); } else { scope.accept(this); } final InstructionImpl end = startNode(null); checkPending(end); //collect return edges return new GroovyControlFlow(myInstructions.toArray(Instruction.EMPTY_ARRAY), getDescriptorMapping()); }