Compilation Context
A CompilationContext lasts for a module's entire compilation activity.
Author
Mark van Gulik
Parameters
The module header of the module to compile. May be null for synthetic modules (for entry points), or when parsing the header.
The current module.`
The source A_String.
The text interface for any fibers started by this compiler.
How to quickly check if the client wants to abort compilation.
How to report progress to the client who instigated compilation. This continuation that accepts the name of the module undergoing compilation, the line number on which the last complete statement concluded, the position of the ongoing parse (in bytes), and the size of the module (in bytes).
The ProblemHandler used for reporting compilation problems.
Constructors
Create a CompilationContext for compiling an A_Module.
Types
Functions
Attempt the zero-argument continuation. The implementation is free to execute it now or to put it in a bag of continuations to run later in an arbitrary order. There may be performance and/or scale benefits to processing entries in FIFO, LIFO, or some hybrid order, but the correctness is not affected by a choice of order. The implementation may run the expression in parallel with the invoking thread and other such expressions.
Record the fact that this token was encountered while parsing the current top-level statement.
Start N work units, which are about to be queued.
Construct and answer a function that wraps the specified continuation in logic that will increment the count of completed work units and potentially call the unambiguous statement.
Eventually execute the specified List of functions as compiler work units. Note that the queued work unit count must be increased by the full amount up-front to ensure the completion of the first N tasks before the N+1st can be queued doesn't trigger execution of noMoreWorkUnits. Each continuation will be passed the same given argument.
Properties
The CompilerDiagnostics that tracks potential errors during compilation.
The CompilerProgressReporter that reports compilation progress at various checkpoints. It accepts the name of the module undergoing compilation, the line number on which the last complete statement concluded, the position of the ongoing parse (in bytes), and the size of the module (in bytes).
The AvailRuntime for the compiler. Since a compiler cannot migrate between two runtime environments, it is safe to cache it for efficient access.
The text interface for any fibers started by this compiler.