two issues in dADL grammar

Hi all,

There are two issues in dADL grammer (as part of the ADL 1.4 specs) I discovered recently when I work on the Java DADL parser. http://www.openehr.org/svn/ref_impl_java/SANDBOX/dadl-parser/

  1. the parentheses around the optional type identifier is missing in the grammar

The example on type information ( from the ADL document) looks like this:
destinations = <
[“seville”] = (TOURIST_DESTINATION) <

Note that the parentheses around the type id. It doesn’t seem to be supported by the current grammar. It can be fixed by adding the parentheses around the original type_identifier block as following:

type_identifier:
<SYM_L_PARENTHESIS> <= here!!
V_TYPE_IDENTIFIER

V_GENERIC_TYPE_IDENTIFIER
<SYM_R_PARENTHESIS> <= and here!!

It’s tested in the Java implementation and seems to work fine.

  1. the current grammar doesn’t seem to support object block without any attributes. It’s needed to support instances that have no values, the mere existence of the instance is enough, e.g. PARTY_SELF from the openEHR RM.

An example (also from ADL document):

profile = (DESTINATION_PROFILE) <>

Make the attr_vals optional (see below) can fix this deficiency.

untyped_single_attr_object_block:
single_attr_object_complex_head SYM_END_DBLOCK

single_attr_object_complex_head [ attr_vals ] SYM_END_DBLOCK <= the “[”, "]’ around attr_vals are new
single_attr_

Cheers,
Rong