ADL 2 parser resources

ADL 1.5 tools require lexical scanners and parsers for ADL, as well as serialisers. A set of these is available for the reference compiler, with other versions appearing. We don't consider the grammars normative, since different grammars or production rules may be more or less efficient depending on the kind of parser. The normative specification is ADL itself.

 Reference Compiler 

The grammar files shown below are from the Eiffel reference compiler. They are shown in pure rule form (i.e. just the production rules, no code), and in the typical .y file form containing code, which gives an idea of what each rule does in the current parsers. NOTE: there is no guarantee that these grammars are the best possible for the syntax, and they are currently made for LALR parsers and will probably need adjustment to work for LL(k) parser tools like Antlr. We are actively looking into this.

ADL is a composite syntax, and uses 4 syntaxes.

Syntax

Description

Production rules

Lexer - 
.l file (Eiffel)

Parser - 
.y file (Eiffel)

ADL

The 'outer' syntax: corresponding to the keywords and top-level structure of a file. This will revert to dADL one day, but since it's friendly and easy to read, and everyone seems to like it, it seems we will stick with it a while longer.

adl_2_parser.html

adl_2_scanner.l

adl_2_parser.y

cADL

The primary constraint syntax of archetypes, characterised by curly brackets. Used to express the core formal constraint semantics of an archetype or template.

cadl_2_parser.html

cadl_2_scanner.l

cadl_2_parser.y

assertion

The assertion syntax of archetypes. Used to express archetype-wide (i.e. cross-attribute) constraints and also archetype slot constraint conditions. This syntax is essentially a simplified variant of XPath.

(embedded in cadl)

(embedded in cadl)

(embedded in cadl)

dADL/ODIN

openEHR's native object serialisation syntax. This syntax is used for all 'data' sections of an ADL archetype, including the description, languages, ontology and annotations sections.

odin_parser.html

odin_scanner.l

odin_parser.y

 

Other Tool Grammars

Swansea University (Athanasios Anastasiou )

A first version of ADL and cADL expressed in EBNF and ANTLR's meta-language is now avaialble at: https://github.com/aanastasiou/adl_ebnf
The ANTLR definitions specifically are available at: https://github.com/aanastasiou/adl_ebnf/tree/master/src/antlrDefs/adl

In general, transcribing from: http://www.openehr.org/wiki/display/spec/ADL+1.5+parser+resources was a straightforward task for the majority of the rules.