help-bison
[Top][All Lists]
Advanced

[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: Sun, 3 Mar 2002 14:17:22 -0800 (PST)

> From: Akim Demaille <address@hidden>
> Date: 03 Mar 2002 16:31:05 +0100

> I would like to
> 
> - know whether POSIX says something,

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


> Date: Sun, 3 Mar 2002 20:22:32 +0100
> From: Hans Aberg <address@hidden>
> 
> >All the presentations I know of Yacc do use this terminator, including
> >Johnson's paper.
> 
> What's this? Is it available on an URL?

http://www.cs.bell-labs.com/7thEdMan/vol2/yacc.bun

In his examples, Johnson makes a pretty big deal about including the
terminating semicolon, including style rules for how to indent it,
which is why (almost) everybody uses one.  I've been using Yacc for
over 25 years, and this is the first that I'd noticed the semicolon is
optional.

While we're on the subject of semicolon trivia, the original Yacc
paper says that you can put as many semicolons as you like after a
rule, e.g.:

  /* This grammar works with Yacc, but not with Bison.  */
  %%
  expr: 'x';;;;;;;

(And no, I don't think Bison should be modified to support _that_.  :-)



reply via email to

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