Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Xinan Tang" <xinan@TidalNetworks.net>
To: "Bob Rossi" <bob@brasko.net>, <gdb@sources.redhat.com>
Subject: RE: GDB/MI Output Syntax ambiguity
Date: Tue, 24 Aug 2004 17:15:00 -0000	[thread overview]
Message-ID: <52BBA75459915749B68F93B604B636CD0666B7@neptune.TidalNetworks.net> (raw)

Hi 

  If it is a shift/reduce conflict, you can ignore it if the shift is
your choice. By default the shift is a default action. If there is
reduce/reduce conflicts, then you need to start to worry.

--Xinan


-----Original Message-----
From: gdb-owner@sources.redhat.com [mailto:gdb-owner@sources.redhat.com]
On Behalf Of Bob Rossi
Sent: Monday, August 23, 2004 1:03 PM
To: gdb@sources.redhat.com
Subject: GDB/MI Output Syntax ambiguity

Hi,

I am generating a bottom up parser for 'GDB/MI Output Syntax' using
bison. Unfortunately, I think that I found an ambiguity, which makes it
not easily parsable. Please correct me if I am wrong.

output                  -> ( out-of-band-record )* [ result-record ]
"(gdb)" nl
result-record           -> [ token ] "^" result-class ( "," result )* nl
out-of-band-record      -> async-record | stream-record
async-record            -> exec-async-output | status-async-output |
notify-asyn
exec-async-output       -> [ token ] "*" async-output
status-async-output     -> [ token ] "+" async-output
notify-async-output     -> [ token ] "=" async-output

I am assuming that the grammar above for 'output' means that there can
be 0 or more 'out-of-band-record', followed by 0 or 1 'result-record',
followed by '(gdb)' and then a newline.

The problem is, when you are parsing 'output', and you get a 'token' as
the first token from the lexer, you don't know if that is part of the 
'out-of-band-record' or if it is part of the 'result-record'. Both of 
these rules optionally start with 'token'.Has anyone actually written a 
recursive descent parser, or generated a parser from bison for GDB/MI's 
output yet, or am I the first?

Help would be greatly appreciated. This is the only shift/reduce
conflict I have in my modified BNF version of the grammar. Other than
this, the grammar looks very well written.

I consider this to be a serious problem so I hope that I am not doing
something incorrectly or am mis-understanding the grammar.

Thanks,
Bob Rossi


             reply	other threads:[~2004-08-24 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-24 17:15 Xinan Tang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-23 21:03 Bob Rossi
2004-08-23 21:09 ` Daniel Jacobowitz
2004-08-23 21:12   ` Bob Rossi
2004-08-23 21:37   ` Bob Rossi
2004-08-23 21:42   ` Michael Chastain
2004-08-23 22:23     ` Bob Rossi
2004-08-24  3:56 ` Michael Chastain
2004-08-24 12:36   ` Bob Rossi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52BBA75459915749B68F93B604B636CD0666B7@neptune.TidalNetworks.net \
    --to=xinan@tidalnetworks.net \
    --cc=bob@brasko.net \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox