[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lpeg.Cg, lpeg.Cb, and how to visualize what they do
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 14 Aug 2023 14:29:05 -0300
> Questions:
> ==========
> What is the official name of this data structure? Is there a place in
> which it is described in more details than in the Lpeg manual? Where?
Maybe I am misuderstanding something, but there is no such data
structure. Captures are computations. You may try to represent
the result of one single capture as a data structure, but there is
no structure to represent the tree of all captures made in a match.
A most archetypal capture is the function capture. What structure
would represent the following match?
((lpeg.C(1) * lpeg.C(1)) / function (a,b)
return string.char(string.byte(a) + string.byte(b))
end):match(" '")
-- Roberto