This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: GDB/MI Output Syntax
- From: Andrew Cagney <cagney at gnu dot org>
- To: Bob Rossi <bob at brasko dot net>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 26 Aug 2004 17:12:01 -0400
- Subject: Re: GDB/MI Output Syntax
- References: <20040825154348.GA19533@white>
Hi,
Along with the newline changes, there are 2 other changes that I propose
to the grammar. They are,
async-record ==> exec-async-output | status-async-output | notify-async-output
exec-async-output ==> [ token ] "*" async-output
status-async-output ==> [ token ] "+" async-output
notify-async-output ==> [ token ] "=" async-output]
FYI, these were done this way so that the complete structure and intent
was clear (rather than worry about language issues). As you note a
rewrite gives an ll(1) grammar; it also looses that clarity.
to
async-record ==> [token] async-record-kind async-output
async-record-kind ==> "*" | "+" | "="
however, if you really would like to keep the *-async-output rules, we
could do
async-record ==> [token] async-record-kind async-output
async-record-kind ==> exec-async-output | status-async-output | notify-async-output
exec-async-output ==> "*"
status-async-output ==> "+"
notify-async-output ==> "="
I can see something like (better names):
async-record ==> [token] async-output
async-output ==> exec-async-output | ...
exec-async-output ==> "*" async-result
async-result ==> async-class ( "," @var{result} )* @var{nl}
The second change is identical but refers to the rules of
stream-record ==> console-stream-output | target-stream-output | log-stream-output
console-stream-output ==> "~" c-string
target-stream-output ==> "@" c-string
log-stream-output ==> "&" c-string
to
stream-record => stream-record-kind c-string
stream-record-kind => "~" | "@" | "&"
The reason it would be helpful to modify the grammar in this way is that
it leads to a more elegant form when trying to build an intermediate
representation. At the parse level of 'stream-record' or 'async-record'
you have all of the information necessary in order to populate a
structure with data. Otherwise, the information is a few levels down
stream.
I don't follow.
Andrew