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