|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The context for Jif type checking. JifContext
extends Context with contextual information needed for
checking labels, and also with some utility methods to assist in the
implementation of label checking. The JifContext object contains
a label environment, which contains a
principal hierarchy; most access to
these objects should be through the JifContext object, for
example, the methods addActsFor, actsFor,
addContraintLE.
| Method Summary | |
|---|---|
boolean |
actsFor(java.util.Collection actorGrp,
java.util.Collection grantorGrp)
Test an actsfor relation, using the principal hierarchy. |
boolean |
actsFor(Principal p1,
Principal p2)
Test an actsfor relation, using the principal hierarchy. |
void |
addActsFor(Principal p1,
Principal p2)
Add an actsfor relation to the principal hierarchy. |
void |
addAssertionLE(Label L1,
Label L2)
Add a less than or equal assertion to the label environment. |
void |
addDefinitionalActsFor(Principal p1,
Principal p2)
Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level |
void |
addDefinitionalAssertionLE(Label L1,
Label L2)
Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level |
Label |
authLabel()
Get the authority of the current code, represented as a privacy label. |
java.util.Set |
authority()
The authority of a class or a procedure is the set of principals who have authorized that code. |
boolean |
checkingInits()
Indicates if we are currently checking the initializers within a constructor. |
void |
clearPH()
Clears the principal hierarchy of all actsfor relations. |
Label |
constructorReturnLabel()
If the current code is a constructor, returns the return label of that constructor. |
Label |
entryPC()
The entry PC is the upper bound on the PC of the caller of the current code. |
Label |
gotoLabel(polyglot.ast.Branch.Kind kind,
java.lang.String label)
Retrieve the Label associated with branching to the
location label, with the branch kind kind. |
void |
gotoLabel(polyglot.ast.Branch.Kind kind,
java.lang.String label,
Label L)
Record the Label associated with branching to the
location label, with the branch kind kind. |
boolean |
inConstructorCall()
Is the Context in a constructor call, e.g. |
LabelEnv |
labelEnv()
|
Label |
pc()
|
PrincipalHierarchy |
ph()
|
polyglot.types.Context |
pushConstructorCall()
Push a Context onto the stack for a constructor call, e.g. |
void |
setAuthority(java.util.Set authority)
|
void |
setCheckingInits(boolean checkingInits)
Set whether we are currently checking the initializers within a constructor. |
void |
setConstructorReturnLabel(Label Lr)
|
void |
setEntryPC(Label label)
|
void |
setPc(Label label)
|
| Methods inherited from interface polyglot.types.Context |
|---|
addMethod, addNamed, addVariable, currentClass, currentClassScope, currentCode, findField, findFieldScope, findLocal, findMethod, findMethodScope, findVariable, findVariableSilent, goalStack, importTable, inCode, inStaticContext, isLocal, outerResolver, package_, pop, pushBlock, pushClass, pushCode, pushGoal, pushGoalStack, pushSource, pushStatic, typeSystem |
| Methods inherited from interface polyglot.types.Resolver |
|---|
find |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Method Detail |
public LabelEnv labelEnv()
public void addAssertionLE(Label L1,
Label L2)
public void addDefinitionalAssertionLE(Label L1,
Label L2)
L1 - L2 - public PrincipalHierarchy ph()
public void addActsFor(Principal p1,
Principal p2)
public void addDefinitionalActsFor(Principal p1,
Principal p2)
public boolean actsFor(Principal p1,
Principal p2)
public boolean actsFor(java.util.Collection actorGrp,
java.util.Collection grantorGrp)
public void clearPH()
public Label pc()
public void setPc(Label label)
public Label entryPC()
public void setEntryPC(Label label)
public Label gotoLabel(polyglot.ast.Branch.Kind kind,
java.lang.String label)
throws polyglot.types.SemanticException
Label associated with branching to the
location label, with the branch kind kind.
polyglot.types.SemanticException
public void gotoLabel(polyglot.ast.Branch.Kind kind,
java.lang.String label,
Label L)
Label associated with branching to the
location label, with the branch kind kind.
public java.util.Set authority()
public void setAuthority(java.util.Set authority)
public Label authLabel()
public boolean checkingInits()
public void setCheckingInits(boolean checkingInits)
public Label constructorReturnLabel()
checkingInits
is true, and is used for more permissive label checking for field
assignments.
public void setConstructorReturnLabel(Label Lr)
public polyglot.types.Context pushConstructorCall()
public boolean inConstructorCall()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||