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