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


Bob Rossi <bob@brasko.net> wrote:
> I would prefer remove all string literals. Or make rules for them.
> gdb -> "(gdb)"
> done -> "done"

Perhaps:

  GDB  -> "(gdb)"
  DONE -> "done"

and say that the lexer is responsible for recognizing these and
returning those tokens.

> My lexer ignores whitespace,
> [ \t\v\f]               {}
> is this bad?

It surprised me because newlines are at the parse level, so I wasn't
expecting to find white space eaten at the lexer level.  With your grammar,
new line in the wrong place is a syntax error, but tab in the wrong place
is not.

Actually it's probably fine.

If we really want to spec the language, the doco has to list the
terminals that come out of the lexer and describe some of the
lexer's behavior, like eating white space, and what characters are
quoted in a C_STRING ("just like C" ... easy answer).

Speaking of nailing things down ... your grammar doesn't define epsilon!

  epsilon -> 


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