jif.types

## Class JifContext_c

- java.lang.Object
- - polyglot.types.Context_c
  - - jif.types.JifContext_c

- All Implemented Interfaces:
    java.lang.Cloneable, JifContext, polyglot.types.Context, polyglot.types.Resolver, polyglot.util.Copy<polyglot.types.Context>

      public class JifContext_c
      extends polyglot.types.Context_c
      implements JifContext

  An implementation of the `JifContext` interface.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `JifContext_c.Key`

    - ### Nested classes/interfaces inherited from class polyglot.types.Context_c

      `polyglot.types.Context_c.Kind`

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<polyglot.types.LocalInstance,Label>` | `checkedEndorsements` Map of local variables that have been endorsed using a checked endorse statement
    `protected boolean` | `checkingInits`
    `protected Label` | `constructorReturnLabel`
    `protected java.util.Map<JifContext_c.Key,Label>` | `gotos` Map from JifContext_c.Key (pairs of Branch.Kind and String) to Labels.
    `protected boolean` | `inConstructorCall`
    `protected boolean` | `inPrologue`
    `protected JifTypeSystem` | `jifts`
    `protected polyglot.types.TypeSystem` | `jlts`
    `protected ProviderLabel` | `provider` Limit authority of classes and code in this context.

    - ### Fields inherited from class polyglot.types.Context_c

      `BLOCK, CLASS, code, CODE, inCode, it, kind, label, LABEL, outer, OUTER, scope, SOURCE, staticContext, ts, type, types, vars`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JifContext_c(JifTypeSystem ts, polyglot.types.TypeSystem jlts)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addActsFor(ActsForParam actor, Principal granter)`
    `void` | `addActsFor(Label L, Principal p)` Adds a label-actsfor-principal assumption to the label environment.
    `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` | `addCheckedEndorse(polyglot.types.LocalInstance li, Label downgradeTo)` Add a checked endorse for the local instance li.
    `void` | `addDefinitionalAssertionEquiv(AccessPath p, AccessPath q)` Adds the assertion that the access path p is equivalent to the access path q to this context, and all outer contexts up to the method/constructor/initializer level
    `void` | `addDefinitionalAssertionEquiv(Label L1, Label L2)` Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
    `void` | `addDefinitionalAssertionEquiv(Label L1, Label L2, boolean addToClass)` Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
    `void` | `addDefinitionalEquiv(Principal p1, Principal p2)` Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
    `void` | `addEquiv(AccessPath p, AccessPath q)` Adds the assertion that the access path p is equivalent to the access path q to this context
    `void` | `addEquiv(Label L1, Label L2)` Add an equivalence to the label environment.
    `void` | `addEquiv(Principal p1, Principal p2)` Add an actsfor relation both ways to the principal hierarchy.
    `Label` | `authLabel()` Get the authority of the current code, represented as a confidentiality label.
    `Label` | `authLabelInteg()` Get the authority of the current code, represented as an integrity label.
    `java.util.Set<Principal>` | `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.
    `JifContext_c` | `copy()`
    `Label` | `currentCodePCBound()` The currentCodePCBound is an upper bound on the PC of the caller of the current code, and a lower bound on the observable effects of the current code.
    `protected void` | `envModification()`
    `protected polyglot.types.VarInstance` | `findStaticPrincipal(java.lang.String name)`
    `polyglot.types.VarInstance` | `findVariableSilent(java.lang.String name)`
    `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.
    `boolean` | `inPrologue()`
    `LabelEnv` | `labelEnv()`
    `PathMap` | `pathMapForLocal(polyglot.types.LocalInstance li, LabelChecker lc)` Return the path map for evaluating a local variable
    `Label` | `pc()`
    `PrincipalHierarchy` | `ph()`
    `ProviderLabel` | `provider()`
    `polyglot.types.Context` | `pushClass(polyglot.types.ParsedClassType classScope, polyglot.types.ClassType type)`
    `polyglot.types.Context` | `pushCode(polyglot.types.CodeInstance ci)`
    `polyglot.types.Context` | `pushConstructorCall()` Push a Context onto the stack for a constructor call, e.g.
    `polyglot.types.Context` | `pushPrologue()`
    `void` | `setAuthority(java.util.Set<Principal> auth)`
    `void` | `setCheckingInits(boolean checkingInits)` Set whether we are currently checking the initializers within a constructor.
    `void` | `setConstructorReturnLabel(Label Lr)`
    `void` | `setCurrentCodePCBound(Label currentCodePCBound)`
    `void` | `setPc(Label pc, LabelChecker lc)`
    `void` | `setProvider(ProviderLabel provider)`
    `boolean` | `updateAllowed(polyglot.ast.Expr e)` Can this expression be updated, e.g.

    - ### Methods inherited from class polyglot.types.Context_c

      `addMethod, addNamed, addNamedToThisScope, addVariable, addVariableToThisScope, currentClass, currentClassScope, currentCode, definingCodeDef, find, findField, findFieldScope, findInThisScope, findLabelSilent, findLocal, findLocalSilent, findMethod, findMethodContainerInThisScope, findMethodScope, findVariable, findVariableInThisScope, importTable, inCode, inStaticContext, isBlock, isClass, isCode, isLocal, isOuter, isSource, lang, mapsToString, outerResolver, package_, pop, push, pushBlock, pushLabel, pushSource, pushStatic, toString, typeSystem`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface polyglot.types.Context

      `addMethod, addNamed, addVariable, currentClass, currentClassScope, currentCode, definingCodeDef, findField, findFieldScope, findLabelSilent, findLocal, findLocalSilent, findMethod, findMethodScope, findVariable, importTable, inCode, inStaticContext, isLocal, lang, outerResolver, package_, pop, pushBlock, pushLabel, pushSource, pushStatic, typeSystem`

    - ### Methods inherited from interface polyglot.types.Resolver

      `find`

