org.erights.e.elang.scope
Class ScopeMapContour

java.lang.Object
  |
  +--org.erights.e.elang.scope.ScopeMap
        |
        +--org.erights.e.elang.scope.ScopeMapContour

class ScopeMapContour
extends ScopeMap

A ScopeMap consisting of an empty innermost contour on top of some other ScopeMap.

Author:
E. Dean Tribble, some mods by Mark S. Miller

Field Summary
private  ScopeMap myNext
           
 
Fields inherited from class org.erights.e.elang.scope.ScopeMap
EMPTY
 
Constructor Summary
(package private) ScopeMapContour(ScopeMap outer)
           
 
Method Summary
(package private)  void addNamesTo(FlexSet names)
          Adds all the names mapped by this ScopeMap to 'names'
 void assertShadowable(String varName)
          Enabled: Throw an exception is the varName may not be shadowed because it is already defined in the current (i.e.
 boolean contains(String name)
          Enabled: Is 'varName' in scope?
 NounExpr getNoun(String name)
          Enabled: Gets the NounExpr which will retrieve the Slot/value of the variable named 'varName' from a corresponding EvalContext.
 ConstSet namesSet()
          Enabled: Return the set of all names mapped by this ScopeMap.
 ScopeMap nested()
          Enabled: Makes a new ScopeMap just like this one, but with a new empty innermost contour added.
 
Methods inherited from class org.erights.e.elang.scope.ScopeMap
make, with
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myNext

private final ScopeMap myNext
Constructor Detail

ScopeMapContour

ScopeMapContour(ScopeMap outer)
Method Detail

getNoun

public NounExpr getNoun(String name)
Description copied from class: ScopeMap
Enabled: Gets the NounExpr which will retrieve the Slot/value of the variable named 'varName' from a corresponding EvalContext.

Specified by:
getNoun in class ScopeMap

contains

public boolean contains(String name)
Description copied from class: ScopeMap
Enabled: Is 'varName' in scope?

Specified by:
contains in class ScopeMap

namesSet

public ConstSet namesSet()
Description copied from class: ScopeMap
Enabled: Return the set of all names mapped by this ScopeMap.

Overrides:
namesSet in class ScopeMap

addNamesTo

void addNamesTo(FlexSet names)
Description copied from class: ScopeMap
Adds all the names mapped by this ScopeMap to 'names'

Specified by:
addNamesTo in class ScopeMap

assertShadowable

public void assertShadowable(String varName)
Description copied from class: ScopeMap
Enabled: Throw an exception is the varName may not be shadowed because it is already defined in the current (i.e. innermost) contour.

If varName may not be shadowed because it is reserved, this is caught in org.erights.e.elang.evm.NounPattern rather than here.

Specified by:
assertShadowable in class ScopeMap

nested

public ScopeMap nested()
Description copied from class: ScopeMap
Enabled: Makes a new ScopeMap just like this one, but with a new empty innermost contour added.

Overrides:
nested in class ScopeMap


comments?