%{ #include <stdio.h> %} /*letter [a-z]*/ %% [A-Z]+ { printf("%s\t%d\n", yytext, yyleng); } \n { printf("New line character\n"); } . ; %% int yywrap() { return 1; } int main() { yylex(); return 0; }
Standard input is empty
Standard output is empty
ERROR: /home/9otp3Z/prog:2:1: Syntax error: Operator expected ERROR: /home/9otp3Z/prog:14:33: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit