[llvm-commits] Initial TableGen language reference

Reed Kotler rkotler at mips.com
Tue Jan 1 09:43:50 PST 2013


Nice work. We need to start from somewhere.
Syntax is the place to start.

On 12/31/2012 04:20 AM, Sean Silva 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
>
> -- Sean Silva




More information about the llvm-commits mailing list