lex and yacc
Posted: Tue Jun 12, 2007 1:47 pm
howcome this simple code doesn't work:
I compile it with "flex foo.txt" and then try "tcc foo.yy.c", but always get:
tcc: undefined symbol "yywrap"
tcc: undefined symbol "main"
Code: Select all
D [0-9]
%%
if printf ("IF statement\n");
[a-z]+ printf ("tag, value %s\n", yytext);
{D}+ printf ("decimal number %s\n", yytext);
"++" printf ("unary op\n");
"+" printf ("binary op\n");
%%
tcc: undefined symbol "yywrap"
tcc: undefined symbol "main"