public interface ISelfCompiled
ITypeManifold.contribute(javax.tools.JavaFileManager.Location, java.lang.String, boolean, java.lang.String, javax.tools.DiagnosticListener<javax.tools.JavaFileObject>)
is typically a stub limited to
member declarations. So, instead of using javac to compile your source to disk, you use it
to parse your stub to allow other types to make references to your type. But the bytecode for
your type comes from your implementation of compile(String)
.Modifier and Type | Method and Description |
---|---|
default byte[] |
compile(String fqn)
Instructs a self-compiling type manifold to compile
fqn and return resulting Java byte-code. |
default boolean |
isSelfCompile(String fqn)
Tests if a type
fqn is self-compiled where subsequent calls to parse(String)
and compile(String) are necessary to compile the type to bytecode. |
default void |
parse(String fqn)
Signal this type manifold to fully parse the type corresponding with
fqn and attach parse errors/warnings
to the source file, for example using IssueReporter <JavaFileObject >. |
default boolean isSelfCompile(String fqn)
fqn
is self-compiled where subsequent calls to parse(String)
and compile(String)
are necessary to compile the type to bytecode.
fqn
- The fully qualified name of the type.true
if the type corresponding with fqn
is self-compiled.default void parse(String fqn)
fqn
and attach parse errors/warnings
to the source file, for example using IssueReporter
<JavaFileObject
>.
For instance, the Gosu language manifold has its own bytecode compiler and handles this
call by fully parsing fqn
. Note this call is made immediately before the Java
compiler's attribution phase, which makes it ok for member definitions and such to fully
resolve.fqn
- The fully qualified name of the type to parse.default byte[] compile(String fqn)
fqn
and return resulting Java byte-code. Note this call
is only made if no errors were attached during parse(String)
.fqn
- The fully qualified name of the type to compile.Copyright © 2024. All rights reserved.