%{ /* * This is my comment section. * This is my first lex file * Anything between %{ %} gets copied * directly to the generated .c file. * Thus, you would have #include libraries * and global variables such here. */ %} %% [\t ]+ /*recognize and ignore any number of tabs or white spaces*/ ; [a-zA-Z] { printf("%s: This is a letter\n", yytext); } .|\n { ECHO; /* normal default anyway */ } %% main() { yylex(); }