org.erights.e.elang.scope
Class PatternMap

java.lang.Object
  |
  +--org.erights.e.elang.scope.PatternMap
Direct Known Subclasses:
PatternMapBase, PatternMapContour, PatternMapLink

public abstract class PatternMap
extends Object

Untamed:


Field Summary
static PatternMap EMPTY
          Enabled:
 
Constructor Summary
PatternMap()
          Enabled:
 
Method Summary
(package private) abstract  void addNamesTo(FlexSet names)
           
abstract  void assertShadowable(String name)
          Enabled: Throw an exception if 'name' may not be shadowed because it is already defined in the current (i.e.
abstract  boolean contains(String name)
          Enabled: Is 'name' in scope?
abstract  NounPattern getPattern(String name)
          Enabled: Get the NounPattern that was used to bind a given variable.
static PatternMap make(ConstMap patterns)
          Enabled:
 ConstSet namesSet()
          Enabled: Return the set of names bound in this PatternMap.
 PatternMap nested()
          Enabled: Make a new PatternMap just like this one, but with a new empty innermost layer added.
abstract  void replace(String name, NounPattern pattern)
          Enabled:
 PatternMap with(String name, NounPattern pattern)
          Enabled: Return a PatternMap just like this one, but with a new name => NounPattern binding added to the innermost layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final PatternMap EMPTY
Enabled:

Constructor Detail

PatternMap

public PatternMap()
Enabled:

Method Detail

make

public static PatternMap make(ConstMap patterns)
Enabled:


getPattern

public abstract NounPattern getPattern(String name)
Enabled: Get the NounPattern that was used to bind a given variable.


contains

public abstract boolean contains(String name)
Enabled: Is 'name' in scope?


namesSet

public ConstSet namesSet()
Enabled: Return the set of names bound in this PatternMap.


addNamesTo

abstract void addNamesTo(FlexSet names)

with

public PatternMap with(String name,
                       NounPattern pattern)
Enabled: Return a PatternMap just like this one, but with a new name => NounPattern binding added to the innermost layer.

This does not create a new contour, so this operation is rejected if 'name' is already defined in the innermost layer.


replace

public abstract void replace(String name,
                             NounPattern pattern)
Enabled:


nested

public PatternMap nested()
Enabled: Make a new PatternMap just like this one, but with a new empty innermost layer added.


assertShadowable

public abstract void assertShadowable(String name)
Enabled: Throw an exception if 'name' may not be shadowed because it is already defined in the current (i.e. innermost) layer.



comments?