This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB/MI Output Syntax


On Wed, Aug 25, 2004 at 11:56:38AM -0400, Michael Chastain wrote:
> Bob Rossi <bob@brasko.net> wrote:
> > Does this sound reasonable? and again, should I post a new grammar with
> > the new lines moved to the 'output' production and with the changes I
> > have above?
> 
> I'd love to see your grammar posted.

OK, here is what I have so far. It's pretty simple. Besides from
changing the grammar on the documentation to a lower level BNF form I
have made 3 modifications.

   1. move the 'nl' up as high as it can go.
   2. reduce the async_record
   3. reduce the stream_record

so far, it seems to parse everything I throw at it. However, I haven't
tested it to much because I am building an intermediate representation.
This is what I'll use from the front end.

It would probably be helpful to post the grammar the way I have it, or
some slight modification of it instead or on top of what's on the
website now.

output                  -> oob_record_list opt_result_record "(gdb)" nl
oob_record_list         -> oob_record_list oob_record nl | epsilon
opt_result_record       -> result_record nl | epsilon
result_record           -> opt_token "^" result_class result_list_prime
oob_record              -> async_record | stream_record
async_record            -> opt_token async_record_class async_output
async_record_class      -> "*" | "+" | "="
async_output            -> async_class result_list_prime
result_class            -> "done" | "running" | "connected" | "error" | "exit"
async_class             -> "stopped"
result_list_prime       -> result_list | epsilon
result_list             -> result_list "," result | "," result
result                  -> variable "=" value
variable                -> string
value_list_prime        -> value_list | epsilon
value_list              -> value_list "," value | "," value
value                   -> c_string | tuple | list
tuple                   -> "{}" | "{" result result_list_prime "}"
list                    -> "[]" | "[" value value_list_prime "]" | "[" result result_list_prime "]"
stream_record           -> stream_record_class c_string
stream_record_class     -> "~" | "@" | "&"
nl                      -> CR | CR_LF
opt_token               -> token | epsilon
token                   -> any sequence of digits.

Thanks,
Bob Rossi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]