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

Generates C code to declare and initialize ports. More...

Static Public Member Functions

static String generateAuxiliaryStruct (TypeParameterizedReactor tpr, Port port, Target target, MessageReporter messageReporter, CTypes types, CodeBuilder federatedExtension, boolean userFacing, ReactorDecl decl)
 Generate the struct type definitions for the port of the reactor.
static void generateDeclarations (TypeParameterizedReactor tpr, ReactorDecl decl, CodeBuilder body, CodeBuilder constructorCode)
 Generate fields in the self struct for input and output ports.
static String initializeInputMultiport (PortInstance input, String reactorSelfStruct)
 Allocate memory for the input port.
static String initializeOutputMultiport (PortInstance output, String reactorSelfStruct, CTypes types)
 Allocate memory for the output port.
static String localPortName (TypeParameterizedReactor tpr, ReactorDecl decl, String portName)

Detailed Description

Generates C code to declare and initialize ports.

Author
Edward A. Lee
Soroush Bateni
Hou Seng Wong

Member Function Documentation

◆ generateAuxiliaryStruct()

String org.lflang.generator.c.CPortGenerator.generateAuxiliaryStruct ( TypeParameterizedReactor tpr,
Port port,
Target target,
MessageReporter messageReporter,
CTypes types,
CodeBuilder federatedExtension,
boolean userFacing,
ReactorDecl decl )
static

Generate the struct type definitions for the port of the reactor.

Parameters
tprThe reactor
portThe port to generate the struct
targetThe target of the code generation (C, CCpp or Python)
messageReporterThe error reporter
typesThe helper object for types related stuff
federatedExtensionThe code needed to support federated execution
userFacingWhether this struct is to be presented in a user-facing header
declThe reactorDecl if this struct is for the header of this reactor's container; null otherwise
Returns
The auxiliary struct for the port as a string

◆ generateDeclarations()

void org.lflang.generator.c.CPortGenerator.generateDeclarations ( TypeParameterizedReactor tpr,
ReactorDecl decl,
CodeBuilder body,
CodeBuilder constructorCode )
static

Generate fields in the self struct for input and output ports.

◆ initializeInputMultiport()

String org.lflang.generator.c.CPortGenerator.initializeInputMultiport ( PortInstance input,
String reactorSelfStruct )
static

Allocate memory for the input port.

Parameters
inputThe input port
reactorSelfStructThe name of the self struct

◆ initializeOutputMultiport()

String org.lflang.generator.c.CPortGenerator.initializeOutputMultiport ( PortInstance output,
String reactorSelfStruct,
CTypes types )
static

Allocate memory for the output port.

Parameters
outputThe output port
reactorSelfStructThe name of the self struct
typesThe C-specific type conversion functions.

◆ localPortName()

String org.lflang.generator.c.CPortGenerator.localPortName ( TypeParameterizedReactor tpr,
ReactorDecl decl,
String portName )
static

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/c/CPortGenerator.java