# ADL-parser, two questions **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2013-08-23 12:22 UTC **Views:** 1 **Replies:** 9 **URL:** https://discourse.openehr.org/t/adl-parser-two-questions/15261 --- ## Post #1 by @system Hi Rong, 1\) According the ADL\-specs, page 89 \-\-\-\-\-\-\-\-\-\-/\* identifiers \*/ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \[a\-z\]\[a\-zA\-Z0\-9\_\]\* V\_ATTRIBUTE\_IDENTIFIER in adl\.jj however: < V\_ATTRIBUTE\_IDENTIFIER: \["a"\-"z"\]\(<LET\_DIG\_U>\)\* > Is there a reason for it? 2\) The ADL\-Parser is not capable of parsing EN13606 archetypes because of the keyword "units" which belongs to the EN13606 datatype PQ\. --- ## Post #2 by @system Hi Rong, excuse the trouble, I had an archetype with an error, camelcase attribute\-names are accepted, no problem at all regards Bert --- ## Post #3 by @system > 2\) > > The ADL\-Parser is not capable of parsing EN13606 archetypes because of the keyword "units" which belongs to the EN13606 datatype PQ\. I solved this problem by commenting out all occurrences of SYM\_UNITS This is in line 2958, becomes: \(<SYM\_C\_QUANTITY\_UNITS>/\*|<SYM\_UNITS>\*/\) <SYM\_EQ> "<" and line 341 becomes: /\*| < SYM\_UNITS: "units"> :DOMAIN\_TYPE\_C\_QUANTITY\*/ When done these changes, it parses the EN13606 PQ datatype, and I don't see another error\-situation coming up\. What do you think? Bert --- ## Post #4 by @yampeku You will have problems with openehr c_quantity domain type. --- ## Post #5 by @system I am not sure about that. There are a lot of test-files with that domain-type and no problem occurs. It is, I think, because the "units" will always occur inside this domain type, and inside the domain type, the DOMAIN_TYPE_C_QUANTITY lexical state should be active. But please feel free to correct me, I don't have much experience with JJ Bert --- ## Post #6 by @yampeku Then you shouldn't have any problems --- ## Post #7 by @system Thanks, Diego, for you encouraging words\. :\) I don't see also no problem, I guess, I take the chance and regard it as a solution\. Because all tests in the ADL\-parser run fine, and the DV\-Quantity is very extensively tested\. Also all my EN13606 datatypes\-tests run fine in the changed parser\. regards Bert --- ## Post #8 by @system \(sorry for my bad English :\), I guess it is Friday\-afternoon and the weather is good\) \(very important in the Netherlands\) --- ## Post #9 by @thomas.beale Treating "units" etc as keywords is a pretty dirty way to implement dADL \(now ODIN\) parsing\! The property names in a C\_DV\_QUANTITY \(or C\_DV\_ORDINAL\) structure shouldn't be keywords, they are just property names, and should be collected and either compared to the RM or \(what I do\) converted straight to an object by the dADL \(ODIN\) deserialiser\. As per my recent post, all of this is now gone in ADL 1\.5\. IN any case, I would not expect any problem with picking up "units" in two different parsing contexts in the parser\. \- thomas --- ## Post #10 by @system I think it is an error in the ADL\-parser, the word "units" was defined twice, once globally in all lexical states, once locally in a specific lexical state\. \(I don't know if globally and locally are right expressions in the context of JJ, I just call it that way for now\.\) The globally definition was interfering with all use of the word "units" in an archetype\. So I removed it, and there were no side\-effects, I could see\. Maybe there are\. I hope not\. The ADL\-parser is a fine piece of software, it takes every data\-type, every\-attribute, as long as the syntax is OK\. It really is a pleasure to work with it, and it gives many opportunities\. Except for some small errors, like this one\. As I understand, the removal of C\_DvQuantity and other AOP constructs is a good development, because it removes exceptional circumstances for specific domain\-types and makes the ADL\-parser even more generic\. Than, ADL will be \(concerning the supporting software\) a fully generic \(not depending on a specific reference model\) archetype definition language\. I think lots of opportunities will arise\. Bert --- **Canonical:** https://discourse.openehr.org/t/adl-parser-two-questions/15261 **Original content:** https://discourse.openehr.org/t/adl-parser-two-questions/15261