…works fine!
On Mon, Apr 4, 2016 at 8:57 PM, Gunther Rademacher grd@gmx.net wrote:
Hi Christian,
thanks for reviewing the code!
REx v5.38 is now online and it includes the -basex option. Use it as follows:
create some grammar G.ebnf, e.g. by using a sample grammar from http://bottlecaps.de/rex/
create a parser by generating it on http://bottlecaps.de/rex/ using command line options: -tree -java -basex
compile G.java and make class files available to BaseX classpath
invoke parser from XQuery, e.g.
declare namespace p="G"; p:parse-S($input)
where S is a start symbol of the grammar.
for an XQuery coded parser, use REx options: -tree -xquery
for just a syntax checker, with no parse tree, omit option: -tree
If you encounter any problems with this, please let me know.
Also please note that I have restored the type of p:match2 in generated XQuery code, which cause bad performance problem with earlier BaseX versions (no longer with 8.4.2). p:transition and some others still come without a type spec, but they are not known to cause any problem and this saves me adding another case distinction to code generation.
Best regards Gunther
Gesendet: Montag, 04. April 2016 um 19:36 Uhr Von: "Christian Grün" christian.gruen@gmail.com An: "Gunther Rademacher" grd@gmx.net Cc: BaseX basex-talk@mailman.uni-konstanz.de Betreff: Re: [basex-talk] BaseX optimizer performance on REx-generated parser Hi Gunther,
Your code looks excellent. And I was amazed to see you’ve even found out how to build the error node via our MemBuilder code (which is not really well-documented, compared to real APIs)… I’ll be happy to play around with it and give more feedback once the -basex option will be available.
Thanks! Christian