Interface Scope

    • Method Detail

      • getParent

        Scope getParent()
        Retrieves this scope's parent
      • setParent

        void setParent​(Scope parent)
        Points this scope to its parent
      • getEnclosingScope

        <T extends Scope> T getEnclosingScope​(java.lang.Class<T> clazz)
        Helper method that goes up the parent scopes to find a scope of the specified type
        clazz - the type of the Scope to search for
        the found scope of the specified type or null if no such scope was found.
      • getDeclarations

        java.util.Map<NameDeclaration,​java.util.List<NameOccurrence>> getDeclarations()
        Gets all the declaration with the occurrences in this scope.
        map of declarations with occurrences.
      • getDeclarations

        <T extends NameDeclaration> java.util.Map<T,​java.util.List<NameOccurrence>> getDeclarations​(java.lang.Class<T> clazz)
        Helper method to get only a specific type of name declarations. The return map elemens have already been casted to the correct type. This method usually returns a subset of getDeclarations().
        clazz - the type of name declarations to use
        map of declarations with occurrences.
      • contains

        boolean contains​(NameOccurrence occ)
        Tests whether or not a NameOccurrence is directly contained in the scope. This means, whether the given NameOccurrence references a declaration, that has been declared within this scope. Note that this search is just for this scope - it doesn't go diving into any parent scopes.