当前位置: 首页>>代码示例>>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;未经允许,请勿转载。