[racket] why shift/reduce conflict?

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Mon Jan 16 04:19:38 EST 2012

Hello all,

I am having trouble with yacc parser giving shift/reduce
conflict, while I do not see where the conflict can be.
I have simplified the grammar to the following one:


#lang racket

(require parser-tools/yacc
          parser-tools/lex)

(define-empty-tokens my-tokens (EOF A B C))

(define (my-parser source-name)
   (parser
    (start start)
    (end EOF)
    (tokens my-tokens)
    (error #f)
    (grammar
     (start ((x) $1))
     (x
      ((y A B) (list $1 'ab)))
     (y
      ((C) 'c)
      ((C A) 'ca)))))


It reports "1 shift/reduce conflict".
But from my primitive point of view, the parser should
accept only "CAB" and "CAAB" inputs, so there is no chance
for a conflict here. Could please anybody point me on what
is not correct with my understanding?


Best regards,

Dmitry


Posted on the users mailing list.