protected abstract class JavaToJavaScriptCompiler.Precompiler extends Object
Modifier and Type | Field and Description |
---|---|
protected String[] |
entryPointTypeNames |
protected RebindPermutationOracle |
rpo |
Constructor and Description |
---|
Precompiler(RebindPermutationOracle rpo,
String[] entryPointTypeNames) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
beforeUnifyAst(Set<String> allRootTypes) |
protected abstract void |
checkEntryPoints(String[] additionalRootTypes) |
protected abstract void |
createJProgram(CompilerContext compilerContext) |
protected UnifiedAst |
precompile(String[] additionalRootTypes,
boolean singlePermutation,
PrecompilationMetricsArtifact precompilationMetrics)
Takes as input a CompilationState and transforms that into a unified by not yet resolved Java
AST (a Java AST wherein cross-class references have been connected and all rebind result
classes are available and have not yet been pruned down to the set applicable for a
particular permutation).
|
protected RebindPermutationOracle rpo
protected String[] entryPointTypeNames
public Precompiler(RebindPermutationOracle rpo, String[] entryPointTypeNames)
protected abstract void beforeUnifyAst(Set<String> allRootTypes) throws UnableToCompleteException
UnableToCompleteException
protected abstract void checkEntryPoints(String[] additionalRootTypes)
protected abstract void createJProgram(CompilerContext compilerContext)
protected final UnifiedAst precompile(String[] additionalRootTypes, boolean singlePermutation, PrecompilationMetricsArtifact precompilationMetrics) throws UnableToCompleteException
1. initialize local state 2. assert preconditions 3. construct and unify the unresolved Java AST 4. normalize the unresolved Java AST // arguably should be removed 5. optimize the unresolved Java AST // arguably should be removed 6. construct and return a valueThere are some other types of work here (mostly metrics and data gathering) which do not serve the goal of output program construction. This work should really be moved into subclasses or some sort of callback or plugin system so as not to visually pollute the real compile logic.
UnableToCompleteException
Copyright © 2018. All rights reserved.