jump to content

	/*************************************************************************
	 * A program to extract SQL from Pro*C                                   *
	 * input is stdin or argument , output is stdout                         *
	 * compile as : (lex thisfile;cc -Aa -o yourexe lex.yy.c;rm lex.yy.*)    *
	 * Vattekkat Satheesh Babu on 05/01/98.If you've GNU-Flex,compile as flex -i     *
	 *************************************************************************/
	#define yywrap()	1
	/* Just to fool HP-UX - C compiler */
%%
EXEC[ \t]SQL|exec[ \t]sql|Exec[ \t]Sql	{
					ECHO ;
					while(input()!=';')
					{
						output(yytchar);
					}
					output(yytchar);
					output('\n');
				 }
\n	  {;}
.	  {;}
%%
main(argc,argv)
int argc;
char **argv;
{
	if ( argc > 1 )
		yyin = fopen(argv[1],"r");
	else
		yyin = stdin;
	yylex() ;
}