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


Groups > comp.programming > #4037

Re: Removing Extra/Unnecessary Parentheses

From Jussi Piitulainen <jpiitula@ling.helsinki.fi>
Newsgroups comp.programming
Subject Re: Removing Extra/Unnecessary Parentheses
Date 2013-12-10 14:34 +0200
Organization University of Helsinki
Message-ID <qotiouwga0h.fsf@ruuvi.it.helsinki.fi> (permalink)
References <ac32b1f5-bd3d-4d84-8b29-7c2499fde56d@googlegroups.com> <2382f062-5f9f-4b47-92f1-30f70747d74a@googlegroups.com> <0.dcc0fa872d9e7291a5b7.20131203215734GMT.87pppdppgx.fsf@bsb.me.uk> <52a6dcee$0$2879$e4fe514c@news2.news.xs4all.nl> <zupbf8jzg1oy$.291zuc3w1iez.dlg@40tude.net>

Show all headers | View raw


Dmitry A. Kazakov writes:

> On Tue, 10 Dec 2013 10:20:45 +0100, Jongware wrote:
> 
> > On 03-Dec-13 22:57 PM, Ben Bacarisse wrote:
> >> [..]
> >> There are asymmetries to consider as well.  (a+b)+c and a+(b+c)
> >> can both be written as a+b+c but the same is not true for
> >> a-(b-c).
> > 
> > Would it get any easier if you translate a - b to a + (-b)?
> 
> Yes, e.g. my parser
> 
> http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc
> 
> does this. The symbols "+" and "-" can be declared "commutative"
> with the unary minus as an inverse. Then the parser will parse
> 
>    a + b - c + d
> 
> as
> 
>   "+"
>    |_ a
>    |_ b
>    |_ "-"
>    |  |_ c
>    |_ d

"Associative".

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


Thread

Removing Extra/Unnecessary Parentheses waterNight <willmann817@gmail.com> - 2013-12-03 06:11 -0800
  Re: Removing Extra/Unnecessary Parentheses waterNight <willmann817@gmail.com> - 2013-12-03 06:12 -0800
    Re: Removing Extra/Unnecessary Parentheses Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-12-03 21:57 +0000
      Re: Removing Extra/Unnecessary Parentheses waterNight <willmann817@gmail.com> - 2013-12-03 18:12 -0800
        Re: Removing Extra/Unnecessary Parentheses Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-12-04 02:45 +0000
      Re: Removing Extra/Unnecessary Parentheses "BartC" <bc@freeuk.com> - 2013-12-04 11:43 +0000
      Re: Removing Extra/Unnecessary Parentheses Jongware <jongware@no-spam.plz> - 2013-12-10 10:20 +0100
        Re: Removing Extra/Unnecessary Parentheses "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-12-10 11:35 +0100
          Re: Removing Extra/Unnecessary Parentheses Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-12-10 14:34 +0200
            Re: Removing Extra/Unnecessary Parentheses "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-12-10 14:35 +0100
  Re: Removing Extra/Unnecessary Parentheses "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-12-10 11:35 +0100
  Re: Removing Extra/Unnecessary Parentheses Kaz Kylheku <kaz@kylheku.com> - 2014-01-25 07:41 +0000

csiph-web