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

Re: How to resolve conflict ?



I discovered the conflict.  I had a conflict between the assignment_expression and the "factor" production.

Thanks!


> ----- Original Message -----
> From: "Roger Pomeroy" <rogerandsue@xxxxxxxx>
> To: sablecc-discussion@xxxxxxxxxxxxxxxxx
> Subject: How to resolve conflict ?
> Date: Mon, 6 Oct 2008 07:54:54 -0800
> 
> 
> I am trying to use sablecc to describe a language grammar.  I took
> a look at some of the example grammars and tried to use those as a
> guide, but I seem to get shift/reduce errors and it's not clear to
> me exactly why.
> 
> I am wondering if anyone can help explain how I can use the error
> messages & printouts to diagnose my problems.  I see that the top
> of the output says something like:
> "A previous conflict that we've tried to solve by inline some
> productions inside the grammars cannot be solved that way. The
> transformed grammar is :"  followed by the grammar.  Is this just a
> comment, or an "early indication" that I have something wrong in
> the grammar, which eventually gives me an error of the form:
> 
> shift/reduce conflict in state [stack: PLhs PAssignOperator
> TIdentifier *] on TNewLine in {
> 	[ PAssignStatement = PLhs PAssignOperator TIdentifier * TNewLine ] (shift),
> 	[ PExpon = TIdentifier * ] followed by TNewLine (reduce)
> 
> I have attached a copy of my language grammar.  It is intended to
> be a (relatively) simple programming type language where variables
> are named something like "abc" or "abc.def" and the usual sort of
> math operators are allowed (similar to java/c/basic/etc...)
> 
> Thanks for any help !
> 
> Roger
> 
> 
> --
> Be Yourself @ mail.com!
> Choose From 200+ Email Addresses
> Get a Free Account at www.mail.com
> << AgpsSyntax.sablecc >>

>


-- 
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com