CommentCommands.td revision 388a594cd04aae78be452f6eacb9ca6be239c1f8
1class Command<string name> { 2 string Name = name; 3 string EndCommandName = ""; 4 5 int NumArgs = 0; 6 7 bit IsInlineCommand = 0; 8 9 bit IsBlockCommand = 0; 10 bit IsBriefCommand = 0; 11 bit IsReturnsCommand = 0; 12 bit IsParamCommand = 0; 13 bit IsTParamCommand = 0; 14 15 bit IsEmptyParagraphAllowed = 0; 16 17 bit IsVerbatimBlockCommand = 0; 18 bit IsVerbatimBlockEndCommand = 0; 19 bit IsVerbatimLineCommand = 0; 20 bit IsDeclarationCommand = 0; 21} 22 23class InlineCommand<string name> : Command<name> { 24 let IsInlineCommand = 1; 25} 26 27class BlockCommand<string name> : Command<name> { 28 let IsBlockCommand = 1; 29} 30 31class VerbatimBlockCommand<string name> : Command<name> { 32 let EndCommandName = name; 33 let IsVerbatimBlockCommand = 1; 34} 35 36multiclass VerbatimBlockCommand<string name, string endCommandName> { 37 def Begin : Command<name> { 38 let EndCommandName = endCommandName; 39 let IsVerbatimBlockCommand = 1; 40 } 41 42 def End : Command<endCommandName> { 43 let IsVerbatimBlockEndCommand = 1; 44 } 45} 46 47class VerbatimLineCommand<string name> : Command<name> { 48 let IsVerbatimLineCommand = 1; 49} 50 51class DeclarationVerbatimLineCommand<string name> : 52 VerbatimLineCommand<name> { 53 let IsDeclarationCommand = 1; 54} 55 56def B : InlineCommand<"b">; 57def C : InlineCommand<"c">; 58def P : InlineCommand<"p">; 59def A : InlineCommand<"a">; 60def E : InlineCommand<"e">; 61def Em : InlineCommand<"em">; 62 63def Brief : BlockCommand<"brief"> { let IsBriefCommand = 1; } 64def Short : BlockCommand<"short"> { let IsBriefCommand = 1; } 65 66def Returns : BlockCommand<"returns"> { let IsReturnsCommand = 1; } 67def Return : BlockCommand<"return"> { let IsReturnsCommand = 1; } 68def Result : BlockCommand<"result"> { let IsReturnsCommand = 1; } 69 70def Param : BlockCommand<"param"> { let IsParamCommand = 1; } 71 72// Doxygen 73def Tparam : BlockCommand<"tparam"> { let IsTParamCommand = 1; } 74 75// HeaderDoc 76def Templatefield : BlockCommand<"templatefield"> { let IsTParamCommand = 1; } 77 78def Deprecated : BlockCommand<"deprecated"> { let IsEmptyParagraphAllowed = 1; } 79 80def Author : BlockCommand<"author">; 81def Authors : BlockCommand<"authors">; 82def Bug : BlockCommand<"bug">; 83def Copyright : BlockCommand<"copyright">; 84def Date : BlockCommand<"date">; 85def Details : BlockCommand<"details">; 86def Invariant : BlockCommand<"invariant">; 87def Note : BlockCommand<"note">; 88def Post : BlockCommand<"post">; 89def Pre : BlockCommand<"pre">; 90def Remark : BlockCommand<"remark">; 91def Remarks : BlockCommand<"remarks">; 92def Sa : BlockCommand<"sa">; 93def See : BlockCommand<"see">; 94def Since : BlockCommand<"since">; 95def Todo : BlockCommand<"todo">; 96def Version : BlockCommand<"version">; 97def Warning : BlockCommand<"warning">; 98 99defm Code : VerbatimBlockCommand<"code", "endcode">; 100defm Verbatim : VerbatimBlockCommand<"verbatim", "endverbatim">; 101defm Htmlonly : VerbatimBlockCommand<"htmlonly", "endhtmlonly">; 102defm Latexonly : VerbatimBlockCommand<"latexonly", "endlatexonly">; 103defm Xmlonly : VerbatimBlockCommand<"xmlonly", "endxmlonly">; 104defm Manonly : VerbatimBlockCommand<"manonly", "endmanonly">; 105defm Rtfonly : VerbatimBlockCommand<"rtfonly", "endrtfonly">; 106 107defm Dot : VerbatimBlockCommand<"dot", "enddot">; 108defm Msc : VerbatimBlockCommand<"msc", "endmsc">; 109 110// These commands have special support in lexer. 111def FDollar : VerbatimBlockCommand<"f$">; // Inline LaTeX formula 112defm FBracket : VerbatimBlockCommand<"f[", "f]">; // Displayed LaTeX formula 113defm FBrace : VerbatimBlockCommand<"f{", "f}">; // LaTeX environment 114 115def Defgroup : VerbatimLineCommand<"defgroup">; 116def Ingroup : VerbatimLineCommand<"ingroup">; 117def Addtogroup : VerbatimLineCommand<"addtogroup">; 118def Weakgroup : VerbatimLineCommand<"weakgroup">; 119def Name : VerbatimLineCommand<"name">; 120 121def Section : VerbatimLineCommand<"section">; 122def Subsection : VerbatimLineCommand<"subsection">; 123def Subsubsection : VerbatimLineCommand<"subsubsection">; 124def Paragraph : VerbatimLineCommand<"paragraph">; 125 126def Mainpage : VerbatimLineCommand<"mainpage">; 127def Subpage : VerbatimLineCommand<"subpage">; 128def Ref : VerbatimLineCommand<"ref">; 129 130// Doxygen commands. 131def Fn : DeclarationVerbatimLineCommand<"fn">; 132def Var : DeclarationVerbatimLineCommand<"var">; 133def Property : DeclarationVerbatimLineCommand<"property">; 134def Typedef : DeclarationVerbatimLineCommand<"typedef">; 135def Overload : DeclarationVerbatimLineCommand<"overload">; 136 137// HeaderDoc commands. 138def Class : DeclarationVerbatimLineCommand<"class">; 139def Interface : DeclarationVerbatimLineCommand<"interface">; 140def Protocol : DeclarationVerbatimLineCommand<"protocol">; 141def Category : DeclarationVerbatimLineCommand<"category">; 142def Template : DeclarationVerbatimLineCommand<"template">; 143def Function : DeclarationVerbatimLineCommand<"function">; 144def Method : DeclarationVerbatimLineCommand<"method">; 145def Callback : DeclarationVerbatimLineCommand<"callback">; 146def Const : DeclarationVerbatimLineCommand<"const">; 147def Constant : DeclarationVerbatimLineCommand<"constant">; 148def Struct : DeclarationVerbatimLineCommand<"struct">; 149def Union : DeclarationVerbatimLineCommand<"union">; 150def Enum : DeclarationVerbatimLineCommand<"enum">; 151 152