]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/tools/clang/include/clang/AST/CommentCommands.td
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / tools / clang / include / clang / AST / CommentCommands.td
1 //===----------------------------------------------------------------------===//
2 // Define command classes.
3 //===----------------------------------------------------------------------===//
4
5 class Command<string name> {
6   string Name = name;
7   string EndCommandName = "";
8
9   int NumArgs = 0;
10
11   bit IsInlineCommand = 0;
12
13   bit IsBlockCommand = 0;
14   bit IsBriefCommand = 0;
15   bit IsReturnsCommand = 0;
16   bit IsParamCommand = 0;
17   bit IsTParamCommand = 0;
18   bit IsDeprecatedCommand = 0;
19   bit IsHeaderfileCommand = 0;
20
21   bit IsEmptyParagraphAllowed = 0;
22
23   bit IsVerbatimBlockCommand = 0;
24   bit IsVerbatimBlockEndCommand = 0;
25   bit IsVerbatimLineCommand = 0;
26   bit IsDeclarationCommand = 0;
27   bit IsFunctionDeclarationCommand = 0;
28   bit IsRecordLikeDetailCommand = 0;
29   bit IsRecordLikeDeclarationCommand = 0;
30 }
31
32 class InlineCommand<string name> : Command<name> {
33   let IsInlineCommand = 1;
34 }
35
36 class BlockCommand<string name> : Command<name> {
37   let IsBlockCommand = 1;
38 }
39
40 class RecordLikeDetailCommand<string name> : BlockCommand<name> {
41   let IsRecordLikeDetailCommand = 1;
42 }
43
44 class VerbatimBlockCommand<string name> : Command<name> {
45   let EndCommandName = name;
46   let IsVerbatimBlockCommand = 1;
47 }
48
49 multiclass VerbatimBlockCommand<string name, string endCommandName> {
50   def Begin : Command<name> {
51     let EndCommandName = endCommandName;
52     let IsVerbatimBlockCommand = 1;
53   }
54
55   def End : Command<endCommandName> {
56     let IsVerbatimBlockEndCommand = 1;
57   }
58 }
59
60 class VerbatimLineCommand<string name> : Command<name> {
61   let IsVerbatimLineCommand = 1;
62 }
63
64 class DeclarationVerbatimLineCommand<string name> :
65       VerbatimLineCommand<name> {
66   let IsDeclarationCommand = 1;
67 }
68
69 class FunctionDeclarationVerbatimLineCommand<string name> :
70       DeclarationVerbatimLineCommand<name> {
71   let IsFunctionDeclarationCommand = 1;
72 }
73
74 class RecordLikeDeclarationVerbatimLineCommand<string name> :
75       DeclarationVerbatimLineCommand<name> {
76   let IsRecordLikeDeclarationCommand = 1;
77 }
78
79 //===----------------------------------------------------------------------===//
80 // InlineCommand
81 //===----------------------------------------------------------------------===//
82
83 def B  : InlineCommand<"b">;
84 def C  : InlineCommand<"c">;
85 def P  : InlineCommand<"p">;
86 def A  : InlineCommand<"a">;
87 def E  : InlineCommand<"e">;
88 def Em : InlineCommand<"em">;
89
90 //===----------------------------------------------------------------------===//
91 // BlockCommand
92 //===----------------------------------------------------------------------===//
93
94 def Brief : BlockCommand<"brief"> { let IsBriefCommand = 1; }
95 def Short : BlockCommand<"short"> { let IsBriefCommand = 1; }
96
97 // Opposite of \brief, it is the default in our implementation.
98 def Details : BlockCommand<"details">;
99
100 def Returns : BlockCommand<"returns"> { let IsReturnsCommand = 1; }
101 def Return  : BlockCommand<"return"> { let IsReturnsCommand = 1; }
102 def Result  : BlockCommand<"result"> { let IsReturnsCommand = 1; }
103
104 def Param : BlockCommand<"param"> { let IsParamCommand = 1; }
105
106 // Doxygen command for template parameter documentation.
107 def Tparam : BlockCommand<"tparam"> { let IsTParamCommand = 1; }
108
109 // HeaderDoc command for template parameter documentation.
110 def Templatefield : BlockCommand<"templatefield"> { let IsTParamCommand = 1; }
111
112 def Deprecated : BlockCommand<"deprecated"> {
113   let IsEmptyParagraphAllowed = 1;
114   let IsDeprecatedCommand = 1;
115 }
116
117 def Headerfile : BlockCommand<"headerfile"> { let IsHeaderfileCommand = 1; }
118
119 // We don't do any additional semantic analysis for the following
120 // BlockCommands.  It might be a good idea to do something extra for them, but
121 // for now we model them as plain BlockCommands.
122 def Arg        : BlockCommand<"arg">;
123 def Attention  : BlockCommand<"attention">;
124 def Author     : BlockCommand<"author">;
125 def Authors    : BlockCommand<"authors">;
126 def Bug        : BlockCommand<"bug">;
127 def Copyright  : BlockCommand<"copyright">;
128 def Date       : BlockCommand<"date">;
129 def Invariant  : BlockCommand<"invariant">;
130 def Li         : BlockCommand<"li">;
131 def Note       : BlockCommand<"note">;
132 def Par        : BlockCommand<"par">;
133 def Post       : BlockCommand<"post">;
134 def Pre        : BlockCommand<"pre">;
135 def Remark     : BlockCommand<"remark">;
136 def Remarks    : BlockCommand<"remarks">;
137 def Sa         : BlockCommand<"sa">;
138 def See        : BlockCommand<"see">;
139 def Since      : BlockCommand<"since">;
140 def Todo       : BlockCommand<"todo">;
141 def Version    : BlockCommand<"version">;
142 def Warning    : BlockCommand<"warning">;
143 // HeaderDoc commands
144 def Abstract      : BlockCommand<"abstract">;
145 def ClassDesign   : RecordLikeDetailCommand<"classdesign">;
146 def CoClass       : RecordLikeDetailCommand<"coclass">;
147 def Dependency    : RecordLikeDetailCommand<"dependency">;
148 def Discussion    : BlockCommand<"discussion">;
149 def Helper        : RecordLikeDetailCommand<"helper">;
150 def HelperClass   : RecordLikeDetailCommand<"helperclass">;
151 def Helps         : RecordLikeDetailCommand<"helps">;
152 def InstanceSize  : RecordLikeDetailCommand<"instancesize">;
153 def Ownership     : RecordLikeDetailCommand<"ownership">;
154 def Performance   : RecordLikeDetailCommand<"performance">;
155 def Security      : RecordLikeDetailCommand<"security">;
156 def SeeAlso       : BlockCommand<"seealso">;
157 def SuperClass    : RecordLikeDetailCommand<"superclass">;
158
159 //===----------------------------------------------------------------------===//
160 // VerbatimBlockCommand
161 //===----------------------------------------------------------------------===//
162
163 defm Code      : VerbatimBlockCommand<"code", "endcode">;
164 defm Verbatim  : VerbatimBlockCommand<"verbatim", "endverbatim">;
165 defm Htmlonly  : VerbatimBlockCommand<"htmlonly", "endhtmlonly">;
166 defm Latexonly : VerbatimBlockCommand<"latexonly", "endlatexonly">;
167 defm Xmlonly   : VerbatimBlockCommand<"xmlonly", "endxmlonly">;
168 defm Manonly   : VerbatimBlockCommand<"manonly", "endmanonly">;
169 defm Rtfonly   : VerbatimBlockCommand<"rtfonly", "endrtfonly">;
170
171 defm Dot : VerbatimBlockCommand<"dot", "enddot">;
172 defm Msc : VerbatimBlockCommand<"msc", "endmsc">;
173
174 // These three commands have special support in CommentLexer to recognize their
175 // names.
176 def  FDollar  : VerbatimBlockCommand<"f$">; // Inline LaTeX formula
177 defm FBracket : VerbatimBlockCommand<"f[", "f]">; // Displayed LaTeX formula
178 defm FBrace   : VerbatimBlockCommand<"f{", "f}">; // LaTeX environment
179
180 // HeaderDoc commands
181 defm Textblock    : VerbatimBlockCommand<"textblock", "/textblock">;
182 defm Link         : VerbatimBlockCommand<"link", "/link">;
183
184 //===----------------------------------------------------------------------===//
185 // VerbatimLineCommand
186 //===----------------------------------------------------------------------===//
187
188 def Defgroup   : VerbatimLineCommand<"defgroup">;
189 def Ingroup    : VerbatimLineCommand<"ingroup">;
190 def Addtogroup : VerbatimLineCommand<"addtogroup">;
191 def Weakgroup  : VerbatimLineCommand<"weakgroup">;
192 def Name       : VerbatimLineCommand<"name">;
193
194 def Section       : VerbatimLineCommand<"section">;
195 def Subsection    : VerbatimLineCommand<"subsection">;
196 def Subsubsection : VerbatimLineCommand<"subsubsection">;
197 def Paragraph     : VerbatimLineCommand<"paragraph">;
198
199 def Mainpage : VerbatimLineCommand<"mainpage">;
200 def Subpage  : VerbatimLineCommand<"subpage">;
201 def Ref      : VerbatimLineCommand<"ref">;
202
203 //===----------------------------------------------------------------------===//
204 // DeclarationVerbatimLineCommand
205 //===----------------------------------------------------------------------===//
206
207 // Doxygen commands.
208 def Fn        : DeclarationVerbatimLineCommand<"fn">;
209 def Namespace : DeclarationVerbatimLineCommand<"namespace">;
210 def Overload  : DeclarationVerbatimLineCommand<"overload">;
211 def Property  : DeclarationVerbatimLineCommand<"property">;
212 def Typedef   : DeclarationVerbatimLineCommand<"typedef">;
213 def Var       : DeclarationVerbatimLineCommand<"var">;
214
215 // HeaderDoc commands.
216 def Class     : RecordLikeDeclarationVerbatimLineCommand<"class">;
217 def Interface : RecordLikeDeclarationVerbatimLineCommand<"interface">;
218 def Protocol  : RecordLikeDeclarationVerbatimLineCommand<"protocol">;
219 def Struct    : RecordLikeDeclarationVerbatimLineCommand<"struct">;
220 def Union     : RecordLikeDeclarationVerbatimLineCommand<"union">;
221 def Category  : DeclarationVerbatimLineCommand<"category">;
222 def Template  : DeclarationVerbatimLineCommand<"template">;
223 def Function  : FunctionDeclarationVerbatimLineCommand<"function">;
224 def FunctionGroup  : FunctionDeclarationVerbatimLineCommand<"functiongroup">;
225 def Method    : FunctionDeclarationVerbatimLineCommand<"method">;
226 def MethodGroup    : FunctionDeclarationVerbatimLineCommand<"methodgroup">;
227 def Callback  : FunctionDeclarationVerbatimLineCommand<"callback">;
228 def Const     : DeclarationVerbatimLineCommand<"const">;
229 def Constant  : DeclarationVerbatimLineCommand<"constant">;
230 def Enum      : DeclarationVerbatimLineCommand<"enum">;