Hi,

I used the standard approach for rewriting left recursion to non left recursion 
described in computer grammar books (and in Wikipedia 
http://en.wikipedia.org/wiki/Left_recursion).  It was a quite straight forward 
translation, but it was necessary to be careful with all the details. :-) We 
will share the grammar when we have cleaned up the file a little more.

                             Regards,
                             Mikael


From: openehr-technical-bounces at openehr.org 
[mailto:[email protected]] On Behalf Of Erik Sundvall
Sent: den 5 januari 2012 11:12
To: For openEHR technical discussions
Subject: Re: Did anybody implement AQL with a LL parser framework?

Hi!

We implemented an AQL parser using JavaCC. My colleague Mikael Nystr?m made 
some transformations to make the published AQL grammar work in JavaCC. Mikael 
is on vacation right now, but I'm sure he does not mind sharing his experiences 
once he gets back.

I do think it would be interesting to switch to ANTLR sooner or later in order 
to share efforts between projects with different 
implementation/target-languages and because the ANTLRWorks environment 
http://www.antlr.org/works/index.html looks promising compared to the pretty 
bad JavaCC-plugin in e.g. Eclipse.

Our parser (and thus also the modified grammar) will soon be open sourced so 
you are free to use it. So if you are not in an extreme hurry I'd suggest using 
or getting inspiration from what we have already done.

Best regards,
Erik Sundvall
erik.sundvall at liu.se<mailto:erik.sundvall at liu.se> 
http://www.imt.liu.se/~erisu/  Tel: +46-13-286733<tel:%2B46-13-286733>

On Wed, Jan 4, 2012 at 16:37, Seref Arikan <serefarikan at 
kurumsalteknoloji.com<mailto:serefarikan at kurumsalteknoloji.com>> wrote:
Greetings,
The AQL grammar from the wiki has direct and indirect left recursion. Which 
means without changes in the grammar, LL parser generators (both JavaCC and 
Anltr) can't generate parsers for this grammar.

I'm curious if anybody has refactored this grammar for LL parser generators. 
Shinji? Your latest release includes an AQL parser does not it? Could you 
please share your method? I can always look at the code, but you'd probably 
save me time :)

I'm interested in experiences of others too.


Kind regards
Seref
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/mailman/private/openehr-technical_lists.openehr.org/attachments/20120113/6c4665ab/attachment.html>

Reply via email to