
org.checkerframework.dataflow.cfg.node.BinaryOperationNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dataflow-shaded Show documentation
Show all versions of dataflow-shaded Show documentation
dataflow-shaded is a dataflow framework based on the javac compiler.
It differs from the org.checkerframework:dataflow artifact in two ways.
First, the packages in this artifact have been renamed to org.checkerframework.shaded.*.
Second, unlike the dataflow artifact, this artifact contains the dependencies it requires.
package org.checkerframework.dataflow.cfg.node;
import com.sun.source.tree.BinaryTree;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.javacutil.TreeUtils;
import java.util.Arrays;
import java.util.Collection;
/**
* A node for a binary expression.
*
* For example:
*
*
* lefOperandNode operator rightOperandNode
*
*/
public abstract class BinaryOperationNode extends Node {
protected final BinaryTree tree;
protected final Node left;
protected final Node right;
protected BinaryOperationNode(BinaryTree tree, Node left, Node right) {
super(TreeUtils.typeOf(tree));
this.tree = tree;
this.left = left;
this.right = right;
}
public Node getLeftOperand() {
return left;
}
public Node getRightOperand() {
return right;
}
@Override
public BinaryTree getTree() {
return tree;
}
@Override
@SideEffectFree
public Collection getOperands() {
return Arrays.asList(getLeftOperand(), getRightOperand());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy