nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ken Hornstein
Subject: [Nmh-workers] First idea of a Bison-based address parser available
Date: Thu, 28 Aug 2014 22:41:17 -0400

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]