- - ### Field Detail

    - #### jlts

          protected final polyglot.types.TypeSystem jlts

    - #### jifts

          protected final JifTypeSystem jifts

    - #### checkedEndorsements

          protected java.util.Map<polyglot.types.LocalInstance,Label> checkedEndorsements

      Map of local variables that have been endorsed using a checked endorse statement

    - #### gotos

          protected java.util.Map<JifContext_c.Key,Label> gotos

      Map from JifContext_c.Key (pairs of Branch.Kind and String) to Labels.

    - #### checkingInits

          protected boolean checkingInits

    - #### inConstructorCall

          protected boolean inConstructorCall

    - #### inPrologue

          protected boolean inPrologue

    - #### constructorReturnLabel

          protected Label constructorReturnLabel

    - #### provider

          protected ProviderLabel provider

      Limit authority of classes and code in this context.

  - ### Constructor Detail

    - #### JifContext_c

          protected JifContext_c(JifTypeSystem ts,
                                 polyglot.types.TypeSystem jlts)

  - ### Method Detail

    - #### copy

          public JifContext_c copy()

      Specified by:
        `copy` in interface `polyglot.util.Copy<polyglot.types.Context>`
      Overrides:
        `copy` in class `polyglot.types.Context_c`

    - #### findVariableSilent

          public polyglot.types.VarInstance findVariableSilent(java.lang.String name)

      Specified by:
        `findVariableSilent` in interface `polyglot.types.Context`
      Overrides:
        `findVariableSilent` in class `polyglot.types.Context_c`

    - #### findStaticPrincipal

          protected polyglot.types.VarInstance findStaticPrincipal(java.lang.String name)

    - #### labelEnv

          public LabelEnv labelEnv()

      Specified by:
        `labelEnv` in interface `JifContext`

    - #### envModification

          protected void envModification()

    - #### addAssertionLE

          public void addAssertionLE(Label L1,
                                     Label L2)

      Description copied from interface: `JifContext`
      Add a less than or equal assertion to the label environment.
      Specified by:
        `addAssertionLE` in interface `JifContext`

    - #### addActsFor

          public void addActsFor(Label L,
                                 Principal p)

      Description copied from interface: `JifContext`
      Adds a label-actsfor-principal assumption to the label environment.
      Specified by:
        `addActsFor` in interface `JifContext`

    - #### addDefinitionalAssertionEquiv

          public void addDefinitionalAssertionEquiv(Label L1,
                                                    Label L2)

      Description copied from interface: `JifContext`
      Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
      Specified by:
        `addDefinitionalAssertionEquiv` in interface `JifContext`

    - #### addDefinitionalAssertionEquiv

          public void addDefinitionalAssertionEquiv(Label L1,
                                                    Label L2,
                                                    boolean addToClass)

      Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
      Specified by:
        `addDefinitionalAssertionEquiv` in interface `JifContext`
      Parameters:
        `L1` -
        `L2` -

    - #### addDefinitionalAssertionEquiv

          public void addDefinitionalAssertionEquiv(AccessPath p,
                                                    AccessPath q)

      Description copied from interface: `JifContext`
      Adds the assertion that the access path p is equivalent to the access path q to this context, and all outer contexts up to the method/constructor/initializer level
      Specified by:
        `addDefinitionalAssertionEquiv` in interface `JifContext`

    - #### addEquiv

          public void addEquiv(Label L1,
                               Label L2)

      Description copied from interface: `JifContext`
      Add an equivalence to the label environment.
      Specified by:
        `addEquiv` in interface `JifContext`

    - #### addEquiv

          public void addEquiv(Principal p1,
                               Principal p2)

      Description copied from interface: `JifContext`
      Add an actsfor relation both ways to the principal hierarchy.
      Specified by:
        `addEquiv` in interface `JifContext`

    - #### addActsFor

          public void addActsFor(Principal p1,
                                 Principal p2)

      Description copied from interface: `JifContext`
      Add an actsfor relation to the principal hierarchy.
      Specified by:
        `addActsFor` in interface `JifContext`

    - #### addActsFor

          public void addActsFor(ActsForParam actor,
                                 Principal granter)

      Specified by:
        `addActsFor` in interface `JifContext`

    - #### addEquiv

          public void addEquiv(AccessPath p,
                               AccessPath q)

      Description copied from interface: `JifContext`
      Adds the assertion that the access path p is equivalent to the access path q to this context
      Specified by:
        `addEquiv` in interface `JifContext`

    - #### addDefinitionalEquiv

          public void addDefinitionalEquiv(Principal p1,
                                           Principal p2)

      Adds the assertion to this context, and all outer contexts up to the method/constructor/initializer level
      Specified by:
        `addDefinitionalEquiv` in interface `JifContext`

    - #### clearPH

          public void clearPH()

      Description copied from interface: `JifContext`
      Clears the principal hierarchy of all actsfor relations.
      Specified by:
        `clearPH` in interface `JifContext`

    - #### gotoLabel

          public Label gotoLabel(polyglot.ast.Branch.Kind kind,
                                 java.lang.String label)

      Description copied from interface: `JifContext`
      Retrieve the `Label` associated with branching to the location `label`, with the branch kind `kind`.
      Specified by:
        `gotoLabel` in interface `JifContext`

    - #### gotoLabel

          public void gotoLabel(polyglot.ast.Branch.Kind kind,
                                java.lang.String label,
                                Label L)

      Description copied from interface: `JifContext`
      Record the `Label` associated with branching to the location `label`, with the branch kind `kind`.
      Specified by:
        `gotoLabel` in interface `JifContext`

    - #### currentCodePCBound

          public Label currentCodePCBound()

      Description copied from interface: `JifContext`
      The currentCodePCBound is an upper bound on the PC of the caller of the current code, and a lower bound on the observable effects of the current code.
      Specified by:
        `currentCodePCBound` in interface `JifContext`

    - #### setCurrentCodePCBound

          public void setCurrentCodePCBound(Label currentCodePCBound)

      Specified by:
        `setCurrentCodePCBound` in interface `JifContext`

    - #### pc

          public Label pc()

      Specified by:
        `pc` in interface `JifContext`

    - #### setPc

          public void setPc(Label pc,
                            LabelChecker lc)

      Specified by:
        `setPc` in interface `JifContext`

    - #### authority

          public java.util.Set<Principal> authority()

      Description copied from interface: `JifContext`
      The authority of a class or a procedure is the set of principals who have authorized that code.
      Specified by:
        `authority` in interface `JifContext`

    - #### setAuthority

          public void setAuthority(java.util.Set<Principal> auth)

      Specified by:
        `setAuthority` in interface `JifContext`

    - #### ph

          public PrincipalHierarchy ph()

      Specified by:
        `ph` in interface `JifContext`

    - #### authLabel

          public Label authLabel()

      Description copied from interface: `JifContext`
      Get the authority of the current code, represented as a confidentiality label.
      Specified by:
        `authLabel` in interface `JifContext`

    - #### authLabelInteg

          public Label authLabelInteg()

      Description copied from interface: `JifContext`
      Get the authority of the current code, represented as an integrity label.
      Specified by:
        `authLabelInteg` in interface `JifContext`

    - #### checkingInits

          public boolean checkingInits()

      Description copied from interface: `JifContext`
      Indicates if we are currently checking the initializers within a constructor. If we are, then more permissive label checking can be used for field assignments.
      Specified by:
        `checkingInits` in interface `JifContext`

    - #### setCheckingInits

          public void setCheckingInits(boolean checkingInits)

      Description copied from interface: `JifContext`
      Set whether we are currently checking the initializers within a constructor.
      Specified by:
        `setCheckingInits` in interface `JifContext`

    - #### constructorReturnLabel

          public Label constructorReturnLabel()

      Description copied from interface: `JifContext`
      If the current code is a constructor, returns the return label of that constructor. The value returned is only valid if `checkingInits` is true, and is used for more permissive label checking for field assignments.
      Specified by:
        `constructorReturnLabel` in interface `JifContext`

    - #### setConstructorReturnLabel

          public void setConstructorReturnLabel(Label Lr)

      Specified by:
        `setConstructorReturnLabel` in interface `JifContext`

    - #### pushConstructorCall

          public polyglot.types.Context pushConstructorCall()

      Description copied from interface: `JifContext`
      Push a Context onto the stack for a constructor call, e.g. "super(...)" or "this(...)". Jif needs to distinguish constructor call contexts from other static contexts because the this label may appear in constructor call contexts, but not other static contexts.
      Specified by:
        `pushConstructorCall` in interface `JifContext`

    - #### pushClass

          public polyglot.types.Context pushClass(polyglot.types.ParsedClassType classScope,
                                                  polyglot.types.ClassType type)

      Specified by:
        `pushClass` in interface `polyglot.types.Context`
      Overrides:
        `pushClass` in class `polyglot.types.Context_c`

    - #### pushCode

          public polyglot.types.Context pushCode(polyglot.types.CodeInstance ci)

      Specified by:
        `pushCode` in interface `polyglot.types.Context`
      Overrides:
        `pushCode` in class `polyglot.types.Context_c`

    - #### inConstructorCall

          public boolean inConstructorCall()

      Description copied from interface: `JifContext`
      Is the Context in a constructor call, e.g. "super(...)" or "this(...)"?
      Specified by:
        `inConstructorCall` in interface `JifContext`

    - #### pathMapForLocal

          public PathMap pathMapForLocal(polyglot.types.LocalInstance li,
                                         LabelChecker lc)

      Description copied from interface: `JifContext`
      Return the path map for evaluating a local variable
      Specified by:
        `pathMapForLocal` in interface `JifContext`

    - #### updateAllowed

          public boolean updateAllowed(polyglot.ast.Expr e)

      Description copied from interface: `JifContext`
      Can this expression be updated, e.g. is "e++" or "e = e'" allowed?
      Specified by:
        `updateAllowed` in interface `JifContext`

    - #### addCheckedEndorse

          public void addCheckedEndorse(polyglot.types.LocalInstance li,
                                        Label downgradeTo)

      Description copied from interface: `JifContext`
      Add a checked endorse for the local instance li.
      Specified by:
        `addCheckedEndorse` in interface `JifContext`

    - #### provider

          public ProviderLabel provider()

      Specified by:
        `provider` in interface `JifContext`

    - #### setProvider

          public void setProvider(ProviderLabel provider)

      Specified by:
        `setProvider` in interface `JifContext`

    - #### pushPrologue

          public polyglot.types.Context pushPrologue()

      Specified by:
        `pushPrologue` in interface `JifContext`

    - #### inPrologue

          public boolean inPrologue()