Ger Hobbelt
Ger Hobbelt
jison has an ARROW_ACTION feature (see ebnf_parser) where you can write a grammar production with shorthand action code like this: ``` a : A -> 'A[' + $A + ']';...
Cf. https://www.gnu.org/software/bison/manual/html_node/Precedence-Decl.html The classic `%left`, `%right` and `%nonassoc` encode **associativity** and thus *implicitly* drive precedence decisions in an otherwise ambiguous grammar, which is to be frowned upon as it does...
Cf. https://www.gnu.org/software/bison/manual/html_node/Initial-Action-Decl.html#Initial-Action-Decl Currently I hack around this by pushing a special Unicode character into the input stream via an initial `%epsilon`: this hack-character would thus end up at input index...
Cf. https://www.gnu.org/software/bison/manual/html_node/Destructor-Decl.html (bison manual page about `%destructor`) See also http://stackoverflow.com/questions/6401286/when-is-destructor-invoked-in-bison `%destructor` is also very useful in JavaScript to prevent memory leaks when your lexer produces `yylval` token values (in jison,...
From the bison docs @ http://dinosaur.compilertools.net/bison/bison_6.html#IDX85 (emphasis mine): > > **If you don't specify an action for a rule, Bison supplies a default**: `$$ = $1`. > Thus, the value...
Reduce lexer run-time costs. See also work done in #338 for the *parser*; now that work should continue into the *lexer* to achieve maximum 'parse' speeds.
Try to drag this bugger out of there; see also https://github.com/zaach/jison/wiki/Deviations-From-Flex-Bison#literal-tokens That diff should go away.
See also the [Bison docs](http://www.gnu.org/software/bison/manual/html_node/Named-References.html#Named-References) Example from their docs; note the `if-stmt` (and the `then.stmt` ! jison never supported _that_ one in any way): ``` if-stmt: "if" '(' expr ')'...
...th` option. Added examples to the samples page to showcase/test the fix (load an old sparkline lib to see the 'fixed dimensions' examples render FUBAR).