From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1119 invoked by alias); 24 Aug 2004 17:15:37 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 1110 invoked from network); 24 Aug 2004 17:15:36 -0000 Received: from unknown (HELO neptune.TidalNetworks.net) (67.114.153.34) by sourceware.org with SMTP; 24 Aug 2004 17:15:36 -0000 Content-class: urn:content-classes:message Subject: RE: GDB/MI Output Syntax ambiguity MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 24 Aug 2004 17:15:00 -0000 Message-ID: <52BBA75459915749B68F93B604B636CD0666B7@neptune.TidalNetworks.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Xinan Tang" To: "Bob Rossi" , X-SW-Source: 2004-08/txt/msg00330.txt.bz2 Hi=20 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 ] "=3D" 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=20 'out-of-band-record' or if it is part of the 'result-record'. Both of=20 these rules optionally start with 'token'.Has anyone actually written a=20 recursive descent parser, or generated a parser from bison for GDB/MI's=20 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