import java.io.PrintWriter; import java.io.File; import java.io.FileNotFoundException; %% %class A3 %unicode %line %standalone %{ private static PrintWriter writer; private static void start() throws FileNotFoundException{ writer = new PrintWriter("test.html"); writer.println(""); } private static void end(){ writer.println(""); writer.close(); } %} %init{ start(); %init} %initthrow{ FileNotFoundException %initthrow} %eof{ end(); %eof} %% [\r\n] {writer.print("
\n");} \"[^\"]*\" {writer.print(yytext());} CLS|PRINT|INPUT {writer.print("" + yytext() + " ");} REM.*[^\n] {writer.print("" + yytext() + "");} [A-Z]+\$ {writer.print("" + yytext() + "");} [A-Z]+\% {writer.print("" + yytext() + "");} [=] {writer.print(" " + yytext() + " ");} [;,] {writer.print(yytext() + " ");}