Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: "Dmitry A. Kazakov" Newsgroups: comp.compilers Subject: Re: precedences vs. hierarchy Date: Tue, 7 Jun 2016 22:53:56 +0200 Organization: Aioe.org NNTP Server Lines: 25 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <16-06-009@comp.compilers> References: <16-06-001@comp.compilers> <16-06-004@comp.compilers> <16-06-008@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="5675"; mail-complaints-to="abuse@iecc.com" Keywords: parse Posted-Date: 07 Jun 2016 17:19:37 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1715 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