On 23 August 2022, Graydon Saunders wrote:
> On Mon, Aug 22, 2022 at 07:42:39PM +0200, Martin Honnen scripsit:
> > On 22.08.2022 19:07, Graydon Saunders wrote:

> > > I'm trying to test if some extracted sentences validate as productions
> > > of a particular context-free grammar expressed in a BNF dialect.
> > > 
> > > Is there an available implementation of a parser in XQuery that can do
> > > this?
> > > 
> > In the context of Invisible XML https://invisiblexml.org/ I have heard
> > that term "Earley" parser a lot but I am not familiar enough with the
> > various implementations to tell whether all are "Earley" parsers,
> > https://github.com/cmsmcq/Aparecium is an XQuery implementation of
> > Invisible XML.

For what it's worth: Of the ixml processors I'm familiar with, all use
(or can use) Earley parsers to parse the input string against the input
grammar; Norm Walsh's Coffeepot and its related libraries also make a
GLL parser available, which is sometimes faster and sometimes slower.
About half use the same parser to parse the input grammar against the
spec grammar; about half have a hand-written parser for the ixml spec
grammar.

> And thus interesting, but alas too slow for the application I have.

If you are willing and able to send me a copy of your grammar and some
sample data, I would be grateful; it might help me improve the situation
with respect to Aparecium's performance.

Both Norm Walsh's processor and John Lumley's processor are currently a
lot faster than Aparecium, though I don't know a simple way to call them
directly from XQuery.

Another alternative, if you have speed issues and just one grammar you
are interested in, is to use Gunther Rademacher's REx parser generator
to compile the grammar you are interested in into a parser written in
XQuery (other target languages are also available).

  https://bottlecaps.de/rex/

-- 
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com

Reply via email to