gnu.expr

Class Compilation

public class Compilation extends Object implements SourceLocator

State for a single expression or module. For each top-level thing (expression or file) we compile or evaluate we create a new Compilation.
Field Summary
static Type[]apply0args
static Methodapply0method
static Type[]apply1args
static Methodapply1method
static Type[]apply2args
static Methodapply2method
static Methodapply3method
static Methodapply4method
static MethodapplyCpsMethod
static Method[]applymethods
static Type[]applyNargs
static MethodapplyNmethod
static FieldargsCallContextField
static intBODY_PARSED
State code indicating the entire module has been parsed.
StringclassPrefix
If non-null: a prefix for generateClassName to prepend to names.
static StringclassPrefixDefault
ClassTypecurClass
LambdaExpcurLambda
OptionscurrentOptions
protected ScopeExpcurrent_scope
static intCALL_WITH_CONSUMER
Function results are written to the current CallContext's Consumer.
static intCALL_WITH_CONTINUATIONS
Support for full continuations.
static intCALL_WITH_RETURN
Plain calling convention, using regular Java parameters and returns.
static intCALL_WITH_TAILCALLS
Like CALL_WITH_CONSUMER, but handle full on-stack-growing tail-calls.
static intCALL_WITH_UNSPECIFIED
static intCLASS_WRITTEN
State code indicating that bytecode has been written to its target.
static intCOMPILED
State code indicating the bytecode has been generated.
static intCOMPILE_SETUP
State code that various compile-only data has been determined.
static booleandebugPrintExpr
If true, print out expressions after parsing and before optimizations.
static booleandebugPrintFinalExpr
If true, print out final expressions after optimizations etc.
static intdefaultCallConvention
The default calling convention.
static booleanemitSourceDebugExtAttr
StackexprStack
A help vector for building expressions.
static intERROR_SEEN
static FieldfalseConstant
static booleanfewerClasses
If true, minimize the number of classes generated.
booleangenerateApplet
True if we should generate an Applet.
static booleangenerateAppletDefault
booleangenerateMain
True if we should generate a main(String[]) method.
static booleangenerateMainDefault
booleangenerateServlet
True if we should generate an Servlet.
static booleangenerateServletDefault
static MethodgetCallContextInstanceMethod
static MethodgetCurrentEnvironmentMethod
static MethodgetLocation1EnvironmentMethod
static MethodgetLocation2EnvironmentMethod
static MethodgetLocationMethod
static MethodgetProcedureBindingMethod
static MethodgetSymbolProcedureMethod
static MethodgetSymbolValueMethod
booleanimmediate
True if the compiled result will be immediately loaded.
static booleaninlineOk
static Type[]int1Args
static ClassTypejavaIntegerType
static ClassTypejavaStringType
protected Languagelanguage
Lexerlexer
NameLookuplexical
Current lexical scope - map name to Declaration.
ClassTypemainClass
ModuleExpmainLambda
protected SourceMessagesmessages
Methodmethod
The current method.
ModuleInfominfo
ClassTypemoduleClass
Generated class that extends ModuleBody.
static intmoduleStatic
If moduleStatic > 0, (module-static #t) is implied by default.
booleanmustCompile
True if the form is too complex to evaluate,and we must compile it.
static FieldnoArgsField
static ArrayTypeobjArrayType
static Optionsoptions
static FieldpcCallContextField
StackpendingImports
static FieldprocCallContextField
static intPROLOG_PARSED
We have determined the module name and class, but not finished parsing.
static intPROLOG_PARSING
State code for initial pre-parse looking for module name.
static intRESOLVED
State code for lexical bindings having been resolved.
static ClassTypescmBooleanType
static ClassTypescmKeywordType
static ClassTypescmListType
static ClassTypescmNamedType
static ClassTypescmPairType
static ClassTypescmSequenceType
static Type[]string1Arg
static Type[]sym1Arg
VariablethisDecl
static FieldtrueConstant
static ClassTypetypeApplet
static ClassTypetypeCallContext
static ClassTypetypeClass
static ClassTypetypeClassType
static ClassTypetypeConsumer
static ClassTypetypeEnvironment
static ClassTypetypeLanguage
static ClassTypetypeLocation
static ClassTypetypeMethodProc
static ClassTypetypeModuleBody
static ClassTypetypeModuleMethod
static ClassTypetypeModuleWithContext
static ClassTypetypeObject
static ClassTypetypeObjectType
static ClassTypetypePair
static ClassTypetypeProcedure
static ClassTypetypeProcedure0
static ClassTypetypeProcedure1
static ClassTypetypeProcedure2
static ClassTypetypeProcedure3
static ClassTypetypeProcedure4
static ClassType[]typeProcedureArray
static ClassTypetypeProcedureN
static ClassTypetypeRunnable
static ClassTypetypeServlet
static ClassTypetypeString
static ClassTypetypeSymbol
static ClassTypetypeType
static ClassTypetypeValues
static intWALKED
State code when various inlining and optimization passes are done.
Constructor Summary
Compilation(boolean immediate, SourceMessages messages)
Compilation(SourceMessages messages)
Compilation(Language language, SourceMessages messages)
Compilation(Language language, SourceMessages messages, NameLookup lexical)
Method Summary
voidaddClass(ClassType new_class)
voidaddMainClass(ModuleExp module)
FieldallocLocalField(Type type, String name)
voidcompileConstant(Object value)
Emit code to "evaluate" a compile-time constant.
voidcompileConstant(Object value, Target target)
FieldcompileConstantToField(Object value)
voidcompileToArchive(ModuleExp mexp, String fname)
LambdaExpcurrentLambda()
ModuleExpcurrentModule()
The same as getModule, until we allow nested modules.
ScopeExpcurrentScope()
static chardemangle2(char char1, char char2)
Demangle a three-character mangling starting with '$'.
static StringdemangleName(String name)
static StringdemangleName(String name, boolean reversible)
voiderror(char severity, String message, SourceLocator location)
voiderror(char severity, String message)
voiderror(char severity, Declaration decl, String msg1, String msg2)
voiderror(char severity, String message, String code, Declaration decl)
static CompilationfindForImmediateLiterals(int key)
ClassTypefindNamedClass(String name)
Search this Compilation for a ClassType with a given name.
voidfreeLocalField(Field field)
voidgenerateApplyMethodsWithContext(LambdaExp lexp)
Generate ModuleBody's apply(CallContext) method Use the applyMethods vector, which contains methods that implement the (public, readable) methods of the current module.
voidgenerateApplyMethodsWithoutContext(LambdaExp lexp)
Generate ModuleBody's apply0...applyN methods.
StringgenerateClassName(String hint)
Generate an unused class name.
voidgenerateConstructor(LambdaExp lexp)
voidgenerateConstructor(ClassType clas, LambdaExp lexp)
voidgenerateMatchMethods(LambdaExp lexp)
booleangetBooleanOption(String key, boolean defaultValue)
Get a named boolean option.
booleangetBooleanOption(String key)
Get a named boolean option.
CodeAttrgetCode()
intgetColumnNumber()
MethodgetConstructor(LambdaExp lexp)
static MethodgetConstructor(ClassType clas, LambdaExp lexp)
static CompilationgetCurrent()
StringgetFileName()
MethodgetForNameHelper()
Generate a method to find a named Class without initializing it.
LanguagegetLanguage()
intgetLineNumber()
SourceMessagesgetMessages()
ModuleExpgetModule()
ClassTypegetModuleType()
StringgetPublicId()
intgetState()
Returns a code indicating how far along we are in the parsing/compilation process.
StringgetSystemId()
booleaninlineOk(Expression proc)
booleaninlineOk(Procedure proc)
booleanisPedantic()
booleanisStableSourceLocation()
booleanisStatic()
static booleanisValidJavaName(String name)
LetExpletDone(Expression body)
voidletEnter()
voidletStart()
DeclarationletVariable(Object name, Type type, Expression init)
voidloadCallContext()
Generate code to push the current CallContext on the JVM stack.
voidloadClassRef(ClassType clas)
voidloadClassRef(String className)
Generate code to load a named Class without initializing it.
Declarationlookup(Object name, int namespace)
voidloopBody(Expression body)
voidloopCond(Expression cond)
voidloopEnter()
Done handling loop variables, and pushes them into the lexical scope.
ExpressionloopRepeat(Expression[] exps)
ExpressionloopRepeat()
ExpressionloopRepeat(Expression exp)
voidloopStart()
Start a new loop.
DeclarationloopVariable(Object name, Type type, Expression init)
static StringmangleName(String name)
static StringmangleName(String name, boolean reversible)
Convert a string to a safe Java identifier.
static StringmangleName(String name, int kind)
Convert a string to a safe Java identifier.
static StringmangleNameIfNeeded(String name)
static StringmangleURI(String name)
Map a URI to a package/class name.
voidmustCompileHere()
Note that we have seen a construct that must be compiled, not evaluated.
voidoutputClass(String directory)
Expressionparse(Object input)
This may not make sense, except for Lisp-like languages.
voidpop(ScopeExp scope)
voidpop()
voidprocess(int wantedState)
Parse/walk/compile this module as needed and requested.
voidpush(ScopeExp scope)
voidpush(Declaration decl)
ModuleExppushNewModule(Lexer lexer)
ModuleExppushNewModule(String filename)
voidpushPendingImport(ModuleInfo info, ScopeExp defs)
voidpushScope(ScopeExp scope)
static intregisterForImmediateLiterals(Compilation comp)
Objectresolve(Object name, boolean function)
voidsetColumn(int column)
static voidsetCurrent(Compilation comp)
voidsetCurrentScope(ScopeExp scope)
Set currentScope().
voidsetFile(String filename)
voidsetLine(int line)
voidsetLine(Expression position)
voidsetLine(Object location)
voidsetLine(String filename, int line, int column)
voidsetLocation(SourceLocator position)
voidsetMessages(SourceMessages messages)
voidsetModule(ModuleExp mexp)
voidsetState(int state)
static voidsetupLiterals(int key)
Call-back from compiled code to initialize literals in immediate mode.
ExpressionsyntaxError(String message)
Handle syntax errors (at rewrite time).
StringtoString()
voidusedClass(Type type)
Called for classes referenced in bytecode.
booleanusingCPStyle()
booleanusingTailCalls()
voidwalkModule(ModuleExp mexp)
Shared processing for both compiling/eval.

Field Detail

apply0args

public static Type[] apply0args

apply0method

public static Method apply0method

apply1args

public static Type[] apply1args

apply1method

public static Method apply1method

apply2args

public static Type[] apply2args

apply2method

public static Method apply2method

apply3method

public static Method apply3method

apply4method

public static Method apply4method

applyCpsMethod

public static Method applyCpsMethod

applymethods

public static Method[] applymethods

applyNargs

public static Type[] applyNargs

applyNmethod

public static Method applyNmethod

argsCallContextField

public static Field argsCallContextField

BODY_PARSED

public static final int BODY_PARSED
State code indicating the entire module has been parsed.

classPrefix

public String classPrefix
If non-null: a prefix for generateClassName to prepend to names.

classPrefixDefault

public static String classPrefixDefault

curClass

public ClassType curClass

curLambda

public LambdaExp curLambda

currentOptions

public Options currentOptions

current_scope

protected ScopeExp current_scope

CALL_WITH_CONSUMER

public static final int CALL_WITH_CONSUMER
Function results are written to the current CallContext's Consumer.

CALL_WITH_CONTINUATIONS

public static final int CALL_WITH_CONTINUATIONS
Support for full continuations. Not implemented.

CALL_WITH_RETURN

public static final int CALL_WITH_RETURN
Plain calling convention, using regular Java parameters and returns.

CALL_WITH_TAILCALLS

public static final int CALL_WITH_TAILCALLS
Like CALL_WITH_CONSUMER, but handle full on-stack-growing tail-calls.

CALL_WITH_UNSPECIFIED

public static final int CALL_WITH_UNSPECIFIED

CLASS_WRITTEN

public static final int CLASS_WRITTEN
State code indicating that bytecode has been written to its target.

COMPILED

public static final int COMPILED
State code indicating the bytecode has been generated.

COMPILE_SETUP

public static final int COMPILE_SETUP
State code that various compile-only data has been determined.

debugPrintExpr

public static boolean debugPrintExpr
If true, print out expressions after parsing and before optimizations.

debugPrintFinalExpr

public static boolean debugPrintFinalExpr
If true, print out final expressions after optimizations etc.

defaultCallConvention

public static int defaultCallConvention
The default calling convention. One of the following CALL_WITHG_xxx values.

emitSourceDebugExtAttr

public static boolean emitSourceDebugExtAttr

exprStack

public Stack exprStack
A help vector for building expressions.

ERROR_SEEN

public static final int ERROR_SEEN

falseConstant

public static final Field falseConstant

fewerClasses

public static boolean fewerClasses
If true, minimize the number of classes generated. Do this even if it makes things a little slower.

generateApplet

public boolean generateApplet
True if we should generate an Applet.

generateAppletDefault

public static boolean generateAppletDefault

generateMain

public boolean generateMain
True if we should generate a main(String[]) method.

generateMainDefault

public static boolean generateMainDefault

generateServlet

public boolean generateServlet
True if we should generate an Servlet.

generateServletDefault

public static boolean generateServletDefault

getCallContextInstanceMethod

public static Method getCallContextInstanceMethod

getCurrentEnvironmentMethod

public static Method getCurrentEnvironmentMethod

getLocation1EnvironmentMethod

public static final Method getLocation1EnvironmentMethod

getLocation2EnvironmentMethod

public static final Method getLocation2EnvironmentMethod

getLocationMethod

public static final Method getLocationMethod

getProcedureBindingMethod

public static final Method getProcedureBindingMethod

getSymbolProcedureMethod

public static final Method getSymbolProcedureMethod

getSymbolValueMethod

public static final Method getSymbolValueMethod

immediate

public boolean immediate
True if the compiled result will be immediately loaded.

inlineOk

public static boolean inlineOk

int1Args

public static final Type[] int1Args

javaIntegerType

public static ClassType javaIntegerType

javaStringType

public static ClassType javaStringType

language

protected Language language

lexer

public Lexer lexer

lexical

public NameLookup lexical
Current lexical scope - map name to Declaration.

mainClass

public ClassType mainClass

mainLambda

public ModuleExp mainLambda

messages

protected SourceMessages messages

method

public Method method
The current method.

minfo

public ModuleInfo minfo

moduleClass

public ClassType moduleClass
Generated class that extends ModuleBody. Normally same as mainClass.

moduleStatic

public static int moduleStatic
If moduleStatic > 0, (module-static #t) is implied by default. If moduleStatic == 2, calls run. If moduleStatic < 0, (module-static #f) is implied by default.

mustCompile

public boolean mustCompile
True if the form is too complex to evaluate,and we must compile it. This is because it contains a construct we know how to compile, but not evaluate, and it it outside a function (which we always compile). This can be a let scope, or primitive procedure.

noArgsField

public static Field noArgsField

objArrayType

public static final ArrayType objArrayType

options

public static Options options

pcCallContextField

public static Field pcCallContextField

pendingImports

public Stack pendingImports

procCallContextField

public static Field procCallContextField

PROLOG_PARSED

public static final int PROLOG_PARSED
We have determined the module name and class, but not finished parsing.

PROLOG_PARSING

public static final int PROLOG_PARSING
State code for initial pre-parse looking for module name.

RESOLVED

public static final int RESOLVED
State code for lexical bindings having been resolved.

scmBooleanType

public static ClassType scmBooleanType

scmKeywordType

public static ClassType scmKeywordType

scmListType

public static ClassType scmListType

scmNamedType

public static ClassType scmNamedType

scmPairType

public static ClassType scmPairType

scmSequenceType

public static ClassType scmSequenceType

string1Arg

public static final Type[] string1Arg

sym1Arg

public static final Type[] sym1Arg

thisDecl

public Variable thisDecl

trueConstant

public static final Field trueConstant

typeApplet

public static ClassType typeApplet

typeCallContext

public static ClassType typeCallContext

typeClass

public static ClassType typeClass

typeClassType

public static ClassType typeClassType

typeConsumer

public static final ClassType typeConsumer

typeEnvironment

public static ClassType typeEnvironment

typeLanguage

public static ClassType typeLanguage

typeLocation

public static ClassType typeLocation

typeMethodProc

public static ClassType typeMethodProc

typeModuleBody

public static ClassType typeModuleBody

typeModuleMethod

public static ClassType typeModuleMethod

typeModuleWithContext

public static ClassType typeModuleWithContext

typeObject

public static ClassType typeObject

typeObjectType

public static ClassType typeObjectType

typePair

public static ClassType typePair

typeProcedure

public static ClassType typeProcedure

typeProcedure0

public static ClassType typeProcedure0

typeProcedure1

public static ClassType typeProcedure1

typeProcedure2

public static ClassType typeProcedure2

typeProcedure3

public static ClassType typeProcedure3

typeProcedure4

public static ClassType typeProcedure4

typeProcedureArray

public static ClassType[] typeProcedureArray

typeProcedureN

public static ClassType typeProcedureN

typeRunnable

public static ClassType typeRunnable

typeServlet

public static ClassType typeServlet

typeString

public static ClassType typeString

typeSymbol

public static ClassType typeSymbol

typeType

public static ClassType typeType

typeValues

public static ClassType typeValues

WALKED

public static final int WALKED
State code when various inlining and optimization passes are done.

Constructor Detail

Compilation

public Compilation(boolean immediate, SourceMessages messages)

Compilation

public Compilation(SourceMessages messages)

Compilation

public Compilation(Language language, SourceMessages messages)

Compilation

public Compilation(Language language, SourceMessages messages, NameLookup lexical)

Method Detail

addClass

public void addClass(ClassType new_class)

addMainClass

public void addMainClass(ModuleExp module)

allocLocalField

public Field allocLocalField(Type type, String name)

compileConstant

public void compileConstant(Object value)
Emit code to "evaluate" a compile-time constant. This is the normal external interface.

Parameters: value the value to be compiled

compileConstant

public void compileConstant(Object value, Target target)

compileConstantToField

public Field compileConstantToField(Object value)

compileToArchive

public void compileToArchive(ModuleExp mexp, String fname)

currentLambda

public LambdaExp currentLambda()

currentModule

public ModuleExp currentModule()
The same as getModule, until we allow nested modules.

currentScope

public ScopeExp currentScope()

demangle2

public static char demangle2(char char1, char char2)
Demangle a three-character mangling starting with '$'. UNFINISHED!

demangleName

public static String demangleName(String name)

demangleName

public static String demangleName(String name, boolean reversible)

error

public void error(char severity, String message, SourceLocator location)

error

public void error(char severity, String message)

error

public void error(char severity, Declaration decl, String msg1, String msg2)

error

public void error(char severity, String message, String code, Declaration decl)

findForImmediateLiterals

public static Compilation findForImmediateLiterals(int key)

findNamedClass

public ClassType findNamedClass(String name)
Search this Compilation for a ClassType with a given name.

Parameters: name the name of the class desired

Returns: the matching ClassType, or null if none is found

freeLocalField

public void freeLocalField(Field field)

generateApplyMethodsWithContext

public void generateApplyMethodsWithContext(LambdaExp lexp)
Generate ModuleBody's apply(CallContext) method Use the applyMethods vector, which contains methods that implement the (public, readable) methods of the current module.

generateApplyMethodsWithoutContext

public void generateApplyMethodsWithoutContext(LambdaExp lexp)
Generate ModuleBody's apply0...applyN methods. Use the applyMethods vector, which contains methods that implement the (public, readable) methods of the current module.

generateClassName

public String generateClassName(String hint)
Generate an unused class name.

Parameters: hint the requested name (or prefix)

Returns: a unique class name.

generateConstructor

public final void generateConstructor(LambdaExp lexp)

generateConstructor

public final void generateConstructor(ClassType clas, LambdaExp lexp)

generateMatchMethods

public void generateMatchMethods(LambdaExp lexp)

getBooleanOption

public final boolean getBooleanOption(String key, boolean defaultValue)
Get a named boolean option.

getBooleanOption

public final boolean getBooleanOption(String key)
Get a named boolean option.

getCode

public final CodeAttr getCode()

getColumnNumber

public final int getColumnNumber()

getConstructor

public final Method getConstructor(LambdaExp lexp)

getConstructor

public static final Method getConstructor(ClassType clas, LambdaExp lexp)

getCurrent

public static Compilation getCurrent()

getFileName

public final String getFileName()

getForNameHelper

public Method getForNameHelper()
Generate a method to find a named Class without initializing it. Generate a static helper method "class$" like javac generates for 'CLASS.class', but does not initialize CLASS. Also, we don't bother catching exceptions, since the JVM doesn't require us to. I.e. generates: public static class $(String name) { return Class.forName(name, false, Class.forName(THISCLASSNAME).getClassLoader()); } Note that we want the result to use the same ClassLoader as the caller, which is why we generate a static helper method.

getLanguage

public Language getLanguage()

getLineNumber

public final int getLineNumber()

getMessages

public SourceMessages getMessages()

getModule

public final ModuleExp getModule()

getModuleType

public final ClassType getModuleType()

getPublicId

public String getPublicId()

getState

public int getState()
Returns a code indicating how far along we are in the parsing/compilation process.

getSystemId

public String getSystemId()

inlineOk

public boolean inlineOk(Expression proc)

inlineOk

public boolean inlineOk(Procedure proc)

isPedantic

public boolean isPedantic()

isStableSourceLocation

public boolean isStableSourceLocation()

isStatic

public boolean isStatic()

isValidJavaName

public static boolean isValidJavaName(String name)

letDone

public LetExp letDone(Expression body)

letEnter

public void letEnter()

letStart

public void letStart()

letVariable

public Declaration letVariable(Object name, Type type, Expression init)

loadCallContext

public final void loadCallContext()
Generate code to push the current CallContext on the JVM stack.

loadClassRef

public void loadClassRef(ClassType clas)

loadClassRef

public void loadClassRef(String className)
Generate code to load a named Class without initializing it.

lookup

public Declaration lookup(Object name, int namespace)

loopBody

public void loopBody(Expression body)

loopCond

public void loopCond(Expression cond)

loopEnter

public void loopEnter()
Done handling loop variables, and pushes them into the lexical scope. Ready to parse the loop condition.

loopRepeat

public Expression loopRepeat(Expression[] exps)

loopRepeat

public Expression loopRepeat()

loopRepeat

public Expression loopRepeat(Expression exp)

loopStart

public void loopStart()
Start a new loop. (We could make this implied by the first loopVaribale call ???)

loopVariable

public Declaration loopVariable(Object name, Type type, Expression init)

mangleName

public static String mangleName(String name)

mangleName

public static String mangleName(String name, boolean reversible)
Convert a string to a safe Java identifier.

Parameters: reversible if we should use an invertible mapping.

mangleName

public static String mangleName(String name, int kind)
Convert a string to a safe Java identifier.

Parameters: kind -1 - non-reversible; 0: reversible, except that '$' is not mapped; 1: reversible

mangleNameIfNeeded

public static String mangleNameIfNeeded(String name)

mangleURI

public static String mangleURI(String name)
Map a URI to a package/class name. Similar to the JAXB mangling, and that in the Java language spec.

mustCompileHere

public void mustCompileHere()
Note that we have seen a construct that must be compiled, not evaluated. If we are not inside a lambda (which is always compiled), but only inside the outer-most ModuleExp, note that it must be compiled.

outputClass

public void outputClass(String directory)

parse

public Expression parse(Object input)
This may not make sense, except for Lisp-like languages. For those, 'input' an s-expression from the reader.

pop

public void pop(ScopeExp scope)

pop

public final void pop()

process

public void process(int wantedState)
Parse/walk/compile this module as needed and requested. This method does not process any dependent modules (expect indirectly, such as may be done by a require form).

Parameters: wantedState the desired value of getState().

push

public void push(ScopeExp scope)

push

public void push(Declaration decl)

pushNewModule

public ModuleExp pushNewModule(Lexer lexer)

pushNewModule

public ModuleExp pushNewModule(String filename)

pushPendingImport

public void pushPendingImport(ModuleInfo info, ScopeExp defs)

pushScope

public final void pushScope(ScopeExp scope)

registerForImmediateLiterals

public static int registerForImmediateLiterals(Compilation comp)

resolve

public Object resolve(Object name, boolean function)

setColumn

public void setColumn(int column)

setCurrent

public static void setCurrent(Compilation comp)

setCurrentScope

public void setCurrentScope(ScopeExp scope)
Set currentScope(). Also update the nesting object.

setFile

public void setFile(String filename)

setLine

public void setLine(int line)

setLine

public final void setLine(Expression position)

setLine

public void setLine(Object location)

setLine

public void setLine(String filename, int line, int column)

setLocation

public final void setLocation(SourceLocator position)

setMessages

public void setMessages(SourceMessages messages)

setModule

public void setModule(ModuleExp mexp)

setState

public void setState(int state)

setupLiterals

public static void setupLiterals(int key)
Call-back from compiled code to initialize literals in immediate mode. In non-immediate mode (i.e. generating class files) the compiler emits code to "re-construct" literal values. However, in immediate mode that would be wasteful, plus we would get values that are similar (equals) to but not necessarily identical (eq) to the compile-time literal. So we need to pass the literal values to the compiled code, by using reflection to initialize various static fields. This method does that. It is called at the start of the generated static initializer, which helps makes things more consistent between immediate and non-immediate mode.

syntaxError

public Expression syntaxError(String message)
Handle syntax errors (at rewrite time).

Parameters: message an error message to print out

Returns: an ErrorExp

toString

public String toString()

usedClass

public void usedClass(Type type)
Called for classes referenced in bytecode. Since this only does something when immediate, we only care about classes referenced in the bytecode when immediate. It is used to ensure that we can inherit from classes defines when in immediate mode (in Scheme using define-class or similar).

usingCPStyle

public boolean usingCPStyle()

usingTailCalls

public boolean usingTailCalls()

walkModule

public void walkModule(ModuleExp mexp)
Shared processing for both compiling/eval.