コード例 #1
0
 private void checkPending(@NotNull InstructionImpl instruction) {
   final PsiElement element = instruction.getElement();
   List<Pair<InstructionImpl, GroovyPsiElement>> target =
       collectCorrespondingPendingEdges(element);
   for (Pair<InstructionImpl, GroovyPsiElement> pair : target) {
     addEdge(pair.getFirst(), instruction);
   }
 }
コード例 #2
0
 @Nullable
 private InstructionImpl findInstruction(PsiElement element) {
   final Iterator<InstructionImpl> iterator = myProcessingStack.descendingIterator();
   while (iterator.hasNext()) {
     final InstructionImpl instruction = iterator.next();
     if (element.equals(instruction.getElement())) return instruction;
   }
   return null;
 }
コード例 #3
0
  public void visitReturnStatement(GrReturnStatement returnStatement) {
    boolean isNodeNeeded = myHead == null || myHead.getElement() != returnStatement;
    final GrExpression value = returnStatement.getReturnValue();
    if (value != null) value.accept(this);

    if (isNodeNeeded) {
      InstructionImpl returnInstruction = startNode(returnStatement);
      addPendingEdge(null, myHead);
      finishNode(returnInstruction);
    } else {
      addPendingEdge(null, myHead);
    }
    interruptFlow();
  }