%option nounput noinput %{ #include int linenum=1; #define PRLN printf("%6d\t",linenum++) %} %% /* Permuter les 2 lignes "^\n", pour choisir entre cat -b ou cat -n */ ^\n PRLN; ECHO; /* cat -n */ ^\n ECHO; /* cat -b */ ^. PRLN; ECHO; /* Line Number */ .|\n ECHO; %% int yywrap(void) { return 1; } int main(int argc, char *argv[]) { while (yylex()!=0) ; return 0; }