Re: GDB/MI Output Syntax ambiguity

Bob Rossi
2004-08-24T12:36:17Z

On Mon, Aug 23, 2004 at 11:56:18PM -0400, Michael Chastain wrote:
> [Shout out to Paul Hilfinger, who was my professor in compiler class,
> Spring 1983, UC Berkeley!]
>
> The grammar in gdb.info from gdb 6.2 has stuff like (foo)* and [bar] and is
> not quite low-level enough for bison input.
>
> I made a grammar out of it by expanding the (foo)* and [bar] stuff
> with rules. Appended is my grammar as I typed it in.

I will compare the grammar more in detail. However, these are the 5
rules I applied to get the MI grammar to not have any left recursions.

1. (out-of-band-record)* ->
out-of-band-record-prime -> out-of-band-record-list | epsilon
out-of-band-record-list -> out-of-band-record-list out-of-band-record | out-of-band-record

2. [result-record]
possible-result-record -> result-record | epsilon

3. [token]
possible-token -> token | epsilon

4. ( "," result )*
result-list-prime -> result-list | epsilon
result-list -> result-list "," result | "," result

5. ( "," value )*
value-list-prime -> value-list | epsilon
value-list -> value-list "," value | "," value

Other than that, I think it's all still the same.
I will compare the grammars in more detail today.

Thanks for putting in the great effort!
Bob Rossi