Package gnu.expr

Class ModuleExp

  • All Implemented Interfaces:
    gnu.kawa.format.Printable, Named, SourceLocator, java.io.Externalizable, java.io.Serializable, javax.xml.transform.SourceLocator, 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 Detail

      • IMMEDIATE

        public static final int IMMEDIATE
        True if the module is immediately evaluated.
        See Also:
        Constant Field Values
      • INTERACTIVE

        public static final int INTERACTIVE
        True 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:
        Constant Field Values
      • USE_DEFINED_CLASS

        public static final int USE_DEFINED_CLASS
        Using explicit class (e.g. define-simple-class) for module class.
        See Also:
        Constant Field Values
      • dumpZipPrefix

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

        @Deprecated
        public static boolean compilerAvailable
        Deprecated.
      • alwaysCompile

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

      • ModuleExp

        public ModuleExp()
    • Method Detail

      • subModulesOnly

        public boolean subModulesOnly()
      • evalToClass

        public static java.lang.Class evalToClass​(Compilation comp,
                                                  java.net.URL url)
                                           throws SyntaxException
        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,
                                               java.net.URL url,
                                               gnu.kawa.io.OutPort msg)
                                        throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • evalModule1

        public static final java.lang.Object evalModule1​(Environment env,
                                                         Compilation comp,
                                                         java.net.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,
                                             java.lang.Object inst)
                                      throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • getNamespaceUri

        public java.lang.String getNamespaceUri()
      • 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.
      • print

        public void print​(gnu.kawa.io.OutPort out)
        Overrides:
        print in class LambdaExp
      • classFor

        public ClassType classFor​(Compilation comp)
        Return the class for 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