CommentCommands.td revision abcf0dccc9cd4c802f4e7797bf452c6808d2226f
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 Note       : BlockCommand<"note">;
87def Post       : BlockCommand<"post">;
88def Pre        : BlockCommand<"pre">;
89def Remark     : BlockCommand<"remark">;
90def Remarks    : BlockCommand<"remarks">;
91def Sa         : BlockCommand<"sa">;
92def See        : BlockCommand<"see">;
93def Since      : BlockCommand<"since">;
94def Todo       : BlockCommand<"todo">;
95def Version    : BlockCommand<"version">;
96def Warning    : BlockCommand<"warning">;
97
98defm Code      : VerbatimBlockCommand<"code", "endcode">;
99defm Verbatim  : VerbatimBlockCommand<"verbatim", "endverbatim">;
100defm Htmlonly  : VerbatimBlockCommand<"htmlonly", "endhtmlonly">;
101defm Latexonly : VerbatimBlockCommand<"latexonly", "endlatexonly">;
102defm Xmlonly   : VerbatimBlockCommand<"xmlonly", "endxmlonly">;
103defm Manonly   : VerbatimBlockCommand<"manonly", "endmanonly">;
104defm Rtfonly   : VerbatimBlockCommand<"rtfonly", "endrtfonly">;
105
106defm Dot : VerbatimBlockCommand<"dot", "enddot">;
107defm Msc : VerbatimBlockCommand<"msc", "endmsc">;
108
109// These commands have special support in lexer.
110def  FDollar  : VerbatimBlockCommand<"f$">; // Inline LaTeX formula
111defm FBracket : VerbatimBlockCommand<"f[", "f]">; // Displayed LaTeX formula
112defm FBrace   : VerbatimBlockCommand<"f{", "f}">; // LaTeX environment
113
114def Defgroup   : VerbatimLineCommand<"defgroup">;
115def Ingroup    : VerbatimLineCommand<"ingroup">;
116def Addtogroup : VerbatimLineCommand<"addtogroup">;
117def Weakgroup  : VerbatimLineCommand<"weakgroup">;
118def Name       : VerbatimLineCommand<"name">;
119
120def Section       : VerbatimLineCommand<"section">;
121def Subsection    : VerbatimLineCommand<"subsection">;
122def Subsubsection : VerbatimLineCommand<"subsubsection">;
123def Paragraph     : VerbatimLineCommand<"paragraph">;
124
125def Mainpage : VerbatimLineCommand<"mainpage">;
126def Subpage  : VerbatimLineCommand<"subpage">;
127def Ref      : VerbatimLineCommand<"ref">;
128
129// Doxygen commands.
130def Fn       : DeclarationVerbatimLineCommand<"fn">;
131def Var      : DeclarationVerbatimLineCommand<"var">;
132def Property : DeclarationVerbatimLineCommand<"property">;
133def Typedef  : DeclarationVerbatimLineCommand<"typedef">;
134def Overload : DeclarationVerbatimLineCommand<"overload">;
135
136// HeaderDoc commands.
137def Class     : DeclarationVerbatimLineCommand<"class">;
138def Interface : DeclarationVerbatimLineCommand<"interface">;
139def Protocol  : DeclarationVerbatimLineCommand<"protocol">;
140def Category  : DeclarationVerbatimLineCommand<"category">;
141def Template  : DeclarationVerbatimLineCommand<"template">;
142def Function  : DeclarationVerbatimLineCommand<"function">;
143def Method    : DeclarationVerbatimLineCommand<"method">;
144def Callback  : DeclarationVerbatimLineCommand<"callback">;
145def Const     : DeclarationVerbatimLineCommand<"const">;
146def Constant  : DeclarationVerbatimLineCommand<"constant">;
147def Struct    : DeclarationVerbatimLineCommand<"struct">;
148def Union     : DeclarationVerbatimLineCommand<"union">;
149def Enum      : DeclarationVerbatimLineCommand<"enum">;
150
151