[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: h e l p on grammars]

"Etienne M. Gagnon" wrote:
> [Note: Majordomo ... the work "help",
Obviously, I meant "word"...

"Wei Hu" wrote:
> I have this basic questions: How does SableCC handle shift/reduce
> conflicts? Is there a way to tell SableCC always to reduce on these
> cases?

No.  SableCC does not allow for "obscure" shift/reduce actions.  You can
trust me:  I know of very few people that know exactly about the real
meaning/consequences of forcing a "reduce" or a "shift" to resolve a
grammar conflict.

Now, I also admit that it can be burdensome to do away without operator
precedence, a "relatively" well known and not so well understood
techniques.  For this reason, I have spent a lot of time designing a
"safe" subset "unambiguous" conflict resolution features for SableCC
3.x.  So, you can consider your request as being already on the
wish-list.  Conflict resolution will be specified much differently than
how you would do it in Bison/YACC.

Until then, you'll have to rewrite your grammars as "unambiguous" pure
LALR(1) grammars, unfortunately.  The good side of this, is that you end
up with a clear, effectively "unambiguous", grammar that you can show
the users of your language.  Users love this:)  It's the language
designers/compiler writers that complain... ;)

> I hope there is a document explaining the SableCC grammar specification
> and other features in details. Etienne's thesis is great, but is it
> outdated after so many revisions of the software itself?

You're free to help starting a FAQ, which could include documentation on
the latest features (like the new experimental error recovery

Etienne M. Gagnon                                    egagnon@j-meg.com
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/