“`flex %{ #include %} %% int|integers { printf(“Keyword: int\n”); } float|floating { printf(“Keyword: float\n”); } if { printf(“Keyword: if\n”); } then { printf(“Keyword: then\n”); } else { printf(“Keyword: else\n”); } for { printf(“Keyword: for\n”); } print£ { printf(“Keyword: print£\n”); } switch { printf(“Keyword: switch\n”); } case { printf(“Keyword: case\n”); } return { printf(“Keyword: return\n”); } [0-9]+ { printf(“Integer: %s\n”, yytext); } [0-9]+”.”[0-9]+ { printf(“Float: %s\n”, yytext); } . { /* Ignore other characters */ } %% int main() { yylex(); return 0; } “`