openEHR / adl-antlr

Antrl4 grammars for ADL
Apache License 2.0
1 stars 4 forks source link

attributes without cardinality or existence? #26

Closed pieterbos closed 8 years ago

pieterbos commented 8 years ago

In the archetype https://github.com/openEHR/adl-archetypes/blob/master/ADL2-reference/features/aom_structures/basic/openEHR-TEST_PKG-WHOLE.primitive_types.v1.adls the following snippet of ADL exists:

WHOLE[id1] matches {    -- test entry
        string_attr1 matches {"something"}
        string_attr2 matches {/this|that|something else/}
        string_attr3 matches {/cardio.*/}
        string_attr4 
}

This does not parse with the new grammar due to the following definition of c_attribute:

c_attribute: adl_dir? rm_attribute_id ( c_existence | c_cardinality | c_existence c_cardinality )
    | adl_dir? rm_attribute_id c_existence? c_cardinality? SYM_MATCHES '{' c_objects '}'
    ;

Not sure if this is a bug in the grammar, or an incorrect test file.

wolandscat commented 8 years ago

The test file is incorrect and had been fixed in the adl-archetypes repo.