org.erights.e.elang.interp
Class ScopeSetup

java.lang.Object
  |
  +--org.erights.e.elang.interp.ScopeSetup

public abstract class ScopeSetup
extends Object

Untamed: The initial namespaces seen by the E language programmer.

Author:
Mark S. Miller, E. Dean Tribble

Field Summary
static ConstSet NonShadowable
          Enabled: Return the set of variable names defined in the safe scope that may not be shadowed (ie, redefined).
(package private) static int OUTER_SPACE
           
 
Constructor Summary
ScopeSetup()
          Enabled:
 
Method Summary
private static Class getClass(String fqName)
          return null if not found
static Loader import__uriGetter(String fqnPrefix)
          Enabled: Gets an import__uriGetter evaluated in its own safeScope.
static OuterScope privileged(String fqnPrefix, boolean interactive, TextWriter altout, TextWriter alterr, CmdLoop interp)
          Enabled: Returns a fresh instantiation of the privileged scope.
static OuterScope privileged(String fqnPrefix, boolean interactive, TextWriter altout, TextWriter alterr, ConstMap props, Object interpVow, Vat optVat)
          Enabled: If the interp isn't resolved yet, the props and vat must be provided explicitly.
private static ScopeMaker safeMaker(String fqnPrefix)
           
static OuterScope safeScope(String fqnPrefix)
          Enabled: Returns a fresh instantiation of the safe scope.
private static ScopeMaker universalMaker(Ref safeScopeVow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTER_SPACE

static final int OUTER_SPACE

NonShadowable

public static final ConstSet NonShadowable
Enabled: Return the set of variable names defined in the safe scope that may not be shadowed (ie, redefined).

This currently includes all names in the safeScope, but should only include those names generated by the E expansion and a few others, as explained in the source code in this class.

Constructor Detail

ScopeSetup

public ScopeSetup()
Enabled:

Method Detail

getClass

private static Class getClass(String fqName)
return null if not found


universalMaker

private static ScopeMaker universalMaker(Ref safeScopeVow)

safeMaker

private static ScopeMaker safeMaker(String fqnPrefix)

safeScope

public static OuterScope safeScope(String fqnPrefix)
Enabled: Returns a fresh instantiation of the safe scope. This scope contains only transitively immutable objects, or objects like the importer (bound to "import:") with transparent-enough caches. It conveys no substantial authority, and so can be given out freely.


import__uriGetter

public static Loader import__uriGetter(String fqnPrefix)
Enabled: Gets an import__uriGetter evaluated in its own safeScope.


privileged

public static OuterScope privileged(String fqnPrefix,
                                    boolean interactive,
                                    TextWriter altout,
                                    TextWriter alterr,
                                    CmdLoop interp)
Enabled: Returns a fresh instantiation of the privileged scope.

This scope contains the root magic powers, so should only be given to fully trusted entities.


privileged

public static OuterScope privileged(String fqnPrefix,
                                    boolean interactive,
                                    TextWriter altout,
                                    TextWriter alterr,
                                    ConstMap props,
                                    Object interpVow,
                                    Vat optVat)
Enabled: If the interp isn't resolved yet, the props and vat must be provided explicitly.

Parameters:
optVat - If null, uses the current vat.


comments?