lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.LFGeneratorContext Interface Reference

The context of a Lingua Franca build process. More...

Inherits IGeneratorContext.

Inherited by org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

Classes

enum  Mode

Public Member Functions

void finish (GeneratorResult result)
 Mark the code generation process performed in this context as finished with the result result.
default void finish (GeneratorResult.Status status, Map< Path, CodeMap > codeMaps)
 Conclude this build and record the result if necessary.
GeneratorArguments getArgs ()
 Return any arguments that will override target properties.
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 reportProgress (String message, int percentage)
 Report the progress of a build.
default void unsuccessfulFinish ()
 Conclude this build and record that it was unsuccessful.

Static Public Member Functions

static LFGeneratorContext lfGeneratorContextOf (Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context)
 Return the LFGeneratorContext that best describes the given context when building Resource.

Detailed Description

The context of a Lingua Franca build process.

It is the point of communication between a build process and the environment in which it is executed.

Author
Peter Donovan

Member Function Documentation

◆ finish() [1/2]

void org.lflang.generator.LFGeneratorContext.finish ( GeneratorResult result)

Mark the code generation process performed in this context as finished with the result result.

Parameters
resultThe result of the code generation process that was performed in this context.

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ finish() [2/2]

default void org.lflang.generator.LFGeneratorContext.finish ( GeneratorResult.Status status,
Map< Path, CodeMap > codeMaps )

Conclude this build and record the result if necessary.

Parameters
statusThe status of the result.
codeMapsThe generated files and their corresponding code maps.

◆ getArgs()

GeneratorArguments org.lflang.generator.LFGeneratorContext.getArgs ( )

Return any arguments that will override target properties.

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ getErrorReporter()

MessageReporter org.lflang.generator.LFGeneratorContext.getErrorReporter ( )

Get the error reporter for this context; construct one if it hasn't been constructed yet.

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ getFileConfig()

FileConfig org.lflang.generator.LFGeneratorContext.getFileConfig ( )

◆ getMode()

Mode org.lflang.generator.LFGeneratorContext.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).

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ getResult()

GeneratorResult 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

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ getTargetConfig()

TargetConfig org.lflang.generator.LFGeneratorContext.getTargetConfig ( )

◆ isCleanRequested()

default boolean org.lflang.generator.LFGeneratorContext.isCleanRequested ( )

Return true if the user requested a clean build in this context.

Implemented in org.lflang.generator.SubContext.

◆ lfGeneratorContextOf()

LFGeneratorContext org.lflang.generator.LFGeneratorContext.lfGeneratorContextOf ( Resource resource,
IFileSystemAccess2 fsa,
IGeneratorContext context )
static

Return the LFGeneratorContext that best describes the given context when building Resource.

Parameters
resource
fsa
contextThe context of a Lingua Franca build process.
Returns
The LFGeneratorContext that best describes the given context when building Resource.

◆ reportProgress()

void org.lflang.generator.LFGeneratorContext.reportProgress ( String message,
int percentage )

Report the progress of a build.

Parameters
messageA message for the LF programmer to read.
percentageThe approximate percent completion of the build.

Implemented in org.lflang.generator.MainContext, and org.lflang.generator.SubContext.

◆ unsuccessfulFinish()

default void org.lflang.generator.LFGeneratorContext.unsuccessfulFinish ( )

Conclude this build and record that it was unsuccessful.


The documentation for this interface was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/LFGeneratorContext.java