An LFGeneratorContext that is not nested in any other generator context.
More...
Inherits org.lflang.generator.LFGeneratorContext.
|
| default void | finish (GeneratorResult.Status status, Map< Path, CodeMap > codeMaps) |
| | Conclude this build and record the result if necessary.
|
| void | finish (GeneratorResult result) |
| | Mark the code generation process performed in this context as finished with the result result.
|
| GeneratorArguments | getArgs () |
| | Return any arguments that will override target properties.
|
| CancelIndicator | getCancelIndicator () |
| MessageReporter | getErrorReporter () |
| | Get the error reporter for this context; construct one if it hasn't been constructed yet.
|
| FileConfig | getFileConfig () |
| Mode | getMode () |
| | Return the mode of operation, which indicates how the compiler has been invoked (e.g., from within Epoch, from the command line, or via a Language Server).
|
| GeneratorResult | getResult () |
| | Return the result of the code generation process that was performed in this context.
|
| TargetConfig | getTargetConfig () |
| default boolean | isCleanRequested () |
| | Return true if the user requested a clean build in this context.
|
| void | loadTargetConfig () |
| | Load the target configuration based on the contents of the resource.
|
| | MainContext (Mode mode, CancelIndicator cancelIndicator, ReportProgress reportProgress, GeneratorArguments args, Resource resource, IFileSystemAccess2 fsa, Function< FileConfig, MessageReporter > constructErrorReporter) |
| | Initialize the context of a build process whose cancellation is indicated by cancelIndicator.
|
| | MainContext (Mode mode, Resource resource, IFileSystemAccess2 fsa, CancelIndicator cancelIndicator) |
| | Initialize the context of a build process whose cancellation is indicated by cancelIndicator.
|
| void | reportProgress (String message, int percentage) |
| | Report the progress of a build.
|
| default void | unsuccessfulFinish () |
| | Conclude this build and record that it was unsuccessful.
|
An LFGeneratorContext that is not nested in any other generator context.
There is one MainContext for every build process.
- Author
- Peter Donovan
◆ MainContext() [1/2]
| org.lflang.generator.MainContext.MainContext |
( |
Mode | mode, |
|
|
Resource | resource, |
|
|
IFileSystemAccess2 | fsa, |
|
|
CancelIndicator | cancelIndicator ) |
Initialize the context of a build process whose cancellation is indicated by cancelIndicator.
- Parameters
-
| mode | The mode of this build process. |
| resource | The resource being processed. |
| fsa | The file system access. |
| cancelIndicator | The cancel indicator of the code generation process to which this corresponds. |
◆ MainContext() [2/2]
Initialize the context of a build process whose cancellation is indicated by cancelIndicator.
- Parameters
-
| mode | The mode of this build process. |
| cancelIndicator | The cancel indicator of the code generation process to which this corresponds. |
| reportProgress | The ReportProgress function of this. |
| args | Any arguments that may be used to affect the product of the build. |
| resource | ... |
| fsa | ... |
| constructErrorReporter | A function that constructs the appropriate error reporter for the given FileConfig. |
◆ finish() [1/2]
Conclude this build and record the result if necessary.
- Parameters
-
| status | The status of the result. |
| codeMaps | The generated files and their corresponding code maps. |
◆ finish() [2/2]
Mark the code generation process performed in this context as finished with the result result.
- Parameters
-
| result | The result of the code generation process that was performed in this context. |
Implements org.lflang.generator.LFGeneratorContext.
◆ getArgs()
◆ getCancelIndicator()
| CancelIndicator org.lflang.generator.MainContext.getCancelIndicator |
( |
| ) |
|
◆ getErrorReporter()
◆ getFileConfig()
| FileConfig org.lflang.generator.MainContext.getFileConfig |
( |
| ) |
|
◆ getMode()
| Mode org.lflang.generator.MainContext.getMode |
( |
| ) |
|
Return the mode of operation, which indicates how the compiler has been invoked (e.g., from within Epoch, from the command line, or via a Language Server).
Implements org.lflang.generator.LFGeneratorContext.
◆ getResult()
Return the result of the code generation process that was performed in this context.
- Returns
- the result of the code generation process that was performed in this context
Implements org.lflang.generator.LFGeneratorContext.
◆ getTargetConfig()
| TargetConfig org.lflang.generator.MainContext.getTargetConfig |
( |
| ) |
|
◆ isCleanRequested()
| default boolean org.lflang.generator.LFGeneratorContext.isCleanRequested |
( |
| ) |
|
|
inherited |
◆ lfGeneratorContextOf()
| LFGeneratorContext org.lflang.generator.LFGeneratorContext.lfGeneratorContextOf |
( |
Resource | resource, |
|
|
IFileSystemAccess2 | fsa, |
|
|
IGeneratorContext | context ) |
|
staticinherited |
Return the LFGeneratorContext that best describes the given context when building Resource.
- Parameters
-
| resource | |
| fsa | |
| context | The context of a Lingua Franca build process. |
- Returns
- The LFGeneratorContext that best describes the given context when building Resource.
◆ loadTargetConfig()
| void org.lflang.generator.MainContext.loadTargetConfig |
( |
| ) |
|
Load the target configuration based on the contents of the resource.
This is done automatically upon instantiation of the context, but in case the resource changes (e.g., due to an AST transformation), this method can be called to reload to ensure that the changes are reflected in the target configuration.
◆ reportProgress()
| void org.lflang.generator.MainContext.reportProgress |
( |
String | message, |
|
|
int | percentage ) |
Report the progress of a build.
- Parameters
-
| message | A message for the LF programmer to read. |
| percentage | The approximate percent completion of the build. |
Implements org.lflang.generator.LFGeneratorContext.
◆ unsuccessfulFinish()
| default void org.lflang.generator.LFGeneratorContext.unsuccessfulFinish |
( |
| ) |
|
|
inherited |
Conclude this build and record that it was unsuccessful.
◆ EPOCH_ERROR_REPORTER_CONSTRUCTOR
This constructor will be set by the LF plugin, if the generator is running in Epoch.
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/MainContext.java