[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make peg.el a built-in library?
From: |
Stefan Monnier |
Subject: |
Re: Make peg.el a built-in library? |
Date: |
Sun, 10 Oct 2021 09:56:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> Is it practically possible to transform a regexp into a really
>> equivalent PEG, or is it too difficult, or would the resulting PEG just
>> be too large or inefficient?
> The LPEG people wrote a paper[*] about this problem. But I haven't read
This is similar to turning the regexp into an NFA and then using the PEG
backtracking to run the NFA. Our regexp engine tries to remove some
simple forms of backtracking (e.g. for regexps like "\\(.foo\\)*\nbar"
because \n and . are mutually exclusive). This significantly reduces
the amount of stack use. We could/should perform similar optimizations
in `peg.el`.
Stefan
- Re: Make peg.el a built-in library?, (continued)
Re: Make peg.el a built-in library?, Eric Abrahamsen, 2021/10/09
- Re: Make peg.el a built-in library?, Stefan Monnier, 2021/10/09
- Re: Make peg.el a built-in library?, Michael Heerdegen, 2021/10/10
- Re: Make peg.el a built-in library?, Helmut Eller, 2021/10/10
- Re: Make peg.el a built-in library?,
Stefan Monnier <=
- Re: Make peg.el a built-in library?, Michael Heerdegen, 2021/10/22
- Re: Make peg.el a built-in library?, Michael Heerdegen, 2021/10/31