Interface ScopedObject<T>

    • Method Detail

      • pushScope

        T pushScope​(ScopeToken token)
             throws SemanticException
        Pushes a new scope, identified by the give token, in this object. This causes all variables not associated with a scope (and thus visible) to be mapped to the given scope and hidden away, until the scope is popped with popScope(ScopeToken).
        Parameters:
        token - the token identifying the scope to push
        Returns:
        a copy of this object where the local unscoped variables have been hidden
        Throws:
        SemanticException - if an error occurs during the computation
      • popScope

        T popScope​(ScopeToken token)
            throws SemanticException
        Pops the scope identified by the given token from this object. This causes all the visible variables (i.e. that are not mapped to a scope) to be removed, while the local variables that were associated to the given scope token (and thus hidden) will become visible again.
        Parameters:
        token - the token of the scope to be restored
        Returns:
        a copy of this object where the local variables have been removed, while the variables mapped to the given scope are visible again
        Throws:
        SemanticException - if an error occurs during the computation