%%writefile program.l %{ #include <stdio.h> %} %% [a-zA-Z]+{ printf("Word: %s\n", yytext); } .|\n{ /* ignore other characters */ } %% int main() { yylex(); return 0; }
void main()
{ int a= 10;
{
gcc lex.yy.c -lfl -o lexerStandard output is empty
ERROR: /home/SH6VfH/prog:15:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? ERROR: Unknown option (h for help) Exception: (3) program ? ERROR: Unknown option (h for help) Exception: (3) program ? ERROR: Unknown option (h for help) Exception: (3) program ? ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit