%{	
#include <stdio.h>
%}
identc	[a-zA-Z0-9_]
%%
"tcb->"[a-zA-Z0-9_]*		{ fprintf (yyout, "%s\n", yytext); }
.|\n				;
%%

main(argc, argv)
int argc;
char **argv;
{
	argc--; argv++;
	while (argc--)
	 { FILE *fd1;
	   FILE *fd2;
	   char temp[256];

	   if ((fd1 = fopen (*argv, "r")) == NULL)
	    { printf ("can't open %s\n", *argv);
	    }
	   else
	    { sprintf (temp, "%s.FID", *argv);
	      if ((fd2 = fopen (temp, "w")) == NULL)
	       { fatal (-1, "can't open temporary file %s\n", temp);
	       }
	      yyin = fd1;
	      yyout = fd2;

	      yylex();

	      rename (temp, *argv);

	      fclose (fd1);
	      fclose (fd2);
	    }
	   argv++;
	 }
	yylex();
}

yywrap ()
{
 	return(1);
}

#if 0
input() 
{
	if (yysptr > yysbuf)
	 { yytchar = *(--yysptr);
	 }
 	else
  	 { char c = getc(yyin);
	   yytchar = c;
	   putLog (c);
	 }
	if (yytchar == '\n')
  	 { yylineno++;
	 }
	if (yytchar == EOF)
  	 { return (0);
	 }
	else
 	 { return (yytchar);
	 }
}

unput(c) 
{	
	yytchar = (c);
	if (yytchar == '\n')
	 { yylineno--;
	 }
	*yysptr++ = yytchar;
}
#endif
