Repeating on the same rule again and again in CFG-parser

33 views Asked by At

I have this rule :

 [<parameterList>
     [() (list 'parameterList)]
     [(<type> <varName> <ITERParamterList>) (append (list 'parameterList $1 $2) $3)]]

and if I add display I can see that it reacting for every option that possible - which means : if I have int a , int b , int c it will try

() 
(a )
(a) (b)
(a) (b) (c) 

so I am wondering why that happens (I guess because the implementation of the LALR(1) and is a must but : ) because in other similar rules, it doesn't happen! how can I fix that ???

0

There are 0 answers