• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 IsVerbatimBlockCommand = 0;
16  bit IsVerbatimBlockEndCommand = 0;
17  bit IsVerbatimLineCommand = 0;
18  bit IsDeclarationCommand = 0;
19}
20
21class InlineCommand<string name> : Command<name> {
22  let IsInlineCommand = 1;
23}
24
25class BlockCommand<string name> : Command<name> {
26  let IsBlockCommand = 1;
27}
28
29class VerbatimBlockCommand<string name> : Command<name> {
30  let EndCommandName = name;
31  let IsVerbatimBlockCommand = 1;
32}
33
34multiclass VerbatimBlockCommand<string name, string endCommandName> {
35  def Begin : Command<name> {
36    let EndCommandName = endCommandName;
37    let IsVerbatimBlockCommand = 1;
38  }
39
40  def End : Command<endCommandName> {
41    let IsVerbatimBlockEndCommand = 1;
42  }
43}
44
45class VerbatimLineCommand<string name> : Command<name> {
46  let IsVerbatimLineCommand = 1;
47}
48
49class DeclarationVerbatimLineCommand<string name> :
50      VerbatimLineCommand<name> {
51  let IsDeclarationCommand = 1;
52}
53
54def B  : InlineCommand<"b">;
55def C  : InlineCommand<"c">;
56def P  : InlineCommand<"p">;
57def A  : InlineCommand<"a">;
58def E  : InlineCommand<"e">;
59def Em : InlineCommand<"em">;
60
61def Brief : BlockCommand<"brief"> { let IsBriefCommand = 1; }
62def Short : BlockCommand<"short"> { let IsBriefCommand = 1; }
63
64def Returns : BlockCommand<"returns"> { let IsReturnsCommand = 1; }
65def Return  : BlockCommand<"return"> { let IsReturnsCommand = 1; }
66def Result  : BlockCommand<"result"> { let IsReturnsCommand = 1; }
67
68def Param : BlockCommand<"param"> { let IsParamCommand = 1; }
69
70// Doxygen
71def Tparam : BlockCommand<"tparam"> { let IsTParamCommand = 1; }
72
73// HeaderDoc
74def Templatefield : BlockCommand<"templatefield"> { let IsTParamCommand = 1; }
75
76def Author  : BlockCommand<"author">;
77def Authors : BlockCommand<"authors">;
78def Pre     : BlockCommand<"pre">;
79def Post    : BlockCommand<"post">;
80
81defm Code      : VerbatimBlockCommand<"code", "endcode">;
82defm Verbatim  : VerbatimBlockCommand<"verbatim", "endverbatim">;
83defm Htmlonly  : VerbatimBlockCommand<"htmlonly", "endhtmlonly">;
84defm Latexonly : VerbatimBlockCommand<"latexonly", "endlatexonly">;
85defm Xmlonly   : VerbatimBlockCommand<"xmlonly", "endxmlonly">;
86defm Manonly   : VerbatimBlockCommand<"manonly", "endmanonly">;
87defm Rtfonly   : VerbatimBlockCommand<"rtfonly", "endrtfonly">;
88
89defm Dot : VerbatimBlockCommand<"dot", "enddot">;
90defm Msc : VerbatimBlockCommand<"msc", "endmsc">;
91
92// These commands have special support in lexer.
93def  FDollar  : VerbatimBlockCommand<"f$">; // Inline LaTeX formula
94defm FBracket : VerbatimBlockCommand<"f[", "f]">; // Displayed LaTeX formula
95defm FBrace   : VerbatimBlockCommand<"f{", "f}">; // LaTeX environment
96
97def Defgroup   : VerbatimLineCommand<"defgroup">;
98def Ingroup    : VerbatimLineCommand<"ingroup">;
99def Addtogroup : VerbatimLineCommand<"addtogroup">;
100def Weakgroup  : VerbatimLineCommand<"weakgroup">;
101def Name       : VerbatimLineCommand<"name">;
102
103def Section       : VerbatimLineCommand<"section">;
104def Subsection    : VerbatimLineCommand<"subsection">;
105def Subsubsection : VerbatimLineCommand<"subsubsection">;
106def Paragraph     : VerbatimLineCommand<"paragraph">;
107
108def Mainpage : VerbatimLineCommand<"mainpage">;
109def Subpage  : VerbatimLineCommand<"subpage">;
110def Ref      : VerbatimLineCommand<"ref">;
111
112// Doxygen commands.
113def Fn       : DeclarationVerbatimLineCommand<"fn">;
114def Var      : DeclarationVerbatimLineCommand<"var">;
115def Property : DeclarationVerbatimLineCommand<"property">;
116def Typedef  : DeclarationVerbatimLineCommand<"typedef">;
117def Overload : DeclarationVerbatimLineCommand<"overload">;
118
119// HeaderDoc commands.
120def Class     : DeclarationVerbatimLineCommand<"class">;
121def Interface : DeclarationVerbatimLineCommand<"interface">;
122def Protocol  : DeclarationVerbatimLineCommand<"protocol">;
123def Category  : DeclarationVerbatimLineCommand<"category">;
124def Template  : DeclarationVerbatimLineCommand<"template">;
125def Function  : DeclarationVerbatimLineCommand<"function">;
126def Method    : DeclarationVerbatimLineCommand<"method">;
127def Callback  : DeclarationVerbatimLineCommand<"callback">;
128def Const     : DeclarationVerbatimLineCommand<"const">;
129def Constant  : DeclarationVerbatimLineCommand<"constant">;
130def Struct    : DeclarationVerbatimLineCommand<"struct">;
131def Union     : DeclarationVerbatimLineCommand<"union">;
132def Enum      : DeclarationVerbatimLineCommand<"enum">;
133
134