I'm attempting to parse one input file .l file with flex, but I'm having trouble constructing my program. I've included my flex code as well as the problem I'm getting.
.l file:
%{
#include "main.tab.h"
%}
%%
[ \t\n] /* ignore whitespace */
"MATCH" { return MATCH; }
"RETURN" { return RETURN; }
"-" { return DASH; }
"(" { return LPAREN; }
")" { return RPAREN; }
"[" { return LBRACKET; }
"]" { return RBRACKET; }
[uv] { return VARIABLE; }
%%
int yywrap(void) {
return 1;
}
Error:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status