Re: What's wrong with my grammar definition in sablecc, who can help me?

George Neuner <gneuner2@comcast.net>
Sat, 15 May 2010 04:42:42 -0400

          From comp.compilers

Related articles
What's wrong with my grammar definition in sablecc, who can help me? pointerkarajan@gmail.com (zheng yang) (2010-05-09)
Re: What's wrong with my grammar definition in sablecc, who can help m gneuner2@comcast.net (George Neuner) (2010-05-11)
Re: What's wrong with my grammar definition in sablecc, who can help m pointerkarajan@gmail.com (zheng yang) (2010-05-14)
Re: What's wrong with my grammar definition in sablecc, who can help m gneuner2@comcast.net (George Neuner) (2010-05-15)
| List of all articles for this month |

From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Sat, 15 May 2010 04:42:42 -0400
Organization: A noiseless patient Spider
References: 10-05-050 10-05-058 10-05-082
Keywords: parse
Posted-Date: 15 May 2010 10:05:37 EDT

On Fri, 14 May 2010 13:48:15 -0700 (PDT), zheng yang
<pointerkarajan@gmail.com> wrote:


>
>the errors/warnings are:
>shift/reduce conflict in state [stack: PClassDecl *] on TKClass in {
> [ PClassDecls = PClassDecl *] * followed by TKClass <reduce>,
> [ PClassHdr = * TKClass TIdentifier] <shift>


I'm not certain I understand the message exactly - I've haven't done
any LR parsing in a while and I've never used SableCC. However the
tool seems to be complaining about use of the token "class" in
"<class_decl> class" vs "class <identifier>".


There is an error here:


  class_decls = {class_declars} class_decl class_decls
                          | {class_declare_single} class_decl;


which may be the source. The terms in the first match form are
backwards - the recursive term should be first.


George



Post a followup to this message

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