Doxygen
Loading...
Searching...
No Matches
declinfo.h File Reference
#include <stdio.h>
#include "qcstring.h"
#include "types.h"
+ Include dependency graph for declinfo.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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

Function Documentation

◆ parseFuncDecl()

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

Definition at line 323 of file declinfo.l.

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

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, ObjC, PHP, QCString::prepend(), removeRedundantWhiteSpace(), QCString::right(), and QCString::startsWith().

Referenced by findMember().