nmh-workers
[Top][All Lists]
Advanced

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

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


From: Ken Hornstein
Subject: Re: [Nmh-workers] First idea of a Bison-based address parser available
Date: Fri, 29 Aug 2014 13:12:33 -0400

>We might want to sacrifice some of its elegance to get rid of
>the shift/reduce conflicts.  Or, the cfws at beginnings looks
>like it causes some of them.  Could the scanner do even more
>than you already have it doing to help?  I don't have anything
>more specific in mind at this point.

It's ... challenging.  Part of the problem is that CFWS (comment-or-
folding-white-space) is not universally permitted everywhere.  Although
on second reading it sems like the only place in _address parsing_ that
you cannot use CFWS and must instead use FWS is in the definition for a
domain-literal.  But maybe that won't really help the problem; I think
most of it comes from (like you said) that CFWS is permitted at the
beginning of tokens like "atom" and also at the end of many tokens (like
"atom").  Across different rules, where does the CFWS end up at when a
reduction happens?  However, it really doesn't matter where CFWS ends up
since we ignore it (except for the case of the old-style addresses).

It wasn't that hard to take the ABNF and turn it into a Bison grammer.
It will be harder to have the scanner be smarter, because there are a bunch
of corner cases that will need careful testing.

--Ken



reply via email to

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