Class CompilerPhase
java.lang.Object
org.ek9lang.compiler.CompilerPhase
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
- Direct Known Subclasses:
CodeGenerationAggregates, CodeGenerationApplications, CodeGenerationConstants, CodeGenerationPreparation, CodeOptimisation, IRAnalysis, IRGenerator, IROptimisation, ModuleDuplicateSymbolChecks, NonInferredTypeDefinition, Packaging, PackagingPostProcessing, PluginLinkage, PluginResolution, PostSymbolResolutionChecks, PreIntermediateRepresentationChecks, ReferenceChecks, SymbolDefinition, SymbolicAnalysis, SymbolResolution, TypeHierarchyChecks
public abstract class CompilerPhase
extends Object
implements BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
Marks the specific activity of a compiler phase.
Provides mechanism to pass both phase and the compiler flags into the compilable program.
This then enables them to be accessed within other components during compilation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SharedThreadContext<CompilableProgram> protected final Consumer<CompilationEvent> protected final booleanIs the symbol model already complete and read-only by the time this phase runs?protected final CompilerReporter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompilerPhase(CompilationPhase phase, SharedThreadContext<CompilableProgram> compilableProgramAccess, Consumer<CompilationEvent> listener, CompilerReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionapply(Workspace workspace, CompilerFlags compilerFlags) protected abstract booleandoApply(Workspace workspace, CompilerFlags compilerFlags) Do the compilation phase.protected ParsedModuleMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Field Details
-
listener
-
reporter
-
compilableProgramAccess
-
modelFrozen
protected final boolean modelFrozenIs the symbol model already complete and read-only by the time this phase runs?A plain
finalfield, fixed when the phase is constructed, because the answer is a static property of where the phase sits in the pipeline - seeCompilationPhase.isModelFrozen(). There is deliberately no setter and no flag to maintain: nothing can set it late, clear it early, or forget to. A post-freeze phase reads a model nobody writes to, so it needs neither the lock nor any other synchronisation, and all of its threads may read concurrently.
-
-
Constructor Details
-
Method Details
-
doApply
Do the compilation phase. -
apply
- Specified by:
applyin interfaceBiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
-
getParsedModuleForSource
-