This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH:doc] GDB/MI attribute names
> > This patch, slightly paranoid, document the current practice for attribute
> > names. I don't want future names to break exiting parsers.
>
> I agree, assuming that what you wrote is factually correct at this
> point, and that we have no good reasons to modify it VSN. Is that
> indeed so?
I can't find any that don't fit the rule that I want to document. It occurred
to me that the regexp that I was using to parse MI output for Emacs wouldn't
work if certain characters, e.g "$", were used. I just want to discourage
their use in future attribute names. Parsers will have to handle existing
anomalies, if any.
> > + @var{variable} expressions should be alphabetic words or comprise of
> > + alphabetic words separated by underscores. ^^^^^^^^^^^
>
> Don't you meant "comprised of"?
Either sounds OK to me.
> In any case, the text you suggests sounds a bit inaccurate to me.
> (Maybe I just don't know enough about MI, so please bear with me.)
> You say "variable expressions", but an expression can use operators,
> can't it? If it can, then the operators are not generally alphabetic
> characters.
No I don't really mean expression.
@var{variable} names...
would probably work.
> Based on my understanding of what you meant, I suggest to rephrase as
> follows:
>
> Every @var{variable} should be specified as a sequence of alphabetic
> characters and underscores.
>
> Does that reflect correctly what you wanted to say?
I'm not sure. To me, thay're not really variables but a field names (or
attribute names in HTML/XML parlance). It might mean the value rather than
the name.
How about:
@var{variable} names should be specified as a sequence of alphabetic
characters and underscores.
Or say what you would like to see. I'm not too worried about the exact
wording. I just want to formalise the output syntax a bit more.
> Btw, are digit really "verboten"? If not, replace "alphabetic" with
> "alphanumeric" above.
I've actually used the [:alnum:] character class in my parser but there are so
few names that I felt that requiring alphabetic wouldn't be restrictive.
--
Nick http://users.snap.net.nz/~nickrob