[docs] TableGen easter egg: Multiline string literals
[oota-llvm.git] / docs / TableGen / LangRef.rst
index 506d2077a633a9c759cf1a4732828ca4edcb662f..e3db3aa62712fae11a0d861699d03356b1c01d9d 100644 (file)
@@ -74,6 +74,9 @@ TableGen also has two string-like literals:
    TokString: '"' <non-'"' characters and C-like escapes> '"'
    TokCodeFragment: "[{" <shortest text not containing "}]"> "}]"
 
+:token:`TokCodeFragment` is essentially a multiline string literal
+delimited by ``[{`` and ``}]``.
+
 .. note::
    The current implementation accepts the following C-like escapes::
 
@@ -86,11 +89,13 @@ TableGen also has the following keywords::
    int   let       list    multiclass   string
 
 TableGen also has "bang operators" which have a
-wide variety of meanings::
+wide variety of meanings:
 
-   !eq     !if      !head    !tail      !con
-   !shl    !sra     !srl
-   !cast   !empty   !subst   !foreach   !strconcat
+.. productionlist::
+   BangOperator: one of
+               :!eq     !if      !head    !tail      !con
+               :!add    !shl     !sra     !srl
+               :!cast   !empty   !subst   !foreach   !strconcat
 
 Syntax
 ======
@@ -284,7 +289,7 @@ given values.
 .. productionlist::
    SimpleValue: "(" `DagArg` `DagArgList` ")"
    DagArgList: `DagArg` ("," `DagArg`)*
-   DagArg: `Value` [":" `TokVarName`]
+   DagArg: `Value` [":" `TokVarName`] | `TokVarName`
 
 The initial :token:`DagArg` is called the "operator" of the dag.
 
@@ -296,7 +301,7 @@ Bodies
 
 .. productionlist::
    ObjectBody: `BaseClassList` `Body`
-   BaseClassList: [`BaseClassListNE`]
+   BaseClassList: [":" `BaseClassListNE`]
    BaseClassListNE: `SubClassRef` ("," `SubClassRef`)*
    SubClassRef: (`ClassID` | `MultiClassID`) ["<" `ValueList` ">"]
    DefmID: `TokIdentifier`
@@ -341,7 +346,7 @@ a ``foreach``.
 --------
 
 .. productionlist::
-   Defm: "defm" `TokIdentifier` ":" `BaseClassList` ";"
+   Defm: "defm" `TokIdentifier` ":" `BaseClassListNE` ";"
 
 Note that in the :token:`BaseClassList`, all of the ``multiclass``'s must
 precede any ``class``'s that appear.