.
/*
needs testing
washington post
*/
int fileno (FILE *);
#define jmp (yy_start) = 1 + 2 *
int d,e,h,l,x;
int mode;
%option nounput noinput noyywrap
%s W
%%
"<!DOCTYPE html>" d=0;e=0;h=0;l=0;
\"@type\":\"NewsArticle\"
\"@type\":\"LiveBlogPosting\" {
fwrite("live blog: use yy059\n",1,20,stderr);
yyterminate();
}
\"headline\":\"[^\"]+ if(!h){
h++;
fwrite("\n<meta charset=utf-8/>\n",1,23,yyout);
fwrite("<p>",1,3,yyout);
for(x=12;x<yyleng;x++)putc(yytext[x],yyout);
fwrite("</p>",1,4,yyout);
}
\"datePublished\":\"[^\"]+ if(!d){
d++;
for(x=17;x<yyleng;x++)putc(yytext[x],yyout);
}
\"content\":\" fwrite("<p>",1,3,yyout);jmp W;
\"byline\":\" fwrite("<p>",1,3,yyout);jmp W;
\"location\":\" fwrite("<p>",1,3,yyout);l++;jmp W;
\"education\":\[\{ e++;
\"name\":\" if(e){fwrite("<p>",1,3,yyout);jmp W;};
<W>\",\" fwrite("</p>\n",1,5,yyout);if(l)e=0;jmp 0;
<W>\"\},\{\" if(e){fwrite("</p>\n",1,5,yyout);jmp 0;};
<W>\"\}\] if(e){fwrite("</p>\n",1,5,yyout);e=0;jmp 0;};
<W>\\u003c putc(60,yyout);
<W>\\u003e putc(62,yyout);
<W>\\n putc(10,yyout);
<W>[^\134] putc(yytext[0],yyout);
.|\n
%%
int main(){
yylex();
exit(0);
}