Hi Gunther, hi all,
here is a straightforward (yet I somewhat hacky) way to invoke the ReX Java parser code from XQuery:
1. download the XQuery grammar, e.g. http://bottlecaps.de/rex/CR-xquery-31-20151217.ebnf
2. generate a Java-coded parser from it, using these command line options -java -tree -main
3. compile the result javac CR_xquery_31_20151217.java
4. run the attached XQuery files with BaseX or Saxon EE, and with the compiled parser classes in the classpath, e.g.:
java -cp BaseX.jar;. org.basex.BaseX parse-xquery.xq java -cp saxon9ee.jar;. net.sf.saxon.Query parse-xquery.xq
(The semicolon must be replaced with a colon on Unix/Linux-based systems).
In BaseX, for simple inputs, the compiled tree will be available in 5-10 ms. I assume it could be even faster when embedding some native BaseX code in the ReX Parser Generator; but I don’t know how much effort this will be?
Hope this helps, feedback is welcome, Christian