Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!draves
From: draves@harvard.ARPA (Richard Draves)
Newsgroups: net.lang.c
Subject: Re: Other 'significant' blanks
Message-ID: <215@harvard.ARPA>
Date: Fri, 14-Dec-84 01:39:13 EST
Article-I.D.: harvard.215
Posted: Fri Dec 14 01:39:13 1984
Date-Received: Sat, 15-Dec-84 02:17:11 EST
References: <10246@watmath.UUCP> <4757@utzoo.UUCP>
Organization: Aiken Computation Laboratory, Harvard
Lines: 17

> > Should a compiler allow blanks between the 'op' and the '=' in an
> > 'op=' operation? ...
> 
> K&R actually says explicitly that (e.g.) "+=" is two tokens; hence
> space between them is allowable (section 7.14).  However, practically
> no C compilers other than the original Ritchie compiler have done it
> this way.  One reason for this is that it makes the language non-LALR(1),
> so all the yacc-based parsers croak.  The current ANSI C draft (12 Nov)
> says that "+=" is one token.
> -- 
> 				Henry Spencer @ U of Toronto Zoology
> 				{allegra,ihnp4,linus,decvax}!utzoo!henry

Why not have the lexxer recognize the double tokens?  For instance,
one rule for lex might be "+"[ \t\n]*"=", etc.

Rich