Package gnu.expr

Class ScopeExp

    • Field Detail

      • scope

        protected Scope scope
      • frameSize

        protected int frameSize
        Size of evalFrame to allocate in interpreter.
      • id

        public int id
        Unique id number, to ease print-outs and debugging.
    • Constructor Detail

      • ScopeExp

        public ScopeExp()
    • Method Detail

      • getVarScope

        public Scope getVarScope()
      • popScope

        public void popScope​(CodeAttr code)
        Clear bytecode resources for the ScopeExp. This potentially allows Kawa to generate code for the same (inlined, shared) ScopeExp multiple times - though we're not making use of that yet.
      • replaceFollowing

        public void replaceFollowing​(Declaration prev,
                                     Declaration newDecl)
        Replace the prev.next by newDecl. If prev==null, replace the first decl.
      • getOuter

        public ScopeExp getOuter()
        Return the statically enclosing binding contour.
      • setOuter

        public void setOuter​(ScopeExp outer)
      • currentLambda

        public LambdaExp currentLambda()
      • topLevel

        public ScopeExp topLevel()
        Return the outermost non-module scope, if there is one.
      • currentModule

        public ModuleExp currentModule()
      • lookup

        public Declaration lookup​(Object sym)
        Find a Declaration by name.
        Parameters:
        sym - the (interned) name of the Declaration sought
        Returns:
        the matching Declaration, if found; otherwise null
      • getNoDefine

        public Declaration getNoDefine​(Object name)
        Lookup a declaration, create a non-defining declaration if needed.
      • getDefine

        public Declaration getDefine​(Object name,
                                     Compilation parser)
        Add a new Declaration, with a message if there is an existing one.
      • addDeclaration

        public final Declaration addDeclaration​(Object name)
        Create a new declaration in the current Scope.
        Parameters:
        name - name (interned) to give to the new Declaration.
      • addDeclaration

        public final Declaration addDeclaration​(Object name,
                                                Type type)
        Create a new declaration in the current Scope.
        Parameters:
        name - name (interned) to give to the new Declaration.
        type - type of the new Declaration.
      • addDeclaration

        public final void addDeclaration​(Declaration decl)
        Add a Declaration to the current Scope.
      • countDecls

        public int countDecls()
      • clearCallList

        public void clearCallList()
      • nesting

        public static int nesting​(ScopeExp sc)
      • nestedIn

        public boolean nestedIn​(ScopeExp outer)
        True if given scope is nesed in this scope, perhaps indirectly.
      • setIndexes

        protected void setIndexes()
        Calculate offset and frameSize needed by interpreter.
      • isClassGenerated

        public final boolean isClassGenerated()
        True if a class is generated for this scope.