nmh-workers
[Top] [All Lists]

[Nmh-workers] First idea of a Bison-based address parser available

2014-08-28 21:41:47
Greetings all,

I had some free time today, so I decided to simply see if it was possible to
even create an RFC-5322 parser in bison.  So I made my first cut at it
and committed it to the tree; it's available in $(nmh)/sbr/addrparse.y.

This isn't used by anything yet at all; it's just a bare grammer, with
no code in the actions.  Also, there's no lexer either (I figured that
would be relatively straightforward).

It compiles successfully with bison, but it does produce 30 (!)
shift/reduce conflicts.  I took a look at them all ... and since shift
is the default action in that case, it looked like the right thing was
happening.  I did take a stab at getting rid of them, but I guess I
don't understand Bison as well as I thought I did, because I didn't make
much headway.

This was really a proof-of-concept to see if it's even feasible to
replace the current address parser with something based on Bison.  A lot
of work would have to be done to make it a reality, but I figured it was
worth it to see what was possible.  If anyone wants to check it out and
make fun of it, feel free.

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>
  • [Nmh-workers] First idea of a Bison-based address parser available, Ken Hornstein <=