[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Comparse recursive parser
From: |
Evan Hanson |
Subject: |
Re: [Chicken-users] Comparse recursive parser |
Date: |
Mon, 18 Feb 2019 12:06:29 +1300 |
Hi there,
On 2019-02-16 19:33, Joe Anonimist wrote:
> Unfortunately the recursive-parser procedure is not documented and
> the above code just keeps looping.
Regarding `recursive-parser', note that this has nothing to do with
recursive parsing per se, but rather exists to simplify *syntactic*
recursion, i.e. referring to a parser before it has been defined. For
example:
(define a*b
(any-of (sequence (is #\a) (recursive-parser a*b))
(is #\b)))
Without `recursive-parser' you would need to enclose the parser body
manually somehow. Regardless, the infinite recursion you're seeing is
due to your grammar, as megane says.
Best,
Evan