gnu.expr
Class ModuleExp

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.Procedure0
              extended by gnu.expr.Expression
                  extended by gnu.expr.ScopeExp
                      extended by gnu.expr.LambdaExp
                          extended by gnu.expr.ModuleExp
All Implemented Interfaces:
Named, Printable, SourceLocator, java.io.Externalizable, java.io.Serializable, org.xml.sax.Locator

public class ModuleExp
extends LambdaExp
implements java.io.Externalizable

Class used to implement Scheme top-level environments.

See Also:
Serialized Form

Field Summary
static boolean alwaysCompile
          Flag to force compilation, even when not required.
static java.lang.String dumpZipPrefix
          Used to control which .zip file dumps are generated.
static int EXPORT_SPECIFIED
           
static int IMMEDIATE
           
static int interactiveCounter
          Numeric identifier for this interactive "command".
static int LAZY_DECLARATIONS
           
static int NONSTATIC_SPECIFIED
           
static int STATIC_RUN_SPECIFIED
           
static int STATIC_SPECIFIED
           
static int SUPERTYPE_SPECIFIED
           
 
Fields inherited from class gnu.expr.LambdaExp
body, closureEnvField, defaultArgs, firstChild, keywords, max_args, min_args, nameDecl, NEXT_AVAIL_FLAG, nextSibling, NO_FIELD, OVERLOADABLE_FIELD, returnContinuation, returnType, SEQUENCE_RESULT, staticLinkField
 
Fields inherited from class gnu.expr.ScopeExp
frameSize, id, outer
 
Fields inherited from class gnu.expr.Expression
flags, noExpressions
 
Constructor Summary
ModuleExp()
           
 
Method Summary
 void allocChildClasses(Compilation comp)
           
 ClassType classFor(Compilation comp)
          Return the class this module.
static boolean evalModule(Environment env, CallContext ctx, Compilation comp, java.net.URL url, OutPort msg)
           
static java.lang.Class evalToClass(Compilation comp, java.net.URL url)
           
 Declaration firstDecl()
           
 ClassType[] getInterfaces()
           
 java.lang.String getJavaName()
           
 ClassType getSuperType()
           
 boolean isStatic()
           
 void print(OutPort out)
           
 void readExternal(java.io.ObjectInput in)
           
 void setInterfaces(ClassType[] s)
           
 void setSuperType(ClassType s)
           
 boolean staticInitRun()
          True if module body (i.e.
protected  Expression walk(ExpWalker walker)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.expr.LambdaExp
allocFrame, apply, capture, compile, compileBody, compileEnd, compileSetField, declareClosureEnv, declareThis, generateApplyMethods, getCallConvention, getCaller, getCanCall, getCanRead, getCompiledClassType, getExpClassName, getHeapFrameType, getImportsLexVars, getInlineOnly, getMainMethod, getMethod, getNeedsClosureEnv, getNeedsStaticLink, getOwningLambda, getProperty, getReturnType, getType, incomingArgs, inline, isClassGenerated, isClassMethod, isHandlingTailCalls, isModuleBody, loadHeapFrame, mustCompile, outerLambda, outerLambdaNotInline, restArgType, setCanCall, setCanRead, setClassMethod, setExceptions, setImportsLexVars, setImportsLexVars, setInlineOnly, setNeedsStaticLink, setNeedsStaticLink, setProperty, setReturnType, setType, toString, variable_args, walkChildren, walkChildrenOnly, walkProperties
 
Methods inherited from class gnu.expr.ScopeExp
add, add, addDeclaration, addDeclaration, addDeclaration, countDecls, currentLambda, currentModule, duplicateDeclarationError, getDefine, getNoDefine, getVarScope, lookup, lookup, nesting, popScope, remove, remove, replaceFollowing, setIndexes
 
Methods inherited from class gnu.expr.Expression
apply0, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, isStableSourceLocation, makeWhile, match0, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, side_effects, valueIfConstant
 
Methods inherited from class gnu.mapping.Procedure0
apply1, apply2, apply3, apply4, applyN, numArgs
 
Methods inherited from class gnu.mapping.Procedure
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation
 
Methods inherited from class gnu.mapping.PropertySet
getName, getSymbol, removeProperty, setName, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXPORT_SPECIFIED

public static final int EXPORT_SPECIFIED
See Also:
Constant Field Values

STATIC_SPECIFIED

public static final int STATIC_SPECIFIED
See Also:
Constant Field Values

NONSTATIC_SPECIFIED

public static final int NONSTATIC_SPECIFIED
See Also:
Constant Field Values

SUPERTYPE_SPECIFIED

public static final int SUPERTYPE_SPECIFIED
See Also:
Constant Field Values

STATIC_RUN_SPECIFIED

public static final int STATIC_RUN_SPECIFIED
See Also:
Constant Field Values

LAZY_DECLARATIONS

public static final int LAZY_DECLARATIONS
See Also:
Constant Field Values

IMMEDIATE

public static final int IMMEDIATE
See Also:
Constant Field Values

dumpZipPrefix

public static java.lang.String dumpZipPrefix
Used to control which .zip file dumps are generated.


interactiveCounter

public static int interactiveCounter
Numeric identifier for this interactive "command". Incremented by Shell.run, and used to set the module name, and maybe the name of the --debug-dump-zip output file. We increment and use this counter purely to ease debugging. (Since each module gets its own ClassLoader, they don't need to be named differently, and it doesn't matter if there is a race condition on the counter.)


alwaysCompile

public static boolean alwaysCompile
Flag to force compilation, even when not required.

Constructor Detail

ModuleExp

public ModuleExp()
Method Detail

getJavaName

public java.lang.String getJavaName()

evalToClass

public static java.lang.Class evalToClass(Compilation comp,
                                          java.net.URL url)

evalModule

public static final boolean evalModule(Environment env,
                                       CallContext ctx,
                                       Compilation comp,
                                       java.net.URL url,
                                       OutPort msg)
                                throws java.lang.Throwable
Throws:
java.lang.Throwable

getSuperType

public final ClassType getSuperType()

setSuperType

public final void setSuperType(ClassType s)

getInterfaces

public final ClassType[] getInterfaces()

setInterfaces

public final void setInterfaces(ClassType[] s)

isStatic

public final boolean isStatic()

staticInitRun

public boolean staticInitRun()
True if module body (i.e. run) is called by class initializer.


allocChildClasses

public void allocChildClasses(Compilation comp)
Overrides:
allocChildClasses in class LambdaExp

walk

protected Expression walk(ExpWalker walker)
Overrides:
walk in class LambdaExp

print

public void print(OutPort out)
Overrides:
print in class LambdaExp

firstDecl

public Declaration firstDecl()
Overrides:
firstDecl in class ScopeExp

classFor

public ClassType classFor(Compilation comp)
Return the class this module. If not set yet, sets it now, based on the source file name.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException