Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.programming Subject: Re: My answer about Ada and FreePascal and C++ Date: Fri, 01 Jan 2016 14:34:35 +0000 Organization: A noiseless patient Spider Lines: 43 Message-ID: <8737uh4bd0.fsf@bsb.me.uk> References: <20151231165420.592@kylheku.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="1269"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CQxcK17hcAdrjQDbBevc35+iEIcF3zYA=" Cancel-Lock: sha1:9GZNrezEBTC/yYG1FMxYCHMKSfw= sha1:zm7adL9wavcHdzMotkhhXhrHPVQ= X-BSB-Auth: 1.a3e753a09f42a737363f.20160101143435GMT.8737uh4bd0.fsf@bsb.me.uk Xref: csiph.com comp.programming:6158 JJ writes: > On Fri, 1 Jan 2016 01:07:16 +0000 (UTC), Kaz Kylheku wrote: >> >> See this Pascal BNF grammar, for instance, which looks like >> some traditiona, old Pascal: >> >> http://www2.informatik.uni-halle.de/lehre/pascal/sprache/pas_bnf.html >> >> In every production where a semicolon terminal symbol appears, it is >> preceded and followed by something (a something which doesn't derive >> an empty string). Hence it is a separator. > > As far as I can see, it's a flaw in the Backus–Naur Form itself. Backus–Naur > Form doesn't require a terminator character at the end of each rule. No, there's nothing wrong with BNF itself. It can describe a language where a semicolon is a statement separator: statement-list: statement statement-list ; statement and it can describe one in which the semicolon is a statement terminator: statement-list: statement ; statement-list statement ; although in the later case it's more normal to put the semicolon into the production for a statement: statement-list: statement statement-list statement statement: statement-content ; -- Ben.