[DGD] Hydra and parse_string

Raymond Jennings shentino at gmail.com
Sat Dec 1 22:14:57 CET 2018


My personal favorite strategy is to have a dedicated parser object for each
grammar.  This allows automatons to build and cache as needed.

This also simplifies things, given the LPC callbacks that can be specified
in the grammar

On Sat, Dec 1, 2018 at 11:57 AM Felix A. Croes <felix at dworkin.nl> wrote:

> bart at wotf.org wrote:
>
> > Hi Felix,
> >
> > Out of curiosity, how does Hydra handle multiple threads calling some
> > centralized function that uses parse_string?
> >
> > From what I understand, parse_string builds its automatons on-the-fly,
> would
> > that result in rollbacks?
>
> Updating the automatons counts as an object modification, so yes it
> could.  Eventually, as the automatons are fleshed out and most calls
> no longer result in an update, the rollbacks would desist.
>
> If initial rollbacks are an issue, you could create a new parser object
> each time, have multiple parser objects, or train the parser with sample
> input in the beginning.
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd



More information about the DGD mailing list