help-flex
[Top][All Lists]
Advanced

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

Strange behavior of PUSH / REJECT


From: wim delvaux
Subject: Strange behavior of PUSH / REJECT
Date: Thu, 10 Jul 2003 17:05:02 +0200
User-agent: KMail/1.5.2

I think there is problem with flex version another but 2.5.31

I have the following

<Y>{
.     {
              YY_POP_STATE();
              YY_PUSH_STATE(xxx)
              REJECT;
}
}

<xxx>{
.             {
                      return T_SOmeToken;
}

.             {
                      return T_Catchall;
}
 
This is an excerpt.

The parser is in a certain state, say Y, in which rule 1 applies

If the input is a character, say 'o',  it matches the rule 1 (compiled using 
debug output of parser).  So The new state is pushed, after the old one (Y) 
is popped.  I would expect the token T_SomeToken to be returned.

However I notice that the CatchAll rule is matched ???

the next character on the stream DOES match the xxx rule (because the state 
seems indeed to be xxx.

Is there a reason I miss why the xxx state pushing is only activated AFTER the 
current character is parsed ?

W





reply via email to

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