mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 15:35:40 +07:00
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
46 lines
1.5 KiB
Java
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;
|
|
}
|
|
}
|