Class OutOfScopeIdentifier


  • public class OutOfScopeIdentifier
    extends Identifier
    An identifier outside the current scope of the call, that is, in a method that is in the call stack but not the last one.
    • Constructor Detail

      • OutOfScopeIdentifier

        public OutOfScopeIdentifier​(Identifier id,
                                    ScopeToken scope,
                                    CodeLocation location)
        Builds the identifier outside the scope.
        Parameters:
        id - the current identifier
        scope - the method call that caused the identifier to exit the scope
        location - the code location of the statement that has generated this expression
    • Method Detail

      • popScope

        public Identifier popScope​(ScopeToken token)
                            throws SemanticException
        Description copied from class: SymbolicExpression
        Pops the scope identified by the given token from the expression. This causes all the invisible variables (i.e. OutOfScopeIdentifiers) mapped to the given scope to become visible (i.e. Variables) again.
        Specified by:
        popScope in class SymbolicExpression
        Parameters:
        token - the token of the scope to be restored
        Returns:
        a copy of this expression where the local variables associated with the given scope are visible again
        Throws:
        SemanticException - if an error occurs during the computation
      • getScope

        public ScopeToken getScope()
        Returns the scope of the identifier.
        Returns:
        the scope of the identifier
      • accept

        public <T> T accept​(ExpressionVisitor<T> visitor,
                            java.lang.Object... params)
                     throws SemanticException
        Description copied from class: SymbolicExpression
        Accepts an ExpressionVisitor, visiting this expression recursively.
        Specified by:
        accept in class SymbolicExpression
        Type Parameters:
        T - the type of value produced by the visiting callbacks
        Parameters:
        visitor - the visitor
        params - additional optional parameters to pass to each visiting callback
        Returns:
        the value produced by the visiting operation
        Throws:
        SemanticException - if an error occurs during the visiting