Functions
declinfo.h File Reference
#include <stdio.h>
#include <qcstring.h>

Go to the source code of this file.

Functions

void parseFuncDecl (const QCString &decl, bool objC, QCString &clName, QCString &type, QCString &name, QCString &args, QCString &funcTempList, QCString &exceptions)
 

Function Documentation

void parseFuncDecl ( const QCString decl,
bool  objC,
QCString clName,
QCString type,
QCString name,
QCString args,
QCString funcTempList,
QCString exceptions 
)

Definition at line 2213 of file declinfo.cpp.

2215 {
2216  printlex(declinfoYY_flex_debug, TRUE, __FILE__, NULL);
2217  inputString = decl;
2218  //printf("Input=`%s'\n",inputString);
2219  if (inputString==0) return;
2220  inputPosition = 0;
2223  insideObjC = objC;
2224  scope.resize(0);
2225  className.resize(0);
2226  classTempList.resize(0);
2227  funcTempList.resize(0);
2228  name.resize(0);
2229  type.resize(0);
2230  args.resize(0);
2232  // first we try to find the type, scope, name and arguments
2234  BEGIN( Start );
2235  declinfoYYlex();
2236 
2237  //printf("type=`%s' class=`%s' name=`%s' args=`%s'\n",
2238  // type.data(),scope.data(),name.data(),args.data());
2239 
2240  int nb = name.findRev('[');
2241  if (nb!=-1 && args.isEmpty()) // correct for [] in name ambigity (due to Java return type allowing [])
2242  {
2243  args.prepend(name.right(name.length()-nb));
2244  name=name.left(nb);
2245  }
2246 
2247 #if 0
2248  {
2249  int l=scope.length();
2250  int i=0;
2251  int skipCount=0;
2252  cl.resize(0);
2253  ctl.resize(0);
2254  for (i=0;i<l;i++)
2255  {
2256  char c=scope.at(i);
2257  if (c=='<')
2258  skipCount++;
2259  else if (c=='>')
2260  skipCount--;
2261  else if (skipCount==0)
2262  cl+=c;
2263  }
2264  }
2266  ctl.resize(0);
2267 #endif
2268 
2269  cl=scope;
2271  int il,ir;
2272  if ((il=n.find('<'))!=-1 && (ir=n.findRev('>'))!=-1)
2273  // TODO: handle cases like where n="operator<< <T>"
2274  {
2275  ftl=removeRedundantWhiteSpace(n.right(n.length()-il));
2276  n=n.left(il);
2277  }
2278 
2279  //ctl=classTempList.copy();
2280  //ftl=funcTempList.copy();
2284 
2285  if (!t.isEmpty() && t.at(t.length()-1)==')') // for function pointers
2286  {
2287  a.prepend(")");
2288  t=t.left(t.length()-1);
2289  }
2290  //printf("type=`%s' class=`%s' name=`%s' args=`%s'\n",
2291  // t.data(),cl.data(),n.data(),a.data());
2292 
2293  printlex(declinfoYY_flex_debug, FALSE, __FILE__, NULL);
2294  return;
2295 
2296 
2297 }
bool resize(uint newlen)
Definition: qcstring.h:225
static QCString scope
Definition: declinfo.cpp:668
static constexpr double nb
Definition: Units.h:81
bool isEmpty() const
Definition: qcstring.h:189
void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
Definition: message.cpp:242
uint length() const
Definition: qcstring.h:195
char & at(uint i) const
Definition: qcstring.h:326
const bool FALSE
Definition: qglobal.h:370
static QCString className
Definition: declinfo.cpp:669
QCString left(uint len) const
Definition: qcstring.cpp:213
static QStrList * l
Definition: config.cpp:1044
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QAsciiDict< Entry > cl
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped)
Definition: util.cpp:6226
static bool funcTempListFound
Definition: declinfo.cpp:677
QCString right(uint len) const
Definition: qcstring.cpp:231
std::void_t< T > n
const double a
int declinfoYY_flex_debug
Definition: declinfo.cpp:602
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
FILE * declinfoYYin
Definition: declinfo.cpp:359
QCString removeRedundantWhiteSpace(const QCString &s)
Definition: util.cpp:1655
#define Start
Definition: declinfo.cpp:737
#define BEGIN
Definition: declinfo.cpp:144
int declinfoYYlex(void)
static bool insideObjC
Definition: declinfo.cpp:679
void resize(uint n)
Definition: qasciidict.h:71
static bool classTempListFound
Definition: declinfo.cpp:676
void declinfoYYrestart(FILE *input_file)
Definition: declinfo.cpp:1649
static QCString classTempList
Definition: declinfo.cpp:670
const bool TRUE
Definition: qglobal.h:371
static int inputPosition
Definition: declinfo.cpp:667
static QCString exceptionString
Definition: declinfo.cpp:678
static const char * inputString
Definition: declinfo.cpp:666