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

Standalone version of the Lingua Franca compiler (lfc). More...

Inherits org.lflang.cli.CliBase.

Classes

class  ThreadingMutuallyExclusive
 Mutually exclusive options related to threading. More...

Public Member Functions

void doExecute (Io io, String[] args)
void doRun ()
 Load the resource, validate it, and, invoke the code generator.
GeneratorArguments getArgs ()
 Check the values of the commandline arguments and return them.
Resource getResource (Path path)
 Obtains a resource from a path.
List< LfIssue > printErrorsIfAny ()
 If any warnings were collected, print them, then return them.
List< LfIssue > printWarningsIfAny ()
 If any warnings were collected, print them, then return them.
void run ()
 The entrypoint of Picocli applications - the first method called when CliBase, which implements the Runnable interface, is instantiated.
void validateResource (Resource resource)
 Validates a given resource.

Static Public Member Functions

static Injector getInjector (String toolName, Io io)
static void main (final String[] args)
 Main function of the stand-alone compiler.
static void main (Io io, final String... args)
 Main function of the standalone compiler, with a custom IO.

Protected Member Functions

void exitIfCollectedErrors ()
 If some errors were collected, print them and abort execution.
List< Path > getInputPaths ()
 Returns the validated input paths.
final JsonObject getJsonObject ()
Path getOutputRoot ()
 Returns the validated, normalized output path.
final boolean stdinMode ()
Path toAbsolutePath (Path other)
 Resolve to an absolute path, in the given io context.

Static Protected Member Functions

static void cliMain (String toolName, Class<? extends CliBase > toolClass, Io io, String[] args)

Protected Attributes

Io io
 IO context of this run.
IssueCollector issueCollector
 Used to collect all errors that happen during validation/generation.
MessageReporter messageReporter
 Used to report error messages at the end.
ReportingBackend reporter
 Used to report error messages at the end.

Package Attributes

CommandSpec spec
 Models a command specification, including the options, positional parameters and subcommands supported by the command.
ThreadingMutuallyExclusive threading
MutuallyExclusive topLevelArg

Detailed Description

Standalone version of the Lingua Franca compiler (lfc).

Author
Marten Lohstroh
Christian Menard
Atharva Patil

Member Function Documentation

◆ cliMain()

void org.lflang.cli.CliBase.cliMain ( String toolName,
Class<? extends CliBase > toolClass,
Io io,
String[] args )
staticprotectedinherited

◆ doExecute()

void org.lflang.cli.CliBase.doExecute ( Io io,
String[] args )
inherited

◆ doRun()

void org.lflang.cli.Lfc.doRun ( )

Load the resource, validate it, and, invoke the code generator.

Reimplemented from org.lflang.cli.CliBase.

◆ exitIfCollectedErrors()

void org.lflang.cli.CliBase.exitIfCollectedErrors ( )
protectedinherited

If some errors were collected, print them and abort execution.

Otherwise, return.

◆ getArgs()

GeneratorArguments org.lflang.cli.Lfc.getArgs ( )

Check the values of the commandline arguments and return them.

◆ getInjector()

Injector org.lflang.cli.CliBase.getInjector ( String toolName,
Io io )
staticinherited

◆ getInputPaths()

List< Path > org.lflang.cli.CliBase.getInputPaths ( )
protectedinherited

Returns the validated input paths.

Returns
Validated input paths.

◆ getJsonObject()

final JsonObject org.lflang.cli.CliBase.getJsonObject ( )
protectedinherited

◆ getOutputRoot()

Path org.lflang.cli.CliBase.getOutputRoot ( )
protectedinherited

Returns the validated, normalized output path.

Returns
Validated, normalized output path.

◆ getResource()

Resource org.lflang.cli.CliBase.getResource ( Path path)
inherited

Obtains a resource from a path.

Returns null if path is not an LF file.

Parameters
pathThe path to obtain the resource from.
Returns
The obtained resource. Set to null if path is not an LF file.

◆ main() [1/2]

void org.lflang.cli.Lfc.main ( final String[] args)
static

Main function of the stand-alone compiler.

Caution: this will invoke System.exit.

Parameters
argsCLI arguments

◆ main() [2/2]

void org.lflang.cli.Lfc.main ( Io io,
final String... args )
static

Main function of the standalone compiler, with a custom IO.

Parameters
ioIO streams.
argsCommand-line arguments.

◆ printErrorsIfAny()

List< LfIssue > org.lflang.cli.CliBase.printErrorsIfAny ( )
inherited

If any warnings were collected, print them, then return them.

Returns
A list of collected errors.

◆ printWarningsIfAny()

List< LfIssue > org.lflang.cli.CliBase.printWarningsIfAny ( )
inherited

If any warnings were collected, print them, then return them.

Returns
A list of collected warnings.

◆ run()

void org.lflang.cli.CliBase.run ( )
inherited

The entrypoint of Picocli applications - the first method called when CliBase, which implements the Runnable interface, is instantiated.

◆ stdinMode()

final boolean org.lflang.cli.CliBase.stdinMode ( )
protectedinherited

◆ toAbsolutePath()

Path org.lflang.cli.CliBase.toAbsolutePath ( Path other)
protectedinherited

Resolve to an absolute path, in the given io context.

◆ validateResource()

void org.lflang.cli.CliBase.validateResource ( Resource resource)
inherited

Validates a given resource.

If issues arise during validation, these are recorded using the issue collector.

Parameters
resourceThe resource to validate.

Member Data Documentation

◆ io

Io org.lflang.cli.CliBase.io
protectedinherited

IO context of this run.

◆ issueCollector

IssueCollector org.lflang.cli.CliBase.issueCollector
protectedinherited

Used to collect all errors that happen during validation/generation.

◆ messageReporter

MessageReporter org.lflang.cli.CliBase.messageReporter
protectedinherited

Used to report error messages at the end.

◆ reporter

ReportingBackend org.lflang.cli.CliBase.reporter
protectedinherited

Used to report error messages at the end.

◆ spec

CommandSpec org.lflang.cli.CliBase.spec
packageinherited

Models a command specification, including the options, positional parameters and subcommands supported by the command.

◆ threading

ThreadingMutuallyExclusive org.lflang.cli.Lfc.threading
package

◆ topLevelArg

MutuallyExclusive org.lflang.cli.CliBase.topLevelArg
packageinherited

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/cli/lfc/src/main/java/org/lflang/cli/Lfc.java