help-flex
[Top][All Lists]
Advanced

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

Re: yy_current_state, stuff


From: Jordan DeLong
Subject: Re: yy_current_state, stuff
Date: Thu, 15 Mar 2001 16:38:43 +0000
User-agent: Mutt/1.2.5i

On Thu, Mar 15, 2001 at 02:37:30PM -0800, Vern Paxson wrote:
> > I want to be able to
> > interrupt the scanner in the middle of scanning and be able to resume
> > without problems.  Such as this:  the scanner has read the letters 'i' and
> > then 'n' while in the INITIAL start condition, and then is interrupted,
> > when it comes back to the scanner, in order for it to know that the 't'
> > char it reads next makes it complete the rule for <INITIAL>"int" it needs
> > to have the yy_current_state variable (declared in the yylex func) restored
> > (in addition to the start condition vars, etc.)
> 
> This will be very hard to do.  First, what does it mean to interrupt the
> scanner?  Like via a signal?  There's no hook to abort scanning mid-token;
> the scanner is sitting in a tight loop at that point.
> 
>               Vern

Oh you're right, I hadn't realized this; the scanner can only be interrupted
when a rule is matched by returning or whatnot.  Actually that makes sense
too, and I think there's a better way to do this than what I was thinking.

Thanks for your time,
-Jordan



reply via email to

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