Skip to content

Make default string size configurable in the model #903

@bocchino

Description

@bocchino

The default string size (i.e., the size used for a type string with no size specifier) is unspecified in the model and is hard-set to 80 in the code generator. In theory this size is configurable, but the configuration is brittle and is not used in practice. We should specify the default string size in the model and make it configurable, as follows:

  1. Add a constant FwDefaultStringSize as a framework definition.
  2. Add this constant to the list of constants required by dictionary generation, as specified here: https://fprime.jpl.nasa.gov/latest/docs/reference/fpp-json-dict/#dictionaries.
  3. When generating C++ code or JSON code for string types with default sizes, use the symbolic constant FwDefaultStringSize as the size.
  4. Eliminate the -s option in fpp-to-cpp, which was a workaround for not having this feature.

This feature is required for #725 (sizeof(T) expression). Until we have it, the size of the type string is not specified in the model.

To integrate this change with F Prime, we'll have to add a configuration constant. However, an alpha release of FPP should not be required, since adding this constant to F Prime does not require a change to FPP.

Metadata

Metadata

Assignees

Labels

code generationIssues related to code generationsemanticsIssues related to semanticsspecIssues related to the FPP language specification

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions