The ADL 1.5 parser uses a number of grammars.
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 1.5 is a composite syntax, and uses 4 syntaxes.
Syntax | Description | Production rules | Lexer - | Parser - |
---|---|---|---|---|
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. | |||
cADL | The primary constraint syntax of archetypes, characterised by curly brackets. Used to express the core formal constraint semantics of an archetype or template. | |||
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. |