|
From: | Matt Gushee |
Subject: | Re: [Chicken-users] Basic abnf usage? |
Date: | Fri, 27 Mar 2015 11:18:22 -0600 |
Hi Matt,
Thanks for your interest in using abnf. I admit that the details of
parsing are hidden away in the documentation for lexgen.
I have updated the example to include a definition for fws and create
and import the appropriate input type classes (more or less equivalent
to importing abnf-charlist). Abnf is intended to be very flexible with
regards to input formats, so it is in a sense necessary to define your
own custom parser specialized for your needs. However, for simple
testing the lexgen `lex' procedure should suffice, so I have extended
the abnf example to use it for parsing. lex takes an input string and
converts it to a char list input stream representation; however many
other input representations are possible. I will copy the
documentation on input formats from lexgen and include it in the abnf
page. Let me know if I can help with anything else.
-Ivan
> _______________________________________________
On Thu, Mar 26, 2015 at 7:53 PM, Matt Gushee <address@hidden> wrote:
> Hello--
>
> I'm attempting to learn how to use the abnf egg, but I'm having some
> difficulties.
>
> First of all, I think the example needs to be updated. It uses the 'lit'
> matcher, which requires 'abnf-charlist' to be imported; also, the 'fws' and
> 'cfws' symbols are not defined. It's not hard to define them if you know the
> grammar, but given that this is the only example for the egg, it would be
> nice if it were a complete working example.
>
> However, the greater challenge for me is understanding how to use the
> parsing rules once you have defined them. Since there is apparently no
> 'parse' function, I have no idea what to do. Is it necessary to define one's
> own parser? If so, what arguments does it need to take, and what does it
> return?
>
> Thanks for any info.
>
> --
> Matt Gushee
>
> Chicken-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
[Prev in Thread] | Current Thread | [Next in Thread] |