]> git.saurik.com Git - bison.git/commit
parser: no longer use the "braceless" non-terminal
authorAkim Demaille <akim@lrde.epita.fr>
Thu, 18 Apr 2013 14:36:54 +0000 (16:36 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Thu, 18 Apr 2013 14:36:58 +0000 (16:36 +0200)
commit985d7177e8aaedcabe48dd911077ddcc8f74891f
treecb53cf980100bf94c3c9ceab9dcade10828ebd82
parent7dbadca2d082e6fcded4bb6f2b42df0035c99aaf
parser: no longer use the "braceless" non-terminal

The purpose of this symbol was only to factor function calls.  As a
result the actions were indeed simpler, but the grammar was somewhat
uselessly obfuscated.  Get rid of this symbol, but introduce functions
to simplify dependencies.

There is no (intended) changes of behavior here.

* src/parse-gram.y (strip_braces, translate_code(
(translate_code_braceless): New.
(braceless): Remove, use "{...}" instead, and one of the previous
functions depending on the context.
(STRING, "%{...%}", EPILOGUE): Declare as <code>, instead of <chars>,
the difference between both is useless (well, I couldn't make sense of
it, even after having read the initial commit that introduced them).
(%union): Remove the now useless "chars" type.
Adjust the printers.
* src/scan-gram.l: Adjust.
src/parse-gram.y
src/scan-gram.l