[llvm-commits] Initial TableGen language reference

Sean Silva silvas at purdue.edu
Wed Jan 2 16:41:35 PST 2013


On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +``class``\es
>
> IIRC, this needs a space after the backslash.

It seems to render fine.

On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +A given class can only be defined once. A ``class`` declaration is
> +considered to define the class if one of the following is true:
>
> s/one/any/, to be more precise?

I like that. I have applied that locally.

On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +You can declare an empty class by giving and empty :token:`TemplateArgList`
> +and an empty :token:`ObjectBody`.
>
> An example would be appropriate.

See the warning at the top of the document ;) There are a lot of
places in this document that I would _love_ to expand or add examples;
the primary reason I haven't is simply exhaustion from slogging
through the source code (I didn't just "write" this down; I did a
depth-first traversal of every line of code in TGParser.cpp, which is
painful).

On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +and an empty :token:`ObjectBody`. This can serve as a restricted form of
> +forward declaration: note that records deriving from the forward-declared
> +class will inherit no fields from it since the record expansion is done
> +when the record is parsed.
>
> That's... interesting.  We might want to do something about it, unless
> it is actually useful in an unexpected way.

Indeed. One of the goals of this document is to bring these strange
behaviors to light (or paper-over them if they can be safely ignored).


On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +Values
> +------
> +
> +.. productionlist::
> +   Value: `SimpleValue` ValueSuffix*
>
> `ValueSuffix`

Fixed.

On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> +The peculiar last form of :token:`RangePiece` is due to the fact that the
> +``-`` is included in the :token:`TokInteger`, hence ``1-5`` gets lexed as
>
> "``-``" might be better (monospaced font alone does not make an
> obvious difference).

Good call. Fixed.

New patch attached incorporating these changes and adding an introduction.

-- Sean Silva
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tblgen-docs-Add-initial-syntax-reference.patch
Type: application/octet-stream
Size: 12374 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130102/fbf82df3/attachment.obj>


More information about the llvm-commits mailing list