%{
#include "y.tab.h"
extern int yylval;
%}
%%
[0-9]+ {yylval = atoi (yytext); return NUM;}
[ \t] ;
\n return 0;
. return yytext[0];
%%
When I use yylval which is pointing to the value, why should I return the NUM? I mean what does NUM represent (NUM is decalred in YACC section)? Is NUM storing any value?
I am very confused with this section even when it has proper solution. I am just not getting the right reason for returning NUM as I have pointer yylval in YACC.