Want a way to strip comments from a

Michael Condict mnc at m10ux.UUCP
Fri Mar 24 15:17:17 AEST 1989


Oops, the previous lex script I posted for deleting comments from
C source code is incorrect -- it doesn't recognize:  /***...**/
Here is a better one (simpler, too):

	%%
	\"([^\\"]*\\(.|\n))*[^\\"]*\"	ECHO;
	"/*"([^*]|"*"+[^/*])*"*"*"*/"	;
	.				ECHO;

Okay, I promise to stop now.  (Unless there is a bug in this one.)
-- 
Michael Condict		{att|allegra}!m10ux!mnc
AT&T Bell Labs		(201)582-5911    MH 3B-416
Murray Hill, NJ



More information about the Comp.lang.c mailing list