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

Collection of functions to generate C code to declare methods. More...

Static Public Member Functions

static void generateMacrosForMethods (TypeParameterizedReactor tpr, CodeBuilder body)
 Generate macro definitions for methods.
static void generateMacroUndefsForMethods (Reactor reactor, CodeBuilder body)
 Generate macro undefinitions for methods.
static String generateMethod (Method method, TypeParameterizedReactor tpr, CTypes types, boolean suppressLineDirectives)
 Generate a method function definition for a reactor.
static void generateMethods (TypeParameterizedReactor tpr, CodeBuilder code, CTypes types, boolean suppressLineDirectives)
 Generate method functions definition for a reactor.
static String generateMethodSignature (Method method, TypeParameterizedReactor tpr, CTypes types)
 Generate a method function signature for a reactor.
static void signatures (TypeParameterizedReactor tpr, CodeBuilder body, CTypes types)
 Generate function signatures for methods.

Detailed Description

Collection of functions to generate C code to declare methods.

Author
Edward A. Lee

Member Function Documentation

◆ generateMacrosForMethods()

void org.lflang.generator.c.CMethodGenerator.generateMacrosForMethods ( TypeParameterizedReactor tpr,
CodeBuilder body )
static

Generate macro definitions for methods.

Parameters
tprThe reactor.
bodyThe place to put the macro definitions.

◆ generateMacroUndefsForMethods()

void org.lflang.generator.c.CMethodGenerator.generateMacroUndefsForMethods ( Reactor reactor,
CodeBuilder body )
static

Generate macro undefinitions for methods.

Parameters
reactorThe reactor.
bodyThe place to put the macro definitions.

◆ generateMethod()

String org.lflang.generator.c.CMethodGenerator.generateMethod ( Method method,
TypeParameterizedReactor tpr,
CTypes types,
boolean suppressLineDirectives )
static

Generate a method function definition for a reactor.

This function will have a first argument that is a void* pointing to the self struct, followed by any arguments given in its definition.

Parameters
methodThe method.
tprThe concrete reactor class.
typesThe C-specific type conversion functions.
suppressLineDirectivesWhether to suppress the generation of line directives.

◆ generateMethods()

void org.lflang.generator.c.CMethodGenerator.generateMethods ( TypeParameterizedReactor tpr,
CodeBuilder code,
CTypes types,
boolean suppressLineDirectives )
static

Generate method functions definition for a reactor.

These functions have a first argument that is a void* pointing to the self struct.

Parameters
tprThe reactor.
codeThe place to put the code.
typesThe C-specific type conversion functions.
suppressLineDirectivesWhether to suppress the generation of line directives.

◆ generateMethodSignature()

String org.lflang.generator.c.CMethodGenerator.generateMethodSignature ( Method method,
TypeParameterizedReactor tpr,
CTypes types )
static

Generate a method function signature for a reactor.

This function will have a first argument that is a void* pointing to the self struct, followed by any arguments given in its definition.

Parameters
methodThe method.
tprThe reactor declaration.
typesThe C-specific type conversion functions.

◆ signatures()

void org.lflang.generator.c.CMethodGenerator.signatures ( TypeParameterizedReactor tpr,
CodeBuilder body,
CTypes types )
static

Generate function signatures for methods.

This can be used to declare all the methods with signatures only before giving the full definition so that methods may call each other (and themselves) regardless of the order of definition.

Parameters
tprThe reactor declaration.
bodyThe code builder for the body.
typesThe C-specific type conversion functions.

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