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

Encapsulate data about the correspondence between ranges of generated code and ranges of a Lingua Franca file. More...

Classes

class  Correspondence

Public Member Functions

Position adjusted (Path lfFile, Position generatedFilePosition)
 Returns the position in lfFile corresponding to generatedFilePosition if such a position is known, or the zero Position otherwise.
Range adjusted (Path lfFile, Range generatedFileRange)
 Returns the range in lfFile corresponding to generatedFileRange if such a range is known, or a degenerate Range otherwise.
int firstNonWhitespace (int line)
String getGeneratedCode ()
 Returns the generated code (without Correspondences).
Set< Path > lfSourcePaths ()
 Returns the set of all paths to Lingua Franca files that are known to contain code that corresponds to code in the generated file represented by this.

Static Public Member Functions

static CodeMap fromGeneratedCode (String internalGeneratedCode)
 Instantiate a CodeMap from internalGeneratedCode.

Detailed Description

Encapsulate data about the correspondence between ranges of generated code and ranges of a Lingua Franca file.

Member Function Documentation

◆ adjusted() [1/2]

Position org.lflang.generator.CodeMap.adjusted ( Path lfFile,
Position generatedFilePosition )

Returns the position in lfFile corresponding to generatedFilePosition if such a position is known, or the zero Position otherwise.

Parameters
lfFilethe path to an arbitrary Lingua Franca source file
generatedFilePositiona position in a generated file
Returns
the position in lfFile corresponding to generatedFilePosition

◆ adjusted() [2/2]

Range org.lflang.generator.CodeMap.adjusted ( Path lfFile,
Range generatedFileRange )

Returns the range in lfFile corresponding to generatedFileRange if such a range is known, or a degenerate Range otherwise.

Parameters
lfFilethe path to an arbitrary Lingua Franca source file
generatedFileRangea position in a generated file
Returns
the range in lfFile corresponding to generatedFileRange

◆ firstNonWhitespace()

int org.lflang.generator.CodeMap.firstNonWhitespace ( int line)

◆ fromGeneratedCode()

CodeMap org.lflang.generator.CodeMap.fromGeneratedCode ( String internalGeneratedCode)
static

Instantiate a CodeMap from internalGeneratedCode.

internalGeneratedCode may be invalid code that is different from the final generated code because it should contain deserializable representations of Correspondences.

Parameters
internalGeneratedCodecode from a code generator that contains serialized Correspondences
Returns
a CodeMap documenting the provided code

◆ getGeneratedCode()

String org.lflang.generator.CodeMap.getGeneratedCode ( )

Returns the generated code (without Correspondences).

Returns
the generated code (without Correspondences)

◆ lfSourcePaths()

Set< Path > org.lflang.generator.CodeMap.lfSourcePaths ( )

Returns the set of all paths to Lingua Franca files that are known to contain code that corresponds to code in the generated file represented by this.


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