help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reentrant flex, bison glue


From: Akim Demaille
Subject: Re: reentrant flex, bison glue
Date: 12 Mar 2002 11:53:12 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

>>>>> "John" == John W Millaway <address@hidden> writes:

John> If bison passes values to flex, the only way for these values to
John> be available to the user in a reentrant scanner is for the
John> values to be saved in the scanner state. 

This is what I don't understand.  Could you detail this part please?
I fail to understand why the scanner would want to save its arguments
in a structure.

John> I say "guts" but they really go in the same place that 'yyleng'
John> goes.  

I don't understand either why yyleng would be saved, it's merely a
local variable of yylex, but this is not my business, you certainly
have motivations I don't know.

That the buffers etc. be part of a structure is obvious, yyleng is
less obvious to me, but really, I don't understand this at all in the
case of yylloc and yylval.

John> Flex preserves these values for you, untouched, inside the
John> scanner state (which is passed around from functions to
John> function).

This is probably the information I'm missing.  What function could
have an access to yylloc and yylval?  yylex is all that is concerned
with them.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]