All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.checkerframework.dataflow.cfg.builder.ConditionalJump Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java's type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.44.0
Show newest version
package org.checkerframework.dataflow.cfg.builder;

import org.checkerframework.dataflow.analysis.Store.FlowRule;
import org.checkerframework.dataflow.cfg.builder.ExtendedNode.ExtendedNodeType;

/**
 * An extended node of type {@link ExtendedNodeType#CONDITIONAL_JUMP}.
 *
 * 

Important: In the list of extended nodes, there should not be any labels that point * to a conditional jump. Furthermore, the node directly ahead of any conditional jump has to be a * {@link NodeWithExceptionsHolder} or {@link NodeHolder}, and the node held by that extended node * is required to be of boolean type. */ @SuppressWarnings("nullness") // TODO class ConditionalJump extends ExtendedNode { /** The true successor label. */ protected final Label trueSucc; /** The false successor label. */ protected final Label falseSucc; /** The true branch flow rule. */ protected FlowRule trueFlowRule; /** The false branch flow rule. */ protected FlowRule falseFlowRule; /** * Construct a ConditionalJump. * * @param trueSucc true successor label * @param falseSucc false successor label */ public ConditionalJump(Label trueSucc, Label falseSucc) { super(ExtendedNodeType.CONDITIONAL_JUMP); assert trueSucc != null; this.trueSucc = trueSucc; assert falseSucc != null; this.falseSucc = falseSucc; } public Label getThenLabel() { return trueSucc; } public Label getElseLabel() { return falseSucc; } /** * Returns the true branch flow rule. * * @return the true branch flow rule */ public FlowRule getTrueFlowRule() { return trueFlowRule; } /** * Returns the false branch flow rule. * * @return the false branch flow rule */ public FlowRule getFalseFlowRule() { return falseFlowRule; } /** * Sets the true branch flow rule. * * @param rule the new true branch flow rule */ public void setTrueFlowRule(FlowRule rule) { trueFlowRule = rule; } /** * Sets the false branch flow rule. * * @param rule the new false branch flow rule */ public void setFalseFlowRule(FlowRule rule) { falseFlowRule = rule; } /** * Produce a string representation. * * @return a string representation * @see org.checkerframework.dataflow.cfg.builder.CFGBuilder.PhaseOneResult#nodeToString */ @Override public String toString() { return "TwoTargetConditionalJump(" + getThenLabel() + ", " + getElseLabel() + ")"; } @Override public String toStringDebug() { return toString(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy