DiscoverLearnDocumentationGet OpenPLXSearch Contact

Annotation syntax

Non-typed meta data can be added to a model via annotations, these can be used for more advanced usecases to specify runtime specific data etc. but the main usecase is to provide documentation to a model. An annotation is similar to an assignment but prefixed by a dot (.).

ModelWithDocString:
    .doc: """
This is my model with an annotation
"""
    x is Real: 1.0

ModelWithGenericAnnotation:
    .metadata: 42.0
    foo is Int: 3

The right hand side of an annotation must be a simple constant expression and references to other variables/annotations are not supported.

They can also be nested under attributes.

Model:
    my_attribute is Foo:
        .metadata: "I am nested under my_attribute"

Grammar

annotation → INDENT "." IDENTIFIER ":" (STRING | REAL | INT | "true" | "false")
OpenPLX is a work in progress. This draft version will evolve with user feedback and experience. We welcome your input and collaboration.
X