public abstract class Constraint
extends java.lang.Object
Constraint
is the superclass of label
constraints and principals constraints, which
are generated during type checking and label checking.Modifier and Type | Class and Description |
---|---|
static class |
Constraint.Kind
Kinds of constraint, either equality or inequality.
|
Modifier and Type | Field and Description |
---|---|
protected LabelEnv |
env
The environment under which this constraint needs to be satisfied.
|
protected Constraint.Kind |
kind |
protected Param |
lhs |
protected ConstraintMessage |
messages
Error messages
|
protected polyglot.util.Position |
pos |
protected boolean |
report
Do we want to report a violation of this constraint, or report the
error for a different constraint?
|
protected Param |
rhs |
Constructor and Description |
---|
Constraint(Param lhs,
Constraint.Kind kind,
Param rhs,
LabelEnv env,
polyglot.util.Position pos,
ConstraintMessage msg,
boolean report) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
detailMsg()
A detailed message to display if this constraint is violated.
|
LabelEnv |
env() |
abstract java.util.Collection<Equation> |
getEquations()
Produce a
Collection of Equations for this
constraint. |
abstract boolean |
hasVariables() |
boolean |
isCanonical() |
Constraint.Kind |
kind() |
ConstraintMessage |
messages() |
java.lang.String |
msg()
A message to display if this constraint is violated.
|
polyglot.util.Position |
position() |
boolean |
report() |
java.lang.String |
technicalMsg()
A technical message to display if this constraint is violated.
|
java.lang.String |
toString() |
protected final Param lhs
protected final Param rhs
protected final Constraint.Kind kind
protected final LabelEnv env
protected final polyglot.util.Position pos
protected final ConstraintMessage messages
protected final boolean report
public Constraint(Param lhs, Constraint.Kind kind, Param rhs, LabelEnv env, polyglot.util.Position pos, ConstraintMessage msg, boolean report)
public Constraint.Kind kind()
public LabelEnv env()
public polyglot.util.Position position()
public boolean report()
public ConstraintMessage messages()
public java.lang.String msg()
NamedLabel
s.public java.lang.String detailMsg()
NamedLabel
s are used.public java.lang.String technicalMsg()
NamedLabel
s are used.public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.util.Collection<Equation> getEquations()
Collection
of Equations
for this
constraint.public boolean isCanonical()
public abstract boolean hasVariables()