Module xl.compiler

Class BlockScope

java.lang.Object
de.grogra.xl.compiler.scope.Scope
de.grogra.xl.compiler.scope.BlockScope
Direct Known Subclasses:
InstanceScope, MethodScope

public class BlockScope extends Scope
A BlockScope represents a scope for local variables.
Author:
Ole Kniemeyer
  • Constructor Details

    • BlockScope

      public BlockScope(Scope enclosing)
    • BlockScope

      public BlockScope(Scope enclosing, boolean seq)
    • BlockScope

      public BlockScope(Scope enclosing, Expression block)
  • Method Details

    • getProduceScope

      public ProduceScope getProduceScope()
    • setUseNewScopeForQueries

      public void setUseNewScopeForQueries(boolean newScope)
    • useNewScopeForQueries

      public boolean useNewScopeForQueries()
    • setScopeForLocals

      public void setScopeForLocals(BlockScope scope)
    • findMembers

      public void findMembers(String name, int flags, Members list)
      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 of super.findMembers has to be included in order to look for members in enclosing scopes. The flags are a combination of the bit masks defined in Members, they are used to restrict the range of possible members.
      Overrides:
      findMembers in class Scope
      Parameters:
      name - simple name of the members to find
      flags - combination of masks defined in Members
      list - found members are added to this list
    • findLocal

      public Local findLocal(String name, boolean includeNonlocal)
    • findClass

      public XClass findClass(String name)
    • getTypeScope

      public TypeScope getTypeScope(Type localClass)
    • declareLocalClass

      public void declareLocalClass(TypeScope cls)
    • getDeclaredClassCount

      public int getDeclaredClassCount()
    • setDeclaredClassCount

      public void setDeclaredClassCount(int c)
    • addExpression

      public void addExpression(Expression e)
    • prependExpression

      public void prependExpression(Expression e)
    • getBlock

      public Expression getBlock()
    • setBlock

      public Expression setBlock(Expression block)
    • nextUniqueId

      public String nextUniqueId()
    • getUniqueName

      public final String getUniqueName(String name)
    • declareLocal

      public final Local declareLocal(String name, long modifiers, Type type, antlr.collections.AST pos)
    • getMethodScope

      public MethodScope getMethodScope()
    • createThis

      public Expression createThis()
    • receiveLocals

      public void receiveLocals(BlockScope src, antlr.collections.AST behind)
    • getLocals

      public Collection<Local> getLocals()