Package gnu.kawa.functions
Class GetModuleClass
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.ProcedureN
gnu.kawa.functions.GetModuleClass
- All Implemented Interfaces:
Inlineable,Named
Special procedure to get the Class of the current module.
Since "current module" is defined by lexical scope,
this isn't a first-class procedure - it has to be inlined.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GetModuleClassA function that returns the class of the current module.static final GetModuleClassA function that returns the URLPath of the current module.static final GetModuleClassA dummy 1-argument functions used in implementing getModuleUri.Fields inherited from class gnu.mapping.ProcedureN
applyToObject, noArgsFields 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 TypeMethodDescriptionstatic gnu.kawa.io.URLPathclassResourcePath(Class clas) voidcompile(ApplyExp exp, Compilation comp, Target target) static Expressionstatic ExpressiongetModuleClassURI(Compilation comp) Return an expression that evaluates to a module-relative URL.getReturnType(Expression[] args) Semi-deprecated - instead should be set at Inline time.intnumArgs()ReturnminArgs()|(maxArgs<<12).Methods inherited from class gnu.mapping.ProcedureN
applyToObjectMethods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toStringMethods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
Field Details
-
getModuleClass
A function that returns the class of the current module. -
getModuleUri
A function that returns the URLPath of the current module. This is"class-resource:"URL (seeResourceStreamHandler), though in immediate mode it gets optimized to a"file:"URL. -
getModuleUriDummy
A dummy 1-argument functions used in implementing getModuleUri. It takes one argument - a reference to a declaration containing the intended result, with a value to initialize it. The compile method sets up the needed static initialization.
-
-
Constructor Details
-
GetModuleClass
public GetModuleClass()
-
-
Method Details
-
applyN
-
numArgs
public int numArgs()Description copied from class:ProcedureReturnminArgs()|(maxArgs<<12). We use a single virtual function to reduce the number of methods in the system, as well as the number of virtual method table entries. We shift by 12 so the number can normally be represented using a sipush instruction, without requiring a constant pool entry. -
compile
- Specified by:
compilein interfaceInlineable
-
getReturnType
Description copied from class:ProcedureSemi-deprecated - instead should be set at Inline time. FIXME- Overrides:
getReturnTypein classProcedure
-
getModuleClassExp
-
getModuleClassURI
Return an expression that evaluates to a module-relative URL. This has the Kawa-specific URL scheme "class-resource:" and an associated ClassLoader (using a WeakHashMap). It's used to reference resources located using the compiled class's ClassLoader. -
classResourcePath
-