[Top][All Lists]

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

Re: RFC: Requiring the ending `;'

From: Paul Eggert
Subject: Re: RFC: Requiring the ending `;'
Date: Mon, 2 Dec 2002 10:51:11 -0800

[This is following up an old thread:

> From: Akim Demaille  address@hidden
> Date: 03 Mar 2002 23:38:10 +0100

> Paul> POSIX requires the ending ';'.  And for good reason: it allows
> Paul> the Yacc grammar to be Yaccable.

> Paul, my dear Paul, I think this is the first time I hear from your
> POSIX mouth with that much pleasure :)

After seeing so many bug reports about this since March, I
double-checked the POSIX spec, and it turns out that I was incorrect;
so you may have to revise your opinion about POSIX and pleasure.

POSIX 1003.1-2001 (as well as POSIX 1003.2-1992) requires that Yacc
must accept rules without the trailing semicolon.  It also requires
that rules must be accepted if they have two or more trailing

My mistake stemmed from the fact that the POSIX spec says in one place
"A grammar rule has the form: `A : BODY ;'.", and I relied on this
statement.  However, in a later place the spec says that the formal
syntax "takes precedence over the preceding text syntax description"
and the formal syntax does indeed allow grammar rules with any number
of trailing semicolons, including zero semicolons.

Sorry about that.

I have drafted a patch, but it it is still not correct since it
doesn't handle line numbers correctly.  The line numbers are a real
pain.  I have discovered some related line-number bugs in the current
Bison code, as well as in the test cases.  I'll try to get it done
later this week.

reply via email to

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