From 5372586720568351527
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,13ce76b24fcf616c
X-Google-Attributes: gidf78e5,public
From: Pieter van Beek <vanbeek@kobasoft.nl>
Subject: Re: Operator precedence
Date: 1999/12/29
Message-ID: <38692702.FCB626F4@kobasoft.nl>#1/1
X-Deja-AN: 565911517
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <3868B1A1.D47627B4@kobasoft.nl> <3868DE6D.5C90C109@sensor.com>
X-Original-Date: Tue, 28 Dec 1999 22:09:22 +0100
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: ariel.ucs.unimelb.edu.au 946439432 2736 128.250.37.153 (29 Dec 1999 03:50:32 GMT)
Organization: Kobayashi Software
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAOGmFLuEDnX0m9pzZAQGBLgGAgrGaSgUhZt08InqJkJlSAQ1ljiI/UkM5 yYBoMvXXe3DNxK9r+UdUJ9HIix5Dk7PL =oT8x
Mime-Version: 1.0
NNTP-Posting-Date: 29 Dec 1999 03:50:32 GMT
Newsgroups: comp.std.c++

Ron Natalie wrote:

> Pieter van Beek wrote:
> >
> > Hi all,
> >
> > There seems to be no operator precedence table in de ansi C++ standard.
> > I always used the one from Stroustrup, and only found out yesterday this
> > topic is not covered by the standard.
> >
> > AIMS?
> >
>
> Precedence is not defined by that table, even in C, it is implied by
> the language grammar.  The inclusion of the table in K&R and Stroustrup
> is purely informational.  Note the comment from Stroustrup at the bottom
> of page 121:
>         A few grammar rules cannot be expressed in terms of precedence
>         (also known as binding strength) and associativity.
>
> This has lead to some confusion with the ?: operator interpretation.

If this is so, then how know, from the standard, how for example
*array_of_arrays[3] will be interpreted? Or *foo->bar() ?

Pieter

--
KOBAYASHI SOFTWARE
Tel. +31 20 4165015
Rich text (HTML) e-mail is preferred
PGP Key ID:  0x823C9CEC
Fingerprint: CE4E E2D5 C18C 45AD 2DBD  08E5 BACA 342F 823C 9CEC
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



