java.lang.Object
de.grogra.xl.compiler.scope.Scope
de.grogra.xl.compiler.scope.BlockScope
- Direct Known Subclasses:
InstanceScope
,MethodScope
A
BlockScope
represents a scope for local variables.- Author:
- Ole Kniemeyer
-
Constructor Summary
ConstructorDescriptionBlockScope
(Scope enclosing) BlockScope
(Scope enclosing, boolean seq) BlockScope
(Scope enclosing, Expression block) -
Method Summary
Modifier and TypeMethodDescriptionvoid
final Local
declareLocal
(String name, long modifiers, Type type, antlr.collections.AST pos) void
void
findMembers
(String name, int flags, Members list) Finds all members which are declared in this scope or enclosing scopes.getBlock()
int
getTypeScope
(Type localClass) final String
getUniqueName
(String name) void
void
receiveLocals
(BlockScope src, antlr.collections.AST behind) setBlock
(Expression block) void
setDeclaredClassCount
(int c) void
setScopeForLocals
(BlockScope scope) void
setUseNewScopeForQueries
(boolean newScope) boolean
Methods inherited from class de.grogra.xl.compiler.scope.Scope
dump, encloses, getCompiler, getDeclaredEntity, getDeclaredType, getDefaultModuleSuperclass, getEnclosingScope, getExtension, getInstantiationProducerType, getOwnerOf, getPackage, getPropertyModel, getQueryModel, getRoot, insert, isD2FImplicit, isEnabledConversion, isShadowedBy, isStatic
-
Constructor Details
-
BlockScope
-
BlockScope
-
BlockScope
-
-
Method Details
-
getProduceScope
-
setUseNewScopeForQueries
public void setUseNewScopeForQueries(boolean newScope) -
useNewScopeForQueries
public boolean useNewScopeForQueries() -
setScopeForLocals
-
findMembers
Description copied from class:Scope
Finds all members which are declared in this scope or enclosing scopes. This method should be overwritten by subclasses; an invocation ofsuper.findMembers
has to be included in order to look for members in enclosing scopes. Theflags
are a combination of the bit masks defined inMembers
, they are used to restrict the range of possible members.- Overrides:
findMembers
in classScope
- Parameters:
name
- simple name of the members to findflags
- combination of masks defined inMembers
list
- found members are added to this list
-
findLocal
-
findClass
-
getTypeScope
-
declareLocalClass
-
getDeclaredClassCount
public int getDeclaredClassCount() -
setDeclaredClassCount
public void setDeclaredClassCount(int c) -
addExpression
-
prependExpression
-
getBlock
-
setBlock
-
nextUniqueId
-
getUniqueName
-
declareLocal
-
getMethodScope
-
createThis
-
receiveLocals
-
getLocals
-