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

Directive to specify the platform for cross code generation. More...

Inherits org.lflang.target.property.TargetProperty< PlatformOptions, UnionType >.

Classes

enum  PlatformOption
 Platform options. More...

Public Member Functions

Optional< Element > astElementFromConfig (TargetConfig config)
boolean checkType (KeyValuePair pair, MessageReporter reporter)
 If the given key-value pair does not match the type required by this target property, report an error through the given reporter.
boolean equals (Object obj)
 Return true if the given object is an instance of a class with the same name.
PlatformOptions fromAst (Element node, MessageReporter reporter)
int hashCode ()
PlatformOptions initialValue ()
boolean loadFromFederate ()
 Return true if this property is to be loaded from imported federates, false otherwise.
boolean loadFromFederation ()
 Return true if this property is to be loaded by federates when specified at the level of the federation, false otherwise.
boolean loadFromImport ()
 Return true if this property is to be loaded from imported files, false otherwise.
String name ()
record Option< T > (boolean setByUser, T value)
 Keep track of whether a value was set by user or not.
final void override (TargetConfig config, T value)
 Replace the value assigned to this target property in the given config with the given value.
record PlatformOptions (Platform platform, Option< String > board, Option< String > port, Option< Integer > baudRate, Option< Boolean > flash, Option< Integer > userThreads)
 Settings related to Platform Options.
Element toAstElement (PlatformOptions value)
abstract Element toAstElement (T value)
 Return an AST node that represents this target property and the value currently assigned to it.
String toString ()
void update (TargetConfig config, T value)
 Update the given configuration using the given value.
void validate (TargetConfig config, MessageReporter reporter)

Public Attributes

final S type
 The type of values assignable to this target property.

Static Public Attributes

static final PlatformProperty INSTANCE = new PlatformProperty()
 Singleton target property instance.

Protected Member Functions

fromJSON (JsonElement element, MessageReporter reporter)
 Return a value based on the given JSON element.
PlatformOptions fromString (String string, MessageReporter reporter)

Detailed Description

Directive to specify the platform for cross code generation.

This is either a string of the platform or a dictionary of options that includes the string name.

Member Function Documentation

◆ astElementFromConfig()

Optional< Element > org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.astElementFromConfig ( TargetConfig config)
inherited

◆ checkType()

boolean org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.checkType ( KeyValuePair pair,
MessageReporter reporter )
inherited

If the given key-value pair does not match the type required by this target property, report an error through the given reporter.

Parameters
pairThe ast node that matches this target property.
reporterThe reporter to issue an error through if the given key-value pair does not match the type required by this property.

◆ equals()

boolean org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.equals ( Object obj)
inherited

Return true if the given object is an instance of a class with the same name.

Parameters
objThe object to compare this instance to.

◆ fromAst()

PlatformOptions org.lflang.target.property.PlatformProperty.fromAst ( Element node,
MessageReporter reporter )

◆ fromJSON()

T org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.fromJSON ( JsonElement element,
MessageReporter reporter )
protectedinherited

Return a value based on the given JSON element.

Parameters
elementThe JSON element to produce a value from/
reporterA message reporter for reporting issues.

◆ fromString()

PlatformOptions org.lflang.target.property.PlatformProperty.fromString ( String string,
MessageReporter reporter )
protected

◆ hashCode()

int org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.hashCode ( )
inherited

◆ initialValue()

PlatformOptions org.lflang.target.property.PlatformProperty.initialValue ( )

◆ loadFromFederate()

boolean org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.loadFromFederate ( )
inherited

Return true if this property is to be loaded from imported federates, false otherwise.

◆ loadFromFederation()

boolean org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.loadFromFederation ( )
inherited

Return true if this property is to be loaded by federates when specified at the level of the federation, false otherwise.

◆ loadFromImport()

boolean org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.loadFromImport ( )
inherited

Return true if this property is to be loaded from imported files, false otherwise.

◆ name()

String org.lflang.target.property.PlatformProperty.name ( )

◆ Option< T >()

record org.lflang.target.property.PlatformProperty.Option< T > ( boolean setByUser,
T value )

Keep track of whether a value was set by user or not.

◆ override()

final void org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.override ( TargetConfig config,
T value )
inherited

Replace the value assigned to this target property in the given config with the given value.

Parameters
configThe configuration to change.
valueThe new value to assign.

◆ PlatformOptions()

record org.lflang.target.property.PlatformProperty.PlatformOptions ( Platform platform,
Option< String > board,
Option< String > port,
Option< Integer > baudRate,
Option< Boolean > flash,
Option< Integer > userThreads )

Settings related to Platform Options.

Parameters
platformThe base platform we build our LF Files on. Should be set to AUTO by default unless developing for specific OS/Embedded Platform
boardThe string value used to determine what type of embedded board we work with and can be used to simplify the build process. This string has the form "board_name[:option]*" (zero or more options separated by colons). For example, "pico:usb" specifies a Raspberry Pi Pico where stdin and stdout go through a USB serial port.
portThe string value used to determine the port on which to flash the compiled program (i.e. /dev/cu.usbmodem21301)
baudRateThe baud rate used as a parameter to certain embedded platforms. 9600 is a standard rate amongst systems like Arduino, so it's the default value.
flashWhether we should automatically attempt to flash once we compile. This may require the use of board and port values depending on the infrastructure you use to flash the boards.
userThreadsThe number of threads requested by the user.

◆ toAstElement() [1/2]

Element org.lflang.target.property.PlatformProperty.toAstElement ( PlatformOptions value)

◆ toAstElement() [2/2]

abstract Element org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.toAstElement ( T value)
abstractinherited

Return an AST node that represents this target property and the value currently assigned to it.

◆ toString()

String org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.toString ( )
inherited

◆ update()

void org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.update ( TargetConfig config,
T value )
inherited

Update the given configuration using the given value.

The default implementation simply assigns the given value, overriding whatever value might have been assigned before.

Parameters
configThe configuration to update.
valueThe value to perform the update with.

◆ validate()

void org.lflang.target.property.PlatformProperty.validate ( TargetConfig config,
MessageReporter reporter )

Member Data Documentation

◆ INSTANCE

final PlatformProperty org.lflang.target.property.PlatformProperty.INSTANCE = new PlatformProperty()
static

Singleton target property instance.

◆ type

final S org.lflang.target.property.TargetProperty< T, S extends TargetPropertyType >.type
inherited

The type of values assignable to this target property.


The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/target/property/PlatformProperty.java