From 3651885406283788818
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,5105623963cf728
X-Google-Attributes: gidf78e5,public
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: controlnews3.google.com!news1.google.com!news.glorb.com!cyclone.bc.net!news.alt.net!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: Victor Bazarov <v.Abazarov@comAcast.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.std.c++
Subject: Re: Whitespace ambiguity in grammar
References: <607f883e.0405241033.ea113f8@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <YWrsc.541$ri.51815@dfw-read.news.verio.net>
X-Complaints-To: abuse@verio.net
X-Trace: dfw-read.news.verio.net 1085426488 149.65.2.103 (Mon, 24 May 2004 19:21:28 GMT)
NNTP-Posting-Date: Mon, 24 May 2004 19:21:28 GMT
Organization: NTT/Verio
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-4.9 required=5.2 tests=BAYES_00 autolearn=ham 
	version=2.60-mulga_r1
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Mon, 24 May 2004 14:29:46 CST
Lines: 43
Xref: controlnews3.google.com comp.std.c++:457

Prateek R Karandikar wrote:
> When there are 2 consecutive elements of grammar, sometimes it is
> intended that whitespace be required between them, someimes that there
> be no whitespace between them, and sometimes that whitespace is
> optional.
> For ex,
> 
> 1)
> original-namespace-definition:
> 	namespace identifier { namespace-body }
> 
> Clearly, whitespace is required between namespace and identifier.
> 
> 2)
> decimal-literal:
> 	nonzero-digit
> 	decimal-literal digit
> Clearly, it is required that there be no whitespace between
> decimal-literal and digit.
> 
> 3)
> 
> and-expression:
> 	equality-expression
> 	and-expression & equality-expression
> Clearly, whitespace is optional on both sides of the &.
> 
> Isn't this inconsistent?

No.  I think you need to look at the translation phases (2.1), pay 
attention to the definition of "preprocessing token" and "token", and to 
the paragraph 2.1/7.  The rule concerning the original namespace 
definition is given in terms of tokens, and with those whitespace is not 
important.  It's only important when determining the token sequence.

V

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



