當前位置: 首頁>>代碼示例>>Java>>正文


Java DfaMemoryState類代碼示例

本文整理匯總了Java中com.intellij.codeInspection.dataFlow.DfaMemoryState的典型用法代碼示例。如果您正苦於以下問題:Java DfaMemoryState類的具體用法?Java DfaMemoryState怎麽用?Java DfaMemoryState使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DfaMemoryState類屬於com.intellij.codeInspection.dataFlow包,在下文中一共展示了DfaMemoryState類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState memState, InstructionVisitor visitor) {
  if (myDuplicationCount == 1 && myValueCount == 1) {
    memState.push(memState.peek());
  } else {
    List<DfaValue> values = new ArrayList<DfaValue>(myValueCount);
    for (int i = 0; i < myValueCount; i++) {
      values.add(memState.pop());
    }
    for (int j = 0; j < myDuplicationCount + 1; j++) {
      for (int i = values.size() - 1; i >= 0; i--) {
        memState.push(values.get(i));
      }
    }
  }
  Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
  return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, memState)};
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:DupInstruction.java

示例2: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState memState, InstructionVisitor visitor) {
  if (myDuplicationCount == 1 && myValueCount == 1) {
    memState.push(memState.peek());
  } else {
    List<DfaValue> values = new ArrayList<DfaValue>(myValueCount);
    for (int i = 0; i < myValueCount; i++) {
      values.add(memState.pop());
    }
    for (int j = 0; j < myDuplicationCount; j++) {
      for (int i = values.size() - 1; i >= 0; i--) {
        memState.push(values.get(i));
      }
    }
  }
  Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
  return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, memState)};
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:19,代碼來源:DupInstruction.java

示例3: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState memState, InstructionVisitor visitor)
{
	if(myDuplicationCount == 1 && myValueCount == 1)
	{
		memState.push(memState.peek());
	}
	else
	{
		List<DfaValue> values = new ArrayList<DfaValue>(myValueCount);
		for(int i = 0; i < myValueCount; i++)
		{
			values.add(memState.pop());
		}
		for(int j = 0; j < myDuplicationCount + 1; j++)
		{
			for(int i = values.size() - 1; i >= 0; i--)
			{
				memState.push(values.get(i));
			}
		}
	}
	Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
	return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, memState)};
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:26,代碼來源:DupInstruction.java

示例4: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor) {
  final DfaValue a = stateBefore.pop();
  final DfaValue b = stateBefore.pop();
  stateBefore.push(a);
  stateBefore.push(b);
  Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
  return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, stateBefore)};
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:SwapInstruction.java

示例5: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState state, InstructionVisitor visitor) {
  if (!myVarsToFlush.isEmpty()) {
    for (DfaVariableValue value : myVarsToFlush) {
      state.flushVariable(value);
    }
  }
  return nextInstruction(runner, state);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:FinishElementInstruction.java

示例6: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor) {
  final int returnIndex = getIndex() + 1;
  stateBefore.pushOffset(returnIndex);
  Instruction nextInstruction = runner.getInstruction(mySubprogramOffset);
  return new DfaInstructionState[] {new DfaInstructionState(nextInstruction, stateBefore)};
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:8,代碼來源:GosubInstruction.java

示例7: isMemoryStateProcessed

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
public boolean isMemoryStateProcessed(DfaMemoryState dfaMemState) {
  for (DfaMemoryState state : myProcessedStates) {
    ProgressManager.checkCanceled();
    if (dfaMemState.equals(state)) {
      return true;
    }
  }

  return false;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:11,代碼來源:Instruction.java

示例8: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor)
{
	List<DfaValue> removed = IntStreamEx.range(myCount).mapToObj(idx -> stateBefore.pop()).toList();
	IntStreamEx.of(myReplacement).elements(removed).forEach(stateBefore::push);
	Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
	return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, stateBefore)};
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:9,代碼來源:SpliceInstruction.java

示例9: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor)
{
	final DfaValue a = stateBefore.pop();
	final DfaValue b = stateBefore.pop();
	stateBefore.push(a);
	stateBefore.push(b);
	Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
	return new DfaInstructionState[]{new DfaInstructionState(nextInstruction, stateBefore)};
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:11,代碼來源:SwapInstruction.java

示例10: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState state, InstructionVisitor visitor)
{
	if(!myVarsToFlush.isEmpty())
	{
		for(DfaVariableValue value : myVarsToFlush)
		{
			state.flushVariable(value);
		}
	}
	return nextInstruction(runner, state);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:13,代碼來源:FinishElementInstruction.java

示例11: buildDataflowTypeMap

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Nullable
private static Map<PsiExpression, PsiType> buildDataflowTypeMap(PsiExpression forPlace)
{
	PsiElement scope = DfaPsiUtil.getTopmostBlockInSameClass(forPlace);
	if(scope == null)
	{
		PsiFile file = forPlace.getContainingFile();
		if(!(file instanceof PsiCodeFragment))
		{
			return Collections.emptyMap();
		}

		scope = file;
	}

	DataFlowRunner runner = new DataFlowRunner()
	{
		@NotNull
		@Override
		protected DfaMemoryState createMemoryState()
		{
			return new ExpressionTypeMemoryState(getFactory());
		}
	};

	final ExpressionTypeInstructionVisitor visitor = new ExpressionTypeInstructionVisitor(forPlace);
	if(runner.analyzeMethod(scope, visitor) == RunnerResult.OK)
	{
		return visitor.getResult();
	}
	return null;
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:33,代碼來源:GuessManagerImpl.java

示例12: visitInstanceof

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] visitInstanceof(InstanceofInstruction instruction, DataFlowRunner runner, DfaMemoryState memState)
{
	memState.pop();
	memState.pop();
	memState.push(new DfaInstanceofValue(runner.getFactory(), instruction.getLeft(), instruction.getCastType()));
	return new DfaInstructionState[]{new DfaInstructionState(runner.getInstruction(instruction.getIndex() + 1), memState)};
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:9,代碼來源:GuessManagerImpl.java

示例13: visitMethodCall

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] visitMethodCall(MethodCallInstruction instruction, DataFlowRunner runner, DfaMemoryState memState)
{
	if(myForPlace == instruction.getCallExpression())
	{
		addToResult(((ExpressionTypeMemoryState) memState).getStates());
	}
	return super.visitMethodCall(instruction, runner, memState);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:10,代碼來源:GuessManagerImpl.java

示例14: visitPush

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] visitPush(PushInstruction instruction, DataFlowRunner runner, DfaMemoryState memState)
{
	if(myForPlace == instruction.getPlace())
	{
		addToResult(((ExpressionTypeMemoryState) memState).getStates());
	}
	return super.visitPush(instruction, runner, memState);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:10,代碼來源:GuessManagerImpl.java

示例15: accept

import com.intellij.codeInspection.dataFlow.DfaMemoryState; //導入依賴的package包/類
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor) {
  return visitor.visitInstanceof(this, runner, stateBefore);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:InstanceofInstruction.java


注:本文中的com.intellij.codeInspection.dataFlow.DfaMemoryState類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。