A validator for generated Python code.
More...
Inherits org.lflang.generator.Validator.
A validator for generated Python code.
- Author
- Peter Donovan
◆ PythonValidator()
| org.lflang.generator.python.PythonValidator.PythonValidator |
( |
FileConfig | fileConfig, |
|
|
MessageReporter | messageReporter, |
|
|
Map< Path, CodeMap > | codeMaps, |
|
|
Set< String > | protoNames ) |
Initialize a PythonValidator for a build process using fileConfig and report errors to errorReporter.
- Parameters
-
| fileConfig | The file configuration of this build. |
| messageReporter | The reporter to which diagnostics should be sent. |
| codeMaps | A mapping from generated file paths to code maps that map them back to LF sources. |
| protoNames | The names of any protocol buffer message types that are used in the LF program being built. |
◆ doValidate()
| final void org.lflang.generator.Validator.doValidate |
( |
LFGeneratorContext | context | ) |
throws ExecutionException, InterruptedException |
|
inherited |
Validate this Validator's group of generated files.
- Parameters
-
| context | The context of the current build. |
◆ getBuildReportingStrategies()
| Pair< Strategy, Strategy > org.lflang.generator.python.PythonValidator.getBuildReportingStrategies |
( |
| ) |
|
|
protected |
◆ getPossibleStrategies()
| Collection< ValidationStrategy > org.lflang.generator.python.PythonValidator.getPossibleStrategies |
( |
| ) |
|
|
protected |
List all validation strategies that exist for the Python validator.
- Returns
- A collection of validation strategies.
Try to report a typical error message from the Python compiler.
- Parameters
-
| lines | The lines of output from the compiler. |
| i | The current index at which a message may start. Guaranteed to be less than lines.length - 3. |
- Returns
- Whether an error message was reported.
Try to report an alternative error message from the Python compiler.
- Parameters
-
| lines | The lines of output from the compiler. |
| i | The current index at which a message may start. |
Return whether the given message should be ignored.
- Parameters
-
| message | A Pylint message that is a candidate to be reported. |
- Returns
- whether message should be reported.
Make a best-effort attempt to place the diagnostic on the correct line.
Reimplemented from org.lflang.generator.Validator.
◆ run()
| final int org.lflang.generator.Validator.run |
( |
LFCommand | command, |
|
|
CancelIndicator | cancelIndicator ) |
|
inherited |
Run the given command, report any messages produced using the reporting strategies given by getBuildReportingStrategies, and return its return code.
◆ validationEnabledByDefault()
| boolean org.lflang.generator.Validator.validationEnabledByDefault |
( |
LFGeneratorContext | context | ) |
|
|
protectedinherited |
Return whether validation of generated code is enabled by default.
- Parameters
-
| context | The context of the current build. |
- Returns
- Whether validation of generated code is enabled by default.
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/python/PythonValidator.java