[llvm-commits] Initial TableGen language reference

Sean Silva silvas at purdue.edu
Mon Dec 31 04:20:28 PST 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tblgen-docs-Add-initial-syntax-reference.patch
Type: application/octet-stream
Size: 11994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121231/401491dc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TableGen Language Reference.pdf
Type: application/pdf
Size: 197619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121231/401491dc/attachment.pdf>


More information about the llvm-commits mailing list