]> git.donarmstrong.com Git - lilypond.git/commit
Parser: let MYREPARSE and MYBACKUP back up even in presence of lookahead
authorDavid Kastrup <dak@gnu.org>
Thu, 12 Dec 2013 14:34:33 +0000 (15:34 +0100)
committerDavid Kastrup <dak@gnu.org>
Thu, 19 Dec 2013 11:18:31 +0000 (12:18 +0100)
commitafea0e309c9a185b1d061fb397bf318ce8ff2fe9
tree33c2f14bc88feeecc54801702672b64ff81c19b4
parent5bf2b8b2d50667582a61abea0e6257be0d033131
Parser: let MYREPARSE and MYBACKUP back up even in presence of lookahead

This implies that the lookahead token must not yet have made an impact
on the state stack other than causing the reduction of the current
rule, or switching the lookahead token while Bison is mulling it over
will cause trouble.

Since an LALR(1) works on the top of the stack, this can usually be
guaranteed.  The "Too much lookahead" message is not produced.  If
these constructs are misused, the parser should typically complain
about the replacement token being unexpected.

The advantage is the ability to vastly simplify syntax rules that up
to now have to avoid lookahead tokens with a lot of drudgework.
lily/parser.yy