100 {B}*"["{B}*"]")* {
101 yyextra->name += yytext;
102 BEGIN(Operator);
103 }
104<Start>{ID}({B}*"*")?{B}*"("{B}*"^"{B}*")"{B}*"(" { // Objective-C 2.0 block return type
105 if (!yyextra->insideObjC)
106 {
107 REJECT;
108 }
109 else
110 {
112 yyextra->type += yytext;
113 }
114 }
static void addType(yyscan_t yyscanner)
115<Start>{ID}{B}*"("{B}*{ID}{B}*")" { // Objective-C class categories
116 if (!yyextra->insideObjC)
117 {
118 REJECT;
119 }
120 else
121 {
122 yyextra->name += yytext;
123 }
124 }
125<Start>([~!]{B}*)?{ID}{B}*"["{B}*"]" { // PHP
126 if (!yyextra->insidePHP)
127 {
128 REJECT;
129 }
132 }
static void addTypeName(yyscan_t yyscanner)
133<Start>"anonymous_namespace{"[^}]+"}" { // anonymous namespace
134 if (!yyextra->scope.empty())
135 {
136 yyextra->scope+=
DString(
"::")+yytext;
137 }
138 else
139 {
140 yyextra->scope = yytext;
141 }
142 }
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
143<Start>([~!]{B}*)?{ID}/({B}*"["{B}*"]")* { // the []'s are for Java,
144
145
146
147
150 }
151<Start>{B}*"::"{B}* { // found a yyextra->scope specifier
152 if (!yyextra->scope.empty() && !yyextra->scope.endsWith("::"))
153 {
154 if (!yyextra->name.empty()) yyextra->scope+="::"+yyextra->name;
155 }
156 else
157 {
158 yyextra->scope = yyextra->name;
159 }
160 yyextra->name.clear();
161 }
162<Start>{B}*":" { // Objective-C argument separator
163 yyextra->name+=yytext;
164 }
165<Start>[*&]+ {
167 yyextra->type+=yytext;
168 }
169<Start>{B}+ {
171 }
172<Start>{B}*"("({ID}"::")*{B}*[&*]({B}*("const"|"volatile"){B}+)? {
173 if (yyextra->insidePHP) REJECT;
174 if (yyextra->insidePython) REJECT;
177 yyextra->type+=text.stripWhiteSpace();
178 }
179<Start>{B}*")" {
180 yyextra->type+=")";
181 }
182<Start>{B}*"const"/{B}+ |
183<Start>{B}*"consteval"/{B}+ |
184<Start>{B}*"constinit"/{B}+ |
185<Start>{B}*"constexpr"/{B}+ {
186 if (!yyextra->type.empty()) yyextra->type+=" ";
187 yyextra->type+=yytext;
188 }
189<Start>{B}*"decltype"/{B}*"(" {
190 yyextra->roundCount=0;
191 if (!yyextra->type.empty()) yyextra->type+=" ";
192 yyextra->type+="decltype";
193 BEGIN(DeclType);
194 }
195<DeclType>{B}*"(" {
196 ++yyextra->roundCount;
197 yyextra->type+="(";
198 }
199<DeclType>{B}*")" {
200 yyextra->type+=")";
201 if (--yyextra->roundCount == 0) {
202 BEGIN(Start);
203 }
204 }
205<DeclType>. {
206 yyextra->type+=yytext;
207 }
208<Start>{B}*"(" { // TODO: function pointers
209 yyextra->args+="(";
210 BEGIN(ReadArgs);
211 }
212<Start>{B}*"[" {
213 yyextra->args+="[";
214 BEGIN(ReadArgs);
215 }
216<Start>{B}*"<" {
217 yyextra->name+="<";
218 yyextra->sharpCount=0;
219 yyextra->roundCount=0;
220 BEGIN(Template);
221 }
222<Template>"<<" { yyextra->name+="<<"; }
223<Template>">>" { yyextra->name+=">>"; }
224<Template>"(" { yyextra->name+="(";
225 yyextra->roundCount++;
226 }
227<Template>")" { yyextra->name+=")";
228 if (yyextra->roundCount>0)
229 {
230 yyextra->roundCount--;
231 }
232 }
233<Template>"<" {
234 yyextra->name+="<";
235 if (yyextra->roundCount==0)
236 {
237 yyextra->sharpCount++;
238 }
239 }
240<Template>">" {
241 yyextra->name+=">";
242 if (yyextra->roundCount==0)
243 {
244 if (yyextra->sharpCount)
245 --yyextra->sharpCount;
246 else
247 {
248 BEGIN(Start);
249 }
250 }
251 }
252<Template>. {
253 yyextra->name+=*yytext;
254 }
255<Operator>{B}*"("{B}*")"{B}*"<>"{Bopt}/"(" {
256 yyextra->name+="() <>";
257 BEGIN(ReadArgs);
258 }
259<Operator>{B}*"("{B}*")"{Bopt}/"(" {
260 yyextra->name+="()";
261 BEGIN(ReadArgs);
262 }
263<Operator>[^(]*{B}*("<>"{B}*)?/"(" {
264 yyextra->name+=yytext;
265 BEGIN(ReadArgs);
266 }
267<ReadArgs>"throw"{B}*"(" {
268 yyextra->exceptionString="throw(";
269 BEGIN(ReadExceptions);
270 }
271<ReadArgs>. {
272 yyextra->args+=*yytext;
273 }
274<ReadExceptions>. {
275 yyextra->exceptionString+=*yytext;
276 }
277<*>.
278<*>\n
279
280%%