I do not understand why lemon waits for one more token when it has
enough information to reduce.
I want to recognize :
foo = Bar()
when the token CLOSE_PAR is received, not when an extra token is parsed.
How can I avoid lemon waiting for the extra token before reducing ?
Thanks for your help !
Gaspard
=============== GRAMMAR ==============
main ::= commands.
commands ::= . /* can be empty */
commands ::= WHITE_SPACE.
commands ::= commands command. /* many commands */
command ::= variable EQUAL class parameters. { printf("[new
object]\n"); }
variable ::= IDENTIFIER.
class ::= CONST_IDENTIFIER.
parameters ::= OPEN_PAR CLOSE_PAR.
=============== DEBUG OUTPUT ==============
Parser started.
> foo = Bar()
>>Input IDENTIFIER
>>Reduce [commands ::=].
>>Shift 1
>>Stack: commands
>>Shift 21
>>Stack: commands IDENTIFIER
>>Input EQUAL
>>Reduce [variable ::= IDENTIFIER].
>>Shift 3
>>Stack: commands variable
>>Shift 4
>>Stack: commands variable EQUAL
>>Input CONST_IDENTIFIER
>>Shift 20
>>Stack: commands variable EQUAL CONST_IDENTIFIER
>>Input OPEN_PAR
>>Reduce [class ::= CONST_IDENTIFIER].
>>Shift 5
>>Stack: commands variable EQUAL class
>>Shift 7
>>Stack: commands variable EQUAL class OPEN_PAR
>>Input CLOSE_PAR
>>Shift 8
>>Stack: commands variable EQUAL class OPEN_PAR CLOSE_PAR
At this point, lemon has all the information needed, but it waits
before reducing...
-------
http://rubyk.org, scriptable multimedia controller
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------