Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!samsung!uakari.primate.wisc.edu!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: What does "a---b" mean? Message-ID: <21602@mimsy.umd.edu> Date: 3 Jan 90 08:30:28 GMT References: <1303@mit-amt.MEDIA.MIT.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 28 In article <1303@mit-amt.MEDIA.MIT.EDU> adamk@mit-amt.MEDIA.MIT.EDU (Adam Kao) writes: >To summarize, my understanding is: > >1. The lexical analyzer scans left to right making the biggest token > possible. Yes. >2. Compound assignment tokens (ONLY) can be read as two consecutive > tokens (ie separated by whitespace ONLY) that are IMMEDIATELY > joined into one token. Yes, but only in Classic C, not in New C (proposed ANSI standard C). >3. Remaining ambiguity is resolved by simple (hah!) precedence and > associativity rules. More or less. C has no nonassociative operators, so every syntactically correct expression has a defined grouping. The result can still be ambiguous in another sense, e.g., p += *p++; is easy to parse but hard to describe. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris