public final class SightlyCompiler
extends java.lang.Object
The SightlyCompiler interprets a HTL script and transforms it internally into a CommandStream. The
CommandStream can be fed to a BackendCompiler for transforming the stream into executable code, either by
transpiling the commands to a JVM supported language or by directly executing them.
| Constructor and Description |
|---|
SightlyCompiler() |
| Modifier and Type | Method and Description |
|---|---|
CompilationResult |
compile(CompilationUnit compilationUnit)
Compiles a
CompilationUnit. |
CompilationResult |
compile(CompilationUnit compilationUnit,
BackendCompiler backendCompiler)
|
static SightlyCompiler |
withKnownExpressionOptions(@NotNull java.util.Set<java.lang.String> options)
Returns an instance of the
SightlyCompiler with the provided options added to the list of known expression options. |
public static SightlyCompiler withKnownExpressionOptions(@NotNull @NotNull java.util.Set<java.lang.String> options)
Returns an instance of the SightlyCompiler with the provided options added to the list of known expression options.
The compiler builds internally a set of allowed options from the options permitted by the expressions or plugins. As soon as an
expression contains an unknown option the compiler logs a warning. Since the compiler works with dynamically registered
RuntimeCalls, some of them can work with additional expression
options, not known to the compiler.
NOTE: The data-sly-template, data-sly-call, data-sly-use plugins allow arbitrary options which define
parameters and do not generate warnings.
options - the options to add to the compiler's set of known expression optionspublic CompilationResult compile(CompilationUnit compilationUnit)
CompilationUnit.compilationUnit - a compilation unitpublic CompilationResult compile(CompilationUnit compilationUnit, BackendCompiler backendCompiler)
compilationUnit - a compilation unitbackendCompiler - the backend compilerCopyright © 2022 The Apache Software Foundation. All rights reserved.