From 413653440b9897abd79dacad78ef3e9730e00ab0 Mon Sep 17 00:00:00 2001 From: Thomas Beale Date: Mon, 15 Sep 2025 13:26:54 -0300 Subject: [PATCH 1/2] Null change rebuild with newer version of Asciidoctor. --- docs/BEL.html | 310 ++++----- docs/EL.html | 1270 +++++++++++++++++++------------------ docs/bmm.html | 632 +++++++++--------- docs/bmm_persistence.html | 770 +++++++++++----------- docs/index.html | 12 +- docs/odin.html | 1192 +++++++++++++++++----------------- 6 files changed, 2100 insertions(+), 2086 deletions(-) diff --git a/docs/BEL.html b/docs/BEL.html index 43923dd..0f674d5 100644 --- a/docs/BEL.html +++ b/docs/BEL.html @@ -4,12 +4,13 @@ - + Basic Expression Language (BEL) + + \ No newline at end of file diff --git a/docs/EL.html b/docs/EL.html index 070dc06..e30a5b6 100644 --- a/docs/EL.html +++ b/docs/EL.html @@ -4,12 +4,13 @@ - + Expression Language (EL) +
-
    tnm_major_number (tnm_t)
-    tnm_major_number ("Tis")
+
    tnm_major_number (tnm_t)
+    tnm_major_number ("Tis")
@@ -1101,12 +1102,12 @@

4

-
    {Env}.current_date                                -- obtain today's date as a Iso8601_date
+
    {Env}.current_date                                -- obtain today's date as a Iso8601_date
 
-    blood_glucose_list: List<Real>
-    {Statistical_evaluator}.max (blood_glucose_list)  -- compute a maximum of Numerics
+    blood_glucose_list: List<Real>
+    {Statistical_evaluator}.max (blood_glucose_list)  -- compute a maximum of Numerics
 
-    {Locale}.language                                 -- the primary language in the locale as a Coded_term
+ {Locale}.language -- the primary language in the locale as a Coded_term
@@ -1194,15 +1195,15 @@

4.4.7
-
    class Book {
-        title: String;
-        pub_date: Date;
-        country: Terminology_code;
-    }
+
    class Book {
+        title: String;
+        pub_date: Date;
+        country: Terminology_code;
+    }
 
-    book_list, old_spanish_books: List<Book>
+    book_list, old_spanish_books: List<Book>
 
-    old_spanish_books := book_list [(b:Book) {b.title.contains("Quixote")}]
+ old_spanish_books := book_list [(b:Book) {b.title.contains("Quixote")}]
@@ -1210,7 +1211,7 @@

4.4.7

