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

A SubContext is the context of a process within a build process. More...

Inherits org.lflang.generator.LFGeneratorContext.

Public Member Functions

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 ()
 never clean in a sub context
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 ()
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.
 SubContext (LFGeneratorContext containingContext, int startPercentProgress, int endPercentProgress)
 Initializes the context within containingContext of the process that extends from startPercentProgress to endPercentProgress.
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.

Protected Attributes

MessageReporter messageReporter

Detailed Description

A SubContext is the context of a process within a build process.

For example, compilation of generated code may optionally be given a SubContext because compilation is part of a complete build.

Author
Peter Donovan

Constructor & Destructor Documentation

◆ SubContext()

org.lflang.generator.SubContext.SubContext ( LFGeneratorContext containingContext,
int startPercentProgress,
int endPercentProgress )

Initializes the context within containingContext of the process that extends from startPercentProgress to endPercentProgress.

Parameters
containingContextThe context of the containing build process.
startPercentProgressThe percent progress of the containing build process when this nested process starts.
endPercentProgressThe percent progress of the containing build process when this nested process ends.

Member Function Documentation

◆ finish() [1/2]

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

Conclude this build and record the result if necessary.

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

◆ finish() [2/2]

void org.lflang.generator.SubContext.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.

Implements org.lflang.generator.LFGeneratorContext.

◆ getArgs()

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

Return any arguments that will override target properties.

Implements org.lflang.generator.LFGeneratorContext.

◆ getCancelIndicator()

CancelIndicator org.lflang.generator.SubContext.getCancelIndicator ( )

never clean in a sub context

◆ getErrorReporter()

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

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

Implements org.lflang.generator.LFGeneratorContext.

◆ getFileConfig()

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

◆ getMode()

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

GeneratorResult org.lflang.generator.SubContext.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.SubContext.getTargetConfig ( )

◆ isCleanRequested()

boolean org.lflang.generator.SubContext.isCleanRequested ( )

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

Implements org.lflang.generator.LFGeneratorContext.

◆ 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
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.SubContext.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.

Implements org.lflang.generator.LFGeneratorContext.

◆ unsuccessfulFinish()

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

Conclude this build and record that it was unsuccessful.

Member Data Documentation

◆ messageReporter

MessageReporter org.lflang.generator.SubContext.messageReporter
protected

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/SubContext.java