|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjif.types.LabelConstraint
public class LabelConstraint
A LabelConstraint
represents a constraint on labels, which
may either be an inequality or equality constraint.
LabelConstraint
s are generated during type checking.
LabelConstraint
s in turn produce Equations
which are what the Solver
will use to find a satisfying
assignment for VarLabels
.
A LabelConstraint
is not the same as a LabelConstraint
, which by contrast is assumed to be satisfied.
Nested Class Summary | |
---|---|
static class |
LabelConstraint.Kind
Kinds of constraint, either equality or inequality. |
Field Summary | |
---|---|
protected LabelEnv |
env
The environment under which this constraint needs to be satisfied. |
static LabelConstraint.Kind |
EQUAL
An equality kind of constraint. |
protected LabelConstraint.Kind |
kind
|
static LabelConstraint.Kind |
LEQ
An inequality kind of constraint. |
protected Label |
lhs
|
protected LabelConstraintMessage |
messages
Error messages |
protected NamedLabel |
namedLHS
Names for the LHS |
protected NamedLabel |
namedRHS
Names for the RHS |
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 Label |
rhs
|
Constructor Summary | |
---|---|
LabelConstraint(NamedLabel lhs,
LabelConstraint.Kind kind,
NamedLabel rhs,
LabelEnv env,
polyglot.util.Position pos,
LabelConstraintMessage msg,
boolean report)
|
Method Summary | |
---|---|
protected void |
addLEQEqns(java.util.Collection eqns,
Label left,
Label right)
Produce equations that require left to be less than or
equal to right , and add them to eqns . |
java.util.Map |
definitions(VarMap bounds)
Returns a Map of Strings to List[String]s which is the definitions/bounds of the NamedLabels, and the description of any components that appear in the NamedLabels. |
java.lang.String |
detailMsg()
A detailed message to display if this constraint is violated. |
LabelEnv |
env()
|
java.util.Collection |
getEquations()
Produce a Collection of Equations for this
constraint. |
LabelConstraint.Kind |
kind()
|
Label |
lhs()
|
LabelConstraintMessage |
messages()
|
java.lang.String |
msg()
A message to display if this constraint is violated. |
protected java.util.Map |
namedDescrips()
Return a map from Strings to Strings, which are the descriptions of names in the left and right hand sides. |
protected java.util.Map |
namedLabels()
Return a map from Strings to Labels, which are the named elements of the left and right hand sides. |
NamedLabel |
namedLhs()
|
NamedLabel |
namedRhs()
|
polyglot.util.Position |
position()
|
boolean |
report()
|
Label |
rhs()
|
java.lang.String |
technicalMsg()
A technical message to display if this constraint is violated. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final LabelConstraint.Kind EQUAL
public static final LabelConstraint.Kind LEQ
protected Label lhs
protected LabelConstraint.Kind kind
protected Label rhs
protected LabelEnv env
protected NamedLabel namedLHS
protected NamedLabel namedRHS
protected polyglot.util.Position pos
protected boolean report
protected LabelConstraintMessage messages
Constructor Detail |
---|
public LabelConstraint(NamedLabel lhs, LabelConstraint.Kind kind, NamedLabel rhs, LabelEnv env, polyglot.util.Position pos, LabelConstraintMessage msg, boolean report)
Method Detail |
---|
public Label lhs()
public LabelConstraint.Kind kind()
public Label rhs()
public NamedLabel namedLhs()
public NamedLabel namedRhs()
public LabelEnv env()
public polyglot.util.Position position()
public boolean report()
public LabelConstraintMessage 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
protected java.util.Map namedLabels()
protected java.util.Map namedDescrips()
public java.util.Map definitions(VarMap bounds)
public java.util.Collection getEquations()
Collection
of Equations
for this
constraint.
protected void addLEQEqns(java.util.Collection eqns, Label left, Label right)
left
to be less than or
equal to right
, and add them to eqns
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |