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


Groups > comp.compilers > #1715

Re: precedences vs. hierarchy

From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.compilers
Subject Re: precedences vs. hierarchy
Date 2016-06-07 22:53 +0200
Organization Aioe.org NNTP Server
Message-ID <16-06-009@comp.compilers> (permalink)
References <16-06-001@comp.compilers> <16-06-004@comp.compilers> <16-06-008@comp.compilers>

Show all headers | View raw


On 2016-06-07 17:35, Kaz Kylheku wrote:

>> (iii) By only precedence, which I prefer. Associativity is not needed if
>> operator precedence is split into the left and right ones. That allows
>> to express any associativity, unary operators included.
>
> What?
>
> You need the concept of associativity to tell whether
> A + B + C  is  (A + B) + C  or  A + (B + C).

No [explicit] associativity needed. You have left and right operator's
precedence instead. If you want

    A + B + C   |=    (A + B) + C

you do +'s left precedence L and right precedence R > L. E.g. 1,2. If
you wanted A + (B + C). You would use 2,1.

The idea is that the ordering depends the operator's side.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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


Thread

precedences vs. hierarchy Andreas Schramm <bassobajo@gmail.com> - 2016-06-06 09:08 +0200
  Re: precedences vs. hierarchy "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2016-06-06 17:08 +0200
    Re: precedences vs. hierarchy Kaz Kylheku <545-066-4921@kylheku.com> - 2016-06-07 15:35 +0000
      Re: precedences vs. hierarchy "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2016-06-07 22:53 +0200
      Re: precedences vs. hierarchy anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-08 09:48 +0000
  Re: precedences vs. hierarchy George Neuner <gneuner2@comcast.net> - 2016-06-06 12:35 -0400
  Re: precedences vs. hierarchy federation2005@netzero.com - 2016-06-06 14:01 -0700
    Example: The Full Syntax Of Prolog (Re: precedences vs. hierarchy) rockbrentwood@gmail.com - 2016-08-24 15:45 -0700

csiph-web