Please i am trying to pass the yyleng of a matched string from my (.l) file to the (.y) file. Here is a sample of the issue:
In the Lex File:
<state1>.+ { fprintf(yyout, "%d", yyleng); }
In the Yacc File:
/* I need to know the methodology used to receive a specific yyleng to the yacc file. Shall I use global variables? or there is a specific way for dealing with this issue? */
Thanks in advance for your help! ~ Any suggestions are highly appreciated.
yytext
instead ofyyleng
): – Jonathan Leffler