I'm studying compilation theory and how to work with flex and i have several issues.
I created a lex file with the following data in it:
%%
"hello" printf("GOODBYE");
. ;
%%
This is the simplest one I could think of. If I understand correctly, it prints GOODBYE every time it encounters the hello token, and ignores everything else.
I used flex on this lex file to generate a C file, and I should now compile that C code to get the lexical analyzer for this grammar.
The problem is that the generated C code has no entry point. It does not compile. Is my .lex file incorrect? Am I misunderstanding something?