Skip to Navigation | Skip to Content

Ref_impl_Java mailing list archives

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Ref_impl_Java mailing list archives


Hi Sebastian,

You've probably been playing around with the adl.jj file. Technically, 
the solution could look something like this:

ArchetypeTerm archetype_term() :
{
Token t;
String code;
String key;
String value = null;
ArchetypeTerm term;
}
{
"["
code = local_code_value()
{ term = new ArchetypeTerm(code); }

"]" <SYM_EQ> "<"
(
<SYM_TEXT> <SYM_EQ> "<"
value = string_value() { term.addItem("text", value); }
">" [ ";" ]
|
<SYM_DESCRIPTION_WORD> <SYM_EQ> "<"
value = string_value() { term.addItem("description", value); }
">" [ ";" ]
|
<SYM_COMMENT> <SYM_EQ> "<"
value = string_value() { term.addItem("comment", value); }
">" [ ";" ]
|
t = <V_IDENTIFIER> <SYM_EQ> "<"
value = string_value()
{
key = t.image;
term.addItem(key, value);
}
">" [ ";" ]
)*
">"
{ return term; }
}

If you just replace the archetype-term definition code with the upper 
snippet, it should work. As for the update of the central svn 
repository, you should probably contact Rong Chen...

Saso




> Hi all,
>
> The current Java parser does not support keys other than text, 
> description and comment for an archetype term in the ontology.
> The specs do allow any key here (although they don't really talk 
> about 
> what kind of characters are supported in such a key as far as I can 
> tell)
>
> I.e. the following example would fail to parse:
>
> ontology
> [...]
> term_definitions = <
> ["en"] = <
> items = <
> ["at0000"] = <
> text = <"test">;
> description = <"test">
> *anotherkey = <"another key value">*
> >
> >
> >
> >
>
> I tried to extend the parser to support any key here (or at least any 
> key without spaces etc. in it), but in the end I gave up.
>
> I thought maybe someone has a smart idea how to support this in the 
> Java Parser?
>
> Regards
> Sebastian

-- 
Sašo Rutar
RD Department

Marand Inženiring d.o.o.
Koprska ulica 100
1000 Ljubljana

Tel: +386-1-470-31-00
Fax: +386-1-470-31-11,


_______________________________________________
Ref_impl_java mailing list
Ref_impl_java@openehr.org
http://lists.chime.ucl.ac.uk/mailman/listinfo/ref_impl_java