Hi Adrian, SableCC 4 will have two robust ambiguity resolution mechanisms: 1- Dangling constructs 2- PrecedenceThe implementation of these constructs are backed by solid theory that proves that: 1- There was an ambiguity, indeed, to resolve, and it was resolved according to the directive. (Note that, in general, a conflict does not imply that there is an ambiguity).
2- No other conflict is "accidentally" resolved.So, it cannot handle arbitrary shift/reduce or reduce/reduce conflict, but it handles some of the most frequent ambiguities found in grammars.
The syntax is already in place in http://sablecc.org/browser/grammars/sablecc4.sablecc3.
Additionally, the lexer engine will be much more powerful, with arbitrary lookahead (while preserving linear parsing complexity), and the parser will have K lookahead and semantic selectors. I certainly hope that it will be sufficient to parse your grammar(s).
Etienne
That sounds great. Will v4 offer directives for resolving shift/reduce conflicts? I am working on a language similar to Lua in that it allows expressions to appear in sequence with no separator, and I don't relish the prospect of maintaining two versions of the expression grammar when the conflict could be resolved by a standard "prefer shift" policy. I really like SableCC's architecture but this one issue is making me consider changing to CUP.
-- Etienne M. Gagnon, Ph.D. SableCC: http://sablecc.org SableVM: http://sablevm.org
Attachment:
signature.asc
Description: OpenPGP digital signature