Something new in C syntax

Chris Torek chris at mimsy.UUCP
Sat Jan 28 16:27:02 AEST 1989


In article <4586 at bunker.UUCP> allen at bunker.UUCP (C. Allen Grabert) writes:
>... I have since decided that the ifdef's do NOT remove the action
>of the comment delimiters.

(correct)

>...  Anyone like to comment on why it works the way it does??

Because dmr did it that way.

More realistically: the preprocessor elides comments, and also must
scan the contents of false `#if' controls to keep track of nesting.
The most obvious way to do this is to have a lexical scanner that
deletes comments, and a parser that parses `#' control lines, and
to continue to delete comments even when parsing only to find the
matching `#endif'.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list