openEHR / adl-antlr

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

problem in definition adl_relative_path. #24

Open ghost opened 8 years ago

ghost commented 8 years ago

I give following command, in my specialized test (excuse the camelcase) grun Test archetypeSlot -gui

Then I give this as argument: allow_archetype OBSERVATION[id2] occurrences matches {0..1} matches { -- Vital signs include domain_concept/test matches {/blood_pressure.v2/} domain_concept matches {/.*/} }

It gives an error: line 4:43 no viable alternative at input 'domain_conceptmatches'

If I change the input like this: allow_archetype OBSERVATION[id2] occurrences matches {0..1} matches { -- Vital signs include domain_concept/test matches {/blood_pressure.v2/} domain_concept/test matches {/.*/} }

I get no error.

It is because of the definition of adl_relative_path which requires a slash somewhere in the string, else it cannot make a valid argument of it. This means that a relative path, consisting of one segment can never be valid.

This will not be a big problem in real life, it will not often happen that a relativepath without slash is used, but it is a weakness of the grammar.