# ADL AOM

**URL:** https://discourse.openehr.org/t/adl-aom/16526
**Category:** Implementers (archive)
**Created:** [1 December 2015 16:59 UTC](https://discourse.openehr.org/t/adl-aom/16526 "2015-12-01T16:59:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [1 December 2015 16:59 UTC](https://discourse.openehr.org/t/adl-aom/16526/1 "2015-12-01T16:59:17Z")

</div>

Hi,

I am trying to generate an AOM from a grammar, I used a some open-sourced of stuff from Pieter Bos and Thomas Beale.  
I modified the grammar, f.e. to let it generate camelCase, and I need to do more with the grammar, still studying it..

I do it just for fun, that is all.

I wanted you to know, so that there are no future misunderstandings

[https://github.com/BertVerhees/adl-aom](https://github.com/BertVerhees/adl-aom)

best regards  
Bert

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [1 December 2015 19:42 UTC](https://discourse.openehr.org/t/adl-aom/16526/2 "2015-12-01T19:42:20Z")

</div>

Bert

things that you might think about that I have not done yet:

- whether we put error branches in the grammar - I had a lot of these in the old .y grammars. All gone for now.
- whether to put labels on sub-parts of parser rules - will generally only be determinable by implementers - it’s hard for me to guess where to put these
- there are still a few outstanding annoyances

If you can document somewhere how to do the CamelCase conversion, I will add it to the comments and/or main ADL spec somewhere (i.e. we don’t want to change the case in the original files, but we do want to make it easy for people wanting CamelCase to do a simple operation to get it, so their code looks normal).

- thomas

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [2 December 2015 07:57 UTC](https://discourse.openehr.org/t/adl-aom/16526/3 "2015-12-02T07:57:18Z")

</div>

I like to see them, can you post a link? Also here, can you give a list and example what it is you are writing about Please list them, now I am diving into it, I can as well take some time for that. I don’t thing there is something as conditionally parsing, but I can write a small conversion-routine which checks the labels, maybe ANTLR gives to room to execute that. I check that. I can only work some 8 hours a week on this, but in that time I can do that. ANTLR has some not often used options, like adding code literally to the grammar to be copied into parser-result. It is good for me to do that, it gies me valuable experience. Bert

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [2 December 2015 08:44 UTC](https://discourse.openehr.org/t/adl-aom/16526/4 "2015-12-02T08:44:00Z")

</div>

ADL - CADL - typical example of code: - look for ‘labels’ - thomas

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [2 December 2015 09:18 UTC](https://discourse.openehr.org/t/adl-aom/16526/5 "2015-12-02T09:18:27Z")

</div>

Thanks, I come back to this

Bert

Thomas Beale schreef op 2-12-2015 om 9:44:

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [8 December 2015 10:53 UTC](https://discourse.openehr.org/t/adl-aom/16526/6 "2015-12-08T10:53:49Z")

</div>

Hi Thomas,

About the errors.

I was wondering, the parser gives syntax errors very well, but they are not for normal users to understand.

But I understand that you need to handle expected errors in a more semantical way, (if this is English)  
Like chapter 9.4 in the book.

Adding an alternative which represents the error?

Example

grammar Simple;

prog:classDef+ ;// match one or more class definitions classDef :'class' ID '{' member+'}' |'class' '{' member+'}' {notifyErrorListeners("missing ID");}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;

Bert

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [8 December 2015 12:55 UTC](https://discourse.openehr.org/t/adl-aom/16526/7 "2015-12-08T12:55:09Z")

</div>

yes, this is the kind of thing I was thinking of. In most cases, the error should be a tag from the [validity error set](https://github.com/openEHR/adl-resources/blob/master/messages/ADL/adl_validity_errors.txt).

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [8 December 2015 13:07 UTC](https://discourse.openehr.org/t/adl-aom/16526/8 "2015-12-08T13:07:11Z")

</div>

Looks good, I’ll give it a try tomorrow Bert
