Re: Reduce/Reduce Conflict ?

"Scott Nicol" <>
24 Feb 2003 13:52:07 -0500

          From comp.compilers

Related articles
Reduce/Reduce Conflict ? (Ashwin) (2003-02-21)
Re: Reduce/Reduce Conflict ? (Matt) (2003-02-24)
Re: Reduce/Reduce Conflict ? (Scott Nicol) (2003-02-24)
Re: Reduce/Reduce Conflict ? (SLK Parsers) (2003-03-02)
| List of all articles for this month |

From: "Scott Nicol" <>
Newsgroups: comp.compilers
Date: 24 Feb 2003 13:52:07 -0500
Organization: APK Net
References: 03-02-124
Keywords: parse
Posted-Date: 24 Feb 2003 13:52:06 EST

"Ashwin" <> wrote in message
> Type:
> ;

This is your problem. You have both ParenthesizedExpression and
CastExpression with a reduction in the middle that looks like OPENPAREN
IDENTIFIER. Simplest fix is to introduce another terminal, lets call it
TYPEIDENTIFIER. Change your Type rule to:


and the reduce/reduce is solved. Now you have passed off to the lexer the
problem of figuring out whether an identifier is a IDENTIFIER or
TYPEIDENTIFIER. I'd suggest adding a "token" field to the symbol table
entry type. When the lexer sees an identifier, look it up in the symbol
table and return ident->token.

Scott Nicol

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.