not the way ... (was Re: Want a way to strip comments from a)

Lawrence C Foard lfoard at wpi.wpi.edu
Fri Mar 24 17:01:02 AEST 1989


I tried the comment stripper I poster earlier today on these pathological
cases and it seems to get the right answer.

Script started on Fri Mar 24 01:56:10 1989
% cat tmp3.tmp
        Commented                  should be
	/ /* / */                #   /
	/*****//hello world */   #  /hello world */
	/* hello /* /* world */  # 
	/* */ hello /* */        #   hello
	/**// /* this input should produce "/ \n" for output */      #     /
	/* */ hello */           #   hello */


% ../tmp/a.out <tmp3.tmp
        Commented                  should be
	/                 #   /
	/hello world */   #  /hello world */
	  # 
	 hello         #   hello
	/       #     /
	 hello */           #   hello */


% ^D
script done on Fri Mar 24 01:56:36 1989

Now the only question is did I parse it right?

-- 
Disclaimer: My school does not share my views about FORTRAN.
            FORTRAN does not share my views about my school.



More information about the Comp.lang.c mailing list