[antlr-interest] XQuery lexer/parser

Johannes.Lichtenberger Johannes.Lichtenberger at uni-konstanz.de
Sat Feb 18 21:15:37 PST 2012


On 02/18/2012 08:06 PM, Johannes.Lichtenberger wrote:
> On 02/18/2012 08:03 PM, Johannes.Lichtenberger wrote:
>> I maybe want to use an XQuery parser to implement som parts of XQuery,
>> for instance XPath 2.0 for a DOM-like tree-structure.
>>
>> I downloaded http://code.google.com/p/xqgrammar/ and successfully
>> imported the project in eclipse with maven support. Now I have no clue
>> how to use the parsed rules. Maybe I have to implement specific parts in
>> XQParser or more specifically for Path expressions for instance in the
>> XPath parser which is called within the XQParser constructor. Buf I
>> think it will mess up the parser itself, thus maybe a callback for each
>> parsed rule would suffice. Furthermore I don't know if I would have to
>> parse a query twice if I want to do query rewritings.
>>
>> But a first step with XPath axis steps and predicates would be ok, or
>> maybe parsing simple XQuery statements besides the FLOWR expression ;-)
> 
> BTW: The author hasn't responsed for about 2 months, that's why I'm
> asking on the ANTLR-mailinglist.

So basically I think I want to implement observers which have to
implement all generated parser rules. For instance an interface and an
abstract class with empty method implementations.

Is this somehow doable or how do I make use of a generated parser
otherwise? Anyhow it would be great, as I can't find suitable
documentation besides maybe the books ;-) I just want to use the
generated parser to implement for instance some basic XPath 2.0 things.

kind regards,
Johannes


More information about the antlr-interest mailing list