This should a very simple one, but I couldn't figure out how.
What I am trying to achieve is a custom SQL parser, I started from the SQL sample from the kit. I added support for LIMIT and OFFSET in the select statement. However, the LIMIT option and OFFSET option can appear before GROUP BY or after GROUP BY.
Currently I have the following rule, which reports "Shift-reduce conflict" error.
selectStmt.Rule = SELECT + columnItemList + FROM + fromItem + whereClauseOpt +
limitOpt + offsetOpt +
groupClauseOpt + havingClauseOpt + orderClauseOpt +
limitOpt + offsetOpt;
As you can see, my rule has limitOpt and offsetOpt twice, which would be the cause of compilation error.
How should I fix this error?
Thanks in advance!