java.lang.Object
de.grogra.xl.compiler.scope.Scope
- Direct Known Subclasses:
BlockScope,ClassPath,CompilationUnitScope,ImportOnDemandScope,Package,SingleStaticImport,SingleTypeImport,TypeScope
Scode is the abstract base class for all scopes. As defined
by the Java language specification, scopes represent regions of
a programme in which Members can be identified
by their simple name. Scopes are nested.- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionvoiddump()booleanChecks if this scope enclosessdirectly or indirectly.voidfindMembers(String name, int flags, Members list) Finds all members which are declared in this scope or enclosing scopes.Returns the type of the innermost enclosing type declaration.Type<?> Returns the enclosing scope of this scope.Type<?> getOwnerOf(Member m) Returns the type of the innermost type declaration of whichmis a member.Returns the innermost enclosing scope of classPackage, ornull.getPropertyModel(Type type, Compiler c, antlr.collections.AST pos) Returns the compile-time model to use in this scope.getQueryModel(Compiler c, antlr.collections.AST pos) Returns the compile-time model to use in this scope.final ScopegetRoot()Returns the outmost enclosing scope.voidInsertsencsuch that it becomes the new enclosing scope of this ecope.booleanbooleanfinal booleanChecks if declarations of this scope are shadowed by declarations ofs.booleanisStatic()Checks if this scope appears in a static context.
-
Method Details
-
insert
Insertsencsuch that it becomes the new enclosing scope of this ecope. The enclosing scope of the outmost enclosing scope ofencis set to the previously enclosing scope of this scope.- Parameters:
enc- the new enclosing scope of this. May benull.
-
getEnclosingScope
Returns the enclosing scope of this scope.- Returns:
- enclosing scope, or
null
-
getRoot
Returns the outmost enclosing scope. This is the (directly or indirectly) enclosing scope of this scope which has no enclosing scope.- Returns:
- outmost enclosing scope
-
encloses
Checks if this scope enclosessdirectly or indirectly. Returnsfalseifsisnullor this scope.- Parameters:
s- a scope- Returns:
truethis scope enclosess
-
isShadowedBy
Checks if declarations of this scope are shadowed by declarations ofs. This is defined by the Java language specification.- Parameters:
s- a scope- Returns:
trueiff this scope is shadowed bys
-
getOwnerOf
Returns the type of the innermost type declaration of whichmis a member.- Parameters:
m- a member- Returns:
- innermost type of which
mis a member
-
getDeclaredType
Returns the type of the innermost enclosing type declaration.- Returns:
- type of innermost enclosing type declaration
-
getDeclaredEntity
-
getQueryModel
Returns the compile-time model to use in this scope. This is the model of the innermost scope (potentiallythis) for which a non-nullmodel has been set by.invalid reference
#setModel(Model)- Returns:
- compile-time model for this scope
-
getPropertyModel
Returns the compile-time model to use in this scope. This is the model of the innermost scope (potentiallythis) for which a non-nullmodel has been set by.invalid reference
#setModel(Model)- Returns:
- compile-time model for this scope
-
getExtension
-
getPackage
Returns the innermost enclosing scope of classPackage, ornull. May bethis.- Returns:
- innermost
Packagescope
-
isStatic
public boolean isStatic()Checks if this scope appears in a static context. This is defined by the Java Language Specification.- Returns:
trueiff this scope appears in a static context
-
findMembers
Finds all members which are declared in this scope or enclosing scopes. This method should be overwritten by subclasses; an invocation ofsuper.findMembershas to be included in order to look for members in enclosing scopes. Theflagsare a combination of the bit masks defined inMembers, they are used to restrict the range of possible members.- Parameters:
name- simple name of the members to findflags- combination of masks defined inMemberslist- found members are added to this list
-
isD2FImplicit
public boolean isD2FImplicit() -
isEnabledConversion
-
getDefaultModuleSuperclass
-
getInstantiationProducerType
-
getCompiler
-
dump
public void dump()
-