What you are describing reminds me of the built-in nesting of parsers with
the ebnf tokenizer :
https://docs.factorcode.org/content/article-peg.ebnf.tokenizers.html

Not sure if it's really applicable to your use case though.


As for streams, aren't packrat parsers backtracking (with memoization)? So
no?



Le sam. 21 nov. 2020 à 18:15, Alexander Ilin <ajs...@yandex.ru> a écrit :

> I have another question to follow this up. I want to create a multilayer
> parser.
> The first layer would read a bunch of textual log files (with date-time in
> their names) and search for various types of events using PEG patterns per
> line and skipping noise. This would produce a stream of interesting events.
> The next layer of parsing will process this stream searching for higher
> level patterns that can be folded into, say, meta-events comprised of a
> tree of sub-events detected on the first parsing level. This layer will
> produce an AST that can be queried by the user to find out details about
> various aspects of what actually happened.
> So, the question is, is it possible to use the peg vocab to create this
> layered parsing architecture, where the first layer would consume a stream
> of file input, and the second would consume a stream of tokens from the
> first layer?
>
> 21.11.2020, 02:17, "Alexander Ilin" <ajs...@yandex.ru>:
>
> Hello!
>
>   I see that the peg vocab operates on strings. Can it operate on streams?
>   I want to parse some log files, and thought it would make sense not to
> load them all at once.
>   Especially since I want to stream multiple files concatenated as one.
>
> ---=====---
>  Александр
>
>
>
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
>
> ---=====---
> Александр
>
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to