
org.checkerframework.dataflow.cfg.builder.Label 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.builder;
/**
* A label is used to refer to other extended nodes using a mapping from labels to extended nodes.
* Labels get their names either from labeled statements in the source code or from internally
* generated unique names.
*
* Note that this class is deliberately public, to enable users of the dataflow library to
* customize CFG construction.
*/
public class Label {
/** Unique id counter that incremented in {@code #uniqueName}. */
private static int uid = 0;
protected final String name;
public Label(String name) {
this.name = name;
}
public Label() {
this.name = uniqueName();
}
@Override
public String toString() {
return name;
}
/**
* Return a new unique label name that cannot be confused with a Java source code label.
*
* @return a new unique label name
*/
private static String uniqueName() {
return "%L" + uid++;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy