Package kawa.standard
Class ImportFromLibrary
- java.lang.Object
-
- kawa.lang.Syntax
-
- kawa.standard.ImportFromLibrary
-
-
Field Summary
Fields Modifier and Type Field Description static String[]classPrefixPathstatic SimpleSymbolclassSymbolstatic SimpleSymbolexceptSymbolstatic ImportFromLibraryinstancestatic SimpleSymbollibrarySymbolstatic SimpleSymbolonlySymbolstatic SimpleSymbolprefixSymbolstatic SimpleSymbolrenameSymbolstatic ThreadLocal<List<CharSequence>>searchPath
-
Constructor Summary
Constructors Constructor Description ImportFromLibrary()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcheckSrfi(String lname, Translator tr)static List<CharSequence>getImportSearchPath()static booleanhandleImport(String implicitSource, String explicitSource, String requestedClass, ScopeExp defs, Translator tr, require.DeclSetMapper mapper)Do the actual work of importing a module.booleanlibraryExists(Object list, Translator tr)Check if library (in r7rs import syntax) exists.ExpressionrewriteForm(Pair form, Translator tr)voidscanForm(Pair st, ScopeExp defs, Translator tr)
-
-
-
Field Detail
-
instance
public static final ImportFromLibrary instance
-
classPrefixPath
public static String[] classPrefixPath
-
searchPath
public static final ThreadLocal<List<CharSequence>> searchPath
-
classSymbol
public static final SimpleSymbol classSymbol
-
exceptSymbol
public static final SimpleSymbol exceptSymbol
-
librarySymbol
public static final SimpleSymbol librarySymbol
-
onlySymbol
public static final SimpleSymbol onlySymbol
-
prefixSymbol
public static final SimpleSymbol prefixSymbol
-
renameSymbol
public static final SimpleSymbol renameSymbol
-
-
Method Detail
-
scanForm
public void scanForm(Pair st, ScopeExp defs, Translator tr)
-
checkSrfi
public static String checkSrfi(String lname, Translator tr)
-
handleImport
public static boolean handleImport(String implicitSource, String explicitSource, String requestedClass, ScopeExp defs, Translator tr, require.DeclSetMapper mapper)
Do the actual work of importing a module.- Parameters:
implicitSource- Source name inferred from library name, with '/' as separator. Does not include a file extension.explicitSource- If non-null, an exlicitly specified source file name.
-
rewriteForm
public Expression rewriteForm(Pair form, Translator tr)
- Overrides:
rewriteFormin classSyntax
-
libraryExists
public boolean libraryExists(Object list, Translator tr)
Check if library (in r7rs import syntax) exists.- Returns:
- if library exists: class name of (existing) library class, or the special BUILTIN value; otherwise null.
-
getImportSearchPath
public static List<CharSequence> getImportSearchPath()
-
-