Scrunch blank lines

John Rupley rupley at arizona.edu
Sat Apr 1 11:57:42 AEST 1989



In article <620 at gonzo.UUCP> daveb at gonzo.UUCP (Dave Brower) writes:
>So, I offer this week's challenge:  Smallest program that will take
>"blank line" style cpp output on stdin and send to stdout a scrunched
>version with appropriate #line directives.

Yet another Lex version:
------------------------------------------------------------------------
	char f[80]; int x;
%%
#.+\n	{sscanf(yytext,"#%d%s",&yylineno,f); x++;}
.+\n	{if(x)printf("# %d %s\n",yylineno-1,f); ECHO; x=0;}
\n	x++;
------------------------------------------------------------------------
John Rupley
rupley!local at megaron.arizona.edu



More information about the Comp.lang.c mailing list