Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Bob Rossi <bob@brasko.net>
Cc: Michael Chastain <mec.gnu@mindspring.com>,
	gdb-patches@sources.redhat.com
Subject: Re: GDB/MI Output syntax
Date: Wed, 25 Aug 2004 15:51:00 -0000	[thread overview]
Message-ID: <412CB539.1060102@gnu.org> (raw)
In-Reply-To: <20040824205613.GG17865@white>


>>>> >Andrew, were you suggesting something like this?
>>>> >
>>>> >from
>>>> >   output ==> ( out-of-band-record )* [ result-record ] "(gdb)" nl
>>>> >to
>>>> >   output ==> (out-of-band-record nl)* [ result-record nl] "(gdb)" nl
>>>> >
>>>> >and removing the 'nl' everywhere else?
>>
>>> 
>>> Yep.
>>> 
>>
>>>> >That might actually work. Although, I don't personally know a way of
>>>> >changing a grammar and guaranteeing that there the same.
>>
>>> 
>>> A series of rewrites where NL is slow pushed down should eventually 
>>> result in the old grammar (well except that it would be fixed).
> 
> 
> By the way you are talking, I can't tell if you are going to do this, or
> if you expect someone else to do it?

I eye balled it - it puts a NL at the end of each record which was the 
intent.

> Should I just post a new grammar with the suggestion? The problem is, I
> don't know how to prove that the new grammar is equivalant to the old
> grammar. Is there a way to do that?

Well, to be pedantic, the old grammer contained a bug which this fixes 
so we can't prove equivalence.  However using a sequence of 
transformations (rewrite was a poor choice of word) we can show rough 
equivalence.  For instance:

> @item @var{output} @expansion{}
> @code{( @var{out-of-band-record} @var{nl} )* [ @var{result-record} @var{nl} ] "(gdb)" @var{nl}}
> 
> @item @var{result-record} @expansion{}
> @code{[ @var{token} ] "^" @var{result-class} ( "," @var{result} )*}

Moving result-record's NL into the result-record production yields:

> @item @var{output} @expansion{}
> @code{( @var{out-of-band-record} @var{nl})* [ @var{result-record} ] "(gdb)" @var{nl}}
> 
> @item @var{result-record} @expansion{}
> @code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}

which is the easy one done.  The other while longer and more tedious is 
similar except it ends up pushing an NL down into stream-record (where 
it was missing).

Is this what you ment?

Andrew



  reply	other threads:[~2004-08-25 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-24 19:19 Bob Rossi
2004-08-24 19:33 ` Michael Chastain
2004-08-24 19:39   ` Bob Rossi
2004-08-24 19:43     ` Bob Rossi
2004-08-24 19:53     ` Michael Chastain
2004-08-24 19:48   ` Andrew Cagney
2004-08-24 19:54     ` Bob Rossi
2004-08-24 20:01     ` Bob Rossi
2004-08-24 20:18       ` Andrew Cagney
2004-08-24 20:56         ` Bob Rossi
2004-08-25 15:51           ` Andrew Cagney [this message]
2004-08-25  4:09 ` Eli Zaretskii

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=412CB539.1060102@gnu.org \
    --to=cagney@gnu.org \
    --cc=bob@brasko.net \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.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