%option prefix="yy" %{ /* Scanner zum Einlesen von DSC Postscript Dateien von Carsten Hammer Hammer.Carsten@oce.de */ #include #include #include #define YY_DECL int yylex(char *buf,int *len) %} %x PAGES %% .*\n strncpy(buf,yytext,*len);*len=yyleng;return(1001); .*\n/"%%Page: 1 1" BEGIN(PAGES);strncpy(buf,yytext,*len);*len=yyleng;return(1001); \n ; .*\n strncpy(buf,yytext,*len);return(yyleng>*len?*len:yyleng); .*\n/"%%Page:" strncpy(buf,yytext,*len);*len=yyleng;return(1000); %% int yywrap(){ return(1); }