Package de.monticore.symboltable
Interface IScope
public interface IScope
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(ITraverser visitor) default voidadd(SymbolWithScopeOfUnknownKind symbol) default booleancheckIfContinueAsSubScope(String symbolName) default booleancheckIfContinueWithEnclosingScope(boolean foundSymbols) filterSymbolsByAccessModifier(AccessModifier modifier, Collection<T> resolvedUnfiltered) default List<SymbolWithScopeOfUnknownKind> getName()default com.google.common.collect.FluentIterable<String> getNameParts(String symbolName) getRemainingNameForResolveDown(String symbolName) getResolvedOrThrowException(Collection<T> resolved) intdefault com.google.common.collect.LinkedListMultimap<String, SymbolWithScopeOfUnknownKind> booleanStates whether this scope exports symbols that can be used from outside the scope.booleanbooleanbooleanbooleandefault booleanisProperSubScopeOf(IScope superScope) whether this is a proper subscope of the other scope (transitive)booleandefault booleanisSubScopeOf(IScope superScope) whether this is a subscope of the other scope (transitive)default voidremove(SymbolWithScopeOfUnknownKind symbol) voidsetAstNode(ASTNode node) voidvoidsetExportingSymbols(boolean b) voidvoidvoidsetOrdered(boolean b) voidsetShadowing(boolean b) voidvoid
-
Method Details
-
getEnclosingScope
IScope getEnclosingScope() -
getSymbolsSize
int getSymbolsSize()- Returns:
- number of symbols directly defined/contained in this scope (not in enclosing scope).
-
isShadowing
boolean isShadowing()- Returns:
- true, if this scope shadows symbols of the enclosing scope. By default, named scopes (see #getName()) are shadowing scopes.
-
isPresentSpanningSymbol
boolean isPresentSpanningSymbol()- Returns:
- true, if this scope is spanned by a symbol. For example, a Java method spans a method scope.
-
isExportingSymbols
boolean isExportingSymbols()States whether this scope exports symbols that can be used from outside the scope. For example, a Java class exports symbols. In contrast, a Java if-block does notisym export any symbols, hence, its locally defined variables cannot be referenced from outside. By default, a scope with a name exports its symbols (although this does not apply for Java methods).- Returns:
- true, if this scope exports symbols that can be used from outside the scope.
-
isOrdered
boolean isOrdered() -
setExportingSymbols
void setExportingSymbols(boolean b) -
setShadowing
void setShadowing(boolean b) -
setOrdered
void setOrdered(boolean b) -
setAstNode
- Parameters:
node- the corresponding ast node
-
setAstNodeAbsent
void setAstNodeAbsent() -
getAstNode
ASTNode getAstNode() -
isPresentAstNode
boolean isPresentAstNode() -
setSpanningSymbol
-
setSpanningSymbolAbsent
void setSpanningSymbolAbsent() -
getSpanningSymbol
IScopeSpanningSymbol getSpanningSymbol() -
setName
-
setNameAbsent
void setNameAbsent() -
getName
String getName() -
isPresentName
boolean isPresentName() -
getRemainingNameForResolveDown
-
getNameParts
-
checkIfContinueWithEnclosingScope
default boolean checkIfContinueWithEnclosingScope(boolean foundSymbols) -
checkIfContinueAsSubScope
-
getResolvedOrThrowException
-
filterSymbolsByAccessModifier
default <T extends ISymbol> List<T> filterSymbolsByAccessModifier(AccessModifier modifier, Collection<T> resolvedUnfiltered) -
getUnknownSymbols
default com.google.common.collect.LinkedListMultimap<String,SymbolWithScopeOfUnknownKind> getUnknownSymbols() -
getLocalUnknownSymbols
-
add
-
remove
-
accept
-
isSubScopeOf
whether this is a subscope of the other scope (transitive) -
isProperSubScopeOf
whether this is a proper subscope of the other scope (transitive)
-