gnu.expr

Class ModuleExp

Implemented Interfaces:
Externalizable, org.xml.sax.Locator, Named, Printable, SourceLocator

public class ModuleExp
extends LambdaExp
implements Externalizable

Class used to implement Scheme top-level environments.

Field Summary

static int
EXPORT_SPECIFIED
static int
IMMEDIATE
static int
LAZY_DECLARATIONS
static int
NONSTATIC_SPECIFIED
static int
STATIC_RUN_SPECIFIED
static int
STATIC_SPECIFIED
static int
SUPERTYPE_SPECIFIED
static boolean
alwaysCompile
Flag to force compilation, even when not required.
static String
dumpZipPrefix
Used to control which .zip file dumps are generated.
static int
interactiveCounter
Numeric identifier for this interactive "command".

Fields inherited from class gnu.expr.LambdaExp

NEXT_AVAIL_FLAG, NO_FIELD, OVERLOADABLE_FIELD, SEQUENCE_RESULT, body, closureEnvField, defaultArgs, firstChild, keywords, max_args, min_args, nameDecl, nextSibling, returnContinuation, returnType, staticLinkField

Fields inherited from class gnu.expr.ScopeExp

frameSize, id, outer

Fields inherited from class gnu.expr.Expression

NEXT_AVAIL_FLAG, 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, URL url, OutPort msg)
static Class
evalToClass(Compilation comp, URL url)
Declaration
firstDecl()
ClassType[]
getInterfaces()
String
getJavaName()
ClassType
getSuperType()
boolean
isStatic()
void
print(OutPort out)
void
readExternal(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(ObjectOutput out)

Methods inherited from class gnu.expr.LambdaExp

allocChildClasses, 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, print, restArgType, setCanCall, setCanRead, setClassMethod, setExceptions, setImportsLexVars, setImportsLexVars, setInlineOnly, setNeedsStaticLink, setNeedsStaticLink, setProperty, setReturnType, setType, toString, variable_args, walk, walkChildren, walkChildrenOnly, walkProperties

Methods inherited from class gnu.expr.ScopeExp

add, add, addDeclaration, addDeclaration, addDeclaration, countDecls, currentLambda, currentModule, duplicateDeclarationError, firstDecl, getDefine, getNoDefine, getVarScope, lookup, lookup, nesting, popScope, remove, remove, replaceFollowing, setIndexes, toString, walk

Methods inherited from class gnu.expr.Expression

apply, apply0, compile, compile, compile, compileButFirst, compileNotePosition, compileWithPosition, compileWithPosition, eval, eval, getColumnNumber, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getSystemId, getType, inline, isStableSourceLocation, makeWhile, match0, mustCompile, print, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLocation, side_effects, toString, valueIfConstant, walk, walkChildren

Methods inherited from class gnu.mapping.Procedure0

apply0, apply1, apply2, apply3, apply4, applyN, numArgs

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString

Methods inherited from class gnu.mapping.PropertySet

getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol

Field Details

EXPORT_SPECIFIED

public static final int EXPORT_SPECIFIED
Field Value:
4096

IMMEDIATE

public static final int IMMEDIATE
Field Value:
262144

LAZY_DECLARATIONS

public static final int LAZY_DECLARATIONS
Field Value:
131072

NONSTATIC_SPECIFIED

public static final int NONSTATIC_SPECIFIED
Field Value:
16384

STATIC_RUN_SPECIFIED

public static final int STATIC_RUN_SPECIFIED
Field Value:
65536

STATIC_SPECIFIED

public static final int STATIC_SPECIFIED
Field Value:
8192

SUPERTYPE_SPECIFIED

public static final int SUPERTYPE_SPECIFIED
Field Value:
32768

alwaysCompile

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

dumpZipPrefix

public static 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.)

Constructor Details

ModuleExp

public ModuleExp()

Method Details

allocChildClasses

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

classFor

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

evalModule

public static final boolean evalModule(Environment env,
                                       CallContext ctx,
                                       Compilation comp,
                                       URL url,
                                       OutPort msg)
            throws Throwable

evalToClass

public static Class evalToClass(Compilation comp,
                                URL url)

firstDecl

public Declaration firstDecl()
Overrides:
firstDecl in interface ScopeExp

getInterfaces

public final ClassType[] getInterfaces()

getJavaName

public String getJavaName()

getSuperType

public final ClassType getSuperType()

isStatic

public final boolean isStatic()

print

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

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

setInterfaces

public final void setInterfaces(ClassType[] s)

setSuperType

public final void setSuperType(ClassType s)

staticInitRun

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

walk

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

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException