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