[Scriptonite-dev] Conflict free scriptonite grammar
Status: Planning
Brought to you by:
egagnon
|
From: Etienne M. G. <eg...@j-...> - 2000-03-05 21:18:57
|
Hi!
I have used the latest SableCC release to solve all conflicts in the grammar.
Notice that a few irregulars requirements of the specification will require
the help of a custom lexer.
Now, it's your turn to start contributing! Don't wait for me to write this
project; I won't. But I am willing to answer questions and offer guidance.
Here is a summary of the conflicts/solutions:
(1) no line terminator in front of incr/decr (++/--): Define the two versions
of tokens that include preceeding white space with or without line
terminators. Fix the grammar appropriately.
(2) no line terminators after continue, break, return, throw. Solved with
lexer states and custom lexer. No grammar modifications.
(3) statement_expression should be an expression that does not start with "{"
or "function". Unroll grammar (introducing expression_no_lbf).
(4) dangling-else ambiguity. Unroll grammar (statement_no_if).
This was it. I guess that the designers of ECMAScript used an LR parser;-)
Etienne
|