Package ortus.boxlang.compiler
Class Boxpiler
java.lang.Object
ortus.boxlang.compiler.Boxpiler
- All Implemented Interfaces:
IBoxpiler
- Direct Known Subclasses:
ASMBoxpiler,JavaBoxpiler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PathThe directory where the generated classes are storedKeeps track of the classes we've compiledprotected DiskClassUtilThe disk class utilprotected FRTransServiceThe transaction service used to track subtransactionsprotected static final org.slf4j.LoggerLoggerFields inherited from interface ortus.boxlang.compiler.IBoxpiler
RESERVED_WORDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompileClass(String source, BoxSourceType type) Compile a BoxLang Class from source into a Java classcompileClass(ResolvedFilePath resolvedFilePath) Compile a BoxLang Class from a file into a Java classcompileInterfaceProxy(IBoxContext context, InterfaceProxyDefinition definition) compileScript(String source, BoxSourceType type) Compile a BoxLang script into a Java classcompileStatement(String source, BoxSourceType type) Compile a single BoxLang statement into a Java classcompileTemplate(ResolvedFilePath resolvedFilePath) Compile a BoxLang template (file on disk) into a Java class-------------------------------------------------------------------------- Public Methods --------------------------------------------------------------------------Parse a file on disk into BoxLang AST nodes.parse(String source, BoxSourceType type, Boolean classOrInterface) Parse source text into BoxLang AST nodes.parseOrFail(File file) Parse a file on disk into BoxLang AST nodes.parseOrFail(String source, BoxSourceType type, Boolean classOrInterface) Parse source text into BoxLang AST nodes.validateParse(ParsingResult result, String source) Validate a parsing result and throw an exception if the parse failed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ortus.boxlang.compiler.IBoxpiler
compileClassInfo, compileTemplateBytes, generateJavaSource
-
Field Details
-
logger
protected static final org.slf4j.Logger loggerLogger -
classPool
Keeps track of the classes we've compiled -
frTransService
The transaction service used to track subtransactions -
diskClassUtil
The disk class util -
classGenerationDirectory
The directory where the generated classes are stored
-
-
Constructor Details
-
Boxpiler
public Boxpiler()
-
-
Method Details
-
getClassPool
-------------------------------------------------------------------------- Public Methods --------------------------------------------------------------------------- Specified by:
getClassPoolin interfaceIBoxpiler
-
parse
Parse source text into BoxLang AST nodes. This method will NOT throw an exception if the parse fails. -
parseOrFail
Parse a file on disk into BoxLang AST nodes. This method will throw an exception if the parse fails.- Specified by:
parseOrFailin interfaceIBoxpiler- Parameters:
file- The file to parse- Returns:
- The parsed AST nodes and any issues if encountered while parsing.
-
parse
Parse a file on disk into BoxLang AST nodes. This method will NOT throw an exception if the parse fails. -
parseOrFail
Parse source text into BoxLang AST nodes. This method will throw an exception if the parse fails.- Specified by:
parseOrFailin interfaceIBoxpiler- Parameters:
source- The source to parse.type- The BoxSourceType of the source.- Returns:
- The parsed AST nodes and any issues if encountered while parsing.
-
validateParse
Validate a parsing result and throw an exception if the parse failed.- Specified by:
validateParsein interfaceIBoxpiler- Parameters:
result- The parsing result to validate- Returns:
- The parsing result if the parse was successful
-
compileStatement
Compile a single BoxLang statement into a Java class- Specified by:
compileStatementin interfaceIBoxpiler- Parameters:
source- The BoxLang source code as a stringtype- The type of BoxLang source code- Returns:
- The loaded class
-
compileScript
Compile a BoxLang script into a Java class- Specified by:
compileScriptin interfaceIBoxpiler- Parameters:
source- The BoxLang source code as a stringtype- The type of BoxLang source code- Returns:
- The loaded class
-
compileTemplate
Compile a BoxLang template (file on disk) into a Java class- Specified by:
compileTemplatein interfaceIBoxpiler- Parameters:
resolvedFilePath- The BoxLang source code as a Path on disk- Returns:
- The loaded class
-
compileClass
Compile a BoxLang Class from source into a Java class- Specified by:
compileClassin interfaceIBoxpiler- Parameters:
source- The BoxLang source code as a string- Returns:
- The loaded class
-
compileClass
Compile a BoxLang Class from a file into a Java class- Specified by:
compileClassin interfaceIBoxpiler- Parameters:
resolvedFilePath- The BoxLang source code as a Path on disk- Returns:
- The loaded class
-
compileInterfaceProxy
public Class<IProxyRunnable> compileInterfaceProxy(IBoxContext context, InterfaceProxyDefinition definition) - Specified by:
compileInterfaceProxyin interfaceIBoxpiler
-
getSourceMapFromFQN
- Specified by:
getSourceMapFromFQNin interfaceIBoxpiler
-