Package gnu.expr
Class ModuleExp
- All Implemented Interfaces:
gnu.kawa.format.Printable,Named,SourceLocator,Externalizable,Serializable,SourceLocator,Locator
Class used to implement Scheme top-level environments.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gnu.expr.LambdaExp
LambdaExp.ClosureNested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanFlag to force compilation, even when not required.static booleanDeprecated.static StringUsed to control which .zip file dumps are generated.static final intstatic final intstatic final intTrue if the module is immediately evaluated.static final intTrue of a read-eval-print interface where each module is only partial.static final intstatic final intstatic final intstatic final intstatic final intstatic final intUsing explicit class (e.g.Fields inherited from class gnu.expr.LambdaExp
ALLOW_OTHER_KEYWORDS, applyToConsumer, ATTEMPT_INLINE, body, CLOSURE_ENV_NAME, closureEnvField, firstChild, HAS_NONTRIVIAL_DEFAULT, HAS_NONTRIVIAL_PATTERN, IN_EXPWALKER, inlineHome, keywords, max_args, min_args, nameDecl, NEXT_AVAIL_FLAG, nextSibling, NO_FIELD, opt_args, OVERLOADABLE_FIELD, PASSES_TAILCALLS, PUBLIC_METHOD, returnContinuation, returnType, SEQUENCE_RESULT, staticLinkFieldFields inherited from class gnu.expr.Expression
applyMethodExpression, flags, noExpressions, type, VALIDATEDFields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKeyFields inherited from class gnu.mapping.PropertySet
nameKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallocChildClasses(Compilation comp) classFor(Compilation comp) Return the class for this module.static booleanstatic final booleanevalModule(Environment env, CallContext ctx, Compilation comp, URL url, gnu.kawa.io.OutPort msg) static final ObjectevalModule1(Environment env, Compilation comp, URL url, gnu.kawa.io.OutPort msg) Parse and compile a module.static final voidevalModule2(Environment env, CallContext ctx, Language language, ModuleExp mexp, Object inst) static ClassevalToClass(Compilation comp, URL url) Compile to a class for immediate evaluation.final ClassType[]getMinfo()final ClassTypefinal booleanisStatic()voidprint(gnu.kawa.io.OutPort out) voidfinal voidsetInterfaces(ClassType[] s) final voidbooleanTrue if module body (i.e.booleanstatic ModuleExpprotected <R,D> R visit(ExpVisitor<R, D> visitor, D d) voidMethods inherited from class gnu.expr.LambdaExp
addParameter, allocFrame, apply, calculateType, capture, checkForInitCall, compile, compileBody, compileEnd, compileSetField, declareClosureEnv, declareThis, generateApplyMethods, getBodyFirstExpression, getCallConvention, getCaller, getCanRead, getClassType, getCompiledClassType, getExpClassName, getHeapFrameType, getImportsLexVars, getInlineOnly, getMainMethod, getMethod, getNeedsClosureEnv, getNeedsStaticLink, getOwningLambda, getProperty, getReturnType, incomingArgs, inlinedInCallerOrCheckMethodOnly, inlinedInCheckMethod, isAbstract, isClassMethod, isHandlingTailCalls, isModuleBody, isNative, loadHeapFrame, maybeSetReturnType, mustCompile, outerLambda, outerLambdaNotInline, outerLambdaOrCaller, pushChild, restArgType, reverseChildList, setCallConvention, setCanRead, setClassMethod, setCoercedReturnType, setCoercedReturnValue, setExceptions, setImportsLexVars, setImportsLexVars, setInlineOnly, setInlineOnly, setNeedsStaticLink, setNeedsStaticLink, setProperty, setReturnType, setType, side_effects, toString, usingCallContext, validateApply, variable_args, visitChildren, visitChildrenOnly, visitPropertiesMethods inherited from class gnu.expr.ScopeExp
add, add, addDeclaration, addDeclaration, addDeclaration, clearCallList, countDecls, currentLambda, currentModule, duplicateDeclarationError, getDefine, getNoDefine, getOuter, getVarScope, isClassGenerated, lastDecl, lookup, lookup, nestedIn, nesting, popScope, remove, remove, replaceFollowing, setIndexes, setOuter, topLevelMethods inherited from class gnu.expr.Expression
applyMethodExpression, checkLiteralKeyword, compile, compile, compileWithPosition, compileWithPosition, deepCopy, deepCopy, deepCopy, deepCopy, eval, eval, getColumnNumber, getEndColumn, getEndLine, getFileName, getFlag, getFlags, getLineNumber, getPublicId, getStartColumn, getStartLine, getSystemId, getType, getTypeRaw, isSingleValue, isStableSourceLocation, makeWhile, maybeSetLine, neverReturns, numArgs, print, printLineColumn, setFile, setFlag, setFlag, setLine, setLine, setLine, setLine, setLine, setLocation, setType, valueIfConstantMethods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocationMethods inherited from class gnu.mapping.PropertySet
getName, getSymbol, removeProperty, setName, setProperty, setSymbol
-
Field Details
-
EXPORT_SPECIFIED
public static final int EXPORT_SPECIFIED- See Also:
-
STATIC_SPECIFIED
public static final int STATIC_SPECIFIED- See Also:
-
NONSTATIC_SPECIFIED
public static final int NONSTATIC_SPECIFIED- See Also:
-
SUPERTYPE_SPECIFIED
public static final int SUPERTYPE_SPECIFIED- See Also:
-
STATIC_RUN_SPECIFIED
public static final int STATIC_RUN_SPECIFIED- See Also:
-
LAZY_DECLARATIONS
public static final int LAZY_DECLARATIONS- See Also:
-
IMMEDIATE
public static final int IMMEDIATETrue if the module is immediately evaluated.- See Also:
-
INTERACTIVE
public static final int INTERACTIVETrue of a read-eval-print interface where each module is only partial. Conceptually, each statement is a fragment of a imagined super-module for the whole interaction, though currently there is no super-module object. IMMEDIATE is also set in this case.- See Also:
-
USE_DEFINED_CLASS
public static final int USE_DEFINED_CLASSUsing explicit class (e.g. define-simple-class) for module class.- See Also:
-
HAS_SUB_MODULE
public static final int HAS_SUB_MODULE- See Also:
-
dumpZipPrefix
Used to control which .zip file dumps are generated. -
compilerAvailable
Deprecated. -
alwaysCompile
public static boolean alwaysCompileFlag to force compilation, even when not required.
-
-
Constructor Details
-
ModuleExp
public ModuleExp()
-
-
Method Details
-
subModulesOnly
public boolean subModulesOnly() -
valueOf
-
evalToClass
Compile to a class for immediate evaluation. Return null on error, if so errors go to comp.getMessages().- Throws:
SyntaxException
-
compilerAvailable
public static boolean compilerAvailable() -
evalModule
public static final boolean evalModule(Environment env, CallContext ctx, Compilation comp, URL url, gnu.kawa.io.OutPort msg) throws Throwable - Throws:
Throwable
-
evalModule1
public static final Object evalModule1(Environment env, Compilation comp, URL url, gnu.kawa.io.OutPort msg) throws SyntaxException Parse and compile a module.- Returns:
- null on error; otherwise a "cookie" that can be passed to evalModule2 or CompiledModule.
- Throws:
SyntaxException
-
evalModule2
public static final void evalModule2(Environment env, CallContext ctx, Language language, ModuleExp mexp, Object inst) throws Throwable - Throws:
Throwable
-
getMinfo
-
getNamespaceUri
-
getSuperType
-
setSuperType
-
getInterfaces
-
setInterfaces
-
isStatic
public final boolean isStatic() -
staticInitRun
public boolean staticInitRun()True if module body (i.e. run) is called by class initializer. -
allocChildClasses
- Overrides:
allocChildClassesin classLambdaExp
-
visit
-
print
public void print(gnu.kawa.io.OutPort out) -
firstDecl
-
classFor
Return the class for this module. If not set yet, sets it now, based on the source file name. -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-