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 325 of file declinfo.l.

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 {
378 ftl=removeRedundantWhiteSpace(n.right(n.length()-il));
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}
@ 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:322
static struct declinfoYY_state g_declinfo_extra
Definition declinfo.l:323
#define FALSE
Definition qcstring.h:34
@ Python
Definition types.h:52
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(), Python, removeRedundantWhiteSpace(), QCString::right(), and QCString::startsWith().

Referenced by findMember().