Thanks, Ivan, that's a great help! BTW, in case you are interested, I was going to use comparse, which is a bit easier to learn (don't know about performance), but found that it didn't support UTF-8, which in my world is not acceptable. And it appears that abnf is the only general-purpose parsing library for chicken that does support UTF-8. Not saying it isn't otherwise good, but that was my reason. Thanks for keeping up with the times.
Matt On Fri, Mar 27, 2015 at 9:26 AM, Ivan Raikov <ivan.g.rai...@gmail.com> wrote: > 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 <m...@gushee.net> 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 > > Chicken-users@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/chicken-users > > >
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users