delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/24/08:15:28

Message-ID: <37716D74.A212F7BC@unb.ca>
From: Endlisnis <s257m AT unb DOT ca>
Organization: Nortel Networks
X-Mailer: Mozilla 4.51 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bison and particular expressions.
References: <37711A9A DOT 4D73B486 AT americasm01 DOT nt DOT com>
Lines: 32
Date: Wed, 23 Jun 1999 23:27:31 GMT
NNTP-Posting-Host: 209.226.124.246
X-Trace: news20.bellglobal.com 930180451 209.226.124.246 (Wed, 23 Jun 1999 19:27:31 EDT)
NNTP-Posting-Date: Wed, 23 Jun 1999 19:27:31 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Campbell, Rolf [SKY:1U32:EXCH]" wrote:

> Here is the grammar rule section of a bison program.  It is a simple
> version of a very complex problem I'm having.  It is designed to allow
> input of these types:
> PS:  Am I trying to break LR grammar modes?  If so, is there any way to
> resolve it?

    I did a really poor job of describing that... here's another try:

one rule looks like:
D: parm ',' parm ','

another rule (for a different token) is
E: parm ',' ID ','

The meanings of the symbols don't matter, only that they are derived tokens,
and ID is not the same as parm.
The problem occurs after the first 'parm' is processed, by that time bison has
already decided what line it is on, but it chooses the wrong line and get's a
parse error when it encounters an ID instead of a 'parm'.  (It seems to choose
D even when E is a better match).

Note:  both D and E have other rules.

--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT HotMail DOT com
          ICQ: 32959047


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019