Re^2: Why nested comments not allowed?

Dan Barrett barrett at jhunix.HCF.JHU.EDU
Tue Feb 20 13:34:14 AEST 1990


>In article <1523 at wacsvax.OZ>, chris at wacsvax.OZ (chris mcdonald) writes:
>> I don't know why they are not supported but agree that they are damn
>> useful. They are easy to parse in syntactically correct programs (ever
>> heard of counting?)

In article <13706 at cbnewsc.ATT.COM> dalenber at cbnewsc.ATT.COM (Russel Dalenberg) writes:
>And what will you do when trying to comment out code that contains the
>"end of comment" sequence?
>	printf("A comment is ended with */");

	Oh, come on... this is no problem.  My kids in "Intermediate
Programming" wrote this for their FIRST assignment in C.  It is easy to
construct the necessary automaton if you aren't counting nest levels,
and not hard to add the nesting.

                                                        Dan

 //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
| Dan Barrett, Department of Computer Science      Johns Hopkins University |
| INTERNET:   barrett at cs.jhu.edu           |                                |
| COMPUSERVE: >internet:barrett at cs.jhu.edu | UUCP:   barrett at jhunix.UUCP    |
 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////



More information about the Comp.lang.c mailing list