Skip to main content

The declinfo.h File Reference

Included Headers

#include <stdio.h> #include "qcstring.h" #include "types.h"

Functions Index

voidparseFuncDecl (const QCString &decl, const SrcLangExt lang, QCString &clName, QCString &type, QCString &name, QCString &args, QCString &funcTempList, QCString &exceptions)

Functions

parseFuncDecl()

void parseFuncDecl (const QCString & decl, const SrcLangExt lang, QCString & clName, QCString & type, QCString & name, QCString & args, QCString & funcTempList, QCString & exceptions)

Declaration at line 25 of file declinfo.h, definition at line 325 of file declinfo.l.

325void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCString &t,
326 QCString &n,QCString &a,QCString &ftl,QCString &exc)
327{
328 if (decl.isEmpty())
329 {
330 return;
331 }
332 declinfoYYlex_init_extra(&g_declinfo_extra, &g_yyscanner);
333 struct yyguts_t *yyg = (struct yyguts_t*)g_yyscanner;
334
335#ifdef FLEX_DEBUG
336 declinfoYYset_debug(Debug::isFlagSet(Debug::Lex_declinfo)?1:0,g_yyscanner);
337#endif
338
339 DebugLex debugLex(Debug::Lex_declinfo,__FILE__, NULL);
340 yyextra->inputString = decl.data();
341 //printf("Input='%s'\n",yyextra->inputString);
342 yyextra->inputPosition = 0;
343 yyextra->classTempListFound = FALSE;
344 yyextra->funcTempListFound = FALSE;
345 yyextra->insideObjC = lang==SrcLangExt::ObjC;
346 yyextra->insidePHP = lang==SrcLangExt::PHP;
347 yyextra->insidePython = lang==SrcLangExt::Python;
348 yyextra->scope.clear();
349 yyextra->className.clear();
350 yyextra->classTempList.clear();
351 yyextra->funcTempList.clear();
352 yyextra->name.clear();
353 yyextra->type.clear();
354 yyextra->args.clear();
355 yyextra->exceptionString.clear();
356 // first we try to find the yyextra->type, yyextra->scope, yyextra->name and arguments
357 declinfoYYrestart( yyin, g_yyscanner );
358 BEGIN( Start );
359 declinfoYYlex(g_yyscanner);
360
361 //printf("yyextra->type='%s' class='%s' yyextra->name='%s' yyextra->args='%s'\n",
362 // qPrint(yyextra->type),qPrint(yyextra->scope),qPrint(yyextra->name),qPrint(yyextra->args));
363
364 int nb = yyextra->name.findRev('[');
365 if (nb!=-1 && yyextra->args.isEmpty()) // correct for [] in yyextra->name ambiguity (due to Java return yyextra->type allowing [])
366 {
367 yyextra->args.prepend(yyextra->name.right(yyextra->name.length()-nb));
368 yyextra->name=yyextra->name.left(nb);
369 }
370
371 cl=yyextra->scope;
372 n=removeRedundantWhiteSpace(yyextra->name);
373 int il=n.find('<'), ir=n.findRev('>');
374 if (il!=-1 && ir!=-1 && n.at(il+1)!='=')
375 // prevent <=>
376 // TODO: handle cases like where n="operator<< <T>"
377 {
379 n=n.left(il);
380 }
381
382 //ctl=yyextra->classTempList.copy();
383 //ftl=yyextra->funcTempList.copy();
384 t=removeRedundantWhiteSpace(yyextra->type);
385 a=removeRedundantWhiteSpace(yyextra->args);
386 exc=removeRedundantWhiteSpace(yyextra->exceptionString);
387
388 if (!t.isEmpty() && !t.startsWith("decltype") && t.at(t.length()-1)==')') // for function pointers
389 {
390 a.prepend(")");
391 t=t.left(t.length()-1);
392 }
393 //printf("yyextra->type='%s' class='%s' yyextra->name='%s' yyextra->args='%s'\n",
394 // qPrint(t),qPrint(cl),qPrint(n),qPrint(a));
395
396 declinfoYYlex_destroy(g_yyscanner);
397 return;
398}

References QCString::at, QCString::data, FALSE, QCString::find, QCString::findRev, g_declinfo_extra, g_yyscanner, QCString::isEmpty, Debug::isFlagSet, QCString::left, QCString::length, Debug::Lex_declinfo, QCString::prepend, removeRedundantWhiteSpace, QCString::right and QCString::startsWith.

Referenced by findMember.


Generated via doxygen2docusaurus by Doxygen 1.14.0.