[llvm-commits] Initial TableGen language reference

Eli Bendersky eliben at google.com
Thu Jan 3 11:28:34 PST 2013


On Mon, Dec 31, 2012 at 4:20 AM, Sean Silva <silvas at purdue.edu> wrote:
> Hi, this patch adds the beginnings of a language reference for
> TableGen. It covers just the syntax currently. I didn't dive too deep
> into the semantics primarily due to sheer exhaustion from reading
> through the code.
>
> The document is pretty bare bones, but pretty much all of the
> productions should be there. I've used Sphinx's "productionlist"
> directive to get relatively nice hyperlinked syntax productions
> (although IMO the syntax for them in the .rst file is pretty ugly).
>
> I gleaned the syntax from a depth-first traversal of TGParser.cpp
> starting from TGParser::ParseFile. I've kept it close to the rough
> grammar laid out in the comments, but I'm open to refactoring it to
> make it clearer. The lexical stuff was of course pulled from
> TGLexer.cpp.
>
> For convenience, I've attached a "print to PDF" of the web page Sphinx
> generates. If you want to render it locally instead, apply the patch
> and do:
>
> cd docs/
> make -f Makefile.sphinx
> $BROWSER _build/html/TableGen/LangRef.html
>

This is great!

As for the eventual division of content between this document and the
fundamentals, I would prefer to have semantic meanings elaborated in a
reference manual (not only syntax), but having another document
serving as a more easy-going tutorial is a good idea.

Eli



More information about the llvm-commits mailing list