%{

/*
   this script compactifies a postscript file by removing all comments
   and spaces that are not needed
*/

%}

%x INTEXT

%%

^[ \t\n]*/[^ \t\n]         {
     BEGIN(INTEXT);
     printf("     PSPUT(\"");
}

<INTEXT>[^ \t\n]+         printf("%s",yytext);
<INTEXT>[ \t]+            printf("%s",yytext);
<INTEXT>[ \t\n]*\n        {
     BEGIN(0);
     printf("\");\n");
}

%%

