I already looked for my answer but I didn\'t get any quick response for a simple example.
I want to compile a flex/bison scanner+parser using g++ just because I want
You need the extern "C" {}
for yylex
to be in shady.l
:
%{
extern "C"
{
int yylex(void);
}
#include "shady.tab.h"
%}
%%
"MOV"|"mov" { return T_MOV; }
"NOP"|"nop" { return T_NOP; }
...etc...
Also, after adding a dummy grammar rule, I was able to build and run this with just:
559 flex shady.l
560 bison -d shady.y
561 g++ shady.tab.c lex.yy.c