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