Your problem is not with these rules at all. Although Michael Mrozek is responding to the right approach to resolving "problems with the dangling others," he does not understand the problem.
If you look at the error message, you will see that a shift / decrease conflict is present during LPAREN lexing . I am sure that only the rules will not create conflict.
I do not see your grammar, so I can not help you. But your conflict probably occurs when command followed by another rule starting with LPAREN .
Look at any other rules that could potentially be after command and begin with LPAREN . Then you have to consolidate the rules. There is a very good chance that your grammar is wrong for a specific input.
rioki source share