Strange C parses

Bill Stewart HO 4K-437 x0705 wcs at homxa.UUCP
Tue Apr 24 08:51:54 AEST 1984


<I wish I could read the article into my temp file.  Oh, well>

This is an reply to the article about why

	int *v, *w;
	x= *v/*w;

treats the /* as a Begincomment token, while
	...
	x= *v/ *w;

works.  (Note that I have x= *v, not x=*v, which still dies on
System V, in violation of the current language definitions.
(So do k=-1; or k=++j; ) )  I assume the reason is that comments are
handled by the lexical analyzer, rather than by the grammar.  While
this is not totally flexible, it's much cleaner to program, and  you
don't get killed by /* stuff with bad(syntax( */.  I think the /*
problem is a tolerable compromise (since I don't use it much);
the =op stuff bugs me.
			Bill Stewart AT&T Bell Labs, Holmdel



More information about the Comp.lang.c mailing list