/* Compile with : > lex example2.l > gcc lex.yy.c -o example2 -lfl */ %{ #include <stdio.h> %} %% [0123456789]+ printf("NUMBER\n"); [a-zA-Z][a-zA-Z0-9]* printf("WORD\n"); %%