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

reduce conflict on... (re-send)

Hello. I am writing a SQL grammar. After playing around with javaCC, I
decided to try SableCC because there were left recursions in SQL that
I could not get rid of.

I have done a first pass on the grammar, but I am running into problems
with the parser regarding reduce conflicts (whatever those are). I am not
very well versed in the theory of languages, and I've looked through
Etienne's thesis for an explanation of the error messages, but I
couldn't find one.

The error message is:
reduce/reduce conflict on TKAs in {
	[PColumnQualifier = TIdentifier TPeriod]:1:TIdentifier,
	[PColumnReference = TIdentifier]:1:TKAs,
	[PColumnReference = TIdentifier]:1:TKBetween,
	[PColumnReference = TIdentifier]:1:TKCollate,
	[PColumnReference = TIdentifier]:1:TKFrom,
	[PColumnReference = TIdentifier]:1:TKIn,
	[PColumnReference = TIdentifier]:1:TKInto,
	[PColumnReference = TIdentifier]:1:TKLike,
	[PColumnReference = TIdentifier]:1:TKMatch,
	[PColumnReference = TIdentifier]:1:TKNot,
	[PColumnReference = TIdentifier]:1:TKOverlaps,
	[PColumnReference = TIdentifier]:1:TIdentifier,
	[PColumnReference = TIdentifier]:1:TPlusOperator,
	[PColumnReference = TIdentifier]:1:TMinusOperator,
	[PColumnReference = TIdentifier]:1:TMultiplicationOperator,
	[PColumnReference = TIdentifier]:1:TDivisionOperator,
	[PColumnReference = TIdentifier]:1:TNotEqualsOperator,
	[PColumnReference = TIdentifier]:1:TGreaterThanOrEqualsOperator,
	[PColumnReference = TIdentifier]:1:TLessThanOrEqualsOperator,
	[PColumnReference = TIdentifier]:1:TConcatenationOperator,
	[PColumnReference = TIdentifier]:1:TLessThanOperator,
	[PColumnReference = TIdentifier]:1:TEqualsOperator,
	[PColumnReference = TIdentifier]:1:TGreaterThanOperator,
	[PColumnReference = TIdentifier]:1:TRp,
	[PColumnReference = TIdentifier]:1:TComma,
	[PQualifiedName = TIdentifier]:1:TKAs,
	[PQualifiedName = TIdentifier]:1:TIdentifier,
	[PQualifiedName = TIdentifier]:1:TPeriod

How should one interpret this error message? What do the numbers mean, for
example (:1:) ? What do the different fields mean?

I am assuming that there is a problem because of:

        [PColumnReference = TIdentifier]:1:TKAs,
        [PQualifiedName = TIdentifier]:1:TKAs,

meaning that both qualified name and column reference consist of an
identifier followed by the keyword 'As'.

Am I correct?


| Chad Loder - Somerville, MA, USA                 |
| EMail:     cloder@acm.org                        |
| Home Page: http://www.ccs.neu.edu/home/cloder    |