%% %include Jflex.include %{ static int MAXLINE = 80; int car_pos = 0; void NL() { System.out.println(); car_pos = 0; } %} NL = \R SP = [ \t\n\r\f\v] CAR = [^ \t\n\r\f\v] %% ^{SP}+ { } {NL}{NL} { NL(); NL(); } {NL} { } {SP}+ { if (car_pos != MAXLINE-1) {System.out.print(" "); car_pos++; } } /* nb : il reste des blancs en fin de ligne */ {CAR}+ { if ((car_pos + yylength() ) > MAXLINE-1) NL(); ECHO(); car_pos += yylength(); } [^] { ECHO(); car_pos++; }