On Mon, Jan 18, 2010 at 04:21:45PM -0600, Michael Chen wrote:
> My grammar statement ends with a ';'. Even myself sometimes press the
> ';' multiple times. So definitely I need a way to silently ignore all
> redundant ';'. How to do it? Thanks.

Multiple ';'-s can be regarded as empty statements, so if your grammar
is:

stmtlist: /* empty */
        | stmtlist ';'
        | stmtlist stmt ';'
        ;

stmt: ....

then this will do it. I guess whitespace is insignificant in your
language, so the lexer eats it up, this way

;   ; ; ;;; will be all empty statements with the above grammar snippet.

regards

Istvan


_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to