![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
A helper class that represents an inferred type. More...
Public Member Functions | |
| String | baseType () |
| Convert the inferred type to its textual representation while ignoring any list qualifiers or type arguments. | |
| boolean | isUndefined () |
| Check if the inferred type is undefined. | |
| String | toOriginalText () |
| Convert the inferred type to its textual representation as it would appear in LF code, without CodeMap tags inserted. | |
| String | toText () |
| Convert the inferred type to its textual representation as it would appear in LF code, with CodeMap tags inserted. | |
Static Public Member Functions | |
| static InferredType | fromAST (Type type) |
| Create an inferred type from an AST node. | |
| static InferredType | time () |
| Create an inferred type representing time. | |
| static InferredType | undefined () |
| Create an undefined inferred type. | |
Public Attributes | |
| final Type | astType |
| The AST node representing the inferred type if such a node exists. | |
| final boolean | isTime |
| A flag indicating whether the inferred type has the base type time. | |
A helper class that represents an inferred type.
This class helps to separate the rules of type inference from code generation for types. It is particularly useful in cases when the type is not given directly in LF code, but is inferred from the context. In this case it could happen that no ASTNode representing the type does not exist. For instance when a parameter type is inferred from a time value. All in all, this class provides a clean interface between type inference in ASTUtils and code generation.
ASTUtils provides functionality to create an inferred type from Lingua Franca variables (getInferredType). This inferred type can than be translated to target code using the code generators or be converted to a general textual representation using toText().
| String org.lflang.InferredType.baseType | ( | ) |
Convert the inferred type to its textual representation while ignoring any list qualifiers or type arguments.
|
static |
Create an inferred type from an AST node.
| type | an AST node |
| boolean org.lflang.InferredType.isUndefined | ( | ) |
Check if the inferred type is undefined.
|
static |
Create an inferred type representing time.
| String org.lflang.InferredType.toOriginalText | ( | ) |
Convert the inferred type to its textual representation as it would appear in LF code, without CodeMap tags inserted.
| String org.lflang.InferredType.toText | ( | ) |
Convert the inferred type to its textual representation as it would appear in LF code, with CodeMap tags inserted.
|
static |
Create an undefined inferred type.
| final Type org.lflang.InferredType.astType |
The AST node representing the inferred type if such a node exists.
| final boolean org.lflang.InferredType.isTime |
A flag indicating whether the inferred type has the base type time.