Documentation

StrataDDM.AST.Datatype

Datatype Support for DDM #

This module provides datatype-related types and functions for the DDM, including function templates and name pattern expansion. This module is imported by Strata.DDM.AST and its types are re-exported there. Most users should import Strata.DDM.AST rather than this module directly.

Function Template System #

Function templates specify patterns for generating auxiliary functions from datatype declarations. Each template has:

Function Template Types #

Iteration scope for function template expansion.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Type reference in a function specification, used to specify parameter and return types in function templates.

      • datatype : TypeRef

        The datatype being declared

      • fieldType : TypeRef

        The type of the current field

      • builtin (name : String) : TypeRef

        A built-in type like "bool", "int"

      Instances For
        Equations
        Instances For

          A part of a name pattern - either a literal string or a placeholder.

          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              Instances For

                A function template specification. Describes how to generate additional functions based on datatype structure.

                Instances For
                  Equations
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Name Pattern Functions #

                        def StrataDDM.expandNamePattern (pattern : Array NamePatternPart) (datatypeName : String) (constructorName fieldName : Option String := none) :

                        Expand a name pattern with concrete values. Each part is expanded based on its type:

                        • literal s → the literal string s
                        • datatype → the datatype name
                        • constructor → the constructor name (or empty string if not provided)
                        • field → the field name (or empty string if not provided)
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Validate a name pattern for scope compatibility. Returns none if valid, or some errorMessage if invalid.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For