-
    old_spanish_books := book_list [(b:Book) {b.title.contains("Quixote") OR b.pub_date < P1650Y AND b.country = #iso639::es}]
+
    old_spanish_books := book_list [(b:Book) {b.title.contains("Quixote") OR b.pub_date < P1650Y AND b.country = #iso639::es}]
@@ -1218,7 +1219,7 @@

4.4.7

-
    old_spanish_books := book_list [title.contains("Quixote") OR pub_date < P1650Y AND country = #iso639::es]
+
    old_spanish_books := book_list [title.contains("Quixote") OR pub_date < P1650Y AND country = #iso639::es]
@@ -1226,9 +1227,9 @@

4.4.7

-
    old_spanish_book: Book
+
    old_spanish_book: Book
 
-    old_spanish_book := book_list [title.contains("Quixote") OR pub_date < P1650Y AND country = #iso639::es][1] -- safe if it is known that there is at least one
+ old_spanish_book := book_list [title.contains("Quixote") OR pub_date < P1650Y AND country = #iso639::es][1] -- safe if it is known that there is at least one
@@ -1236,7 +1237,7 @@

4.4.7

-
    book_list [pub_date >= PY2003]
+
    book_list [pub_date >= PY2003]
@@ -1244,7 +1245,7 @@

4.4.7

-
    book_list [title.contains("Quixote")][1].pub_date.year
+
    book_list [title.contains("Quixote")][1].pub_date.year
@@ -1299,7 +1300,7 @@

4

-
    not attached (test_result) or else test_result.data.events[1].data.value > 6.5
+
    not attached (test_result) or else test_result.data.events[1].data.value > 6.5
@@ -1311,15 +1312,15 @@

4.6. Agents

-
    |
-    | define a naive obstetric risk function
-    |
-    obstetric_risk (age: Duration[1]; previous_pregnancies: Integer[1]): Coded_term[1]
+
    |
+    | define a naive obstetric risk function
+    |
+    obstetric_risk (age: Duration[1]; previous_pregnancies: Integer[1]): Coded_term[1]
 
-    |
-    | generate an agent with signature <[Duration, Integer], Coded_term>
-    |
-    agent obstetric_risk
+ | + | generate an agent with signature <[Duration, Integer], Coded_term> + | + agent obstetric_risk
@@ -1327,7 +1328,7 @@

4.6. Agents

-
    agent obstetric_risk ('P38Y', ?)
+
    agent obstetric_risk ('P38Y', ?)
@@ -1361,16 +1362,16 @@

-
    |
-    | in class Numeric
-    |
-    subtract (other: Numeric): Numeric
-        alias infix '-'
+
    |
+    | in class Numeric
+    |
+    subtract (other: Numeric): Numeric
+        alias infix '-'
 
-    |
-    | redefined in class Integer as
-    |
-    subtract (other: Integer): Integer
+ | + | redefined in class Integer as + | + subtract (other: Integer): Integer
@@ -1494,9 +1495,9 @@

-
    systolic_bp > 140 AND (is_smoker OR is_hypertensive)
+
    systolic_bp > 140 AND (is_smoker OR is_hypertensive)
 
-    systolic_bp > 140  (is_smoker  is_hypertensive)
+ systolic_bp > 140 (is_smoker is_hypertensive)

@@ -1662,17 +1663,17 @@

-
    list_of_reals: List<Real>
+
    list_of_reals: List<Real>
 
-    |
-    | an expression that will return true if list_of_reals
-    | contains a value greater than 140.0
-    |
-    list_of_reals.there_exists (
-        agent (v: Real): Boolean {
-            v > 140.0
-        }
-    )
+ | + | an expression that will return true if list_of_reals + | contains a value greater than 140.0 + | + list_of_reals.there_exists ( + agent (v: Real): Boolean { + v > 140.0 + } + )

@@ -1696,17 +1697,17 @@

-
    list_of_reals: List<Real>
+
    list_of_reals: List<Real>
 
-    |
-    | an expression that will return true if list_of_reals
-    | consists of values all greater than 140.0
-    |
-    list_of_reals.for_all (
-        agent (v: Real): Boolean {
-            v > 140.0
-        }
-    )
+ | + | an expression that will return true if list_of_reals + | consists of values all greater than 140.0 + | + list_of_reals.for_all ( + agent (v: Real): Boolean { + v > 140.0 + } + )

@@ -1723,13 +1724,13 @@

-
    choice in
-        <condition_1>:  <expression_1>,
-        <condition_2>:  <expression_2>,
-        ...
-        <condition_N>:  <expression_N>,
-        *:              <else expression>
-    ;
+
    choice in
+        <condition_1>:  <expression_1>,
+        <condition_2>:  <expression_2>,
+        ...
+        <condition_N>:  <expression_N>,
+        *:              <else expression>
+    ;
@@ -1740,33 +1741,33 @@

-
    molecular_subtype: Terminology_term
-        Result := choice in
-            =========================================================
-            er_positive and
-            her2_negative and
-            not ki67.in_range ([high]):    #luminal_A,
-            ---------------------------------------------------------
-            er_positive and
-            her2_negative and
-            ki67.in_range ([high]):        #luminal_B_HER2_negative,
-            ---------------------------------------------------------
-            er_positive and
-            her2_positive:                 #luminal_B_HER2_positive,
-            ---------------------------------------------------------
-            er_negative and
-            pr_negative and
-            her2_positive and
-            ki67.in_range ([high]):        #HER2,
-            ---------------------------------------------------------
-            er_negative and
-            pr_negative and
-            her2_negative and
-            ki67.in_range ([high]):        #triple_negative,
-            ---------------------------------------------------------
-            *:                             #none
-            =========================================================
-        ;
+
    molecular_subtype: Terminology_term
+        Result := choice in
+            =========================================================
+            er_positive and
+            her2_negative and
+            not ki67.in_range ([high]):    #luminal_A,
+            ---------------------------------------------------------
+            er_positive and
+            her2_negative and
+            ki67.in_range ([high]):        #luminal_B_HER2_negative,
+            ---------------------------------------------------------
+            er_positive and
+            her2_positive:                 #luminal_B_HER2_positive,
+            ---------------------------------------------------------
+            er_negative and
+            pr_negative and
+            her2_positive and
+            ki67.in_range ([high]):        #HER2,
+            ---------------------------------------------------------
+            er_negative and
+            pr_negative and
+            her2_negative and
+            ki67.in_range ([high]):        #triple_negative,
+            ---------------------------------------------------------
+            *:                             #none
+            =========================================================
+        ;

@@ -1819,16 +1820,16 @@

5.4.2. Case Table
-
    gfr_range: Real
+
    gfr_range: Real
 
-    risk_assessment: Real
-        Result := case gfr_range in
-            =================
-            |>20|:      1,
-            |10 - 20|:  0.75,
-            |<10|:      0.5
-            =================
-        ;
+ risk_assessment: Real + Result := case gfr_range in + ================= + |>20|: 1, + |10 - 20|: 0.75, + |<10|: 0.5 + ================= + ;
@@ -1842,60 +1843,60 @@

5.4

-
    post_bureau_risk_category: Terminology_term
-        Result := case existing_customer in
-            ========================================
-            True:   case
-                    appl_risk_score
-                    in
-                    --------------------------------
-                    |120|:     case
-                                credit_score
-                                in
-                                --------------------
-                                |<590|:      #HIGH,
-                                |590..610|:  #MEDIUM,
-                                |>610|:      #LOW
-                                --------------------
-                                ;,
-                    |>120|:     case
-                                credit_score
-                                in
-                                --------------------
-                                |<600|:      #HIGH,
-                                |600..625|:  #MEDIUM,
-                                |>625|:      #LOW
-                                --------------------
-                                ;
-                    --------------------------------
-                    ;,
-            False:  case
-                    appl_risk_score
-                    in
-                    --------------------------------
-                    |100|:     case
-                                credit_score
-                                in
-                                --------------------
-                                |<580|:      #HIGH,
-                                |580..600|:  #MEDIUM,
-                                |>600|:      #LOW
-                                --------------------
-                                ;,
-                    |>100|:     case
-                                credit_score
-                                in
-                                --------------------
-                                |<590|:      #HIGH,
-                                |590..615|:  #MEDIUM,
-                                |>615|:      #LOW
-                                --------------------
-                                ;
-                    --------------------------------
-                    ;
-            ========================================
-            ;
-        ;
+
    post_bureau_risk_category: Terminology_term
+        Result := case existing_customer in
+            ========================================
+            True:   case
+                    appl_risk_score
+                    in
+                    --------------------------------
+                    |120|:     case
+                                credit_score
+                                in
+                                --------------------
+                                |<590|:      #HIGH,
+                                |590..610|:  #MEDIUM,
+                                |>610|:      #LOW
+                                --------------------
+                                ;,
+                    |>120|:     case
+                                credit_score
+                                in
+                                --------------------
+                                |<600|:      #HIGH,
+                                |600..625|:  #MEDIUM,
+                                |>625|:      #LOW
+                                --------------------
+                                ;
+                    --------------------------------
+                    ;,
+            False:  case
+                    appl_risk_score
+                    in
+                    --------------------------------
+                    |100|:     case
+                                credit_score
+                                in
+                                --------------------
+                                |<580|:      #HIGH,
+                                |580..600|:  #MEDIUM,
+                                |>600|:      #LOW
+                                --------------------
+                                ;,
+                    |>100|:     case
+                                credit_score
+                                in
+                                --------------------
+                                |<590|:      #HIGH,
+                                |590..615|:  #MEDIUM,
+                                |>615|:      #LOW
+                                --------------------
+                                ;
+                    --------------------------------
+                    ;
+            ========================================
+            ;
+        ;
@@ -1906,29 +1907,29 @@

-
post_bureau_risk_category := multicase
-    =======================================================================================
-   {existing_customer,  appl_risk_score,        credit_score} in
-    ---------------------------------------------------------------------------------------
-    True:               |120|:                 |<590|:         #HIGH,
-                                                |590..610|:     #MEDIUM,
-                                                |>610|:         #LOW;
-                        -------------------------------------------------------------------
-                        |>120|:                 |<600|:         #HIGH,
-                                                |600..625|:     #MEDIUM,
-                                                |>625|:         #LOW;
-                        ,
-   ----------------------------------------------------------------------------------------
-   False:               |100|:                 |<580|:         #HIGH,
-                                                |580..600|:     #MEDIUM,
-                                                |>600|:         #LOW;
-                        -------------------------------------------------------------------
-                        |>100|:                 |<590|:         #HIGH,
-                                                |590..615|:     #MEDIUM,
-                                                |>615|:         #LOW;
-                        ;
-    =======================================================================================
-    ;
+
post_bureau_risk_category := multicase
+    =======================================================================================
+   {existing_customer,  appl_risk_score,        credit_score} in
+    ---------------------------------------------------------------------------------------
+    True:               |120|:                 |<590|:         #HIGH,
+                                                |590..610|:     #MEDIUM,
+                                                |>610|:         #LOW;
+                        -------------------------------------------------------------------
+                        |>120|:                 |<600|:         #HIGH,
+                                                |600..625|:     #MEDIUM,
+                                                |>625|:         #LOW;
+                        ,
+   ----------------------------------------------------------------------------------------
+   False:               |100|:                 |<580|:         #HIGH,
+                                                |580..600|:     #MEDIUM,
+                                                |>600|:         #LOW;
+                        -------------------------------------------------------------------
+                        |>100|:                 |<590|:         #HIGH,
+                                                |590..615|:     #MEDIUM,
+                                                |>615|:         #LOW;
+                        ;
+    =======================================================================================
+    ;
@@ -1939,16 +1940,16 @@

-
item in
-    ==========================================================================
-                   {    isEconomy(p),   isBusiness(p),      isFirstClass(p) },
-    --------------------------------------------------------------------------
-    isChild(p):    {    50,             250,                1000            },
-    --------------------------------------------------------------------------
-    isAdult(p):    {    250 + trip.d,   450 + trip.d,       750 + trip.d    },
-    --------------------------------------------------------------------------
-    isMilitary(p): {    90,             250,                750 - 2 * p.age }
-    ==========================================================================
+
item in
+    ==========================================================================
+                   {    isEconomy(p),   isBusiness(p),      isFirstClass(p) },
+    --------------------------------------------------------------------------
+    isChild(p):    {    50,             250,                1000            },
+    --------------------------------------------------------------------------
+    isAdult(p):    {    250 + trip.d,   450 + trip.d,       750 + trip.d    },
+    --------------------------------------------------------------------------
+    isMilitary(p): {    90,             250,                750 - 2 * p.age }
+    ==========================================================================
 ;
@@ -1968,347 +1969,347 @@

<
-
//
-//  description: Antlr4 grammar for openEHR Expression Language baed on BMM meta-model.
-//  author:      Thomas Beale <thomas.beale@openehr.org>
-//  contributors:Pieter Bos <pieter.bos@nedap.com>
-//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
-//  copyright:   Copyright (c) 2016- openEHR Foundation <http://www.openEHR.org>
-//  license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
-//
-
-parser grammar ElParser;
-options { tokenVocab=ElLexer; }
-import Cadl2Parser;
-
-
-
-// ========================== EL Statements ==========================
-
-statementBlock: statement+ EOF ;
-
-statement: declaration | assignment | assertion ;
-
-declaration:
-      variableDeclaration
-    | constantDeclaration
-    ;
-
-variableDeclaration: instantiableRef ':' typeId ( SYM_ASSIGNMENT expression )? ;
-
-constantDeclaration: constantId ':' typeId ( SYM_EQ expression )? ;
-
-assignment: valueGenerator SYM_ASSIGNMENT expression ;
-
-assertion: ( ( LC_ID | UC_ID ) ':' )? SYM_ASSERT booleanExpr ;
-
-// ========================== EL Expressions ==========================
-
-//
-// Expressions are either value-generators, or operator expressions (containing value-generators)
-//
-expression:
-      terminal
-    | operatorExpression
-    | tuple
-    ;
-
-operatorExpression:
-      booleanExpr
-    | arithmeticExpr
-    ;
-
-// ------------------- Boolean-returning operator expressions --------------------
-
-//
-// Expressions evaluating to boolean values, using standard precedence;
-// These map to ordinary 1- and 2-argument function calls on Boolean instances
-//
-booleanExpr:
-      SYM_NOT booleanExpr
-    | booleanExpr SYM_AND booleanExpr
-    | booleanExpr SYM_XOR booleanExpr
-    | booleanExpr SYM_OR booleanExpr
-    | booleanExpr SYM_IMPLIES booleanExpr
-    | booleanExpr ( SYM_IFF | SYM_EQ ) booleanExpr
-    | booleanLeaf
-    ;
-
-//
-// Atomic Boolean-valued expression elements
-//
-booleanLeaf:
-      booleanValue
-    | forAllExpr
-    | thereExistsExpr
-    | arithmeticConstraintExpr
-    | generalConstraintExpr
-    | '(' booleanExpr ')'
-    | SYM_DEFINED '(' valueGenerator ')'
-    | arithmeticComparisonExpr
-    | objectComparisonExpr
-    | valueGenerator
-    ;
-
-//
-//  Universal and existential quantifier
-//
-forAllExpr: SYM_FOR_ALL localVariableId ':' valueGenerator '|' booleanExpr ;
-
-thereExistsExpr: SYM_THERE_EXISTS localVariableId ':' valueGenerator '|' booleanExpr ;
-
-// Constraint expressions
-// This provides a way of using one operator (matches) to compare a
-// value (LHS) with a value range (RHS). As per ADL, the value range
-// for ordered types like Integer, Date etc may be a single value,
-// a list of values, or a list of intervals, and in future, potentially
-// other comparators, including functions (e.g. divisible_by_N).
-//
-// For non-ordered types like String and Terminology_code, the RHS
-// is in other forms, e.g. regex for Strings.
-//
-// The matches operator can be used to generate a Boolean value that
-// may be used within an expression like any other Boolean (hence it
-// is a booleanLeaf).
-// TODO: non-primitive objects might be supported on the RHS in future.
-arithmeticConstraintExpr: arithmeticLeaf SYM_MATCHES '{' cInlineOrderedObject '}' ;
-
-generalConstraintExpr: simpleTerminal SYM_MATCHES '{' cObjectMatcher '}' ;
-
-// --------------------------- Arithmetic operator expressions --------------------------
-
-//
-// Comparison expressions of arithmetic operands generating Boolean results
-//
-arithmeticComparisonExpr: arithmeticExpr comparisonBinop arithmeticExpr ;
-
-comparisonBinop:
-      SYM_EQ
-    | SYM_NE
-    | SYM_GT
-    | SYM_LT
-    | SYM_LE
-    | SYM_GE
-    ;
-
-//
-// Expressions evaluating to values of arithmetic types, using standard precedence
-//
-arithmeticExpr:
-      <assoc=right> arithmeticExpr '^' arithmeticExpr
-    | arithmeticExpr ( '/' | SYM_ASTERISK | '%' ) arithmeticExpr
-    | arithmeticExpr ( '+' | '-' ) arithmeticExpr
-    | arithmeticLeaf
-    ;
-
-// TODO: need to be able to plug in terminal to allow decision tables in expressions
-arithmeticLeaf:
-      arithmeticValue
-    | '(' arithmeticExpr ')'
-    | valueGenerator
-    | simpleCaseTable
-    ;
-
-arithmeticValue:
-      integerValue
-    | realValue
-    | dateValue
-    | dateTimeValue
-    | timeValue
-    | durationValue
-    ;
-
-// -------------------- Equality operator expressions for other types ------------------------
-
-//
-// Compare any kind of objects
-//
-objectComparisonExpr: simpleTerminal equalityBinop simpleTerminal ;
-
-equalityBinop:
-    SYM_EQ
-  | SYM_NE
-  ;
-
-//
-// -------------------------- tuples -----------------------------
-//
-
-tuple: '[' expression ( ',' expression )+ ']';
-
-//
-// -------------------------- value-generating expressions -----------------------------
-//
-
-terminal:
-      simpleTerminal
-    | decisionTable
-    ;
-
-simpleTerminal:
-      primitiveObject
-    | valueGenerator
-    ;
-
-//
-// TODO: Can't syntactically distinguish between a local or other variable id
-// and a property or constant reference.
-//
-valueGenerator:
-      bareRef
-    | scopedFeatureRef
-    | typeRef
-    ;
-
-bareRef:
-      boundVariableId
-    | staticRef
-    | localRef
-    | functionCall
-    ;
-
-//
-// Static and constant feature refs, distinguished by the use of
-// initial capital in the id.
-// Will map to EL_READABLE_VARIABLE or EL_STATIC_REF (unscoped)
-//
-staticRef:
-      SYM_SELF
-    | constantId
-    ;
-
-//
-// Local writable reference, distinguished by use of initial lowercase id
-// Will map to EL_WRITABLE_VARIABLE or EL_PROPERTY_REF (unscoped)
-//
-localRef:
-      SYM_RESULT
-    | localVariableId
-    ;
-
-//
-// scoped feature references.
-// Will map to any EL_FEATURE_REF (scoped)
-//
-scopedFeatureRef: scoper featureRef ;
-
-scoper: ( typeRef '.' )? ( bareRef '.' )* ;
-
-typeRef: '{' typeId '}' ;
-
-typeId: UC_ID ( '<' typeId ( ',' typeId )* '>' )? ;
-
-featureRef:
-      functionCall
-    | instantiableRef
-    ;
-
-//
-// Instantiable feature refs
-//
-instantiableRef:
-      boundVariableId
-    | localVariableId
-    | constantId
-    ;
-
-//
-// TODO: analyse how a boundVariableId can be created as a built-in feature
-//
-boundVariableId: BOUND_VARIABLE_ID ;
-
-localVariableId: LC_ID ;
-
-constantId: UC_ID ;
-
-//
-// Function calls
-//
-functionCall: LC_ID '(' exprList? ')' ';'? ;
-
-exprList: expression ( ',' expression )* ;
-
-//
-// -------------------------- decision tables -----------------------------
-//
-
-decisionTable:
-      binaryChoice
-    | caseTable
-    | conditionTable
-    ;
-
-caseTable:
-    | simpleCaseTable
-    | generalCaseTable
-    ;
-
-//
-// condition chains (if/then statement equivalent)
-// choice in
-//   =========================================================
-//   er_positive and
-//   her2_negative and
-//   not ki67.in_range (#high):    #luminal_A,
-//   ---------------------------------------------------------
-//   er_positive and
-//   her2_negative and
-//   ki67.in_range (#high):        #luminal_B_HER2_negative,
-//   ---------------------------------------------------------
-//   *:                            #none
-//   =========================================================
-//   ;
-//
-conditionTable: SYM_CHOICE SYM_IN ( conditionBranch ',' )+ ( conditionBranch | conditionDefaultBranch ) ';' ;
-
-conditionBranch: booleanExpr ':' expression ;
-
-conditionDefaultBranch: SYM_ASTERISK ':' expression ;
-
-//
-// Binary-choice version of condition table, using old-school
-// C/Java syntax:
-// booleanExpr ? x : y ;
-//
-binaryChoice:  booleanExpr '?' simpleTerminal ':' simpleTerminal ;
-
-//
-// Case tables, e.g.:
-//     Result := case qCSI_score in
-//        ============================
-//        0:          expr0,
-//        ----------------------------
-//        |1..2|:     expr1,
-//        ----------------------------
-//        |3..5|:     expr2,
-//        ----------------------------
-//        |6..8|:     expr3,
-//        ----------------------------
-//        |≥ 9|:      expr4
-//        ============================
-//     ;
-//
-generalCaseTable: SYM_CASE expression SYM_IN ( generalCaseBranch ',' )+ ( generalCaseBranch | generalCaseDefaultBranch ) ';' ;
-
-generalCaseBranch: primitiveObject ':' expression ;
-
-generalCaseDefaultBranch: SYM_ASTERISK ':' expression ;
-
-//
-// Simple value-based (typed) Case tables, e.g.:
-// case gfr_range in
-//   =================
-//   |>20|:      1,
-//   |10..20|:   0.75,
-//   |<10|:      0.5
-//   =================
-//   ;
-//
-simpleCaseTable: SYM_CASE simpleTerminal SYM_IN ( simpleCaseBranch ',' )+ ( simpleCaseBranch | simpleCaseDefaultBranch ) ';' ;
-
-simpleCaseBranch: primitiveObject ':' simpleTerminal ;
-
-simpleCaseDefaultBranch: SYM_ASTERISK ':' simpleTerminal ;
+
//
+//  description: Antlr4 grammar for openEHR Expression Language baed on BMM meta-model.
+//  author:      Thomas Beale <thomas.beale@openehr.org>
+//  contributors:Pieter Bos <pieter.bos@nedap.com>
+//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
+//  copyright:   Copyright (c) 2016- openEHR Foundation <http://www.openEHR.org>
+//  license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
+//
+
+parser grammar ElParser;
+options { tokenVocab=ElLexer; }
+import Cadl2Parser;
+
+
+
+// ========================== EL Statements ==========================
+
+statementBlock: statement+ EOF ;
+
+statement: declaration | assignment | assertion ;
+
+declaration:
+      variableDeclaration
+    | constantDeclaration
+    ;
+
+variableDeclaration: instantiableRef ':' typeId ( SYM_ASSIGNMENT expression )? ;
+
+constantDeclaration: constantId ':' typeId ( SYM_EQ expression )? ;
+
+assignment: valueGenerator SYM_ASSIGNMENT expression ;
+
+assertion: ( ( LC_ID | UC_ID ) ':' )? SYM_ASSERT booleanExpr ;
+
+// ========================== EL Expressions ==========================
+
+//
+// Expressions are either value-generators, or operator expressions (containing value-generators)
+//
+expression:
+      terminal
+    | operatorExpression
+    | tuple
+    ;
+
+operatorExpression:
+      booleanExpr
+    | arithmeticExpr
+    ;
+
+// ------------------- Boolean-returning operator expressions --------------------
+
+//
+// Expressions evaluating to boolean values, using standard precedence;
+// These map to ordinary 1- and 2-argument function calls on Boolean instances
+//
+booleanExpr:
+      SYM_NOT booleanExpr
+    | booleanExpr SYM_AND booleanExpr
+    | booleanExpr SYM_XOR booleanExpr
+    | booleanExpr SYM_OR booleanExpr
+    | booleanExpr SYM_IMPLIES booleanExpr
+    | booleanExpr ( SYM_IFF | SYM_EQ ) booleanExpr
+    | booleanLeaf
+    ;
+
+//
+// Atomic Boolean-valued expression elements
+//
+booleanLeaf:
+      booleanValue
+    | forAllExpr
+    | thereExistsExpr
+    | arithmeticConstraintExpr
+    | generalConstraintExpr
+    | '(' booleanExpr ')'
+    | SYM_DEFINED '(' valueGenerator ')'
+    | arithmeticComparisonExpr
+    | objectComparisonExpr
+    | valueGenerator
+    ;
+
+//
+//  Universal and existential quantifier
+//
+forAllExpr: SYM_FOR_ALL localVariableId ':' valueGenerator '|' booleanExpr ;
+
+thereExistsExpr: SYM_THERE_EXISTS localVariableId ':' valueGenerator '|' booleanExpr ;
+
+// Constraint expressions
+// This provides a way of using one operator (matches) to compare a
+// value (LHS) with a value range (RHS). As per ADL, the value range
+// for ordered types like Integer, Date etc may be a single value,
+// a list of values, or a list of intervals, and in future, potentially
+// other comparators, including functions (e.g. divisible_by_N).
+//
+// For non-ordered types like String and Terminology_code, the RHS
+// is in other forms, e.g. regex for Strings.
+//
+// The matches operator can be used to generate a Boolean value that
+// may be used within an expression like any other Boolean (hence it
+// is a booleanLeaf).
+// TODO: non-primitive objects might be supported on the RHS in future.
+arithmeticConstraintExpr: arithmeticLeaf SYM_MATCHES '{' cInlineOrderedObject '}' ;
+
+generalConstraintExpr: simpleTerminal SYM_MATCHES '{' cObjectMatcher '}' ;
+
+// --------------------------- Arithmetic operator expressions --------------------------
+
+//
+// Comparison expressions of arithmetic operands generating Boolean results
+//
+arithmeticComparisonExpr: arithmeticExpr comparisonBinop arithmeticExpr ;
+
+comparisonBinop:
+      SYM_EQ
+    | SYM_NE
+    | SYM_GT
+    | SYM_LT
+    | SYM_LE
+    | SYM_GE
+    ;
+
+//
+// Expressions evaluating to values of arithmetic types, using standard precedence
+//
+arithmeticExpr:
+      <assoc=right> arithmeticExpr '^' arithmeticExpr
+    | arithmeticExpr ( '/' | SYM_ASTERISK | '%' ) arithmeticExpr
+    | arithmeticExpr ( '+' | '-' ) arithmeticExpr
+    | arithmeticLeaf
+    ;
+
+// TODO: need to be able to plug in terminal to allow decision tables in expressions
+arithmeticLeaf:
+      arithmeticValue
+    | '(' arithmeticExpr ')'
+    | valueGenerator
+    | simpleCaseTable
+    ;
+
+arithmeticValue:
+      integerValue
+    | realValue
+    | dateValue
+    | dateTimeValue
+    | timeValue
+    | durationValue
+    ;
+
+// -------------------- Equality operator expressions for other types ------------------------
+
+//
+// Compare any kind of objects
+//
+objectComparisonExpr: simpleTerminal equalityBinop simpleTerminal ;
+
+equalityBinop:
+    SYM_EQ
+  | SYM_NE
+  ;
+
+//
+// -------------------------- tuples -----------------------------
+//
+
+tuple: '[' expression ( ',' expression )+ ']';
+
+//
+// -------------------------- value-generating expressions -----------------------------
+//
+
+terminal:
+      simpleTerminal
+    | decisionTable
+    ;
+
+simpleTerminal:
+      primitiveObject
+    | valueGenerator
+    ;
+
+//
+// TODO: Can't syntactically distinguish between a local or other variable id
+// and a property or constant reference.
+//
+valueGenerator:
+      bareRef
+    | scopedFeatureRef
+    | typeRef
+    ;
+
+bareRef:
+      boundVariableId
+    | staticRef
+    | localRef
+    | functionCall
+    ;
+
+//
+// Static and constant feature refs, distinguished by the use of
+// initial capital in the id.
+// Will map to EL_READABLE_VARIABLE or EL_STATIC_REF (unscoped)
+//
+staticRef:
+      SYM_SELF
+    | constantId
+    ;
+
+//
+// Local writable reference, distinguished by use of initial lowercase id
+// Will map to EL_WRITABLE_VARIABLE or EL_PROPERTY_REF (unscoped)
+//
+localRef:
+      SYM_RESULT
+    | localVariableId
+    ;
+
+//
+// scoped feature references.
+// Will map to any EL_FEATURE_REF (scoped)
+//
+scopedFeatureRef: scoper featureRef ;
+
+scoper: ( typeRef '.' )? ( bareRef '.' )* ;
+
+typeRef: '{' typeId '}' ;
+
+typeId: UC_ID ( '<' typeId ( ',' typeId )* '>' )? ;
+
+featureRef:
+      functionCall
+    | instantiableRef
+    ;
+
+//
+// Instantiable feature refs
+//
+instantiableRef:
+      boundVariableId
+    | localVariableId
+    | constantId
+    ;
+
+//
+// TODO: analyse how a boundVariableId can be created as a built-in feature
+//
+boundVariableId: BOUND_VARIABLE_ID ;
+
+localVariableId: LC_ID ;
+
+constantId: UC_ID ;
+
+//
+// Function calls
+//
+functionCall: LC_ID '(' exprList? ')' ';'? ;
+
+exprList: expression ( ',' expression )* ;
+
+//
+// -------------------------- decision tables -----------------------------
+//
+
+decisionTable:
+      binaryChoice
+    | caseTable
+    | conditionTable
+    ;
+
+caseTable:
+    | simpleCaseTable
+    | generalCaseTable
+    ;
+
+//
+// condition chains (if/then statement equivalent)
+// choice in
+//   =========================================================
+//   er_positive and
+//   her2_negative and
+//   not ki67.in_range (#high):    #luminal_A,
+//   ---------------------------------------------------------
+//   er_positive and
+//   her2_negative and
+//   ki67.in_range (#high):        #luminal_B_HER2_negative,
+//   ---------------------------------------------------------
+//   *:                            #none
+//   =========================================================
+//   ;
+//
+conditionTable: SYM_CHOICE SYM_IN ( conditionBranch ',' )+ ( conditionBranch | conditionDefaultBranch ) ';' ;
+
+conditionBranch: booleanExpr ':' expression ;
+
+conditionDefaultBranch: SYM_ASTERISK ':' expression ;
+
+//
+// Binary-choice version of condition table, using old-school
+// C/Java syntax:
+// booleanExpr ? x : y ;
+//
+binaryChoice:  booleanExpr '?' simpleTerminal ':' simpleTerminal ;
+
+//
+// Case tables, e.g.:
+//     Result := case qCSI_score in
+//        ============================
+//        0:          expr0,
+//        ----------------------------
+//        |1..2|:     expr1,
+//        ----------------------------
+//        |3..5|:     expr2,
+//        ----------------------------
+//        |6..8|:     expr3,
+//        ----------------------------
+//        |≥ 9|:      expr4
+//        ============================
+//     ;
+//
+generalCaseTable: SYM_CASE expression SYM_IN ( generalCaseBranch ',' )+ ( generalCaseBranch | generalCaseDefaultBranch ) ';' ;
+
+generalCaseBranch: primitiveObject ':' expression ;
+
+generalCaseDefaultBranch: SYM_ASTERISK ':' expression ;
+
+//
+// Simple value-based (typed) Case tables, e.g.:
+// case gfr_range in
+//   =================
+//   |>20|:      1,
+//   |10..20|:   0.75,
+//   |<10|:      0.5
+//   =================
+//   ;
+//
+simpleCaseTable: SYM_CASE simpleTerminal SYM_IN ( simpleCaseBranch ',' )+ ( simpleCaseBranch | simpleCaseDefaultBranch ) ';' ;
+
+simpleCaseBranch: primitiveObject ':' simpleTerminal ;
+
+simpleCaseDefaultBranch: SYM_ASTERISK ':' simpleTerminal ;
-
//
-//  description: Antlr4 grammar for openEHR Expression Language baed on BMM meta-model.
-//  author:      Thomas Beale <thomas.beale@openehr.org>
-//  contributors:Pieter Bos <pieter.bos@nedap.com>
-//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
-//  copyright:   Copyright (c) 2016- openEHR Foundation <http://www.openEHR.org>
-//  license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
-//
-
-lexer grammar ElLexer;
-import AdlPathLexer, Cadl2Lexer, GeneralLexer;
+
//
+//  description: Antlr4 grammar for openEHR Expression Language baed on BMM meta-model.
+//  author:      Thomas Beale <thomas.beale@openehr.org>
+//  contributors:Pieter Bos <pieter.bos@nedap.com>
+//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
+//  copyright:   Copyright (c) 2016- openEHR Foundation <http://www.openEHR.org>
+//  license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
+//
+
+lexer grammar ElLexer;
+import AdlPathLexer, Cadl2Lexer, GeneralLexer;
 
 channels {
-    COMMENT
-}
-
-// ------------------ lines and comments ------------------
-CMT_LINE : '--' .*? EOL -> channel(COMMENT) ;
-TABLE_CMT_LINE : '===' '='* EOL -> channel(COMMENT) ;
-EOL      : '\r'? '\n'   -> channel(HIDDEN) ;
-WS       : [ \t\r]+     -> channel(HIDDEN) ;
-
-// --------- keywords ----------
-
-SYM_DEFINED : 'defined' ;
-SYM_SELF    : 'Self' ;
-SYM_IN      : 'in' ;
-SYM_CHOICE  : 'choice' ;
-SYM_CASE    : 'case' ;
-
-SYM_RESULT  : 'Result' ;
-
-// --------- symbols ----------
-SYM_ASSIGNMENT: ':=' ;
-SYM_COLON : ':' ;
-SYM_INTERROGATION: '?' ;
-SYM_NE : '/=' | '!=' | '≠' ;
-SYM_EQ : '=' ;
-SYM_GT : '>' ;
-SYM_LT : '<' ;
-SYM_LE : '<=' | '≤' ;
-SYM_GE : '>=' | '≥' ;
-
-SYM_PLUS    : '+' ;
-SYM_MINUS   : '-' ;
-SYM_SLASH   : '/' ;
-SYM_PERCENT : '%' ;
-SYM_CARET   : '^' ;
-SYM_DOT     : '.' ;
-
-SYM_DOUBLE_MINUS: '--' ;
-SYM_DOUBLE_PLUS: '++' ;
-
-SYM_THEN     : 'then' | 'THEN' ;
-SYM_AND      : 'and' | 'AND' | '∧' ;
-SYM_OR       : 'or' | 'OR' | '∨' ;
-SYM_XOR      : 'xor' | 'XOR' ;
-SYM_NOT      : 'not' | 'NOT' | '!' | '~' | '¬' ;
-SYM_IMPLIES  : 'implies' | '⇒' | '→' ;
-SYM_IFF      : '⇔' | '↔' ;
-SYM_FOR_ALL  : 'for_all' | '∀' ;
-SYM_THERE_EXISTS: 'there_exists' | '∃' ;
-SYM_MATCHES  : 'matches' | 'is_in' | '∈' ;
-SYM_ASSERT   : 'assert' ;
-
-// TODO: replace with defined() and attached() predicates
-SYM_EXISTS   : 'exists' ;
-
-BOUND_VARIABLE_ID: '$' LC_ID ;
-
-// ---------- local code that are not ADL codes -------
-// e.g. [heart_rate]
-LOCAL_TERM_CODE_REF: '[' ALPHANUM_US_CHAR+ ']' ;
+ COMMENT +} + +// ------------------ lines and comments ------------------ +CMT_LINE : '--' .*? EOL -> channel(COMMENT) ; +TABLE_CMT_LINE : '===' '='* EOL -> channel(COMMENT) ; +EOL : '\r'? '\n' -> channel(HIDDEN) ; +WS : [ \t\r]+ -> channel(HIDDEN) ; + +// --------- keywords ---------- + +SYM_DEFINED : 'defined' ; +SYM_SELF : 'Self' ; +SYM_IN : 'in' ; +SYM_CHOICE : 'choice' ; +SYM_CASE : 'case' ; + +SYM_RESULT : 'Result' ; + +// --------- symbols ---------- +SYM_ASSIGNMENT: ':=' ; +SYM_COLON : ':' ; +SYM_INTERROGATION: '?' ; +SYM_NE : '/=' | '!=' | '≠' ; +SYM_EQ : '=' ; +SYM_GT : '>' ; +SYM_LT : '<' ; +SYM_LE : '<=' | '≤' ; +SYM_GE : '>=' | '≥' ; + +SYM_PLUS : '+' ; +SYM_MINUS : '-' ; +SYM_SLASH : '/' ; +SYM_PERCENT : '%' ; +SYM_CARET : '^' ; +SYM_DOT : '.' ; + +SYM_DOUBLE_MINUS: '--' ; +SYM_DOUBLE_PLUS: '++' ; + +SYM_THEN : 'then' | 'THEN' ; +SYM_AND : 'and' | 'AND' | '∧' ; +SYM_OR : 'or' | 'OR' | '∨' ; +SYM_XOR : 'xor' | 'XOR' ; +SYM_NOT : 'not' | 'NOT' | '!' | '~' | '¬' ; +SYM_IMPLIES : 'implies' | '⇒' | '→' ; +SYM_IFF : '⇔' | '↔' ; +SYM_FOR_ALL : 'for_all' | '∀' ; +SYM_THERE_EXISTS: 'there_exists' | '∃' ; +SYM_MATCHES : 'matches' | 'is_in' | '∈' ; +SYM_ASSERT : 'assert' ; + +// TODO: replace with defined() and attached() predicates +SYM_EXISTS : 'exists' ; + +BOUND_VARIABLE_ID: '$' LC_ID ; + +// ---------- local code that are not ADL codes ------- +// e.g. [heart_rate] +LOCAL_TERM_CODE_REF: '[' ALPHANUM_US_CHAR+ ']' ;
@@ -2411,8 +2412,9 @@

References

+ \ No newline at end of file diff --git a/docs/bmm.html b/docs/bmm.html index bf381cf..e377f57 100644 --- a/docs/bmm.html +++ b/docs/bmm.html @@ -4,12 +4,13 @@ - + Basic Meta-Model (BMM) +
-

It is designed to enable both human authoring and machine processing, including e.g. extraction of BMM textual schemas from a UML tool or programming language classes. The semantics of the model are heavily influenced by the formal approach to object-orientation described by Bertrand Meyer in Object-oriented Software Construction (Meyer, 1997) and also the Eiffel language, which is significantly better basis for object modelling than the UML 2.x meta-model. The BMM consequently departs from UML in a number of significant ways, and also from the OOSC/Eiffel approach in some aspects (e.g. direct meta-type suport for container types). Its key features are as follows:

+

It is designed to enable both human authoring and machine processing, including e.g. extraction of BMM textual schemas from a UML tool or programming language classes. The semantics of the model are heavily influenced by the formal approach to object-orientation described by Bertrand Meyer in Object-oriented Software Construction (Meyer, 1997) and also the Eiffel language, which is significantly better basis for object modelling than the UML 2.x meta-model. The BMM consequently departs from UML in a number of significant ways, and also from the OOSC/Eiffel approach in some aspects (e.g. direct meta-type suport for container types). Its key features are as follows:

    @@ -3161,78 +3162,78 @@

    6.6.

-
Boolean type_conforms_to (String a_type, anc_type)
+
Boolean type_conforms_to (String a_type, anc_type)
 {
-    BMM_TYPE_NAME a_type_name, anc_type_name;
+    BMM_TYPE_NAME a_type_name, anc_type_name;
 
-    if attached create_type_name_from_string (a_a_type) as a_type_name and
-        attached create_type_name_from_string (anc_type) as anc_type_name
-    {
-        base_class = a_type_name.name;
-        anc_base_class = anc_type_name.name;
+    if attached create_type_name_from_string (a_a_type) as a_type_name and
+        attached create_type_name_from_string (anc_type) as anc_type_name
+    {
+        base_class = a_type_name.name;
+        anc_base_class = anc_type_name.name;
 
-        if (base_class.is_case_insensitive_equal (anc_base_class) or else
-            class_definition (base_class).has_ancestor_class (anc_base_class))
-        {
-            BMM_CLASS bmm_def_class = class_definition (base_class);
+        if (base_class.is_case_insensitive_equal (anc_base_class) or else
+            class_definition (base_class).has_ancestor_class (anc_base_class))
+        {
+            BMM_CLASS bmm_def_class = class_definition (base_class);
 
-            // ---- Tuple types
+            // ---- Tuple types
 
-            // ---- Signature types ----
+            // ---- Signature types ----
 
-            // ---- Generic types
-            // handle case where formal generic names appear in type name
-            if (valid_generic_type_name (a_type) and bmm_def_class instanceOf (BMM_GENERIC_CLASS) {
+            // ---- Generic types
+            // handle case where formal generic names appear in type name
+            if (valid_generic_type_name (a_type) and bmm_def_class instanceOf (BMM_GENERIC_CLASS) {
 
-                // in the case of both being generic, we need to compare generics
-                // to start with, the number of generics must match
-                BMM_CLASS anc_bmm_def_class = class_definition (anc_base_class);
-                if (valid_generic_type_name (anc_type) and anc_bmm_def_class instanceOf (BMM_GENERIC_CLASS)) {
-                    ArrayedList<String> a_type_gen_params = a_type_name.generic_parameters_type_list;
-                    ArrayedList<String> anc_type_gen_params = anc_type_name.generic_parameters_type_list;
+                // in the case of both being generic, we need to compare generics
+                // to start with, the number of generics must match
+                BMM_CLASS anc_bmm_def_class = class_definition (anc_base_class);
+                if (valid_generic_type_name (anc_type) and anc_bmm_def_class instanceOf (BMM_GENERIC_CLASS)) {
+                    ArrayedList<String> a_type_gen_params = a_type_name.generic_parameters_type_list;
+                    ArrayedList<String> anc_type_gen_params = anc_type_name.generic_parameters_type_list;
 
-                    if (a_type_gen_params.count = anc_type_gen_params.count) {
+                    if (a_type_gen_params.count = anc_type_gen_params.count) {
 
-                        Iterator<String> this_gen_parms_it = a_type_gen_params.iterator();
-                        Iterator<String> other_gen_parms_it = anc_type_gen_params.iterator();
+                        Iterator<String> this_gen_parms_it = a_type_gen_params.iterator();
+                        Iterator<String> other_gen_parms_it = anc_type_gen_params.iterator();
 
-                        Boolean result = True;
-                        String a_type_gen_type, anc_type_gen_type;
+                        Boolean result = True;
+                        String a_type_gen_type, anc_type_gen_type;
 
-                        while (this_gen_parms_it.hasNext() && other_gen_parms_it.hasNext() || !result) {
-                            // first we convert any open generic parameters to their conformance types
-                            // We assume type names of 1 letter are open parameters
-                            String this_gen_parm = this_gen_parms_it.next();
-                            String other_gen_parm = other_gen_parms_it.next();
-                            if (formal_generic_parameter_name (this_gen_parm))
-                                a_type_gen_type = this_bmm_gen_class.generic_parameter_conformance_type (this_gen_parm);
-                            else
-                                a_type_gen_type = this_gen_parm;
+                        while (this_gen_parms_it.hasNext() && other_gen_parms_it.hasNext() || !result) {
+                            // first we convert any open generic parameters to their conformance types
+                            // We assume type names of 1 letter are open parameters
+                            String this_gen_parm = this_gen_parms_it.next();
+                            String other_gen_parm = other_gen_parms_it.next();
+                            if (formal_generic_parameter_name (this_gen_parm))
+                                a_type_gen_type = this_bmm_gen_class.generic_parameter_conformance_type (this_gen_parm);
+                            else
+                                a_type_gen_type = this_gen_parm;
 
-                            if (formal_generic_parameter_name (other_gen_parm))
-                                anc_type_gen_type = other_bmm_gen_class.generic_parameter_conformance_type (other_gen_parm);
-                            else
-                                anc_type_gen_type = other_gen_parm;
+                            if (formal_generic_parameter_name (other_gen_parm))
+                                anc_type_gen_type = other_bmm_gen_class.generic_parameter_conformance_type (other_gen_parm);
+                            else
+                                anc_type_gen_type = other_gen_parm;
 
-                            -- now do the test
-                            result = type_conforms_to (a_type_gen_type, anc_type_gen_type);
-                        }
+                            -- now do the test
+                            result = type_conforms_to (a_type_gen_type, anc_type_gen_type);
+                        }
 
-                        return result;
-                    }
+                        return result;
+                    }
 
-                }
-                // Conforms - case where anc type is not provided in generic form, but desc is
-                // e.g. Interval<Integer> conforms to Interval
-                else
-                    return True;
-            }
-            // in the following case, the descendant type is not generic,
-            // so the ancestor type cannot be either, for conformance
-            else
-                return not valid_generic_type_name (anc_type);
-        }
-    }
+                }
+                // Conforms - case where anc type is not provided in generic form, but desc is
+                // e.g. Interval<Integer> conforms to Interval
+                else
+                    return True;
+            }
+            // in the following case, the descendant type is not generic,
+            // so the ancestor type cannot be either, for conformance
+            else
+                return not valid_generic_type_name (anc_type);
+        }
+    }
 }
@@ -4414,16 +4415,16 @@

7.2. Simp
-
class DvQuantity
+
class DvQuantity
 {
-    feature
-        // feature definitions
+    feature
+        // feature definitions
 }
 
-class Observation
+class Observation
 {
-    feature
-        // feature definitions
+    feature
+        // feature definitions
 }
@@ -4438,27 +4439,27 @@

7.3. Ge
//
 // a primitive generic class with an open type parameter
 //
-primitive class List <T>
+primitive class List <T>
 
 feature
-    // feature definitions
+    // feature definitions
 
 
 //
 // a generic class with a constrained type parameter
 //
-class DvInterval <T:DvOrdered>
+class DvInterval <T:DvOrdered>
 
 feature
-    // feature definitions
+    // feature definitions
 
 //
 // a primitive generic class two type parameters
 //
-primitive class HashMap <K:Ordered, V>
+primitive class HashMap <K:Ordered, V>
 
 feature
-    // feature definitions
+ // feature definitions
@@ -4514,19 +4515,19 @@

7.4.1
// an Integer-based enumeration
-enumeration class TASK_LIFECYCLE
+enumeration class TASK_LIFECYCLE
 
-feature -- Enumeration Literals
+feature -- Enumeration Literals
 
-    planned   = 0;
-    available = 1;
-    cancelled = 2;
-    aborted   = 3;
-    abandoned = 4;
-    underway  = 5;
-    suspended = 6;
-    resumed   = 7;
-    completed = 8;
+ planned = 0; + available = 1; + cancelled = 2; + aborted = 3; + abandoned = 4; + underway = 5; + suspended = 6; + resumed = 7; + completed = 8;
@@ -4544,13 +4545,13 @@

7.4.1
// a String-based enumeration
-enumeration class ContractStatus
+enumeration class ContractStatus
 
-feature -- Enumeration Literals
-    initial   = "Initial";
-    cancelled = "Cancelled";
-    active    = "Active";
-    completed = "Completed";
+feature -- Enumeration Literals + initial = "Initial"; + cancelled = "Cancelled"; + active = "Active"; + completed = "Completed";
@@ -4586,10 +4587,10 @@

7.4.2.
// a Value-set type
-class Document
+class Document
 
 feature
-    property language: CodedText <<"iso::iso_639-2">> [1];
+ property language: CodedText <<"iso::iso_639-2">> [1];

@@ -4606,10 +4607,10 @@

7.5.1

-
abstract class ENTRY
+
abstract class ENTRY
 
 feature
-    // feature definitions
+ // feature definitions

@@ -4620,16 +4621,16 @@

-
primitive class Integer
+
primitive class Integer
 
 feature
-    // feature definitions
+    // feature definitions
 
 
-primitive class String
+primitive class String
 
 feature
-    // feature definitions
+ // feature definitions
@@ -4659,36 +4660,36 @@

7.6.
//
 // a class with simple invariants
 //
-class COMPOSITION
+class COMPOSITION
 
 feature
-    // feature definitions
+    // feature definitions
 
 invariant
-    Is_archetype_root: is_archetype_root
-    Content_valid: content /= Void implies not content.is_empty
+    Is_archetype_root: is_archetype_root
+    Content_valid: content /= Void implies not content.is_empty
 
 
 //
 // a class with more complex invariants
 //
-class VERSIONED_COMPOSITION
+class VERSIONED_COMPOSITION
 
 feature
-    // feature definitions
+    // feature definitions
 
 invariant
-    Archetype_node_id_valid: all_versions.for_all (
-        agent (v: VERSION) {
-            v.archetype_node_id.is_equal (all_versions.first.archetype_node_id);
-        }
-    )
+    Archetype_node_id_valid: all_versions.for_all (
+        agent (v: VERSION) {
+            v.archetype_node_id.is_equal (all_versions.first.archetype_node_id);
+        }
+    )
 
-    Persistent_validity: all_versions.for_all (
-        agent (v: VERSION) {
-            v.is_persistent = all_versions.first.data.is_persistent;
-        }
-    )
+ Persistent_validity: all_versions.for_all ( + agent (v: VERSION) { + v.is_persistent = all_versions.first.data.is_persistent; + } + )

@@ -5393,20 +5394,20 @@

8.2.1.1. Constants<
-
class BASIC_DEFINITIONS
+
class BASIC_DEFINITIONS
 
 feature
-    //
-    // simple constants
-    //
-    constant CR: Character = '\015';
-    constant LF: Character = '\012';
+    //
+    // simple constants
+    //
+    constant CR: Character = '\015';
+    constant LF: Character = '\012';
 
-    //
-    // constant of complex type
-    // TODO: correct JSON (maybe YAML?) or other syntax
-    //
-    constant SafeSpeed: Interval<Quantity> = |0.0 km/h .. 60.0 km/h|;
+ // + // constant of complex type + // TODO: correct JSON (maybe YAML?) or other syntax + // + constant SafeSpeed: Interval<Quantity> = |0.0 km/h .. 60.0 km/h|;
@@ -5421,11 +5422,11 @@
8.2.1.2. Singleto
feature
-    //
-    // constant generated by a function call
-    //
-    singleton criticalPressure: ProxyVar<Quantity>
-        Result := {ProxyVar<Quantity>}({Quantity}(0.0, "kPa"), {Quantity}(150.0, "kPa"));
+ // + // constant generated by a function call + // + singleton criticalPressure: ProxyVar<Quantity> + Result := {ProxyVar<Quantity>}({Quantity}(0.0, "kPa"), {Quantity}(150.0, "kPa"));
@@ -5457,17 +5458,17 @@
-
abstract class ENTRY extend CARE_ENTRY
+
abstract class ENTRY extend CARE_ENTRY
 
-feature -- Locale
-    association property language: CODE_PHRASE <<"iso::iso_639-2">> [0..1];
-    association property encoding: CODE_PHRASE <<"iana::character-sets">> [0..1];
+feature -- Locale
+    association property language: CODE_PHRASE <<"iso::iso_639-2">> [0..1];
+    association property encoding: CODE_PHRASE <<"iana::character-sets">> [0..1];
 
-feature -- Access
-    composition property protocol: ITEM_STRUCTURE[1];
-    composition property guideline_id: OBJECT_REF[0..1];
-    composition property subject: PARTY_PROXY[0..1];
-    composition property other_participations: PARTICIPATION[*]{set};
+feature -- Access + composition property protocol: ITEM_STRUCTURE[1]; + composition property guideline_id: OBJECT_REF[0..1]; + composition property subject: PARTY_PROXY[0..1]; + composition property other_participations: PARTICIPATION[*]{set};
@@ -5517,37 +5518,37 @@

-
abstract class DV_AMOUNT
-    inherit
-        DV_QUANTIFIED
+
abstract class DV_AMOUNT
+    inherit
+        DV_QUANTIFIED
 
-feature -- Arithmetic Operations
+feature -- Arithmetic Operations
 
-    function equal (other: DV_AMOUNT[1]): Boolean[1]
-        alias {infix '='};
+    function equal (other: DV_AMOUNT[1]): Boolean[1]
+        alias {infix '='};
 
-    function less_than (other: DV_AMOUNT[1]): Boolean[1]
-        alias {infix '<'};
+    function less_than (other: DV_AMOUNT[1]): Boolean[1]
+        alias {infix '<'};
 
-feature -- Arithmetic Operations
+feature -- Arithmetic Operations
 
-    function add (other: DV_AMOUNT[1]): DV_AMOUNT[1]
-        alias {infix '+'};
+    function add (other: DV_AMOUNT[1]): DV_AMOUNT[1]
+        alias {infix '+'};
 
-    function subtract (other: DV_AMOUNT[1]): DV_AMOUNT[1]
-        alias {infix '-'};
+    function subtract (other: DV_AMOUNT[1]): DV_AMOUNT[1]
+        alias {infix '-'};
 
-    function multiply (val: Real[1]): DV_AMOUNT[1]
-        alias {infix '*'};
+    function multiply (val: Real[1]): DV_AMOUNT[1]
+        alias {infix '*'};
 
-    function divide (val: Real[1]): DV_AMOUNT[1]
-        alias {infix '/', infix '÷'};
+ function divide (val: Real[1]): DV_AMOUNT[1] + alias {infix '/', infix '÷'};

8.3.1. Pre- and Post-conditions

-

All BMM routine definitions may include pre- and/or post-conditions, with the semantics of Djikstra’s weakest pre-condition logic (Dijkstra (1976)), Object-Z (Smith (2000)) and the Eiffel language (Meyer (1997)).

+

All BMM routine definitions may include pre- and/or post-conditions, with the semantics of Djikstra’s weakest pre-condition logic (Dijkstra (1976)), Object-Z (Smith (2000)) and the Eiffel language (Meyer (1997)).

@@ -5615,23 +5616,23 @@

-
class Date
+
class Date
 
 inherit
-    Temporal
+    Temporal
 
 convert
-    create_from_string
+    create_from_string
 
-feature -- Creators
+feature -- Creators
 
-    procedure create_from_string (a_date_str: String[1])
+    procedure create_from_string (a_date_str: String[1])
 
-    procedure create (a_day, a_month, a_year: Integer[1])
+    procedure create (a_day, a_month, a_year: Integer[1])
 
-feature -- Modification
+feature -- Modification
 
-    procedure set_day (a_day: Integer[1])
+ procedure set_day (a_day: Integer[1])
@@ -7559,15 +7560,15 @@
Attached (x)
-
class SmartRef
+
class SmartRef
 
 feature
 
-    property url: Url;
-    property value: Base64String;
+    property url: Url;
+    property value: Base64String;
 
-    invariant
-        Validity: attached(url) or attached(value)
+ invariant + Validity: attached(url) or attached(value)
@@ -7617,33 +7618,33 @@

10.2.2.
-
    molecular_subtype: Terminology_term
-        Result := choice in
-            =======================================================
-            er_positive and
-            her2_negative and
-            not ki67.in_range (#high):    #luminal_A,
-            -------------------------------------------------------
-            er_positive and
-            her2_negative and
-            ki67.in_range (#high):        #luminal_B_HER2_negative,
-            -------------------------------------------------------
-            er_positive and
-            her2_positive:                #luminal_B_HER2_positive,
-            -------------------------------------------------------
-            er_negative and
-            pr_negative and
-            her2_positive and
-            ki67.in_range (#high):        #HER2,
-            -------------------------------------------------------
-            er_negative and
-            pr_negative and
-            her2_negative and
-            ki67.in_range (#high):        #triple_negative,
-            -------------------------------------------------------
-            *:                            #none
-            =======================================================
-        ;
+
    molecular_subtype: Terminology_term
+        Result := choice in
+            =======================================================
+            er_positive and
+            her2_negative and
+            not ki67.in_range (#high):    #luminal_A,
+            -------------------------------------------------------
+            er_positive and
+            her2_negative and
+            ki67.in_range (#high):        #luminal_B_HER2_negative,
+            -------------------------------------------------------
+            er_positive and
+            her2_positive:                #luminal_B_HER2_positive,
+            -------------------------------------------------------
+            er_negative and
+            pr_negative and
+            her2_positive and
+            ki67.in_range (#high):        #HER2,
+            -------------------------------------------------------
+            er_negative and
+            pr_negative and
+            her2_negative and
+            ki67.in_range (#high):        #triple_negative,
+            -------------------------------------------------------
+            *:                            #none
+            =======================================================
+        ;
@@ -7654,20 +7655,20 @@

10.2.2.

-
    cyclophosphamide_dose: Quantity
-        Result := cyclophosphamide_dose_per_m2 * BSA.bsa_m2
-            * case platelets.range in
-                ===================
-                #normal:      1,
-                #low:         0.75
-                ===================
-            * case gfr.range in
-                ===================
-                #normal:      1,
-                #low:         0.75,
-                #very_low:    0.5
-                ===================
-            ;
+
    cyclophosphamide_dose: Quantity
+        Result := cyclophosphamide_dose_per_m2 * BSA.bsa_m2
+            * case platelets.range in
+                ===================
+                #normal:      1,
+                #low:         0.75
+                ===================
+            * case gfr.range in
+                ===================
+                #normal:      1,
+                #low:         0.75,
+                #very_low:    0.5
+                ===================
+            ;
@@ -7688,14 +7689,14 @@

<
-
class Account
+
class Account
 
 feature
-    balance: Decimal
-    overdraft_limit: Decimal
+    balance: Decimal
+    overdraft_limit: Decimal
 
 invariant
-    balance + overdraft_limit > 0
+ balance + overdraft_limit > 0
-
class Decimal
+
class Decimal
 
 feature
-    greater_than (other: Decimal): Boolean
-        alias '>'
+    greater_than (other: Decimal): Boolean
+        alias '>'
 
-    addition: (other: Decimal): Decimal
-        alias '+'
+ addition: (other: Decimal): Decimal + alias '+'
-
    feature -- Definitions
+
    feature -- Definitions
 
-        Fast_resting_heart_rate: Real = 100;
-        Atrial_fibrillation_heart_rate: Real = 120;
-        Erratic: Terminology_code = {
-            "terminology_id": "snomed_ct",
-            "code_string": "286761003"
-        }
-        Blood_pressure_units: String = "mm[Hg]";
+        Fast_resting_heart_rate: Real = 100;
+        Atrial_fibrillation_heart_rate: Real = 120;
+        Erratic: Terminology_code = {
+            "terminology_id": "snomed_ct",
+            "code_string": "286761003"
+        }
+        Blood_pressure_units: String = "mm[Hg]";
 
-    feature -- Accessors
+    feature -- Accessors
 
-        heart_rate: Real;
-        heart_rhythm: Terminology_code;
-        bp_samples: List<Quantity>;
-        patient: Patient;
+ heart_rate: Real; + heart_rhythm: Terminology_code; + bp_samples: List<Quantity>; + patient: Patient;
-
    heart_rate >= 80
+
    heart_rate >= 80
-
    heart_rate >= Fast_resting_heart_rate
+
    heart_rate >= Fast_resting_heart_rate
-
    heart_rhythm = Erratic and heart_rate >= Atrial_fibrillation_heart_rate
+
    heart_rhythm = Erratic and heart_rate >= Atrial_fibrillation_heart_rate
-
    patient.heart_rhythm = Erratic and patient.heart_rate >= Atrial_fibrillation_heart_rate
+
    patient.heart_rhythm = Erratic and patient.heart_rate >= Atrial_fibrillation_heart_rate
-
    date_of_birth.earlier ({Env}.current_date - P10Y)
+
    date_of_birth.earlier ({Env}.current_date - P10Y)
-
    bp_samples.for_all (
-        agent (a_quantity: Quantity) {
-            a_quantity.units.is_equal (Blood_pressure_units);
-        }
-    );
+
    bp_samples.for_all (
+        agent (a_quantity: Quantity) {
+            a_quantity.units.is_equal (Blood_pressure_units);
+        }
+    );
@@ -7825,11 +7826,11 @@

-
class PersonName
-property items: String[1..*];
+
class PersonName
+property items: String[1..*];
 
 invariant
-     nameItem: items | not nameItem.isEmpty()
+ nameItem: items | not nameItem.isEmpty()
@@ -7837,10 +7838,10 @@

-
    invariant
-        for nameItem in items all
-            not nameItem.isEmpty()
-        end
+
    invariant
+        for nameItem in items all
+            not nameItem.isEmpty()
+        end
-
class Simple_bank_account
+
class Simple_bank_account
 
-feature -- Definitions
+feature -- Definitions
 
-    overdraft_limit: Decimal = 250;
+    overdraft_limit: Decimal = 250;
 
-feature -- State
+feature -- State
 
-    balance: Decimal;
+    balance: Decimal;
 
-feature -- Interface
+feature -- Interface
 
-    position: Decimal {
-        Result := balance + overdraft_limit
-    }
+    position: Decimal {
+        Result := balance + overdraft_limit
+    }
 
 invariant
-    Solvent: position >= 0.0
+ Solvent: position >= 0.0
@@ -9592,34 +9593,34 @@

12.4. Pro

-
class Simple_bank_account
+
class Simple_bank_account
 
-feature -- Modification
+feature -- Modification
 
-    put (val: Decimal)
-        precondition
-            valid_amount: val + overdraft_limit >= 0.0
-    {
-        balance := balance + val
-    }
+    put (val: Decimal)
+        precondition
+            valid_amount: val + overdraft_limit >= 0.0
+    {
+        balance := balance + val
+    }
 
-class Account_access
+class Account_access
 
-feature -- Command
+feature -- Command
 
-    deposit (v: Decimal; ac: Simple_bank_account)
-        pre_condition
-            valid_amount: v > 0.0
-    {
-        ac.put (v);
-    }
+    deposit (v: Decimal; ac: Simple_bank_account)
+        pre_condition
+            valid_amount: v > 0.0
+    {
+        ac.put (v);
+    }
 
-    withdraw (v: Decimal; ac: Simple_bank_account)
-        pre_condition
-            valid_amount: ac.overdraft_limit - v >= 0.0
-    {
-        ac.put (-v);
-    }
+ withdraw (v: Decimal; ac: Simple_bank_account) + pre_condition + valid_amount: ac.overdraft_limit - v >= 0.0 + { + ac.put (-v); + }
@@ -9642,14 +9643,14 @@

12.5. Actio

-
    check_vital_signs
-        if systolic_pressure.in_range ([critical_high])
-            raise_alarm ([emergency])
+
    check_vital_signs
+        if systolic_pressure.in_range ([critical_high])
+            raise_alarm ([emergency])
 
-        elseif systolic_pressure.in_range ([high]) and oxygen_sat.in_range([low])
-            call_staff
-        end
-    end
+ elseif systolic_pressure.in_range ([high]) and oxygen_sat.in_range([low]) + call_staff + end + end
@@ -9657,14 +9658,14 @@

12.5. Actio

-
    check_vital_signs
-        ============================================================================
-        systolic_pressure.in_range ([critical_high]):     raise_alarm ([emergency]),
-        ----------------------------------------------------------------------------
-        systolic_pressure.in_range ([high]) and
-        oxygen_sat.in_range([low]):                       call_staff
-        ============================================================================
-    end
+
    check_vital_signs
+        ============================================================================
+        systolic_pressure.in_range ([critical_high]):     raise_alarm ([emergency]),
+        ----------------------------------------------------------------------------
+        systolic_pressure.in_range ([high]) and
+        oxygen_sat.in_range([low]):                       call_staff
+        ============================================================================
+    end

@@ -10207,8 +10208,9 @@

References

+ \ No newline at end of file diff --git a/docs/bmm_persistence.html b/docs/bmm_persistence.html index 49fd4c4..b4388ac 100644 --- a/docs/bmm_persistence.html +++ b/docs/bmm_persistence.html @@ -4,12 +4,13 @@ - + BMM Persistence Model and Syntax + @@ -1807,10 +1808,10 @@

4.2. Header I

4.3. Inclusions

-
includes = <
-    ["1"] = <
-        id = <"openehr_basic_types_1.0.2">
-    >
+
includes = <
+    ["1"] = <
+        id = <"openehr_basic_types_1.0.2">
+    >
 >
@@ -1858,11 +1859,11 @@

4
-
packages = <
-    ["org.openehr.test_pkg"] = <
-        name = <"org.openehr.test_pkg">
-        classes = <"WHOLE", "SOME_TYPE", "BOOK", "CHAPTER", "ENTRY", "CAR", "CAR_BODY">
-    >
+
packages = <
+    ["org.openehr.test_pkg"] = <
+        name = <"org.openehr.test_pkg">
+        classes = <"WHOLE", "SOME_TYPE", "BOOK", "CHAPTER", "ENTRY", "CAR", "CAR_BODY">
+    >
 >
@@ -1888,16 +1889,16 @@

-
primitive_types = <
-    ["Any"] = <
-        name = <"Any">
-        is_abstract = <True>
-    >
-    ["Ordered"] = <
-        name = <"Ordered">
-        is_abstract = <True>
-        ancestors = <"Any">
-    >
+
primitive_types = <
+    ["Any"] = <
+        name = <"Any">
+        is_abstract = <True>
+    >
+    ["Ordered"] = <
+        name = <"Ordered">
+        is_abstract = <True>
+        ancestors = <"Any">
+    >
 >
@@ -1934,16 +1935,16 @@

4.5.3. Si
-
class_definitions = <
-    ["ITEM"] = <
-        name = <"ITEM">
-        ancestors = <"Any">
-        is_abstract = <True>
-        properties = <
-            -- properties here
-        >
-    >
-    -- more classes here
+
class_definitions = <
+    ["ITEM"] = <
+        name = <"ITEM">
+        ancestors = <"Any">
+        is_abstract = <True>
+        properties = <
+            -- properties here
+        >
+    >
+    -- more classes here
 >
@@ -1970,21 +1971,21 @@
4.5.3
-
    ["ELEMENT"] = <
-        name = <"ELEMENT">
-        ancestors = <"ITEM">
-        properties = <
-            ["null_flavour"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"null_flavour">
-                type = <"DV_CODED_TEXT">
-                is_mandatory = <True>
-            >
-            ["value"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"value">
-                type = <"DATA_VALUE">
-            >
-        >
-    >
+
    ["ELEMENT"] = <
+        name = <"ELEMENT">
+        ancestors = <"ITEM">
+        properties = <
+            ["null_flavour"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"null_flavour">
+                type = <"DV_CODED_TEXT">
+                is_mandatory = <True>
+            >
+            ["value"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"value">
+                type = <"DATA_VALUE">
+            >
+        >
+    >
@@ -1995,21 +1996,21 @@
<
-
    ["ELEMENT"] = <
-        name = <"ELEMENT">
-        ancestors = <"ITEM">
-        properties = <
-            ["items"] = (P_BMM_CONTAINER_PROPERTY) <
-                name = <"items">
-                type_def = <
-                    container_type = <"List">
-                    type = <"ITEM">
-                >
-                cardinality = <|>=1|>
-                is_mandatory = <True>
-            >
-        >
-    >
+
    ["ELEMENT"] = <
+        name = <"ELEMENT">
+        ancestors = <"ITEM">
+        properties = <
+            ["items"] = (P_BMM_CONTAINER_PROPERTY) <
+                name = <"items">
+                type_def = <
+                    container_type = <"List">
+                    type = <"ITEM">
+                >
+                cardinality = <|>=1|>
+                is_mandatory = <True>
+            >
+        >
+    >
-
    ["CALLBACK_WAIT"] = <
-        name = <"CALLBACK_WAIT">
-        ancestors = <"...">
-        properties = <
-            ["custom_actions"] = (P_BMM_INDEXED_CONTAINER_PROPERTY) <
-                name = <"custom_actions">
-                type_def = <
-                    container_type = <"Hash">
-                    index_type = <"String">
-                    type = <"EVENT_ACTION">
-                >
-                cardinality = <|>=0|>
-            >
-        >
-    >
+
    ["CALLBACK_WAIT"] = <
+        name = <"CALLBACK_WAIT">
+        ancestors = <"...">
+        properties = <
+            ["custom_actions"] = (P_BMM_INDEXED_CONTAINER_PROPERTY) <
+                name = <"custom_actions">
+                type_def = <
+                    container_type = <"Hash">
+                    index_type = <"String">
+                    type = <"EVENT_ACTION">
+                >
+                cardinality = <|>=0|>
+            >
+        >
+    >
-
    ["Interval"] = <
-        name = <"Interval">
-        ancestors = <"Any">
-        generic_parameter_defs = <
-            ["T"] = <
-                name = <"T">
-                conforms_to_type = <"Ordered">
-            >
-        >
-        properties = <
-            ["lower"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
-                name = <"lower">
-                type = <"T">
-            >
-            ["upper"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
-                name = <"upper">
-                type = <"T">
-            >
-        >
-    >
+
    ["Interval"] = <
+        name = <"Interval">
+        ancestors = <"Any">
+        generic_parameter_defs = <
+            ["T"] = <
+                name = <"T">
+                conforms_to_type = <"Ordered">
+            >
+        >
+        properties = <
+            ["lower"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
+                name = <"lower">
+                type = <"T">
+            >
+            ["upper"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
+                name = <"upper">
+                type = <"T">
+            >
+        >
+    >
@@ -2076,30 +2077,30 @@

4.5.4.

-
    ["DV_INTERVAL"] = <
-        name = <"DV_INTERVAL">
-        ancestors = <"Interval", "DATA_VALUE">
-        generic_parameter_defs = <
-            ["T"] = <
-                name = <"T">
-                conforms_to_type = <"DV_ORDERED">
-            >
-        >
-    >
+
    ["DV_INTERVAL"] = <
+        name = <"DV_INTERVAL">
+        ancestors = <"Interval", "DATA_VALUE">
+        generic_parameter_defs = <
+            ["T"] = <
+                name = <"T">
+                conforms_to_type = <"DV_ORDERED">
+            >
+        >
+    >
 
-    ["SOME_TYPE"] = <
-        name = <"SOME_TYPE">
-        ancestors = <"Any", ...>
-        properties = <
-            ["qty_interval_attr"] = (P_BMM_GENERIC_PROPERTY) <
-                name = <"qty_interval_attr">
-                type_def = <
-                    root_type = <"DV_INTERVAL">
-                    generic_parameters = <"DV_QUANTITY">
-                >
-            >
-        >
-    >
+ ["SOME_TYPE"] = < + name = <"SOME_TYPE"> + ancestors = <"Any", ...> + properties = < + ["qty_interval_attr"] = (P_BMM_GENERIC_PROPERTY) < + name = <"qty_interval_attr"> + type_def = < + root_type = <"DV_INTERVAL"> + generic_parameters = <"DV_QUANTITY"> + > + > + > + >
@@ -2107,23 +2108,23 @@

4.5.4.

-
    ["Patient"] = <
-        name = <"Patient">
-        ancestors = <"Any">
-        properties = <
-            ["careProvider"] = (P_BMM_CONTAINER_PROPERTY) <
-                name = <"careProvider">
-                type_def = <
-                    container_type = <"List">
-                    type_def = (P_BMM_GENERIC_TYPE) <
-                        root_type = <"Reference">
-                        generic_parameters = <"Party">
-                    >
-                >
-                cardinality = <|>=0|>
-            >
-        >
-    >
+
    ["Patient"] = <
+        name = <"Patient">
+        ancestors = <"Any">
+        properties = <
+            ["careProvider"] = (P_BMM_CONTAINER_PROPERTY) <
+                name = <"careProvider">
+                type_def = <
+                    container_type = <"List">
+                    type_def = (P_BMM_GENERIC_TYPE) <
+                        root_type = <"Reference">
+                        generic_parameters = <"Party">
+                    >
+                >
+                cardinality = <|>=0|>
+            >
+        >
+    >
@@ -2131,41 +2132,41 @@

4.5.4.

-
    ["REFERENCE_RANGE"] = <
-        name = <"REFERENCE_RANGE">
-        ancestors = <"Any">
-        generic_parameter_defs = <
-            ["T"] = <
-                name = <"T">
-                conforms_to_type = <"DV_ORDERED">
-            >
-        >
-        properties = <
-            ["range"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"range">
-                type = <"DV_INTERVAL">
-                is_mandatory = <True>
-            >
-        >
-    >
+
    ["REFERENCE_RANGE"] = <
+        name = <"REFERENCE_RANGE">
+        ancestors = <"Any">
+        generic_parameter_defs = <
+            ["T"] = <
+                name = <"T">
+                conforms_to_type = <"DV_ORDERED">
+            >
+        >
+        properties = <
+            ["range"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"range">
+                type = <"DV_INTERVAL">
+                is_mandatory = <True>
+            >
+        >
+    >
 
-    ["RANGE_OF_INTERVAL_OF_QUANTITY"] = <
-        name = <"RANGE_OF_INTERVAL_OF_QUANTITY">
-        ancestors = <"Any", ...>
-        properties = <
-            ["range"] = (P_BMM_GENERIC_PROPERTY) <
-                name = <"range">
-                type_def = <
-                    root_type = <"REFERENCE_RANGE">
-                    generic_parameter_defs = <
-                        ["T"] = (P_BMM_GENERIC_TYPE) <
-                            root_type = <"DV_INTERVAL">
-                            generic_parameters = <"DV_QUANTITY">
-                        >
-                    >
-                >
-            >
-        >
+ ["RANGE_OF_INTERVAL_OF_QUANTITY"] = < + name = <"RANGE_OF_INTERVAL_OF_QUANTITY"> + ancestors = <"Any", ...> + properties = < + ["range"] = (P_BMM_GENERIC_PROPERTY) < + name = <"range"> + type_def = < + root_type = <"REFERENCE_RANGE"> + generic_parameter_defs = < + ["T"] = (P_BMM_GENERIC_TYPE) < + root_type = <"DV_INTERVAL"> + generic_parameters = <"DV_QUANTITY"> + > + > + > + > + >
@@ -2186,38 +2187,38 @@

4.5.4.

-
    ["CRAZY_TYPE"] = <
-        name = <"CRAZY_TYPE">
-        ancestors = <"Any">
-        properties = <
-            ["range"] = (P_BMM_GENERIC_PROPERTY) <
-                name = <"range">
-                type_def = <
-                    root_type = <"REFERENCE_RANGE">
-                    generic_parameter_defs = <
-                        ["T"] = (P_BMM_GENERIC_TYPE) <
-                            root_type = <"DV_INTERVAL">
-                            generic_parameters = <"DV_QUANTITY">
-                        >
-                        ["U"] = (P_BMM_SIMPLE_TYPE) <
-                            type = <"Integer">
-                        >
-                        ["V"] = (P_BMM_CONTAINER_TYPE) <
-                            type = <"DV_QUANTITY">
-                            container_type = <"List">
-                        >
-                        ["W"] = (P_BMM_CONTAINER_TYPE) <
-                            type_def = (P_BMM_GENERIC_TYPE) <
-                                root_type = <"DV_INTERVAL">
-                                generic_parameters = <"DV_QUANTITY">
-                            >
-                            container_type = <"List">
-                        >
-                    >
-                >
-            >
-        >
-    >
+
    ["CRAZY_TYPE"] = <
+        name = <"CRAZY_TYPE">
+        ancestors = <"Any">
+        properties = <
+            ["range"] = (P_BMM_GENERIC_PROPERTY) <
+                name = <"range">
+                type_def = <
+                    root_type = <"REFERENCE_RANGE">
+                    generic_parameter_defs = <
+                        ["T"] = (P_BMM_GENERIC_TYPE) <
+                            root_type = <"DV_INTERVAL">
+                            generic_parameters = <"DV_QUANTITY">
+                        >
+                        ["U"] = (P_BMM_SIMPLE_TYPE) <
+                            type = <"Integer">
+                        >
+                        ["V"] = (P_BMM_CONTAINER_TYPE) <
+                            type = <"DV_QUANTITY">
+                            container_type = <"List">
+                        >
+                        ["W"] = (P_BMM_CONTAINER_TYPE) <
+                            type_def = (P_BMM_GENERIC_TYPE) <
+                                root_type = <"DV_INTERVAL">
+                                generic_parameters = <"DV_QUANTITY">
+                            >
+                            container_type = <"List">
+                        >
+                    >
+                >
+            >
+        >
+    >
@@ -2231,18 +2232,18 @@

4.5.5
-
    ["PROPORTION_KIND"] = (P_BMM_ENUMERATION_INTEGER) <
-        name = <"PROPORTION_KIND">
-        ancestors = <"Integer">
-        item_names = <"pk_ratio", "pk_unitary", "pk_percent", "pk_fraction", "pk_integer_fraction">
-    >
+
    ["PROPORTION_KIND"] = (P_BMM_ENUMERATION_INTEGER) <
+        name = <"PROPORTION_KIND">
+        ancestors = <"Integer">
+        item_names = <"pk_ratio", "pk_unitary", "pk_percent", "pk_fraction", "pk_integer_fraction">
+    >
 
-    ["PROPORTION_KIND_2"] = (P_BMM_ENUMERATION_INTEGER) <
-        name = <"PROPORTION_KIND_2">
-        ancestors = <"Integer">
-        item_names = <"pk_ratio", "pk_unitary", "pk_percent", "pk_fraction", "pk_integer_fraction">
-        item_values = <0, 1001, 1002, 1003>
-    >
+ ["PROPORTION_KIND_2"] = (P_BMM_ENUMERATION_INTEGER) < + name = <"PROPORTION_KIND_2"> + ancestors = <"Integer"> + item_names = <"pk_ratio", "pk_unitary", "pk_percent", "pk_fraction", "pk_integer_fraction"> + item_values = <0, 1001, 1002, 1003> + >
@@ -2250,18 +2251,18 @@

4.5.5

-
    ["MAGNITUDE_STATUS"] = (P_BMM_ENUMERATION_STRING) <
-        name = <"MAGNITUDE_STATUS">
-        ancestors = <"String", ...>
-        item_names = <"le", "ge", "eq", "approx_eq">
-        item_values = <"<=", ">=", "=", "~">
-    >
+
    ["MAGNITUDE_STATUS"] = (P_BMM_ENUMERATION_STRING) <
+        name = <"MAGNITUDE_STATUS">
+        ancestors = <"String", ...>
+        item_names = <"le", "ge", "eq", "approx_eq">
+        item_values = <"<=", ">=", "=", "~">
+    >
 
-    ["NAME_PART"] = (P_BMM_ENUMERATION_STRING) <
-        name = <"NAME_PART">
-        ancestors = <"String", ...>
-        item_names = <"FIRST", "MIDDLE", "LAST">
-    >
+ ["NAME_PART"] = (P_BMM_ENUMERATION_STRING) < + name = <"NAME_PART"> + ancestors = <"String", ...> + item_names = <"FIRST", "MIDDLE", "LAST"> + >
@@ -2272,10 +2273,10 @@

-
    ["encoding"] = (P_BMM_SINGLE_PROPERTY) <
-        name = <"encoding">
-        type = <"CODE_PHRASE">
-    >
+
    ["encoding"] = (P_BMM_SINGLE_PROPERTY) <
+        name = <"encoding">
+        type = <"CODE_PHRASE">
+    >
-
    ["GENERIC_PARENT"] = <
-        name = <"GENERIC_PARENT">
-        generic_parameter_defs = <
-            ["T"] = <
-                name = <"T">
-                conforms_to_type = <"SUPPLIER">
-            >
-            ["U"] = <
-                name = <"U">
-                conforms_to_type = <"SUPPLIER">
-            >
-        >
-        properties = <
-            ["property_a"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
-                name = <"property_a">
-                type = <"T">
-            >
-            ["property_b"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
-                name = <"property_b">
-                type = <"U">
-            >
-        >
-    >
+
    ["GENERIC_PARENT"] = <
+        name = <"GENERIC_PARENT">
+        generic_parameter_defs = <
+            ["T"] = <
+                name = <"T">
+                conforms_to_type = <"SUPPLIER">
+            >
+            ["U"] = <
+                name = <"U">
+                conforms_to_type = <"SUPPLIER">
+            >
+        >
+        properties = <
+            ["property_a"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
+                name = <"property_a">
+                type = <"T">
+            >
+            ["property_b"] = (P_BMM_SINGLE_PROPERTY_OPEN) <
+                name = <"property_b">
+                type = <"U">
+            >
+        >
+    >
 
-    ["SUPPLIER"] = <
-        name = <"SUPPLIER">
-        is_abstract = <True>
-        properties = <
-            ["abstract_prop"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"abstract_prop">
-                type = <"String">
-            >
-        >
-    >
+    ["SUPPLIER"] = <
+        name = <"SUPPLIER">
+        is_abstract = <True>
+        properties = <
+            ["abstract_prop"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"abstract_prop">
+                type = <"String">
+            >
+        >
+    >
 
-    ["SUPPLIER_A"] = <
-        name = <"SUPPLIER_A">
-        ancestors = <"SUPPLIER">
-        properties = <
-            ["magnitude"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"magnitude">
-                type = <"Double">
-                is_mandatory = <True>
-            >
-            ["units"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"units">
-                type = <"String">
-                is_mandatory = <True>
-            >
-        >
-    >
+    ["SUPPLIER_A"] = <
+        name = <"SUPPLIER_A">
+        ancestors = <"SUPPLIER">
+        properties = <
+            ["magnitude"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"magnitude">
+                type = <"Double">
+                is_mandatory = <True>
+            >
+            ["units"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"units">
+                type = <"String">
+                is_mandatory = <True>
+            >
+        >
+    >
 
-    ["SUPPLIER_B"] = <
-        name = <"SUPPLIER_B">
-        ancestors = <"SUPPLIER">
-        properties = <
-            ["property"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"property">
-                type = <"CODE_PHRASE">
-                is_mandatory = <True>
-            >
-            ["precision"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"precision">
-                type = <"Integer">
-            >
-        >
-    >
+    ["SUPPLIER_B"] = <
+        name = <"SUPPLIER_B">
+        ancestors = <"SUPPLIER">
+        properties = <
+            ["property"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"property">
+                type = <"CODE_PHRASE">
+                is_mandatory = <True>
+            >
+            ["precision"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"precision">
+                type = <"Integer">
+            >
+        >
+    >
 
-    ["GENERIC_CHILD_OPEN_T"] = <
-        name = <"GENERIC_CHILD_OPEN_T">
-        ancestor_defs = <
-            ["GENERIC_PARENT<T,SUPPLIER_B>"] = (P_BMM_GENERIC_TYPE) <
-                root_type = <"GENERIC_PARENT">
-                generic_parameters = <"T", "SUPPLIER_B">
-            >
-        >
-        generic_parameter_defs = <
-            ["T"] = <
-                name = <"T">
-                conforms_to_type = <"SUPPLIER">
-            >
-        >
-        properties = <
-            ["gen_child_open_t_prop"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"gen_child_open_t_prop">
-                type = <"String">
-            >
-        >
-    >
+    ["GENERIC_CHILD_OPEN_T"] = <
+        name = <"GENERIC_CHILD_OPEN_T">
+        ancestor_defs = <
+            ["GENERIC_PARENT<T,SUPPLIER_B>"] = (P_BMM_GENERIC_TYPE) <
+                root_type = <"GENERIC_PARENT">
+                generic_parameters = <"T", "SUPPLIER_B">
+            >
+        >
+        generic_parameter_defs = <
+            ["T"] = <
+                name = <"T">
+                conforms_to_type = <"SUPPLIER">
+            >
+        >
+        properties = <
+            ["gen_child_open_t_prop"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"gen_child_open_t_prop">
+                type = <"String">
+            >
+        >
+    >
 
-    ["GENERIC_CHILD_OPEN_U"] = <
-        name = <"GENERIC_CHILD_OPEN_U">
-        ancestor_defs = <
-            ["GENERIC_PARENT<SUPPLIER_A,U>"] = (P_BMM_GENERIC_TYPE) <
-                root_type = <"GENERIC_PARENT">
-                generic_parameters = <"SUPPLIER_A", "U">
-            >
-        >
-        generic_parameter_defs = <
-            ["U"] = <
-                name = <"U">
-                conforms_to_type = <"SUPPLIER">
-            >
-        >
-        properties = <
-            ["gen_child_open_u_prop"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"gen_child_open_u_prop">
-                type = <"String">
-            >
-        >
-    >
+    ["GENERIC_CHILD_OPEN_U"] = <
+        name = <"GENERIC_CHILD_OPEN_U">
+        ancestor_defs = <
+            ["GENERIC_PARENT<SUPPLIER_A,U>"] = (P_BMM_GENERIC_TYPE) <
+                root_type = <"GENERIC_PARENT">
+                generic_parameters = <"SUPPLIER_A", "U">
+            >
+        >
+        generic_parameter_defs = <
+            ["U"] = <
+                name = <"U">
+                conforms_to_type = <"SUPPLIER">
+            >
+        >
+        properties = <
+            ["gen_child_open_u_prop"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"gen_child_open_u_prop">
+                type = <"String">
+            >
+        >
+    >
 
-    ["GENERIC_CHILD_CLOSED"] = <
-        name = <"GENERIC_CHILD_CLOSED">
-        ancestor_defs = <
-            ["GENERIC_PARENT<SUPPLIER_A,SUPPLIER_B>"] = (P_BMM_GENERIC_TYPE) <
-                root_type = <"GENERIC_PARENT">
-                generic_parameters = <"SUPPLIER_A", "SUPPLIER_B">
-            >
-        >
-        properties = <
-            ["gen_child_closed_prop"] = (P_BMM_SINGLE_PROPERTY) <
-                name = <"gen_child_closed_prop">
-                type = <"String">
-            >
-        >
-    >
+    ["GENERIC_CHILD_CLOSED"] = <
+        name = <"GENERIC_CHILD_CLOSED">
+        ancestor_defs = <
+            ["GENERIC_PARENT<SUPPLIER_A,SUPPLIER_B>"] = (P_BMM_GENERIC_TYPE) <
+                root_type = <"GENERIC_PARENT">
+                generic_parameters = <"SUPPLIER_A", "SUPPLIER_B">
+            >
+        >
+        properties = <
+            ["gen_child_closed_prop"] = (P_BMM_SINGLE_PROPERTY) <
+                name = <"gen_child_closed_prop">
+                type = <"String">
+            >
+        >
+    >
 
 >
@@ -2474,8 +2475,9 @@

4.6. Inheritanc

+ \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 4e732e6..f38a178 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,11 +4,12 @@ - + Languages (LANG) Component - latest +

Languages (LANG) Component - latest

-
+ + \ No newline at end of file diff --git a/docs/odin.html b/docs/odin.html index 611537b..1455c79 100644 --- a/docs/odin.html +++ b/docs/odin.html @@ -4,12 +4,13 @@ - + Object Data Instance Notation (ODIN) +
-
person = (List<PERSON>) <
-    [01234] = <
-        name = < -- person's name
-            forenames = <"Sherlock">
-            family_name = <"Holmes">
-            salutation = <"Mr">
-        >
-        address = < -- person's address
-            habitation_number = <"221B">
-            street_name = <"Baker St">
-            city = <"London">
-            country = <"England">
-        >
-    >
-    [01235] = < -- etc >
+
person = (List<PERSON>) <
+    [01234] = <
+        name = < -- person's name
+            forenames = <"Sherlock">
+            family_name = <"Holmes">
+            salutation = <"Mr">
+        >
+        address = < -- person's address
+            habitation_number = <"221B">
+            street_name = <"Baker St">
+            city = <"London">
+            country = <"England">
+        >
+    >
+    [01235] = < -- etc >
 >
@@ -608,10 +609,10 @@

3.1. File E

-
unreserved : ALPHA | DIGIT | '-' | '.' | '_' | '~' ;
+
unreserved : ALPHA | DIGIT | '-' | '.' | '_' | '~' ;
 
-ALPHA : [a-zA-Z] ;
-DIGIT : [0-9] ;
+ALPHA : [a-zA-Z] ; +DIGIT : [0-9] ;
@@ -743,12 +744,12 @@

3.7. Semi-colon
-
term = <text = <"plan">; description = <"The clinician's advice">>
-term = <text = <"plan"> description = <"The clinician's advice">>
+
term = <text = <"plan">; description = <"The clinician's advice">>
+term = <text = <"plan"> description = <"The clinician's advice">>
 
-term = <
-    text = <"plan">
-    description = <"The clinician's advice">
+term = <
+    text = <"plan">
+    description = <"The clinician's advice">
 >
@@ -766,8 +767,8 @@

4. ODIN A
-
odin_text           ::=   ( schema_identifier )? main_text ;
-schema_identifier   ::=   `@` schema '=' URI ;
+
odin_text           ::=   ( schema_identifier )? main_text ;
+schema_identifier   ::=   `@` schema '=' URI ;
@@ -783,23 +784,23 @@

4.1

-
... other formalism text ...
-... delimiter ...
+
... other formalism text ...
+... delimiter ...
 
 --
 -- ODIN Embedded Fragment
 --
-    attr_1 = <
-        attr_12 = <
-            attr_13 = <leaf_value>
-        >
-    >
-    attr_2 = <
-        attr_22 = <leaf_value>
-    >
+    attr_1 = <
+        attr_12 = <
+            attr_13 = <leaf_value>
+        >
+    >
+    attr_2 = <
+        attr_22 = <leaf_value>
+    >
 
-... delimiter ...
-... other formalism text ...
+... delimiter ... +... other formalism text ...
@@ -828,14 +829,14 @@

-- ODIN Anonymous Object Document -- < - attr_1 = < - attr_12 = < - attr_13 = <leaf_value> - > - > - attr_2 = < - attr_22 = <leaf_value> - > + attr_1 = < + attr_12 = < + attr_13 = <leaf_value> + > + > + attr_2 = < + attr_22 = <leaf_value> + > > @@ -853,30 +854,30 @@

-- -- ODIN Identified Object Document -- -["id_1"] = < - attr_1 = < - attr_12 = < - attr_13 = <leaf_value> - > - > +["id_1"] = < + attr_1 = < + attr_12 = < + attr_13 = <leaf_value> + > + > > -["id_2"] = < - attr_1 = < - attr_12 = < - attr_13 = <leaf_value> - > - > +["id_2"] = < + attr_1 = < + attr_12 = < + attr_13 = <leaf_value> + > + > > ... -["id_N"] = < - attr_1 = < - attr_12 = < - attr_13 = <leaf_value> - > - > +["id_N"] = < + attr_1 = < + attr_12 = < + attr_13 = <leaf_value> + > + > > @@ -892,14 +893,14 @@

-- ODIN Identified Object Document -- -["aaa"] = < - ... +["aaa"] = < + ... > -["bbb"] = < - ... +["bbb"] = < + ... > -["ccc"] = < - ... +["ccc"] = < + ... > @@ -920,7 +921,7 @@

5.1
-
object = attribute_name '=' '<' value '>' ;
+
object = attribute_name '=' '<' value '>' ;
@@ -931,19 +932,19 @@

5.1

-
attr_1 = <
-    attr_2 = <
-        attr_3 = <leaf_value>
-        attr_4 = <leaf_value>
-    >
-    attr_5 = <
-        attr_3 = <
-            attr_6 = <leaf_value>
-        >
-        attr_7 = <leaf_value>
-    >
+
attr_1 = <
+    attr_2 = <
+        attr_3 = <leaf_value>
+        attr_4 = <leaf_value>
+    >
+    attr_5 = <
+        attr_3 = <
+            attr_6 = <leaf_value>
+        >
+        attr_7 = <leaf_value>
+    >
 >
-attr_8 = <...>
+attr_8 = <...>
@@ -963,15 +964,15 @@

5.2. Paths

-
    /attr_1
-    /attr_1/attr_2
-    /attr_1/attr_2/attr_3           -- path to a leaf value
-    /attr_1/attr_2/attr_4           -- path to a leaf value
-    /attr_1/attr_5
-    /attr_1/attr_5/attr_3
-    /attr_1/attr_5/attr_3/attr_6    -- path to a leaf value
-    /attr_1/attr_5/attr_7           -- path to a leaf value
-    /attr_8
+
    /attr_1
+    /attr_1/attr_2
+    /attr_1/attr_2/attr_3           -- path to a leaf value
+    /attr_1/attr_2/attr_4           -- path to a leaf value
+    /attr_1/attr_5
+    /attr_1/attr_5/attr_3
+    /attr_1/attr_5/attr_3/attr_6    -- path to a leaf value
+    /attr_1/attr_5/attr_7           -- path to a leaf value
+    /attr_8
@@ -985,7 +986,7 @@

5.3. Void Obj

-
    address = <...>    -- person's address
+
    address = <...>    -- person's address
@@ -996,8 +997,8 @@

5.4
-
fruits = <"pear", "cumquat", "peach">
-some_primes = <1, 2, 3, 5>
+
fruits = <"pear", "cumquat", "peach">
+some_primes = <1, 2, 3, 5>
@@ -1010,10 +1011,10 @@

5.4
-- WARNING: THIS IS NOT VALID ODIN
 
-people = <
-    <name = <...> date_of_birth = <...> sex = <...> interests = <...> >
-    <name = <...> date_of_birth = <...> sex = <...> interests = <...> >
-    -- etc
+people = <
+    <name = <...> date_of_birth = <...> sex = <...> interests = <...> >
+    <name = <...> date_of_birth = <...> sex = <...> interests = <...> >
+    -- etc
 >

@@ -1025,10 +1026,10 @@

5.4
-
people = <
-    [1] = <name = <...> birth_date = <...> interests = <...> >
-    [2] = <name = <...> birth_date = <...> interests = <...> >
-    [3] = <name = <...> birth_date = <...> interests = <...> >
+
people = <
+    [1] = <name = <...> birth_date = <...> interests = <...> >
+    [2] = <name = <...> birth_date = <...> interests = <...> >
+    [3] = <name = <...> birth_date = <...> interests = <...> >
 >
@@ -1037,10 +1038,10 @@

5.4
-
people = <
-    ["akmal:1975-04-22"] = <name = <...> birth_date = <...> interests = <...> >
-    ["akmal:1962-02-11"] = <name = <...> birth_date = <...> interests = <...> >
-    ["gianni:1978-11-30"] = <name = <...> birth_date = <...> interests = <...> >
+
people = <
+    ["akmal:1975-04-22"] = <name = <...> birth_date = <...> interests = <...> >
+    ["akmal:1962-02-11"] = <name = <...> birth_date = <...> interests = <...> >
+    ["gianni:1978-11-30"] = <name = <...> birth_date = <...> interests = <...> >
 >
@@ -1052,35 +1053,35 @@

5.4
-
school_schedule = <
-    lesson_times = <08:30:00, 09:30:00, 10:30:00, ...>
-
-    locations = <
-        [1] = <"under the big plane tree">
-        [2] = <"under the north arch">
-        [3] = <"in a garden">
-    >
-
-    subjects = <
-        ["philosophy:plato"] = < -- note construction of key
-            name = <"philosophy">
-            teacher = <"plato">
-            topics = <"meta-physics", "natural science">
-            weighting = <76%>
-        >
-        ["philosophy:kant"] = <
-            name = <"philosophy">
-            teacher = <"kant">
-            topics = <"meaning and reason", "meta-physics", "ethics">
-            weighting = <80%>
-        >
-        ["art"] = <
-            name = <"art">
-            teacher = <"goya">
-            topics = <"technique", "portraiture", "satire">
-            weighting = <78%>
-        >
-    >
+
school_schedule = <
+    lesson_times = <08:30:00, 09:30:00, 10:30:00, ...>
+
+    locations = <
+        [1] = <"under the big plane tree">
+        [2] = <"under the north arch">
+        [3] = <"in a garden">
+    >
+
+    subjects = <
+        ["philosophy:plato"] = < -- note construction of key
+            name = <"philosophy">
+            teacher = <"plato">
+            topics = <"meta-physics", "natural science">
+            weighting = <76%>
+        >
+        ["philosophy:kant"] = <
+            name = <"philosophy">
+            teacher = <"kant">
+            topics = <"meaning and reason", "meta-physics", "ethics">
+            weighting = <80%>
+        >
+        ["art"] = <
+            name = <"art">
+            teacher = <"goya">
+            topics = <"technique", "portraiture", "satire">
+            weighting = <78%>
+        >
+    >
 >
@@ -1089,17 +1090,17 @@

5.4
-
class SCHEDULE
-    lesson_times: List<Time>
-    locations: List<String>
-    subjects: List<SUBJECT> -- or it could be Hash<SUBJECT>
+
class SCHEDULE
+    lesson_times: List<Time>
+    locations: List<String>
+    subjects: List<SUBJECT> -- or it could be Hash<SUBJECT>
 end
 
-class SUBJECT
-    name: String
-    teacher: String
-    topics: List<String>
-    weighting: Real
+class SUBJECT
+    name: String
+    teacher: String
+    topics: List<String>
+    weighting: Real
 end
@@ -1120,8 +1121,8 @@

5.4
-
/school_schedule/locations[1]                   -- path to "under the big..."
-/school_schedule/subjects["philosophy:kant"]    -- path to "kant"
+
/school_schedule/locations[1]                   -- path to "under the big..."
+/school_schedule/subjects["philosophy:kant"]    -- path to "kant"
@@ -1132,19 +1133,19 @@

-
list_of_string_lists = <
-    [1] = <
-        [1] = <"first string in first list">
-        [2] = <"second string in first list">
-    >
-    [2] = <
-        [1] = <"first string in second list">
-        [2] = <"second string in second list">
-        [3] = <"third string in second list">
-    >
-    [3] = <
-        [1] = <"only string in third list">
-    >
+
list_of_string_lists = <
+    [1] = <
+        [1] = <"first string in first list">
+        [2] = <"second string in first list">
+    >
+    [2] = <
+        [1] = <"first string in second list">
+        [2] = <"second string in second list">
+        [3] = <"third string in second list">
+    >
+    [3] = <
+        [1] = <"only string in third list">
+    >
 >
@@ -1170,19 +1171,19 @@

-
destinations = <
-    ["seville"] = (TOURIST_DESTINATION) <
-        profile = (DESTINATION_PROFILE) <...>
-        hotels = <
-            ["gran sevilla"] = (HISTORIC_HOTEL) <...>
-            ["sofitel"] = (LUXURY_HOTEL) <...>
-            ["hotel real"] = (PENSION) <...>
-        >
-        attractions = <
-            ["la corrida"] = (SPORT_VENUE) <...>
-            ["Alcázar"] = (HISTORIC_SITE) <...>
-        >
-    >
+
destinations = <
+    ["seville"] = (TOURIST_DESTINATION) <
+        profile = (DESTINATION_PROFILE) <...>
+        hotels = <
+            ["gran sevilla"] = (HISTORIC_HOTEL) <...>
+            ["sofitel"] = (LUXURY_HOTEL) <...>
+            ["hotel real"] = (PENSION) <...>
+        >
+        attractions = <
+            ["la corrida"] = (SPORT_VENUE) <...>
+            ["Alcázar"] = (HISTORIC_SITE) <...>
+        >
+    >
 >
@@ -1209,8 +1210,8 @@

-
hotels = (List<HOTEL>) <
-    ["gran sevilla"] = (HISTORIC_HOTEL) <...>
+
hotels = (List<HOTEL>) <
+    ["gran sevilla"] = (HISTORIC_HOTEL) <...>
 >
@@ -1238,28 +1239,28 @@

6.1.1
-
destinations = <
-    ["seville"] = <
-        hotels = <
-            ["gran sevilla"] = </hotels["gran sevilla"]>
-            ["sofitel"] = </hotels["sofitel"]>
-            ["hotel real"] = </hotels["hotel real"]>
-        >
-    >
+
destinations = <
+    ["seville"] = <
+        hotels = <
+            ["gran sevilla"] = </hotels["gran sevilla"]>
+            ["sofitel"] = </hotels["sofitel"]>
+            ["hotel real"] = </hotels["hotel real"]>
+        >
+    >
 >
 
-bookings = <
-    ["seville:0134"] = <
-        customer_id = <"0134">
-        period = <...>
-        hotel = </hotels["sofitel"]>
-    >
+bookings = <
+    ["seville:0134"] = <
+        customer_id = <"0134">
+        period = <...>
+        hotel = </hotels["sofitel"]>
+    >
 >
 
-hotels = <
-    ["gran sevilla"] = (HISTORIC_HOTEL) <...>
-    ["sofitel"] = (LUXURY_HOTEL) <...>
-    ["hotel real"] = (PENSION) <...>
+hotels = <
+    ["gran sevilla"] = (HISTORIC_HOTEL) <...>
+    ["sofitel"] = (LUXURY_HOTEL) <...>
+    ["hotel real"] = (PENSION) <...>
 >
@@ -1274,32 +1275,32 @@

6.1.2. Ac
-
["travel_db_0293822"] = <
-    destinations = <
-        ["seville"] = <
-            hotels = <
-                ["gran sevilla"] = <["tourism_db_13"]/hotels["gran sevilla"]>
-                ["sofitel"] = <["tourism_db_13"]/hotels["sofitel"]>
-                ["hotel real"] = <["tourism_db_13"]/hotels["hotel real"]>
-            >
-        >
-    >
-
-    bookings = <
-        ["seville:0134"] = <
-            customer_id = <"0134">
-            period = <...>
-            hotel = <["tourism_db_13"]/hotels["sofitel"]>
-        >
-    >
+
["travel_db_0293822"] = <
+    destinations = <
+        ["seville"] = <
+            hotels = <
+                ["gran sevilla"] = <["tourism_db_13"]/hotels["gran sevilla"]>
+                ["sofitel"] = <["tourism_db_13"]/hotels["sofitel"]>
+                ["hotel real"] = <["tourism_db_13"]/hotels["hotel real"]>
+            >
+        >
+    >
+
+    bookings = <
+        ["seville:0134"] = <
+            customer_id = <"0134">
+            period = <...>
+            hotel = <["tourism_db_13"]/hotels["sofitel"]>
+        >
+    >
 >
 
-["tourism_db_13"] = <
-    hotels = <
-        ["gran sevilla"] = (HISTORIC_HOTEL) <...>
-        ["sofitel"] = (LUXURY_HOTEL) <...>
-        ["hotel real"] = (PENSION) <...>
-    >
+["tourism_db_13"] = <
+    hotels = <
+        ["gran sevilla"] = (HISTORIC_HOTEL) <...>
+        ["sofitel"] = (LUXURY_HOTEL) <...>
+        ["hotel real"] = (PENSION) <...>
+    >
 >
@@ -1363,7 +1364,7 @@

7.1.2. String D
-
    text = <"And now the STORM-BLAST came, and he
+
    text = <"And now the STORM-BLAST came, and he
             Was tyrannous and strong :
             He struck with his o'ertaking wings,
             And chased us south along.">
@@ -1432,10 +1433,10 @@
7
-
    1919-01-23                 -- birthdate of Django Reinhardt
-    16:35:04,5                 -- rise of Venus in Sydney on 24 Jul 2003
-    2001-05-12T07:35:20+1000   -- timestamp on an email received from Australia
-    P22DT4H15M0S               -- period of 22 days, 4 hours, 15 minutes
+
    1919-01-23                 -- birthdate of Django Reinhardt
+    16:35:04,5                 -- rise of Venus in Sydney on 24 Jul 2003
+    2001-05-12T07:35:20+1000   -- timestamp on an email received from Australia
+    P22DT4H15M0S               -- period of 22 days, 4 hours, 15 minutes
@@ -1657,9 +1658,9 @@

-
items[1]            -- the first member of 'items'
-items["systolic"]   -- the member of 'items' with meaning 'systolic'
-items["at0001"]     -- the member of 'items' with node id 'at0001'
+
items[1]            -- the first member of 'items'
+items["systolic"]   -- the member of 'items' with meaning 'systolic'
+items["at0001"]     -- the member of 'items' with node id 'at0001'
-
subjects = <
-    ["philosophy:plato"] = <
-        name = <"philosophy">
-    >
-    ["philosophy:kant"] = <
-        name = <"philosophy">
-    >
+
subjects = <
+    ["philosophy:plato"] = <
+        name = <"philosophy">
+    >
+    ["philosophy:kant"] = <
+        name = <"philosophy">
+    >
 >
@@ -1774,11 +1775,11 @@
<
-
<subjects id="philosophy:plato">
-    <name> philosophy </name>
+
<subjects id="philosophy:plato">
+    <name> philosophy </name>
 </subjects>
-<subjects id="philosophy:kant">
-    <name> philosophy </name>
+<subjects id="philosophy:kant">
+    <name> philosophy </name>
 </subjects>
@@ -1793,15 +1794,15 @@
-
countries = <
-    ["spain"] = <
-        ["hotels"] = <...>
-        ["attractions"] = <...>
-    >
-    ["egypt"] = <
-        ["hotels"] = <...>
-        ["attractions"] = <...>
-    >
+
countries = <
+    ["spain"] = <
+        ["hotels"] = <...>
+        ["attractions"] = <...>
+    >
+    ["egypt"] = <
+        ["hotels"] = <...>
+        ["attractions"] = <...>
+    >
 >
@@ -1810,22 +1811,22 @@
-
<countries key="spain">
-    <_items key="hotels">
-        ...
-    </_items>
-    <_items key="attractions">
-        ...
-    </_items>
+
<countries key="spain">
+    <_items key="hotels">
+        ...
+    </_items>
+    <_items key="attractions">
+        ...
+    </_items>
 </countries>
 
-<countries key="egypt">
-    <_items id="hotels">
-    ...
-    </_items>
-    <_items key="attractions">
-    ...
-    </_items>
+<countries key="egypt">
+    <_items id="hotels">
+    ...
+    </_items>
+    <_items key="attractions">
+    ...
+    </_items>
 </countries>
@@ -1840,13 +1841,13 @@
A.1.1.4. Type Nam
-
destinations = <
-    ["seville"] = (TOURIST_DESTINATION) <
-        profile = (DESTINATION_PROFILE) <...>
-        hotels = <
-            ["gran sevilla"] = (HISTORIC_HOTEL) <...>
-        >
-    >
+
destinations = <
+    ["seville"] = (TOURIST_DESTINATION) <
+        profile = (DESTINATION_PROFILE) <...>
+        hotels = <
+            ["gran sevilla"] = (HISTORIC_HOTEL) <...>
+        >
+    >
 >
@@ -1855,13 +1856,13 @@
A.1.1.4. Type Nam
-
<destinations id="seville" rm:type="TOURIST_DESTINATION">
-	<profile rm:type="DESTINATION_PROFILE">
-		...
-	</profile>
-	<hotels id="gran sevilla" rm:type="HISTORIC_HOTEL">
-		...
-	</hotels>
+
<destinations id="seville" rm:type="TOURIST_DESTINATION">
+	<profile rm:type="DESTINATION_PROFILE">
+		...
+	</profile>
+	<hotels id="gran sevilla" rm:type="HISTORIC_HOTEL">
+		...
+	</hotels>
 </destinations>
@@ -1886,11 +1887,11 @@

A.2.1. Leaf types
-
class Interval <T: Ordered> {
-    T lower;
-    T upper;
-    Boolean lower_included;
-    Boolean upper_included;
+
class Interval <T: Ordered> {
+    T lower;
+    T upper;
+    Boolean lower_included;
+    Boolean upper_included;
 }
@@ -1913,57 +1914,57 @@

<
-
//
-// description: Antlr4 grammar for Object Data Instance Notation (ODIN)
-// author:      Thomas Beale <thomas.beale@openehr.org>
-// contributors:Pieter Bos <pieter.bos@nedap.com>
-// support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
-// copyright:   Copyright (c) 2015- openEHR Foundation <http://www.openEHR.org>
-// license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
-//
+
//
+// description: Antlr4 grammar for Object Data Instance Notation (ODIN)
+// author:      Thomas Beale <thomas.beale@openehr.org>
+// contributors:Pieter Bos <pieter.bos@nedap.com>
+// support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
+// copyright:   Copyright (c) 2015- openEHR Foundation <http://www.openEHR.org>
+// license:     Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>
+//
 
-grammar odin;
-import odin_values;
+grammar odin;
+import odin_values;
 
-//
-// -------------------------- Parse Rules --------------------------
-//
+//
+// -------------------------- Parse Rules --------------------------
+//
 
-odin_text :
-      attr_vals
-    | object_value_block
-	;
+odin_text :
+      attr_vals
+    | object_value_block
+	;
 
-attr_vals : ( attr_val ';'? )+ ;
+attr_vals : ( attr_val ';'? )+ ;
 
-attr_val : odin_object_key '=' object_block ;
+attr_val : odin_object_key '=' object_block ;
 
-odin_object_key : ALPHA_UC_ID | ALPHA_UNDERSCORE_ID | rm_attribute_id ;
+odin_object_key : ALPHA_UC_ID | ALPHA_UNDERSCORE_ID | rm_attribute_id ;
 
-object_block :
-      object_value_block
-    | object_reference_block
-    ;
+object_block :
+      object_value_block
+    | object_reference_block
+    ;
 
-object_value_block : ( '(' rm_type_id ')' )? '<' ( primitive_object | attr_vals? | keyed_object* ) '>' | EMBEDDED_URI;
+object_value_block : ( '(' rm_type_id ')' )? '<' ( primitive_object | attr_vals? | keyed_object* ) '>' | EMBEDDED_URI;
 
-keyed_object : '[' key_id ']' '=' object_block ;
+keyed_object : '[' key_id ']' '=' object_block ;
 
-key_id :
-      string_value
-    | integer_value
-    | date_value
-    | time_value
-    | date_time_value
-    ;
+key_id :
+      string_value
+    | integer_value
+    | date_value
+    | time_value
+    | date_time_value
+    ;
 
-object_reference_block : '<' odin_path_list '>' ;
+object_reference_block : '<' odin_path_list '>' ;
 
-odin_path_list  : odin_path ( ( ',' odin_path )+ | SYM_LIST_CONTINUE )? ;
-odin_path       : '/' | ADL_PATH ;
+odin_path_list  : odin_path ( ( ',' odin_path )+ | SYM_LIST_CONTINUE )? ;
+odin_path       : '/' | ADL_PATH ;
 
-rm_type_id      : ALPHA_UC_ID ( '<' rm_type_id ( ',' rm_type_id )* '>' )? ;
-rm_attribute_id : ALPHA_LC_ID ;
+rm_type_id : ALPHA_UC_ID ( '<' rm_type_id ( ',' rm_type_id )* '>' )? ; +rm_attribute_id : ALPHA_LC_ID ;
-
//
-// grammar defining ODIN terminal value types, including atoms, lists and intervals
-// author:      Pieter Bos <pieter.bos@nedap.com>
-// support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
-// copyright:   Copyright (c) 2018- openEHR Foundation <http://www.openEHR.org>
-//
-
-grammar odin_values;
-import base_lexer;
-
-//
-// ========================= Parser ============================
-//
-
-primitive_object :
-      primitive_value
-    | primitive_list_value
-    | primitive_interval_value
-    ;
-
-primitive_value :
-      string_value
-    | integer_value
-    | real_value
-    | boolean_value
-    | character_value
-    | term_code_value
-    | date_value
-    | time_value
-    | date_time_value
-    | duration_value
-    ;
-
-primitive_list_value :
-      string_list_value
-    | integer_list_value
-    | real_list_value
-    | boolean_list_value
-    | character_list_value
-    | term_code_list_value
-    | date_list_value
-    | time_list_value
-    | date_time_list_value
-    | duration_list_value
-    ;
-
-primitive_interval_value :
-      integer_interval_value
-    | real_interval_value
-    | date_interval_value
-    | time_interval_value
-    | date_time_interval_value
-    | duration_interval_value
-    ;
-
-string_value : STRING ;
-string_list_value : string_value ( ( ',' string_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-integer_value : ( '+' | '-' )? INTEGER ;
-integer_list_value : integer_value ( ( ',' integer_value )+ | ',' SYM_LIST_CONTINUE ) ;
-integer_interval_value :
-      '|' SYM_GT? integer_value '..' SYM_LT? integer_value '|'
-    | '|' relop? integer_value '|'
-    | '|' integer_value SYM_PLUS_OR_MINUS integer_value '|'
-    ;
-integer_interval_list_value : integer_interval_value ( ( ',' integer_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-real_value : ( '+' | '-' )? REAL ;
-real_list_value : real_value ( ( ',' real_value )+ | ',' SYM_LIST_CONTINUE ) ;
-real_interval_value :
-      '|' SYM_GT? real_value '..' SYM_LT? real_value '|'
-    | '|' relop? real_value '|'
-    | '|' real_value SYM_PLUS_OR_MINUS real_value '|'
-    ;
-real_interval_list_value : real_interval_value ( ( ',' real_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-boolean_value : SYM_TRUE | SYM_FALSE ;
-boolean_list_value : boolean_value ( ( ',' boolean_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-character_value : CHARACTER ;
-character_list_value : character_value ( ( ',' character_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-date_value : ISO8601_DATE ;
-date_list_value : date_value ( ( ',' date_value )+ | ',' SYM_LIST_CONTINUE ) ;
-date_interval_value :
-      '|' SYM_GT? date_value '..' SYM_LT? date_value '|'
-    | '|' relop? date_value '|'
-    | '|' date_value SYM_PLUS_OR_MINUS duration_value '|'
-    ;
-date_interval_list_value : date_interval_value ( ( ',' date_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-time_value : ISO8601_TIME ;
-time_list_value : time_value ( ( ',' time_value )+ | ',' SYM_LIST_CONTINUE ) ;
-time_interval_value :
-      '|' SYM_GT? time_value '..' SYM_LT? time_value '|'
-    | '|' relop? time_value '|'
-    | '|' time_value SYM_PLUS_OR_MINUS duration_value '|'
-    ;
-time_interval_list_value : time_interval_value ( ( ',' time_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-date_time_value : ISO8601_DATE_TIME ;
-date_time_list_value : date_time_value ( ( ',' date_time_value )+ | ',' SYM_LIST_CONTINUE ) ;
-date_time_interval_value :
-      '|' SYM_GT? date_time_value '..' SYM_LT? date_time_value '|'
-    | '|' relop? date_time_value '|'
-    | '|' date_time_value SYM_PLUS_OR_MINUS duration_value '|'
-    ;
-date_time_interval_list_value : date_time_interval_value ( ( ',' date_time_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-duration_value : ISO8601_DURATION ;
-duration_list_value : duration_value ( ( ',' duration_value )+ | ',' SYM_LIST_CONTINUE ) ;
-duration_interval_value :
-      '|' SYM_GT? duration_value '..' SYM_LT? duration_value '|'
-    | '|' relop? duration_value '|'
-    | '|' duration_value SYM_PLUS_OR_MINUS duration_value '|'
-    ;
-duration_interval_list_value : duration_interval_value ( ( ',' duration_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-term_code_value : TERM_CODE_REF ;
-term_code_list_value : term_code_value ( ( ',' term_code_value )+ | ',' SYM_LIST_CONTINUE ) ;
-
-relop : SYM_GT | SYM_LT | SYM_LE | SYM_GE ;
+
//
+// grammar defining ODIN terminal value types, including atoms, lists and intervals
+// author:      Pieter Bos <pieter.bos@nedap.com>
+// support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
+// copyright:   Copyright (c) 2018- openEHR Foundation <http://www.openEHR.org>
+//
+
+grammar odin_values;
+import base_lexer;
+
+//
+// ========================= Parser ============================
+//
+
+primitive_object :
+      primitive_value
+    | primitive_list_value
+    | primitive_interval_value
+    ;
+
+primitive_value :
+      string_value
+    | integer_value
+    | real_value
+    | boolean_value
+    | character_value
+    | term_code_value
+    | date_value
+    | time_value
+    | date_time_value
+    | duration_value
+    ;
+
+primitive_list_value :
+      string_list_value
+    | integer_list_value
+    | real_list_value
+    | boolean_list_value
+    | character_list_value
+    | term_code_list_value
+    | date_list_value
+    | time_list_value
+    | date_time_list_value
+    | duration_list_value
+    ;
+
+primitive_interval_value :
+      integer_interval_value
+    | real_interval_value
+    | date_interval_value
+    | time_interval_value
+    | date_time_interval_value
+    | duration_interval_value
+    ;
+
+string_value : STRING ;
+string_list_value : string_value ( ( ',' string_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+integer_value : ( '+' | '-' )? INTEGER ;
+integer_list_value : integer_value ( ( ',' integer_value )+ | ',' SYM_LIST_CONTINUE ) ;
+integer_interval_value :
+      '|' SYM_GT? integer_value '..' SYM_LT? integer_value '|'
+    | '|' relop? integer_value '|'
+    | '|' integer_value SYM_PLUS_OR_MINUS integer_value '|'
+    ;
+integer_interval_list_value : integer_interval_value ( ( ',' integer_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+real_value : ( '+' | '-' )? REAL ;
+real_list_value : real_value ( ( ',' real_value )+ | ',' SYM_LIST_CONTINUE ) ;
+real_interval_value :
+      '|' SYM_GT? real_value '..' SYM_LT? real_value '|'
+    | '|' relop? real_value '|'
+    | '|' real_value SYM_PLUS_OR_MINUS real_value '|'
+    ;
+real_interval_list_value : real_interval_value ( ( ',' real_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+boolean_value : SYM_TRUE | SYM_FALSE ;
+boolean_list_value : boolean_value ( ( ',' boolean_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+character_value : CHARACTER ;
+character_list_value : character_value ( ( ',' character_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+date_value : ISO8601_DATE ;
+date_list_value : date_value ( ( ',' date_value )+ | ',' SYM_LIST_CONTINUE ) ;
+date_interval_value :
+      '|' SYM_GT? date_value '..' SYM_LT? date_value '|'
+    | '|' relop? date_value '|'
+    | '|' date_value SYM_PLUS_OR_MINUS duration_value '|'
+    ;
+date_interval_list_value : date_interval_value ( ( ',' date_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+time_value : ISO8601_TIME ;
+time_list_value : time_value ( ( ',' time_value )+ | ',' SYM_LIST_CONTINUE ) ;
+time_interval_value :
+      '|' SYM_GT? time_value '..' SYM_LT? time_value '|'
+    | '|' relop? time_value '|'
+    | '|' time_value SYM_PLUS_OR_MINUS duration_value '|'
+    ;
+time_interval_list_value : time_interval_value ( ( ',' time_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+date_time_value : ISO8601_DATE_TIME ;
+date_time_list_value : date_time_value ( ( ',' date_time_value )+ | ',' SYM_LIST_CONTINUE ) ;
+date_time_interval_value :
+      '|' SYM_GT? date_time_value '..' SYM_LT? date_time_value '|'
+    | '|' relop? date_time_value '|'
+    | '|' date_time_value SYM_PLUS_OR_MINUS duration_value '|'
+    ;
+date_time_interval_list_value : date_time_interval_value ( ( ',' date_time_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+duration_value : ISO8601_DURATION ;
+duration_list_value : duration_value ( ( ',' duration_value )+ | ',' SYM_LIST_CONTINUE ) ;
+duration_interval_value :
+      '|' SYM_GT? duration_value '..' SYM_LT? duration_value '|'
+    | '|' relop? duration_value '|'
+    | '|' duration_value SYM_PLUS_OR_MINUS duration_value '|'
+    ;
+duration_interval_list_value : duration_interval_value ( ( ',' duration_interval_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+term_code_value : TERM_CODE_REF ;
+term_code_list_value : term_code_value ( ( ',' term_code_value )+ | ',' SYM_LIST_CONTINUE ) ;
+
+relop : SYM_GT | SYM_LT | SYM_LE | SYM_GE ;
-
//
-//  General purpose patterns used in all openEHR parser and lexer tools
-//  author:      Pieter Bos <pieter.bos@nedap.com>
-//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
-//  copyright:   Copyright (c) 2018- openEHR Foundation <http://www.openEHR.org>
-//
+
//
+//  General purpose patterns used in all openEHR parser and lexer tools
+//  author:      Pieter Bos <pieter.bos@nedap.com>
+//  support:     openEHR Specifications PR tracker <https://openehr.atlassian.net/projects/SPECPR/issues>
+//  copyright:   Copyright (c) 2018- openEHR Foundation <http://www.openEHR.org>
+//
 
-lexer grammar base_lexer;
+lexer grammar base_lexer;
 
-// ---------- whitespace & comments ----------
+// ---------- whitespace & comments ----------
 
-WS         : [ \t\r]+    -> channel(HIDDEN) ;
-LINE       : '\r'? EOL  -> channel(HIDDEN) ;  // increment line count
-CMT_LINE   : '--' .*? '\r'? EOL  -> skip ;   // (increment line count)
-fragment EOL : '\n' ;
+WS         : [ \t\r]+    -> channel(HIDDEN) ;
+LINE       : '\r'? EOL  -> channel(HIDDEN) ;  // increment line count
+CMT_LINE   : '--' .*? '\r'? EOL  -> skip ;   // (increment line count)
+fragment EOL : '\n' ;
 
 
-// -------------- template overlay cannot be handled in a more simple way because it includes the comment line
-SYM_TEMPLATE_OVERLAY : H_CMT_LINE (WS|LINE)* SYM_TEMPLATE_OVERLAY_ONLY;
-fragment H_CMT_LINE : '--------' '-'*? ('\n'|'\r''\n'|'\r')  ;  // special type of comment for splitting template overlays
-fragment SYM_TEMPLATE_OVERLAY_ONLY     : [Tt][Ee][Mm][Pp][Ll][Aa][Tt][Ee]'_'[Oo][Vv][Ee][Rr][Ll][Aa][Yy] ;
+// -------------- template overlay cannot be handled in a more simple way because it includes the comment line
+SYM_TEMPLATE_OVERLAY : H_CMT_LINE (WS|LINE)* SYM_TEMPLATE_OVERLAY_ONLY;
+fragment H_CMT_LINE : '--------' '-'*? ('\n'|'\r''\n'|'\r')  ;  // special type of comment for splitting template overlays
+fragment SYM_TEMPLATE_OVERLAY_ONLY     : [Tt][Ee][Mm][Pp][Ll][Aa][Tt][Ee]'_'[Oo][Vv][Ee][Rr][Ll][Aa][Yy] ;
 
-// ---------- path patterns -----------
+// ---------- path patterns -----------
 
-ADL_PATH : ADL_ABSOLUTE_PATH | ADL_RELATIVE_PATH;
-fragment ADL_ABSOLUTE_PATH : ('/' ADL_PATH_SEGMENT)+;
-fragment ADL_RELATIVE_PATH : ADL_PATH_SEGMENT ('/' ADL_PATH_SEGMENT)+;
+ADL_PATH : ADL_ABSOLUTE_PATH | ADL_RELATIVE_PATH;
+fragment ADL_ABSOLUTE_PATH : ('/' ADL_PATH_SEGMENT)+;
+fragment ADL_RELATIVE_PATH : ADL_PATH_SEGMENT ('/' ADL_PATH_SEGMENT)+;
 
-fragment ADL_PATH_SEGMENT      : ALPHA_LC_ID ('[' ADL_PATH_ATTRIBUTE ']')?;
-fragment ADL_PATH_ATTRIBUTE    : ID_CODE | STRING | INTEGER | ARCHETYPE_REF | ARCHETYPE_HRID;
+fragment ADL_PATH_SEGMENT      : ALPHA_LC_ID ('[' ADL_PATH_ATTRIBUTE ']')?;
+fragment ADL_PATH_ATTRIBUTE    : ID_CODE | STRING | INTEGER | ARCHETYPE_REF | ARCHETYPE_HRID;
 
 
-// ---------- ISO8601-based date/time/duration constraint patterns
+// ---------- ISO8601-based date/time/duration constraint patterns
 
-DATE_CONSTRAINT_PATTERN      : YEAR_PATTERN '-' MONTH_PATTERN '-' DAY_PATTERN ;
-TIME_CONSTRAINT_PATTERN      : HOUR_PATTERN ':' MINUTE_PATTERN ':' SECOND_PATTERN TZ_PATTERN? ;
-DATE_TIME_CONSTRAINT_PATTERN : DATE_CONSTRAINT_PATTERN 'T' TIME_CONSTRAINT_PATTERN ;
+DATE_CONSTRAINT_PATTERN      : YEAR_PATTERN '-' MONTH_PATTERN '-' DAY_PATTERN ;
+TIME_CONSTRAINT_PATTERN      : HOUR_PATTERN ':' MINUTE_PATTERN ':' SECOND_PATTERN TZ_PATTERN? ;
+DATE_TIME_CONSTRAINT_PATTERN : DATE_CONSTRAINT_PATTERN 'T' TIME_CONSTRAINT_PATTERN ;
 
-fragment YEAR_PATTERN   : 'yyyy' | 'YYYY' | 'yyy' | 'YYY' ;
-fragment MONTH_PATTERN  : 'mm' | 'MM' | '??' | 'XX' | 'xx' ;
-fragment DAY_PATTERN    : 'dd' | 'DD' | '??' | 'XX' | 'xx'  ;
-fragment HOUR_PATTERN   : 'hh' | 'HH' | '??' | 'XX' | 'xx'  ;
-fragment MINUTE_PATTERN : 'mm' | 'MM' | '??' | 'XX' | 'xx'  ;
-fragment SECOND_PATTERN : 'ss' | 'SS' | '??' | 'XX' | 'xx'  ;
-fragment TZ_PATTERN     : '±' ('hh' | 'HH') (':'? ('mm' | 'MM'))? | 'Z' ;
+fragment YEAR_PATTERN   : 'yyyy' | 'YYYY' | 'yyy' | 'YYY' ;
+fragment MONTH_PATTERN  : 'mm' | 'MM' | '??' | 'XX' | 'xx' ;
+fragment DAY_PATTERN    : 'dd' | 'DD' | '??' | 'XX' | 'xx'  ;
+fragment HOUR_PATTERN   : 'hh' | 'HH' | '??' | 'XX' | 'xx'  ;
+fragment MINUTE_PATTERN : 'mm' | 'MM' | '??' | 'XX' | 'xx'  ;
+fragment SECOND_PATTERN : 'ss' | 'SS' | '??' | 'XX' | 'xx'  ;
+fragment TZ_PATTERN     : '±' ('hh' | 'HH') (':'? ('mm' | 'MM'))? | 'Z' ;
 
-DURATION_CONSTRAINT_PATTERN  : 'P' [yY]?[mM]?[Ww]?[dD]? ( 'T' [hH]?[mM]?[sS]? )? ;
+DURATION_CONSTRAINT_PATTERN  : 'P' [yY]?[mM]?[Ww]?[dD]? ( 'T' [hH]?[mM]?[sS]? )? ;
 
-// ---------- Delimited Regex matcher ------------
-// In ADL, a regexp can only exist between {}.
-// allows for '/' or '^' delimiters
-// logical form - REGEX: '/' ( '\\/' | ~'/' )+ '/' | '^' ( '\\^' | ~'^' )+ '^';
-// The following is used to ensure REGEXes don't get mixed up with paths, which use '/' chars
+// ---------- Delimited Regex matcher ------------
+// In ADL, a regexp can only exist between {}.
+// allows for '/' or '^' delimiters
+// logical form - REGEX: '/' ( '\\/' | ~'/' )+ '/' | '^' ( '\\^' | ~'^' )+ '^';
+// The following is used to ensure REGEXes don't get mixed up with paths, which use '/' chars
 
-//a
-// regexp can only exist between {}. It can optionally have an assumed value, by adding ;"value"
-CONTAINED_REGEXP: '{'WS* (SLASH_REGEXP | CARET_REGEXP) WS* (';' WS* STRING)? WS* '}';
-fragment SLASH_REGEXP: '/' SLASH_REGEXP_CHAR+ '/';
-fragment SLASH_REGEXP_CHAR: ~[/\n\r] | ESCAPE_SEQ | '\\/';
+//a
+// regexp can only exist between {}. It can optionally have an assumed value, by adding ;"value"
+CONTAINED_REGEXP: '{'WS* (SLASH_REGEXP | CARET_REGEXP) WS* (';' WS* STRING)? WS* '}';
+fragment SLASH_REGEXP: '/' SLASH_REGEXP_CHAR+ '/';
+fragment SLASH_REGEXP_CHAR: ~[/\n\r] | ESCAPE_SEQ | '\\/';
 
-fragment CARET_REGEXP: '^' CARET_REGEXP_CHAR+ '^';
-fragment CARET_REGEXP_CHAR: ~[^\n\r] | ESCAPE_SEQ | '\\^';
+fragment CARET_REGEXP: '^' CARET_REGEXP_CHAR+ '^';
+fragment CARET_REGEXP_CHAR: ~[^\n\r] | ESCAPE_SEQ | '\\^';
 
 // ---------- various ADL2 codes -------
 
-ROOT_ID_CODE : 'id1' '.1'* ;
-ID_CODE      : 'id' CODE_STR ;
-AT_CODE      : 'at' CODE_STR ;
-AC_CODE      : 'ac' CODE_STR ;
-fragment CODE_STR : ('0' | [1-9][0-9]*) ( '.' ('0' | [1-9][0-9]* ))* ;
+ROOT_ID_CODE : 'id1' '.1'* ;
+ID_CODE      : 'id' CODE_STR ;
+AT_CODE      : 'at' CODE_STR ;
+AC_CODE      : 'ac' CODE_STR ;
+fragment CODE_STR : ('0' | [1-9][0-9]*) ( '.' ('0' | [1-9][0-9]* ))* ;
 
 // ---------- ISO8601 Date/Time values ----------
 
-ISO8601_DATE      : YEAR '-' MONTH ( '-' DAY )? | YEAR '-' MONTH '-' UNKNOWN_DT | YEAR '-' UNKNOWN_DT '-' UNKNOWN_DT ;
-ISO8601_TIME      : ( HOUR ':' MINUTE ( ':' SECOND ( SECOND_DEC_SEP DIGIT+ )?)? | HOUR ':' MINUTE ':' UNKNOWN_DT | HOUR ':' UNKNOWN_DT ':' UNKNOWN_DT ) TIMEZONE? ;
-ISO8601_DATE_TIME : ( YEAR '-' MONTH '-' DAY 'T' HOUR (':' MINUTE (':' SECOND ( SECOND_DEC_SEP DIGIT+ )?)?)? | YEAR '-' MONTH '-' DAY 'T' HOUR ':' MINUTE ':' UNKNOWN_DT | YEAR '-' MONTH '-' DAY 'T' HOUR ':' UNKNOWN_DT ':' UNKNOWN_DT ) TIMEZONE? ;
-fragment TIMEZONE : 'Z' | ('+'|'-') HOUR_MIN ;   // hour offset, e.g. `+0930`, or else literal `Z` indicating +0000.
-fragment YEAR     : [0-9][0-9][0-9][0-9] ;		   // Year in ISO8601:2004 is 4 digits with 0-filling as needed
-fragment MONTH    : ( [0][1-9] | [1][0-2] ) ;    // month in year
-fragment DAY      : ( [0][1-9] | [12][0-9] | [3][0-1] ) ;  // day in month
-fragment HOUR     : ( [01]?[0-9] | [2][0-3] ) ;  // hour in 24 hour clock
-fragment MINUTE   : [0-5][0-9] ;                 // minutes
-fragment HOUR_MIN : ( [01]?[0-9] | [2][0-3] ) [0-5][0-9] ;  // hour / minutes quad digit pattern
-fragment SECOND   : [0-5][0-9] ;                 // seconds
-fragment SECOND_DEC_SEP : '.' | ',' ;
-fragment UNKNOWN_DT  : '??' ;                    // any unknown date/time value, except years.
+ISO8601_DATE      : YEAR '-' MONTH ( '-' DAY )? | YEAR '-' MONTH '-' UNKNOWN_DT | YEAR '-' UNKNOWN_DT '-' UNKNOWN_DT ;
+ISO8601_TIME      : ( HOUR ':' MINUTE ( ':' SECOND ( SECOND_DEC_SEP DIGIT+ )?)? | HOUR ':' MINUTE ':' UNKNOWN_DT | HOUR ':' UNKNOWN_DT ':' UNKNOWN_DT ) TIMEZONE? ;
+ISO8601_DATE_TIME : ( YEAR '-' MONTH '-' DAY 'T' HOUR (':' MINUTE (':' SECOND ( SECOND_DEC_SEP DIGIT+ )?)?)? | YEAR '-' MONTH '-' DAY 'T' HOUR ':' MINUTE ':' UNKNOWN_DT | YEAR '-' MONTH '-' DAY 'T' HOUR ':' UNKNOWN_DT ':' UNKNOWN_DT ) TIMEZONE? ;
+fragment TIMEZONE : 'Z' | ('+'|'-') HOUR_MIN ;   // hour offset, e.g. `+0930`, or else literal `Z` indicating +0000.
+fragment YEAR     : [0-9][0-9][0-9][0-9] ;		   // Year in ISO8601:2004 is 4 digits with 0-filling as needed
+fragment MONTH    : ( [0][1-9] | [1][0-2] ) ;    // month in year
+fragment DAY      : ( [0][1-9] | [12][0-9] | [3][0-1] ) ;  // day in month
+fragment HOUR     : ( [01]?[0-9] | [2][0-3] ) ;  // hour in 24 hour clock
+fragment MINUTE   : [0-5][0-9] ;                 // minutes
+fragment HOUR_MIN : ( [01]?[0-9] | [2][0-3] ) [0-5][0-9] ;  // hour / minutes quad digit pattern
+fragment SECOND   : [0-5][0-9] ;                 // seconds
+fragment SECOND_DEC_SEP : '.' | ',' ;
+fragment UNKNOWN_DT  : '??' ;                    // any unknown date/time value, except years.
 
 // ISO8601 DURATION PnYnMnWnDTnnHnnMnn.nnnS 
 // here we allow a deviation from the standard to allow weeks to be // mixed in with the rest since this commonly occurs in medicine
 // TODO: the following will incorrectly match just 'P'
-ISO8601_DURATION : '-'?'P' (DIGIT+ [yY])? (DIGIT+ [mM])? (DIGIT+ [wW])? (DIGIT+[dD])? ('T' (DIGIT+[hH])? (DIGIT+[mM])? (DIGIT+ (SECOND_DEC_SEP DIGIT+)?[sS])?)? ;
+ISO8601_DURATION : '-'?'P' (DIGIT+ [yY])? (DIGIT+ [mM])? (DIGIT+ [wW])? (DIGIT+[dD])? ('T' (DIGIT+[hH])? (DIGIT+[mM])? (DIGIT+ (SECOND_DEC_SEP DIGIT+)?[sS])?)? ;
 
 // ------------------- special word symbols --------------
-SYM_TRUE  : [Tt][Rr][Uu][Ee] ;
-SYM_FALSE : [Ff][Aa][Ll][Ss][Ee] ;
+SYM_TRUE  : [Tt][Rr][Uu][Ee] ;
+SYM_FALSE : [Ff][Aa][Ll][Ss][Ee] ;
 
 // ---------------------- Identifiers ---------------------
 
-ARCHETYPE_HRID      : ARCHETYPE_HRID_ROOT '.v' ARCHETYPE_VERSION_ID ;
-ARCHETYPE_REF       : ARCHETYPE_HRID_ROOT '.v' INTEGER ( '.' DIGIT+ )* ;
-fragment ARCHETYPE_HRID_ROOT : (NAMESPACE '::')? IDENTIFIER '-' IDENTIFIER '-' IDENTIFIER '.' LABEL ;
-fragment ARCHETYPE_VERSION_ID: DIGIT+ ('.' DIGIT+ ('.' DIGIT+ ( ( '-rc' | '-alpha' ) ( '.' DIGIT+ )? )?)?)? ;
-VERSION_ID          : DIGIT+ '.' DIGIT+ '.' DIGIT+ ( ( '-rc' | '-alpha' ) ( '.' DIGIT+ )? )? ;
-fragment IDENTIFIER : ALPHA_CHAR WORD_CHAR* ;
+ARCHETYPE_HRID      : ARCHETYPE_HRID_ROOT '.v' ARCHETYPE_VERSION_ID ;
+ARCHETYPE_REF       : ARCHETYPE_HRID_ROOT '.v' INTEGER ( '.' DIGIT+ )* ;
+fragment ARCHETYPE_HRID_ROOT : (NAMESPACE '::')? IDENTIFIER '-' IDENTIFIER '-' IDENTIFIER '.' LABEL ;
+fragment ARCHETYPE_VERSION_ID: DIGIT+ ('.' DIGIT+ ('.' DIGIT+ ( ( '-rc' | '-alpha' | '-beta' ) ( '.' DIGIT+ )? )?)?)? ;
+VERSION_ID          : DIGIT+ '.' DIGIT+ '.' DIGIT+ ( ( '-rc' | '-alpha' | '-beta' ) ( '.' DIGIT+ )? )? ;
+fragment IDENTIFIER : ALPHA_CHAR WORD_CHAR* ;
 
 // --------------------- composed primitive types -------------------
 
 // e.g. [ICD10AM(1998)::F23]; [ISO_639-1::en]
-TERM_CODE_REF : '[' TERM_CODE_CHAR+ ( '(' TERM_CODE_CHAR+ ')' )? '::' TERM_CODE_CHAR+ ']' ;
-fragment TERM_CODE_CHAR: NAME_CHAR | '.';
+TERM_CODE_REF : '[' TERM_CODE_CHAR+ ( '(' TERM_CODE_CHAR+ ')' )? '::' TERM_CODE_CHAR+ ']' ;
+fragment TERM_CODE_CHAR: NAME_CHAR | '.';
 
 // --------------------- URIs --------------------
 
 // URI recogniser based on https://tools.ietf.org/html/rfc3986 and
 // http://www.w3.org/Addressing/URL/5_URI_BNF.html
-EMBEDDED_URI: '<' ([ \t\r\n]|CMT_LINE)* URI ([ \t\r\n]|CMT_LINE)* '>';
+EMBEDDED_URI: '<' ([ \t\r\n]|CMT_LINE)* URI ([ \t\r\n]|CMT_LINE)* '>';
 
-fragment URI : URI_SCHEME ':' URI_HIER_PART ( '?' URI_QUERY )? ('#' URI_FRAGMENT)? ;
+fragment URI : URI_SCHEME ':' URI_HIER_PART ( '?' URI_QUERY )? ('#' URI_FRAGMENT)? ;
 
-fragment URI_HIER_PART : ( '//' URI_AUTHORITY ) URI_PATH_ABEMPTY
-    | URI_PATH_ABSOLUTE
-    | URI_PATH_ROOTLESS
-    | URI_PATH_EMPTY;
+fragment URI_HIER_PART : ( '//' URI_AUTHORITY ) URI_PATH_ABEMPTY
+    | URI_PATH_ABSOLUTE
+    | URI_PATH_ROOTLESS
+    | URI_PATH_EMPTY;
 
-fragment URI_SCHEME : ALPHA_CHAR ( ALPHA_CHAR | DIGIT | '+' | '-' | '.')* ;
+fragment URI_SCHEME : ALPHA_CHAR ( ALPHA_CHAR | DIGIT | '+' | '-' | '.')* ;
 
-fragment URI_AUTHORITY : ( URI_USERINFO '@' )? URI_HOST ( ':' URI_PORT )? ;
-fragment URI_USERINFO: (URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | ':' )* ;
-fragment URI_HOST : URI_IP_LITERAL | URI_IPV4_ADDRESS | URI_REG_NAME ; //TODO: ipv6
-fragment URI_PORT: DIGIT*;
+fragment URI_AUTHORITY : ( URI_USERINFO '@' )? URI_HOST ( ':' URI_PORT )? ;
+fragment URI_USERINFO: (URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | ':' )* ;
+fragment URI_HOST : URI_IP_LITERAL | URI_IPV4_ADDRESS | URI_REG_NAME ; //TODO: ipv6
+fragment URI_PORT: DIGIT*;
 
-fragment URI_IP_LITERAL   : '[' URI_IPV6_LITERAL ']'; //TODO, if needed: IPvFuture
-fragment URI_IPV4_ADDRESS : URI_DEC_OCTET '.' URI_DEC_OCTET '.' URI_DEC_OCTET '.' URI_DEC_OCTET ;
-fragment URI_IPV6_LITERAL : HEX_QUAD (':' HEX_QUAD )* ':' ':' HEX_QUAD (':' HEX_QUAD )* ;
+fragment URI_IP_LITERAL   : '[' URI_IPV6_LITERAL ']'; //TODO, if needed: IPvFuture
+fragment URI_IPV4_ADDRESS : URI_DEC_OCTET '.' URI_DEC_OCTET '.' URI_DEC_OCTET '.' URI_DEC_OCTET ;
+fragment URI_IPV6_LITERAL : HEX_QUAD (':' HEX_QUAD )* ':' ':' HEX_QUAD (':' HEX_QUAD )* ;
 
-fragment URI_DEC_OCTET  : DIGIT | [1-9] DIGIT | '1' DIGIT DIGIT | '2' [0-4] DIGIT | '25' [0-5];
-fragment URI_REG_NAME: (URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS)*;
-fragment HEX_QUAD : HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ;
+fragment URI_DEC_OCTET  : DIGIT | [1-9] DIGIT | '1' DIGIT DIGIT | '2' [0-4] DIGIT | '25' [0-5];
+fragment URI_REG_NAME: (URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS)*;
+fragment HEX_QUAD : HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ;
 
-fragment URI_PATH_ABEMPTY: ('/' URI_SEGMENT ) *;
-fragment URI_PATH_ABSOLUTE: '/' ( URI_SEGMENT_NZ ( '/' URI_SEGMENT )* )?;
-fragment URI_PATH_NOSCHEME: URI_SEGMENT_NZ_NC ( '/' URI_SEGMENT )*;
-fragment URI_PATH_ROOTLESS: URI_SEGMENT_NZ ( '/' URI_SEGMENT )*;
-fragment URI_PATH_EMPTY: ;
+fragment URI_PATH_ABEMPTY: ('/' URI_SEGMENT ) *;
+fragment URI_PATH_ABSOLUTE: '/' ( URI_SEGMENT_NZ ( '/' URI_SEGMENT )* )?;
+fragment URI_PATH_NOSCHEME: URI_SEGMENT_NZ_NC ( '/' URI_SEGMENT )*;
+fragment URI_PATH_ROOTLESS: URI_SEGMENT_NZ ( '/' URI_SEGMENT )*;
+fragment URI_PATH_EMPTY: ;
 
-fragment URI_SEGMENT: URI_PCHAR*;
-fragment URI_SEGMENT_NZ: URI_PCHAR+;
-fragment URI_SEGMENT_NZ_NC: ( URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | '@' )+; //non-zero-length segment without any colon ":"
+fragment URI_SEGMENT: URI_PCHAR*;
+fragment URI_SEGMENT_NZ: URI_PCHAR+;
+fragment URI_SEGMENT_NZ_NC: ( URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | '@' )+; //non-zero-length segment without any colon ":"
 
-fragment URI_PCHAR: URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | ':' | '@';
+fragment URI_PCHAR: URI_UNRESERVED | URI_PCT_ENCODED | URI_SUB_DELIMS | ':' | '@';
 
 //fragment URI_PATH   : '/' | ( '/' URI_XPALPHA+ )+ ('/')?;
-fragment URI_QUERY : (URI_PCHAR | '/' | '?')*;
-fragment URI_FRAGMENT  : (URI_PCHAR | '/' | '?')*;
+fragment URI_QUERY : (URI_PCHAR | '/' | '?')*;
+fragment URI_FRAGMENT  : (URI_PCHAR | '/' | '?')*;
 
-fragment URI_PCT_ENCODED : '%' HEX_DIGIT HEX_DIGIT ;
+fragment URI_PCT_ENCODED : '%' HEX_DIGIT HEX_DIGIT ;
 
-fragment URI_UNRESERVED: ALPHA_CHAR | DIGIT | '-' | '.' | '_' | '~';
-fragment URI_RESERVED: URI_GEN_DELIMS | URI_SUB_DELIMS;
-fragment URI_GEN_DELIMS: ':' | '/' | '?' | '#' | '[' | ']' | '@'; //TODO: migrate to [/?#...] notation
-fragment URI_SUB_DELIMS: '!' | '$' | '&' | '\'' | '(' | ')'
-                         | '*' | '+' | ',' | ';' | '=';
+fragment URI_UNRESERVED: ALPHA_CHAR | DIGIT | '-' | '.' | '_' | '~';
+fragment URI_RESERVED: URI_GEN_DELIMS | URI_SUB_DELIMS;
+fragment URI_GEN_DELIMS: ':' | '/' | '?' | '#' | '[' | ']' | '@'; //TODO: migrate to [/?#...] notation
+fragment URI_SUB_DELIMS: '!' | '$' | '&' | '\'' | '(' | ')'
+                         | '*' | '+' | ',' | ';' | '=';
 
 // According to IETF http://tools.ietf.org/html/rfc1034[RFC 1034] and http://tools.ietf.org/html/rfc1035[RFC 1035],
 // as clarified by http://tools.ietf.org/html/rfc2181[RFC 2181] (section 11)
-fragment NAMESPACE : LABEL ('.' LABEL)* ;
-fragment LABEL : ALPHA_CHAR (NAME_CHAR|URI_PCT_ENCODED)* ;
+fragment NAMESPACE : LABEL ('.' LABEL)* ;
+fragment LABEL : ALPHA_CHAR (NAME_CHAR|URI_PCT_ENCODED)* ;
 
 
-GUID : HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ ;
+GUID : HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ '-' HEX_DIGIT+ ;
 
-ALPHA_UC_ID :   ALPHA_UCHAR WORD_CHAR* ;   // used for type ids
-ALPHA_LC_ID :   ALPHA_LCHAR WORD_CHAR* ;   // used for attribute / method ids
-ALPHA_UNDERSCORE_ID : '_' WORD_CHAR* ;     // usually used for meta-model ids
+ALPHA_UC_ID :   ALPHA_UCHAR WORD_CHAR* ;   // used for type ids
+ALPHA_LC_ID :   ALPHA_LCHAR WORD_CHAR* ;   // used for attribute / method ids
+ALPHA_UNDERSCORE_ID : '_' WORD_CHAR* ;     // usually used for meta-model ids
 
 // --------------------- atomic primitive types -------------------
 
-INTEGER : DIGIT+ E_SUFFIX? ;
-REAL :    DIGIT+ '.' DIGIT+ E_SUFFIX? ;
-fragment E_SUFFIX : [eE][+-]? DIGIT+ ;
+INTEGER : DIGIT+ E_SUFFIX? ;
+REAL :    DIGIT+ '.' DIGIT+ E_SUFFIX? ;
+fragment E_SUFFIX : [eE][+-]? DIGIT+ ;
 
-STRING : '"' STRING_CHAR*? '"' ;
-fragment STRING_CHAR : ~["\\] | ESCAPE_SEQ | UTF8CHAR ; // strings can be multi-line
+STRING : '"' STRING_CHAR*? '"' ;
+fragment STRING_CHAR : ~["\\] | ESCAPE_SEQ | UTF8CHAR ; // strings can be multi-line
 
 CHARACTER : '\'' CHAR '\'' ;
 fragment CHAR : ~['\\\r\n] | ESCAPE_SEQ | UTF8CHAR  ;
 
-fragment ESCAPE_SEQ: '\\' ['"?abfnrtv\\] ;
+fragment ESCAPE_SEQ: '\\' ['"?abfnrtv\\] ;
 
 // ------------------- character fragments ------------------
 
-fragment NAME_CHAR     : WORD_CHAR | '-' ;
-fragment WORD_CHAR     : ALPHANUM_CHAR | '_' ;
-fragment ALPHANUM_CHAR : ALPHA_CHAR | DIGIT ;
+fragment NAME_CHAR     : WORD_CHAR | '-' ;
+fragment WORD_CHAR     : ALPHANUM_CHAR | '_' ;
+fragment ALPHANUM_CHAR : ALPHA_CHAR | DIGIT ;
 
-fragment ALPHA_CHAR  : [a-zA-Z] ;
-fragment ALPHA_UCHAR : [A-Z] ;
-fragment ALPHA_LCHAR : [a-z] ;
-fragment UTF8CHAR    : '\\u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ;
+fragment ALPHA_CHAR  : [a-zA-Z] ;
+fragment ALPHA_UCHAR : [A-Z] ;
+fragment ALPHA_LCHAR : [a-z] ;
+fragment UTF8CHAR    : '\\u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ;
 
-fragment DIGIT     : [0-9] ;
-fragment HEX_DIGIT : [0-9a-fA-F] ;
+fragment DIGIT     : [0-9] ;
+fragment HEX_DIGIT : [0-9a-fA-F] ;
 
 // -------------------- common symbols ---------------------
 
-SYM_COMMA: ',' ;
-SYM_SEMI_COLON : ';' ;
+SYM_COMMA: ',' ;
+SYM_SEMI_COLON : ';' ;
 
-SYM_LPAREN   : '(';
-SYM_RPAREN   : ')';
-SYM_LBRACKET : '[';
-SYM_RBRACKET : ']';
-SYM_LCURLY   : '{' ;
-SYM_RCURLY   : '}' ;
+SYM_LPAREN   : '(';
+SYM_RPAREN   : ')';
+SYM_LBRACKET : '[';
+SYM_RBRACKET : ']';
+SYM_LCURLY   : '{' ;
+SYM_RCURLY   : '}' ;
 
 // --------- symbols ----------
-SYM_ASSIGNMENT: ':=' | '::=' ;
+SYM_ASSIGNMENT: ':=' | '::=' ;
 
-SYM_NE : '/=' | '!=' | '≠' ;
-SYM_EQ : '=' ;
-SYM_GT : '>' ;
-SYM_LT : '<' ;
-SYM_LE : '<=' | '≤' ;
-SYM_GE : '>=' | '≥' ;
+SYM_NE : '/=' | '!=' | '≠' ;
+SYM_EQ : '=' ;
+SYM_GT : '>' ;
+SYM_LT : '<' ;
+SYM_LE : '<=' | '≤' ;
+SYM_GE : '>=' | '≥' ;
 
 // TODO: remove when [] path predicates supported
-VARIABLE_WITH_PATH: VARIABLE_ID ADL_ABSOLUTE_PATH ;
+VARIABLE_WITH_PATH: VARIABLE_ID ADL_ABSOLUTE_PATH ;
 
-VARIABLE_ID: '$' ALPHA_LC_ID ;
+VARIABLE_ID: '$' ALPHA_LC_ID ;
 
 
 //
@@ -2336,18 +2337,18 @@ 

< // // -------------------- symbols for lists ------------------------ -SYM_LIST_CONTINUE: '...' ; +SYM_LIST_CONTINUE: '...' ; // ------------------ symbols for intervals ---------------------- -SYM_PLUS : '+' ; -SYM_MINUS : '-' ; -SYM_PLUS_OR_MINUS : '+/-' | '±' ; -SYM_PERCENT : '%' ; -SYM_CARAT: '^' ; +SYM_PLUS : '+' ; +SYM_MINUS : '-' ; +SYM_PLUS_OR_MINUS : '+/-' | '±' ; +SYM_PERCENT : '%' ; +SYM_CARAT: '^' ; -SYM_IVL_DELIM: '|' ; -SYM_IVL_SEP : '..' ;

+SYM_IVL_DELIM: '|' ; +SYM_IVL_SEP : '..' ;
@@ -2355,8 +2356,9 @@

< + \ No newline at end of file From 0db6471f6077280129bfd34fc0b44b9c021e475f Mon Sep 17 00:00:00 2001 From: Thomas Beale Date: Mon, 15 Sep 2025 13:28:37 -0300 Subject: [PATCH 2/2] Changes for SPECLANG-13 - Add missed class EXPR_VALUE_REF to imports in spec document --- docs/BEL.html | 31 +++++++++++++++++-- .../BEL/master04-expression_object_model.adoc | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/BEL.html b/docs/BEL.html index 0f674d5..7ba7c0a 100644 --- a/docs/BEL.html +++ b/docs/BEL.html @@ -108,7 +108,8 @@
  • 4.2.3.13. EXPR_LEAF Class
  • 4.2.3.14. EXPR_LITERAL Class
  • 4.2.3.15. EXPR_VARIABLE_REF Class
  • -
  • 4.2.3.16. EXPR_FUNCTION_CALL Class
  • +
  • 4.2.3.16. EXPR_VALUE_REF Class
  • +
  • 4.2.3.17. EXPR_FUNCTION_CALL Class
  • @@ -1926,7 +1927,33 @@

    -
    4.2.3.16. EXPR_FUNCTION_CALL Class
    +
    4.2.3.16. EXPR_VALUE_REF Class
    + +++++ + + + + + + + + + + + + + + +

    Class

    EXPR_VALUE_REF

    Description

    +

    Path-based reference to a value in a data structure.

    +

    Inherit

    EXPR_LEAF

    + +
    +
    4.2.3.17. EXPR_FUNCTION_CALL Class
    diff --git a/docs/BEL/master04-expression_object_model.adoc b/docs/BEL/master04-expression_object_model.adoc index 876cc90..bb0c834 100644 --- a/docs/BEL/master04-expression_object_model.adoc +++ b/docs/BEL/master04-expression_object_model.adoc @@ -58,6 +58,7 @@ include::{uml_export_dir}/classes/{pkg}expr_for_all.adoc[leveloffset=+1] include::{uml_export_dir}/classes/{pkg}expr_leaf.adoc[leveloffset=+1] include::{uml_export_dir}/classes/{pkg}expr_literal.adoc[leveloffset=+1] include::{uml_export_dir}/classes/{pkg}expr_variable_ref.adoc[leveloffset=+1] +include::{uml_export_dir}/classes/{pkg}expr_value_ref.adoc[leveloffset=+1] include::{uml_export_dir}/classes/{pkg}expr_function_call.adoc[leveloffset=+1] == Operators