Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #6161

Re: My answer about Ada and FreePascal and C++

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.programming
Subject Re: My answer about Ada and FreePascal and C++
Date 2016-01-02 03:23 +0000
Organization Aioe.org NNTP Server
Message-ID <20160101190553.82@kylheku.com> (permalink)
References (2 earlier) <zvygk11xgjjj.1qafdhx96mz38$.dlg@40tude.net> <20151231165420.592@kylheku.com> <nhjg07949sqg$.1f2w63mp1tynq$.dlg@40tude.net> <8737uh4bd0.fsf@bsb.me.uk> <1cgmbawv5ehql$.1wjzek6ys3t2l$.dlg@40tude.net>

Show all headers | View raw


On 2016-01-02, JJ <jj4public@vfemail.net> wrote:
> On Fri, 01 Jan 2016 14:34:35 +0000, Ben Bacarisse wrote:
>> 
>> 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 ;
>> 
>> <snip>
>
> So, it's that page's author then?

No, it's not the author either. It's the design of Pascal,
whose grammar the author was just writing down in BNF.

You may be tripped up by the fact that some Pacal dialects have a null
statement, whose use looks like a terminating semicolon:

   begin
     a := a + 1;
   end

In the above block, we have two statements: a = a + 1 and a null
statement, separated by a semicolon!

ISO 7185:1990 Pascal has such a thing in its grammar; see the
"empty-statement" rule in
<http://www.pascal-central.com/docs/iso7185.pdf>, section
6.8.2.1.

Perhaps some Pascal dialects have actual statement-terminating
semicolons in their grammars.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: My answer about Ada and FreePascal and C++ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-31 18:59 +0000
  Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-01 07:23 +0700
    Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-01 01:07 +0000
      Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-01 18:16 +0700
        Re: My answer about Ada and FreePascal and C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-01 14:34 +0000
          Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-02 09:58 +0700
            Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-02 03:23 +0000
              Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-02 21:35 +0700
        Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-01 16:08 +0000

csiph-web