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 they cannot be nested and the identifier must be 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.

Grammar

annotation → INDENT "." IDENTIFIER ":" (STRING | REAL | INT | "true" | "false")