Files
openide/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/instructions/NotInstruction.java
T
Tagir Valeev 3e4cd658e9 DFA instruction visitor refactoring wave#1
InstructionVisitor#beforeExpressionPush method which is called before every push of PsiExpression result (were it simple reference, operation or method call)
CustomMethodHandlers: do not modify states; only return resulting value (current handlers do not produce more than one value)
Xor polyadic now supports reporting for subexpressions
2018-06-15 15:24:16 +07:00

46 lines
1.5 KiB
Java

/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInspection.dataFlow.instructions;
import com.intellij.codeInspection.dataFlow.DataFlowRunner;
import com.intellij.codeInspection.dataFlow.DfaInstructionState;
import com.intellij.codeInspection.dataFlow.DfaMemoryState;
import com.intellij.codeInspection.dataFlow.InstructionVisitor;
import com.intellij.psi.PsiPrefixExpression;
public class NotInstruction extends Instruction implements ExpressionPushingInstruction {
private final PsiPrefixExpression myAnchor;
public NotInstruction(PsiPrefixExpression anchor) {
myAnchor = anchor;
}
@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor) {
return visitor.visitNot(this, runner, stateBefore);
}
public String toString() {
return "NOT";
}
@Override
public PsiPrefixExpression getExpression() {
return myAnchor;
}
}