本文整理匯總了Java中com.intellij.codeInspection.dataFlow.value.DfaValue.createNegated方法的典型用法代碼示例。如果您正苦於以下問題:Java DfaValue.createNegated方法的具體用法?Java DfaValue.createNegated怎麽用?Java DfaValue.createNegated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.codeInspection.dataFlow.value.DfaValue
的用法示例。
在下文中一共展示了DfaValue.createNegated方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visitNot
import com.intellij.codeInspection.dataFlow.value.DfaValue; //導入方法依賴的package包/類
public DfaInstructionState[] visitNot(NotInstruction instruction, DataFlowRunner runner, DfaMemoryState memState) {
DfaValue dfaValue = memState.pop();
dfaValue = dfaValue.createNegated();
memState.push(dfaValue);
return nextInstruction(instruction, runner, memState);
}
示例2: visitNot
import com.intellij.codeInspection.dataFlow.value.DfaValue; //導入方法依賴的package包/類
public DfaInstructionState[] visitNot(NotInstruction instruction, DataFlowRunner runner, DfaMemoryState memState)
{
DfaValue dfaValue = memState.pop();
dfaValue = dfaValue.createNegated();
memState.push(dfaValue);
return nextInstruction(instruction, runner, memState);
}
示例3: visitConditionalGoto
import com.intellij.codeInspection.dataFlow.value.DfaValue; //導入方法依賴的package包/類
public DfaInstructionState[] visitConditionalGoto(ConditionalGotoInstruction instruction, DataFlowRunner runner, DfaMemoryState memState) {
DfaValue cond = memState.pop();
DfaValue condTrue;
DfaValue condFalse;
if (instruction.isNegated()) {
condFalse = cond;
condTrue = cond.createNegated();
} else {
condTrue = cond;
condFalse = cond.createNegated();
}
if (condTrue == runner.getFactory().getConstFactory().getTrue()) {
markBranchReachable(instruction, true);
return new DfaInstructionState[] {new DfaInstructionState(runner.getInstruction(instruction.getOffset()), memState)};
}
if (condFalse == runner.getFactory().getConstFactory().getTrue()) {
markBranchReachable(instruction, false);
return nextInstruction(instruction, runner, memState);
}
ArrayList<DfaInstructionState> result = new ArrayList<DfaInstructionState>();
DfaMemoryState thenState = memState.createCopy();
DfaMemoryState elseState = memState.createCopy();
if (thenState.applyCondition(condTrue)) {
result.add(new DfaInstructionState(runner.getInstruction(instruction.getOffset()), thenState));
markBranchReachable(instruction, true);
}
if (elseState.applyCondition(condFalse)) {
result.add(new DfaInstructionState(runner.getInstruction(instruction.getIndex() + 1), elseState));
markBranchReachable(instruction, false);
}
return result.toArray(new DfaInstructionState[result.size()]);
}
示例4: visitConditionalGoto
import com.intellij.codeInspection.dataFlow.value.DfaValue; //導入方法依賴的package包/類
public DfaInstructionState[] visitConditionalGoto(ConditionalGotoInstruction instruction, DataFlowRunner runner, DfaMemoryState memState)
{
DfaValue cond = memState.pop();
DfaValue condTrue;
DfaValue condFalse;
if(instruction.isNegated())
{
condFalse = cond;
condTrue = cond.createNegated();
}
else
{
condTrue = cond;
condFalse = cond.createNegated();
}
if(condTrue == runner.getFactory().getConstFactory().getTrue())
{
markBranchReachable(instruction, true);
return new DfaInstructionState[]{new DfaInstructionState(runner.getInstruction(instruction.getOffset()), memState)};
}
if(condFalse == runner.getFactory().getConstFactory().getTrue())
{
markBranchReachable(instruction, false);
return nextInstruction(instruction, runner, memState);
}
ArrayList<DfaInstructionState> result = new ArrayList<>();
DfaMemoryState thenState = memState.createCopy();
DfaMemoryState elseState = memState.createCopy();
if(thenState.applyCondition(condTrue))
{
result.add(new DfaInstructionState(runner.getInstruction(instruction.getOffset()), thenState));
markBranchReachable(instruction, true);
}
if(elseState.applyCondition(condFalse))
{
result.add(new DfaInstructionState(runner.getInstruction(instruction.getIndex() + 1), elseState));
markBranchReachable(instruction, false);
}
return result.toArray(new DfaInstructionState[result.size()]);
}