Index: src/entry.h =================================================================== --- src/entry.h (revision 661) +++ src/entry.h (working copy) @@ -61,12 +61,14 @@ struct Argument { /*! Construct a new argument. */ - Argument() {} + Argument() {suffixSpacer = " ";} /*! Copy an argument (does a deep copy of all strings). */ Argument(const Argument &a) { attrib=a.attrib.copy(); type=a.type.copy(); + suffixSpacer=a.suffixSpacer.copy(); + suffixType=a.suffixType.copy(); name=a.name.copy(); defval=a.defval.copy(); docs=a.docs.copy(); @@ -79,6 +81,9 @@ { attrib=a.attrib.copy(); type=a.type.copy(); + suffixSpacer=a.suffixSpacer.copy(); + suffixType = a.suffixType.copy(); + name=a.name.copy(); defval=a.defval.copy(); docs=a.docs.copy(); @@ -96,6 +101,10 @@ QCString attrib; /*!< Argument's attribute (IDL only) */ QCString type; /*!< Argument's type */ + QCString suffixSpacer; /*! To separate the argument name from the suffixType */ + QCString suffixType; /*! The argument's type for languages where the type + appears after the argument name, eg ActionScript */ + QCString canType; /*!< Cached value of canonical type (after type resolution). Empty initially. */ QCString name; /*!< Argument's name (may be empty) */ QCString array; /*!< Argument's array specifier (may be empty) */ @@ -118,6 +127,8 @@ volatileSpecifier(FALSE), pureSpecifier(FALSE) { setAutoDelete(TRUE); } + + ArgumentList(const ArgumentList &toCopy); /*! Destroys the argument list */ ~ArgumentList() {} bool hasDocumentation() const; @@ -337,6 +348,7 @@ QCString args; //!< member argument string QCString bitfields; //!< member's bit fields ArgumentList *argList; //!< member arguments as a list + ArgumentList *declArgList; //!< declaration arguments as a list QList *tArgLists; //!< template argument declarations QGString program; //!< the program text QGString initializer; //!< initial value (for variables) @@ -371,7 +383,12 @@ bool hidden; //!< does this represent an entity that is hidden from the output bool artificial; //!< Artificially introduced item GroupDocType groupDocType; + + QCString suffixSpacer; //!< string to place before the suffixType + QCString suffixType; //!< the entry's type for languages where the type is + // is written after the function declaration (eg ActionScript) + static int num; //!< counts the total number of entries /// return the command name used to define GROUPDOC_SEC Index: src/util.cpp =================================================================== --- src/util.cpp (revision 661) +++ src/util.cpp (working copy) @@ -1,12 +1,12 @@ /***************************************************************************** * - * * + * * Copyright (C) 1997-2008 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -70,7 +70,7 @@ #define ALGO_COUNT 1 #define ALGO_CRC16 2 #define ALGO_MD5 3 - + //#define MAP_ALGO ALGO_COUNT //#define MAP_ALGO ALGO_CRC16 #define MAP_ALGO ALGO_MD5 @@ -81,12 +81,12 @@ // TextGeneratorOLImpl implementation //------------------------------------------------------------------------ -TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od) +TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od) { } void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const -{ +{ if (keepSpaces) { const char *p=s; @@ -97,19 +97,19 @@ cs[1]='\0'; while ((c=*p++)) { - if (c==' ') m_od.writeNonBreakableSpace(1); + if (c==' ') m_od.writeNonBreakableSpace(1); else cs[0]=c,m_od.docify(cs); } } } else { - m_od.docify(s); + m_od.docify(s); } } void TextGeneratorOLImpl::writeBreak() const -{ +{ m_od.pushGeneratorState(); m_od.disableAllBut(OutputGenerator::Html); m_od.lineBreak("typebreak"); @@ -127,9 +127,9 @@ //------------------------------------------------------------------------ // an inheritance tree of depth of 100000 should be enough for everyone :-) -const int maxInheritanceDepth = 100000; +const int maxInheritanceDepth = 100000; -/*! +/*! Removes all anoymous scopes from string s Possible examples: \verbatim @@ -158,9 +158,9 @@ while (c=i && s.at(c)!='@') if (s.at(c--)==':') b2=TRUE; - if (b1 && b2) - { - result+="::"; + if (b1 && b2) + { + result+="::"; } p=i+l; } @@ -228,7 +228,7 @@ void writePageRef(OutputDocInterface &od,const char *cn,const char *mn) { od.pushGeneratorState(); - + od.disable(OutputGenerator::Html); od.disable(OutputGenerator::Man); if (Config_getBool("PDF_HYPERLINKS")) od.disable(OutputGenerator::Latex); @@ -253,7 +253,7 @@ static QCString stripFromPath(const QCString &path,QStrList &l) { - // look at all the strings in the list and strip the longest match + // look at all the strings in the list and strip the longest match const char *s=l.first(); QCString potential; unsigned int length = 0; @@ -289,7 +289,7 @@ } /*! try to determine if \a name is a source or a header file name by looking - * at the extension. A number of variations is allowed in both upper and + * at the extension. A number of variations is allowed in both upper and * lower case) If anyone knows or uses another extension please let me know :-) */ int guessSection(const char *name) @@ -325,7 +325,7 @@ //printf("<name().data() : "",qualifiedName.data()); QCString result; - if (qualifiedName.isEmpty()) + if (qualifiedName.isEmpty()) { //printf(" qualified name empty!\n"); return result; @@ -352,7 +352,7 @@ { // step 1: get the right scope Definition *resScope=mContext; - if (scopeIndex!=-1) + if (scopeIndex!=-1) { // split-off scope part QCString resScopeName = qualifiedName.left(scopeIndex); @@ -373,9 +373,9 @@ } } //printf("resScope=%s\n",resScope?resScope->name().data():""); - + // step 2: get the member - if (resScope) // no scope or scope found in the current context + if (resScope) // no scope or scope found in the current context { //printf("scope found: %s, look for typedef %s\n", // resScope->qualifiedName().data(),resName.data()); @@ -396,7 +396,7 @@ for (;(tmd=mni.current());++mni) { //printf("Found member %s resScope=%s outerScope=%s mContext=%p\n", - // tmd->name().data(), resScope->name().data(), + // tmd->name().data(), resScope->name().data(), // tmd->getOuterScope()->name().data(), mContext); if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/) { @@ -433,11 +433,11 @@ // qualifiedName.data(),context ? context->name().data() : ""); } return result; - + } -/*! Get a class definition given its name. +/*! Get a class definition given its name. * Returns 0 if the class is not found. */ ClassDef *getClass(const char *name) @@ -489,7 +489,7 @@ * within file \a fileScope. * * Example: typedef A T; will return the class representing A if it is a class. - * + * * Example: typedef int T; will return 0, since "int" is not a class. */ ClassDef *newResolveTypedef(FileDef *fileScope,MemberDef *md, @@ -515,10 +515,10 @@ if (g_resolvedTypedefs.find(qname)) return 0; // typedef already done g_resolvedTypedefs.insert(qname,md); // put on the trace list - + ClassDef *typeClass = md->getClassDef(); QCString type = md->typeString(); // get the "value" of the typedef - if (typeClass && typeClass->isTemplate() && + if (typeClass && typeClass->isTemplate() && actTemplParams && actTemplParams->count()>0) { type = substituteTemplateArgumentsInString(type, @@ -527,7 +527,7 @@ QCString typedefValue = type; int tl=type.length(); int ip=tl-1; // remove * and & at the end - while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' ')) + while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' ')) { ip--; } @@ -542,7 +542,7 @@ ClassDef *result = getResolvedClassRec(md->getOuterScope(), fileScope,type,&memTypeDef,0,pResolvedType); // if type is a typedef then return what it resolves to. - if (memTypeDef && memTypeDef->isTypedef()) + if (memTypeDef && memTypeDef->isTypedef()) { result=newResolveTypedef(fileScope,memTypeDef,pMemType,pTemplSpec); goto done; @@ -602,8 +602,8 @@ } // remember computed value for next time - if (result && result->getDefFileName()!="") - // this check is needed to prevent that temporary classes that are + if (result && result->getDefFileName()!="") + // this check is needed to prevent that temporary classes that are // introduced while parsing code fragments are being cached here. { //printf("setting cached typedef %p in result %p\n",md,result); @@ -614,9 +614,9 @@ pResolvedType ? *pResolvedType : QCString() ); } - + g_resolvedTypedefs.remove(qname); // remove from the trace list - + return result; } @@ -651,11 +651,11 @@ { // test accessibility of typedef within scope. int distance = isAccessibleFromWithExpScope(scope,fileScope,d,""); - if (distance!=-1 && distancetypeString(); if (pTypeDef) *pTypeDef=bestMatch; } - + //printf("substTypedef(%s,%s)=%s\n",scope?scope->name().data():"", // name.data(),result.data()); return result; @@ -705,8 +705,8 @@ } /*! Starting with scope \a start, the string \a path is interpreted as - * a part of a qualified scope name (e.g. A::B::C), and the scope is - * searched. If found the scope definition is returned, otherwise 0 + * a part of a qualified scope name (e.g. A::B::C), and the scope is + * searched. If found the scope definition is returned, otherwise 0 * is returned. */ static Definition *followPath(Definition *start,FileDef *fileScope,const QCString &path) @@ -737,7 +737,7 @@ // qualScopePart.data(), // current->name().data(), // next?next->name().data():""); - if (next==0) // failed to follow the path + if (next==0) // failed to follow the path { //printf("==> next==0!\n"); if (current->definitionType()==Definition::TypeNamespace) @@ -771,7 +771,7 @@ const QCString &explicitScopePart="" ) { - if (cl) // see if the class was imported via a using statement + if (cl) // see if the class was imported via a using statement { SDict::Iterator cli(*cl); Definition *ucd; @@ -780,7 +780,7 @@ { //printf("Trying via used class %s\n",ucd->name().data()); Definition *sc = explicitScopePartEmpty ? ucd : followPath(ucd,fileScope,explicitScopePart); - if (sc && sc==item) return TRUE; + if (sc && sc==item) return TRUE; //printf("Try via used class done\n"); } } @@ -803,10 +803,10 @@ //printf("[Trying via used namespace %s: count=%d/%d\n",und->name().data(), // count,nl->count()); Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart); - if (sc && item->getOuterScope()==sc) + if (sc && item->getOuterScope()==sc) { //printf("] found it\n"); - return TRUE; + return TRUE; } QCString key=und->name(); if (und->getUsedNamespaces() && visitedDict.find(key)==0) @@ -829,7 +829,7 @@ /* Returns the "distance" (=number of levels up) from item to scope, or -1 - * if item in not inside scope. + * if item in not inside scope. */ int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item) { @@ -839,7 +839,7 @@ QCString key(40); key.sprintf("%p:%p:%p",scope,fileScope,item); static QDict visitedDict; - if (visitedDict.find(key)) + if (visitedDict.find(key)) { //printf("> already found\n"); return -1; // already looked at this @@ -851,7 +851,7 @@ Definition *itemScope=item->getOuterScope(); - if ( + if ( itemScope==scope || // same thing (item->definitionType()==Definition::TypeMember && // a member itemScope && itemScope->definitionType()==Definition::TypeClass && // of a class @@ -859,11 +859,11 @@ ((ClassDef*)scope)->isAccessibleMember((MemberDef *)item) // from scope ) || (item->definitionType()==Definition::TypeClass && // a nested class - itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base + itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base scope->definitionType()==Definition::TypeClass && // class of scope - ((ClassDef*)scope)->isBaseClass((ClassDef*)itemScope,TRUE) + ((ClassDef*)scope)->isBaseClass((ClassDef*)itemScope,TRUE) ) - ) + ) { //printf("> found it\n"); } @@ -872,13 +872,13 @@ if (fileScope) { SDict *cl = fileScope->getUsedClasses(); - if (accessibleViaUsingClass(cl,fileScope,item)) + if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } NamespaceSDict *nl = fileScope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item)) + if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); goto done; @@ -895,13 +895,13 @@ NamespaceDef *nscope = (NamespaceDef*)scope; //printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses()); SDict *cl = nscope->getUsedClasses(); - if (accessibleViaUsingClass(cl,fileScope,item)) + if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } NamespaceSDict *nl = nscope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item)) + if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); goto done; @@ -928,10 +928,10 @@ * class B { public: class J {}; }; * * - Looking for item=='J' inside scope=='B' will return 0. - * - Looking for item=='I' inside scope=='B' will return -1 + * - Looking for item=='I' inside scope=='B' will return -1 * (as it is not found in B nor in the global scope). - * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but - * not found and then A::I is searched in the global scope, which matches and + * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but + * not found and then A::I is searched in the global scope, which matches and * thus the result is 1. */ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope, @@ -946,7 +946,7 @@ QCString key(40+explicitScopePart.length()); key.sprintf("%p:%p:%p:%s",scope,fileScope,item,explicitScopePart.data()); static QDict visitedDict; - if (visitedDict.find(key)) + if (visitedDict.find(key)) { //printf("Already visited!\n"); return -1; // already looked at this @@ -977,7 +977,7 @@ ((ClassDef*)newScope)->isBaseClass((ClassDef*)itemScope,TRUE,0) ) { - // inheritance is also ok. Example: looking for B::I, where + // inheritance is also ok. Example: looking for B::I, where // class A { public: class I {} }; // class B : public A {} // but looking for B::I, where @@ -1052,7 +1052,7 @@ { NamespaceDef *nscope = (NamespaceDef*)scope; NamespaceSDict *nl = nscope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) + if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); goto done; @@ -1063,7 +1063,7 @@ if (fileScope) { NamespaceSDict *nl = fileScope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) + if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); goto done; @@ -1095,7 +1095,7 @@ static void getResolvedSymbol(Definition *scope, FileDef *fileScope, - Definition *d, + Definition *d, const QCString &explicitScopePart, ArgumentList *actTemplParams, int &minDistance, @@ -1110,8 +1110,8 @@ // only look at classes and members that are enums or typedefs if (d->definitionType()==Definition::TypeClass || - (d->definitionType()==Definition::TypeMember && - (((MemberDef*)d)->isTypedef() || ((MemberDef*)d)->isEnumerate()) + (d->definitionType()==Definition::TypeMember && + (((MemberDef*)d)->isTypedef() || ((MemberDef*)d)->isEnumerate()) ) ) { @@ -1127,23 +1127,23 @@ ClassDef *cd = (ClassDef *)d; //printf("cd=%s\n",cd->name().data()); if (!cd->isTemplateArgument()) // skip classes that - // are only there to - // represent a template + // are only there to + // represent a template // argument { //printf("is not a templ arg\n"); if (distancequalifiedName(); } else if (distance==minDistance && fileScope && bestMatch && - fileScope->getUsedNamespaces() && - d->getOuterScope()->definitionType()==Definition::TypeNamespace && + fileScope->getUsedNamespaces() && + d->getOuterScope()->definitionType()==Definition::TypeNamespace && bestMatch->getOuterScope()==Doxygen::globalScope ) { @@ -1156,7 +1156,7 @@ // Just a non-perfect heuristic but it could help in some situations // (kdecore code is an example). minDistance=distance; - bestMatch = cd; + bestMatch = cd; bestTypedef = 0; bestTemplSpec.resize(0); bestResolvedType = cd->qualifiedName(); @@ -1251,7 +1251,7 @@ /* Find the fully qualified class name refered to by the input class * or typedef name against the input scope. * Loops through scope and each of its parent scopes looking for a - * match against the input name. Can recursively call itself when + * match against the input name. Can recursively call itself when * resolving typedefs. */ ClassDef *getResolvedClassRec(Definition *scope, @@ -1286,7 +1286,7 @@ name=name.mid(qualifierIndex+2); } - if (name.isEmpty()) + if (name.isEmpty()) { //printf("] empty name\n"); return 0; // empty name @@ -1294,16 +1294,16 @@ DefinitionIntf *di = Doxygen::symbolMap->find(name); //printf("Looking for symbol %s result=%p\n",name.data(),di); - if (di==0) + if (di==0) { return 0; } - bool hasUsingStatements = - (fileScope && ((fileScope->getUsedNamespaces() && + bool hasUsingStatements = + (fileScope && ((fileScope->getUsedNamespaces() && fileScope->getUsedNamespaces()->count()>0) || - (fileScope->getUsedClasses() && - fileScope->getUsedClasses()->count()>0)) + (fileScope->getUsedClasses() && + fileScope->getUsedClasses()->count()>0)) ); //printf("hasUsingStatements=%d\n",hasUsingStatements); // Since it is often the case that the same name is searched in the same @@ -1330,7 +1330,7 @@ // if a file scope is given and it contains using statements we should // also use the file part in the key (as a class name can be in - // two different namespaces and a using statement in a file can select + // two different namespaces and a using statement in a file can select // one of them). if (hasUsingStatements) { @@ -1346,19 +1346,19 @@ //printf("Searching for %s result=%p\n",key.data(),pval); if (pval) { - //printf("LookupInfo %p %p '%s' %p\n", - // pval->classDef, pval->typeDef, pval->templSpec.data(), - // pval->resolvedType.data()); + //printf("LookupInfo %p %p '%s' %p\n", + // pval->classDef, pval->typeDef, pval->templSpec.data(), + // pval->resolvedType.data()); if (pTemplSpec) *pTemplSpec=pval->templSpec; if (pTypeDef) *pTypeDef=pval->typeDef; if (pResolvedType) *pResolvedType=pval->resolvedType; //printf("] cachedMatch=%s\n", // pval->classDef?pval->classDef->name().data():""); - //if (pTemplSpec) + //if (pTemplSpec) // printf("templSpec=%s\n",pTemplSpec->data()); - return pval->classDef; + return pval->classDef; } - else // not found yet; we already add a 0 to avoid the possibility of + else // not found yet; we already add a 0 to avoid the possibility of // endless recursion. { Doxygen::lookupCache.insert(key,new LookupInfo); @@ -1392,7 +1392,7 @@ bestResolvedType); } - if (pTypeDef) + if (pTypeDef) { *pTypeDef = bestTypedef; } @@ -1421,7 +1421,7 @@ } //printf("] bestMatch=%s distance=%d\n", // bestMatch?bestMatch->name().data():"",minDistance); - //if (pTemplSpec) + //if (pTemplSpec) // printf("templSpec=%s\n",pTemplSpec->data()); return bestMatch; } @@ -1429,7 +1429,7 @@ /* Find the fully qualified class name refered to by the input class * or typedef name against the input scope. * Loops through scope and each of its parent scopes looking for a - * match against the input name. + * match against the input name. */ ClassDef *getResolvedClass(Definition *scope, FileDef *fileScope, @@ -1443,7 +1443,7 @@ { g_resolvedTypedefs.clear(); if (scope==0 || - (scope->definitionType()!=Definition::TypeClass && + (scope->definitionType()!=Definition::TypeClass && scope->definitionType()!=Definition::TypeNamespace ) || (fileScope && fileScope->isJava() && QCString(n).find("::")!=-1) @@ -1458,7 +1458,7 @@ // mayBeUnlinkable // ); ClassDef *result = getResolvedClassRec(scope,fileScope,n,pTypeDef,pTemplSpec,pResolvedType); - if (!mayBeUnlinkable && result && !result->isLinkable()) + if (!mayBeUnlinkable && result && !result->isLinkable()) { if (!mayBeHidden || !result->isHidden()) { @@ -1480,7 +1480,7 @@ int b = s.findRev("operator",i); if (b==-1) return FALSE; // not found b+=8; - while (b { if (!isspace((uchar)s.at(b))) return FALSE; @@ -1513,7 +1513,7 @@ int resultLen = 1024; int resultPos = 0; QCString result(resultLen); - // we use ADD_CHAR(c) instead of result+=c to + // we use ADD_CHAR(c) instead of result+=c to // improve the performance of this function #define ADD_CHAR(c) if (resultPos>=resultLen) { resultLen+=1024; result.resize(resultLen); } \ result[resultPos++]=(c) @@ -1528,19 +1528,19 @@ // search for "const" if (csp<6 && c==constScope[csp] && // character matches substring "const" - (csp>0 || // if it is the first character + (csp>0 || // if it is the first character i==0 || // the previous may not be a digit !isId(s.at(i-1)) ) ) - csp++; + csp++; else // reset counter csp=0; // search for "virtual" if (vsp<8 && c==virtualScope[vsp] && // character matches substring "virtual" (vsp>0 || // if it is the first character - i==0 || // the previous may not be a digit + i==0 || // the previous may not be a digit !isId(s.at(i-1)) ) ) @@ -1557,9 +1557,9 @@ char cc=s.at(i); ADD_CHAR(cc); if (cc=='\\') // escaped character - { + { ADD_CHAR(s.at(i+1)); - i+=2; + i+=2; } else if (cc=='"') // end of string { i++; goto nextChar; } @@ -1591,8 +1591,8 @@ ADD_CHAR(','); ADD_CHAR(' '); } - else if (i>0 && - ((isId(s.at(i)) && s.at(i-1)==')') || + else if (i>0 && + ((isId(s.at(i)) && s.at(i-1)==')') || (s.at(i)=='\'' && s.at(i-1)==' ') ) ) @@ -1601,12 +1601,12 @@ ADD_CHAR(s.at(i)); } else if (c=='t' && csp==5 /*&& (i<5 || !isId(s.at(i-5)))*/ && - !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ || - s.at(i+1)==')' || - s.at(i+1)==',' || + !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ || + s.at(i+1)==')' || + s.at(i+1)==',' || s.at(i+1)=='\0' ) - ) + ) // prevent const ::A from being converted to const::A { ADD_CHAR('t'); @@ -1614,7 +1614,7 @@ if (s.at(i+1)==' ') i++; csp=0; } - else if (c==':' && csp==6 /*&& (i<6 || !isId(s.at(i-6)))*/) + else if (c==':' && csp==6 /*&& (i<6 || !isId(s.at(i-6)))*/) // replace const::A by const ::A { ADD_CHAR(' '); @@ -1622,12 +1622,12 @@ csp=0; } else if (c=='l' && vsp==7 /*&& (i<7 || !isId(s.at(i-7)))*/ && - !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ || - s.at(i+1)==')' || - s.at(i+1)==',' || + !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ || + s.at(i+1)==')' || + s.at(i+1)==',' || s.at(i+1)=='\0' ) - ) + ) // prevent virtual ::A from being converted to virtual::A { ADD_CHAR('l'); @@ -1635,7 +1635,7 @@ if (s.at(i+1)==' ') i++; vsp=0; } - else if (c==':' && vsp==8 /*&& (i<8 || !isId(s.at(i-8)))*/) + else if (c==':' && vsp==8 /*&& (i<8 || !isId(s.at(i-8)))*/) // replace virtual::A by virtual ::A { ADD_CHAR(' '); @@ -1647,22 +1647,22 @@ (isId(s.at(i-1)) || s.at(i-1)==')' || s.at(i-1)==',' || s.at(i-1)=='>' || s.at(i-1)==']') && (isId(s.at(i+1)) || (i0 && (isId(result.at(rl-1)) || result.at(rl-1)=='>')) && ((c!='*' && c!='&') || !findOperator2(s,i)) // avoid splitting operator* and operator->* and operator& - ) + ) { ADD_CHAR(' '); } } ADD_CHAR(c); - if (cliSupport && (c=='^' || c=='%') && i>1 && isId(s.at(i-1))) + if (cliSupport && (c=='^' || c=='%') && i>1 && isId(s.at(i-1))) { ADD_CHAR(' '); // C++/CLI: Type^ name and Type% name } @@ -1672,23 +1672,23 @@ ADD_CHAR(0); result.resize(resultPos); return result; -} +} bool rightScopeMatch(const QCString &scope, const QCString &name) { - return (name==scope || // equal - (scope.right(name.length())==name && // substring + return (name==scope || // equal + (scope.right(name.length())==name && // substring scope.at(scope.length()-name.length()-1)==':' // scope - ) + ) ); } bool leftScopeMatch(const QCString &scope, const QCString &name) { - return (name==scope || // equal - (scope.left(name.length())==name && // substring + return (name==scope || // equal + (scope.left(name.length())==name && // substring scope.at(name.length())==':' // scope - ) + ) ); } @@ -1714,17 +1714,17 @@ int floatingIndex=0; if (strLen==0) return; // read a word from the text string - while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1 && + while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1 && (newIndex==0 || !(txtStr.at(newIndex-1)>='0' && txtStr.at(newIndex-1)<='9')) // avoid matching part of hex numbers ) { // add non-word part to the result floatingIndex+=newIndex-skipIndex+matchLen; - bool insideString=FALSE; + bool insideString=FALSE; int i; - for (i=index;iname().data()); // add link to the result @@ -1808,22 +1808,22 @@ } QCString scopeName; - if (scope && - (scope->definitionType()==Definition::TypeClass || + if (scope && + (scope->definitionType()==Definition::TypeClass || scope->definitionType()==Definition::TypeNamespace - ) + ) ) { scopeName=scope->name(); } //printf("ScopeName=%s\n",scopeName.data()); - //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data()); - if (!found && - getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) && - (md->isTypedef() || md->isEnumerate() || + //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data()); + if (!found && + getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) && + (md->isTypedef() || md->isEnumerate() || md->isReference() || md->isVariable() - ) && - (external ? md->isLinkable() : md->isLinkableInProject()) + ) && + (external ? md->isLinkable() : md->isLinkableInProject()) ) { //printf("Found ref scope=%s\n",d?d->name().data():""); @@ -1865,7 +1865,7 @@ ol.parseText(exampleLine.mid(index,newIndex-index)); uint entryIndex = exampleLine.mid(newIndex+1,matchLen-1).toUInt(&ok); Example *e=ed->at(entryIndex); - if (ok && e) + if (ok && e) { ol.pushGeneratorState(); //if (latexEnabled) ol.disable(OutputGenerator::Latex); @@ -1887,7 +1887,7 @@ ol.popGeneratorState(); } index=newIndex+matchLen; - } + } ol.parseText(exampleLine.right(exampleLine.length()-index)); ol.writeString("."); } @@ -1901,7 +1901,7 @@ result+="("; while (a) { - QCString type1 = useCanonicalType && !a->canType.isEmpty() ? + QCString type1 = useCanonicalType && !a->canType.isEmpty() ? a->canType : a->type; QCString type2; int i=type1.find(")("); // hack to deal with function pointers @@ -1916,7 +1916,16 @@ } if (!a->name.isEmpty() || !a->array.isEmpty()) { - result+= type1+" "+a->name+type2+a->array; + + result+= type1; + if (!type1.isEmpty()) + result += a->suffixSpacer; + + result += a->name+type2 + a->array; + + if (!a->suffixType.isEmpty()) + result += a->suffixSpacer + a->suffixType; + } else { @@ -1927,7 +1936,7 @@ result+="="+a->defval; } a = al->next(); - if (a) result+=", "; + if (a) result+=", "; } result+=")"; if (al->constSpecifier) result+=" const"; @@ -2012,7 +2021,7 @@ { c = '\n'; // each CR to LF if (src'%s'\n", inputEncoding.data(),outputEncoding); @@ -2146,7 +2155,7 @@ /*! reads a file with name \a name and returns it as a string. If \a filter * is TRUE the file will be filtered by any user specified input filter. - * If \a name is "-" the string will be read from standard input. + * If \a name is "-" the string will be read from standard input. */ QCString fileToString(const char *name,bool filter) { @@ -2166,7 +2175,7 @@ while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize) { totalSize+=bSize; - contents.resize(totalSize+bSize); + contents.resize(totalSize+bSize); } totalSize = filterCRLF(contents.data(),totalSize+size)+2; contents.resize(totalSize); @@ -2193,14 +2202,14 @@ int fsize=f.size(); QCString contents(fsize+2); f.readBlock(contents.data(),fsize); - if (fsize==0 || contents[fsize-1]=='\n') + if (fsize==0 || contents[fsize-1]=='\n') contents[fsize]='\0'; else contents[fsize]='\n'; // to help the scanner contents[fsize+1]='\0'; f.close(); int newSize = filterCRLF(contents.data(),fsize+2); - if (newSize!=fsize+2) + if (newSize!=fsize+2) { contents.resize(newSize); } @@ -2224,7 +2233,7 @@ while ((size=fread(contents.data()+totalSize,1,bSize,f))==bSize) { totalSize+=bSize; - contents.resize(totalSize+bSize); + contents.resize(totalSize+bSize); } totalSize = filterCRLF(contents.data(),totalSize+size)+2; contents.resize(totalSize); @@ -2234,7 +2243,7 @@ return transcodeCharacterStringToUTF8(contents); } } - if (!fileOpened) + if (!fileOpened) { err("Error: cannot open file `%s' for reading\n",name); } @@ -2274,24 +2283,24 @@ } //---------------------------------------------------------------------- -// recursive function that returns the number of branches in the +// recursive function that returns the number of branches in the // inheritance tree that the base class `bcd' is below the class `cd' int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level) { - if (bcd->categoryOf()) // use class that is being extended in case of + if (bcd->categoryOf()) // use class that is being extended in case of // an Objective-C category { bcd=bcd->categoryOf(); } - if (cd==bcd) return level; + if (cd==bcd) return level; if (level==256) { err("Error: Internal inconsistency: found class %s seem to have a recursive " "inheritance relation! Please send a bug report to dimitri@stack.nl\n",cd->name().data()); return -1; } - int m=maxInheritanceDepth; + int m=maxInheritanceDepth; if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); @@ -2314,7 +2323,7 @@ // printf("("); // for (;(a=ali.current());++ali) // { -// printf("t=`%s' n=`%s' v=`%s' ",a->type.data(),!a->name.isEmpty()>0?a->name.data():"",!a->defval.isEmpty()>0?a->defval.data():""); +// printf("t=`%s' n=`%s' v=`%s' ",a->type.data(),!a->name.isEmpty()>0?a->name.data():"",!a->defval.isEmpty()>0?a->defval.data():""); // } // printf(")"); //} @@ -2401,7 +2410,7 @@ { int sl=s.length(); int pl=pattern.length(); - int sp=0; + int sp=0; *len=0; while (p') + else if (s.at(p)=='>') { bc--; - if (bc==0) + if (bc==0) { p++; break; @@ -2472,7 +2481,7 @@ scopeOffset=name.findRev("::",scopeOffset-1); result = tmp; - } while (scopeOffset>0); + } while (scopeOffset>0); //printf("trimScope(name=%s,scope=%s)=%s\n",name.data(),s.data(),result.data()); return result; } @@ -2496,7 +2505,7 @@ } //printf("base class `%s'\n",cd->name().data()); if (cd->baseClasses()) - trimBaseClassScope(cd->baseClasses(),s,level+1); + trimBaseClassScope(cd->baseClasses(),s,level+1); } } @@ -2594,7 +2603,7 @@ if (i1==-1 && i2==-1) { // strip str from target at index i - target=target.left(i)+target.right(target.length()-i-l); + target=target.left(i)+target.right(target.length()-i-l); changed=TRUE; i-=l; } @@ -2621,8 +2630,8 @@ \code const T param -> T param // not relevant - const T& param -> const T& param // const needed - T* const param -> T* param // not relevant + const T& param -> const T& param // const needed + T* const param -> T* param // not relevant const T* param -> const T* param // const needed \endcode */ @@ -2666,15 +2675,15 @@ srcAType.stripPrefix("class "); dstAType.stripPrefix("class "); - // allow distingishing "const A" from "const B" even though - // from a syntactic point of view they would be two names of the same - // type "const". This is not fool prove ofcourse, but should at least + // allow distingishing "const A" from "const B" even though + // from a syntactic point of view they would be two names of the same + // type "const". This is not fool prove ofcourse, but should at least // catch the most common cases. if ((srcAType=="const" || srcAType=="volatile") && !srcAName.isEmpty()) { srcAType+=" "; srcAType+=srcAName; - } + } if ((dstAType=="const" || dstAType=="volatile") && !dstAName.isEmpty()) { dstAType+=" "; @@ -2697,11 +2706,11 @@ // strip typename keyword if (strncmp(srcAType,"typename ",9)==0) { - srcAType = srcAType.right(srcAType.length()-9); + srcAType = srcAType.right(srcAType.length()-9); } if (strncmp(dstAType,"typename ",9)==0) { - dstAType = dstAType.right(dstAType.length()-9); + dstAType = dstAType.right(dstAType.length()-9); } srcAType = removeRedundantWhiteSpace(srcAType); @@ -2718,10 +2727,10 @@ NOMATCH return FALSE; } - if (srcAType!=dstAType) // check if the argument only differs on name + if (srcAType!=dstAType) // check if the argument only differs on name { - // remove a namespace scope that is only in one type + // remove a namespace scope that is only in one type // (assuming a using statement was used) //printf("Trimming %s<->%s: %s\n",srcAType.data(),dstAType.data(),namespaceName.data()); //trimNamespaceScope(srcAType,dstAType,namespaceName); @@ -2743,8 +2752,8 @@ cd=getClass(className); if (cd && cd->baseClasses()) { - trimBaseClassScope(cd->baseClasses(),srcAType); - trimBaseClassScope(cd->baseClasses(),dstAType); + trimBaseClassScope(cd->baseClasses(),srcAType); + trimBaseClassScope(cd->baseClasses(),dstAType); } //printf("trimBaseClassScope: `%s' <=> `%s'\n",srcAType.data(),dstAType.data()); } @@ -2793,12 +2802,12 @@ } - uint srcPos=0,dstPos=0; + uint srcPos=0,dstPos=0; bool equal=TRUE; while (srcPos if no then there is no match - if (!srcAName.isEmpty() || !dstAName.isEmpty()) + if (!srcAName.isEmpty() || !dstAName.isEmpty()) { NOMATCH return FALSE; @@ -2823,10 +2832,10 @@ // types only while (srcPos no match @@ -2870,7 +2879,7 @@ { dstPos++; while (dstPos no match @@ -2887,7 +2896,7 @@ return FALSE; } while (srcPos no match @@ -2897,7 +2906,7 @@ { srcPos++; while (srcPos no match @@ -2912,9 +2921,9 @@ /*! * Matches the arguments list srcAl with the argument list dstAl - * Returns TRUE if the argument lists are equal. Two argument list are - * considered equal if the number of arguments is equal and the types of all - * arguments are equal. Furthermore the const and volatile specifiers + * Returns TRUE if the argument lists are equal. Two argument list are + * considered equal if the number of arguments is equal and the types of all + * arguments are equal. Furthermore the const and volatile specifiers * stored in the list should be equal. */ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, @@ -2927,7 +2936,7 @@ // strip template specialization from class name if present //int til=className.find('<'),tir=className.find('>'); - //if (til!=-1 && tir!=-1 && tir>til) + //if (til!=-1 && tir!=-1 && tir>til) //{ // className=className.left(til)+className.right(className.length()-tir-1); //} @@ -2956,7 +2965,7 @@ } // handle special case with void argument - if ( srcAl->count()==0 && dstAl->count()==1 && + if ( srcAl->count()==0 && dstAl->count()==1 && dstAl->getFirst()->type=="void" ) { // special case for finding match between func() and func(void) Argument *a=new Argument; @@ -2983,7 +2992,7 @@ if (checkCV) { - if (srcAl->constSpecifier != dstAl->constSpecifier) + if (srcAl->constSpecifier != dstAl->constSpecifier) { NOMATCH return FALSE; // one member is const, the other not -> no match @@ -3000,7 +3009,7 @@ ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl); Argument *srcA,*dstA; for (;(srcA=srcAli.current(),dstA=dstAli.current());++srcAli,++dstAli) - { + { if (!matchArgument(srcA,dstA,className,namespaceName, usingNamespaces,usingClasses)) { @@ -3009,7 +3018,7 @@ } } MATCH - return TRUE; // all arguments match + return TRUE; // all arguments match } #endif @@ -3018,7 +3027,7 @@ static QCString resolveSymbolName(FileDef *fs,Definition *symbol,QCString &templSpec) { ASSERT(symbol!=0); - if (symbol->definitionType()==Definition::TypeMember && + if (symbol->definitionType()==Definition::TypeMember && ((MemberDef*)symbol)->isTypedef()) // if symbol is a typedef then try // to resolve it { @@ -3055,11 +3064,11 @@ QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec) { - + QCString templSpec = spec.stripWhiteSpace(); // this part had been commented out before... but it is needed to match for instance // std::list against list so it is now back again! - if (!templSpec.isEmpty() && templSpec.at(0) == '<') + if (!templSpec.isEmpty() && templSpec.at(0) == '<') { templSpec = "< " + extractCanonicalType(d,fs,templSpec.right(templSpec.length()-1).stripWhiteSpace()); } @@ -3223,7 +3232,7 @@ //printf(" word=%s templSpec=%s canType=%s\n",word.data(),templSpec.data(),canType.data()); if (!templSpec.isEmpty()) // if we didn't use up the templSpec already // (i.e. type is not a template specialization) - // then resolve any identifiers inside. + // then resolve any identifiers inside. { static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*"); int tp=0,tl,ti; @@ -3251,11 +3260,11 @@ QCString type = arg->type.stripWhiteSpace(); QCString name = arg->name; //printf("extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data()); - if ((type=="const" || type=="volatile") && !name.isEmpty()) + if ((type=="const" || type=="volatile") && !name.isEmpty()) { // name is part of type => correct type+=" "; type+=name; - } + } if (name=="const" || name=="volatile") { // name is part of type => correct if (!type.isEmpty()) type+=" "; @@ -3351,7 +3360,7 @@ } // handle special case with void argument - if ( srcAl->count()==0 && dstAl->count()==1 && + if ( srcAl->count()==0 && dstAl->count()==1 && dstAl->getFirst()->type=="void" ) { // special case for finding match between func() and func(void) Argument *a=new Argument; @@ -3378,7 +3387,7 @@ if (checkCV) { - if (srcAl->constSpecifier != dstAl->constSpecifier) + if (srcAl->constSpecifier != dstAl->constSpecifier) { NOMATCH return FALSE; // one member is const, the other not -> no match @@ -3395,7 +3404,7 @@ ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl); Argument *srcA,*dstA; for (;(srcA=srcAli.current(),dstA=dstAli.current());++srcAli,++dstAli) - { + { if (!matchArgument2(srcScope,srcFileScope,srcA, dstScope,dstFileScope,dstA) ) @@ -3405,7 +3414,7 @@ } } MATCH - return TRUE; // all arguments match + return TRUE; // all arguments match } @@ -3548,26 +3557,26 @@ * memberName may also include a (partial) scope to indicate the scope * in which the member is located. * - * The parameter `scName' is a string representing the name of the scope in + * The parameter `scName' is a string representing the name of the scope in * which the link was found. * - * In case of a function args contains a string representation of the - * argument list. Passing 0 means the member has no arguments. + * In case of a function args contains a string representation of the + * argument list. Passing 0 means the member has no arguments. * Passing "()" means any argument list will do, but "()" is preferred. * * The function returns TRUE if the member is known and documented or * FALSE if it is not. - * If TRUE is returned parameter `md' contains a pointer to the member - * definition. Furthermore exactly one of the parameter `cd', `nd', or `fd' + * If TRUE is returned parameter `md' contains a pointer to the member + * definition. Furthermore exactly one of the parameter `cd', `nd', or `fd' * will be non-zero: * - if `cd' is non zero, the member was found in a class pointed to by cd. * - if `nd' is non zero, the member was found in a namespace pointed to by nd. * - if `fd' is non zero, the member was found in the global namespace of * file fd. */ -bool getDefs(const QCString &scName,const QCString &memberName, +bool getDefs(const QCString &scName,const QCString &memberName, const char *args, - MemberDef *&md, + MemberDef *&md, ClassDef *&cd, FileDef *&fd, NamespaceDef *&nd, GroupDef *&gd, bool forceEmptyScope, FileDef *currentFile, @@ -3583,12 +3592,12 @@ int is,im=0,pm=0; // strip common part of the scope from the scopeName - while ((is=scopeName.findRev("::"))!=-1 && + while ((is=scopeName.findRev("::"))!=-1 && (im=memberName.find("::",pm))!=-1 && (scopeName.right(scopeName.length()-is-2)==memberName.mid(pm,im-pm)) ) { - scopeName=scopeName.left(is); + scopeName=scopeName.left(is); pm=im+2; } //printf("result after scope corrections scope=%s name=%s\n", @@ -3598,11 +3607,11 @@ QCString mScope; if (memberName.left(9)!="operator " && // treat operator conversion methods // as a special case - (im=memberName.findRev("::"))!=-1 && + (im=memberName.findRev("::"))!=-1 && im<(int)memberName.length()-2 // not A:: ) { - mScope=memberName.left(im); + mScope=memberName.left(im); mName=memberName.right(memberName.length()-im-2); } @@ -3633,13 +3642,13 @@ ClassDef *fcd=0; // todo: fill in correct fileScope! if ((fcd=getResolvedClass(Doxygen::globalScope,0,className)) && // is it a documented class - fcd->isLinkable() + fcd->isLinkable() ) { //printf(" Found fcd=%p\n",fcd); MemberListIterator mmli(*mn); MemberDef *mmd; - int mdist=maxInheritanceDepth; + int mdist=maxInheritanceDepth; ArgumentList *argList=0; if (args) { @@ -3651,11 +3660,11 @@ //if (mmd->isLinkable()) //{ LockingPtr mmdAl = mmd->argumentList(); - bool match=args==0 || + bool match=args==0 || matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),mmdAl.pointer(), fcd,fcd->getFileDef(),argList, checkCV - ); + ); //printf("match=%d\n",match); if (match) { @@ -3702,9 +3711,9 @@ } } //printf(" >Succes=%d\n",mdistisLinkable()) + if (!md->isLinkable()) { md=0; // avoid returning things we cannot link to cd=0; @@ -3717,7 +3726,7 @@ return TRUE; /* found match */ } } - } + } /* go to the parent scope */ if (scopeOffset==0) @@ -3730,7 +3739,7 @@ } } while (scopeOffset>=0); - // unknown or undocumented scope + // unknown or undocumented scope } if (mn && scopeName.isEmpty() && mScope.isEmpty()) // Maybe a related function? { @@ -3796,7 +3805,7 @@ namespaceName=mScope.copy(); } //printf("Trying namespace %s\n",namespaceName.data()); - if (!namespaceName.isEmpty() && + if (!namespaceName.isEmpty() && (fnd=Doxygen::namespaceSDict->find(namespaceName)) && fnd->isLinkable() ) @@ -3821,7 +3830,7 @@ match=matchArguments2( mmd->getOuterScope(),mmd->getFileDef(),mmdAl.pointer(), fnd,mmd->getFileDef(),argList, - checkCV); + checkCV); } if (match) { @@ -3835,8 +3844,8 @@ } } } - if (!found && args && !strcmp(args,"()")) - // no exact match found, but if args="()" an arbitrary + if (!found && args && !strcmp(args,"()")) + // no exact match found, but if args="()" an arbitrary // member will do { for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli) @@ -3849,9 +3858,9 @@ } } } - if (found) + if (found) { - if (!md->isLinkable()) + if (!md->isLinkable()) { md=0; // avoid returning things we cannot link to nd=0; @@ -3888,7 +3897,7 @@ //printf(" md->name()=`%s' md->args=`%s' fd=%p gd=%p\n", // md->name().data(),args,fd,gd); if ( - ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) && + ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) && md->getNamespaceDef()==0 && md->isLinkable() ) { @@ -3903,10 +3912,10 @@ match=matchArguments2( md->getOuterScope(),fd,mdAl.pointer(), Doxygen::globalScope,fd,argList, - checkCV); + checkCV); delete argList; argList=0; } - if (match) + if (match) { //printf("Found match!\n"); members.append(md); @@ -3915,7 +3924,7 @@ } if (members.count()!=1 && args && !strcmp(args,"()")) { - // no exact match found, but if args="()" an arbitrary + // no exact match found, but if args="()" an arbitrary // member will do md=mn->last(); while (md /* && md->isLinkable()*/) @@ -3925,7 +3934,7 @@ fd=md->getFileDef(); gd=md->getGroupDef(); if ( - (gd && gd->isLinkable()) || (fd && fd->isLinkable()) + (gd && gd->isLinkable()) || (fd && fd->isLinkable()) ) { members.append(md); @@ -3957,7 +3966,7 @@ bmd = 0; break; } - if (!md->isStatic() || Config_getBool("EXTRACT_STATIC")) bmd = md; + if (!md->isStatic() || Config_getBool("EXTRACT_STATIC")) bmd = md; } if (bmd) md=bmd; } @@ -3978,14 +3987,14 @@ /*! * Searches for a scope definition given its name as a string via parameter - * `scope'. + * `scope'. * - * The parameter `docScope' is a string representing the name of the scope in + * The parameter `docScope' is a string representing the name of the scope in * which the `scope' string was found. * * The function returns TRUE if the scope is known and documented or * FALSE if it is not. - * If TRUE is returned exactly one of the parameter `cd', `nd' + * If TRUE is returned exactly one of the parameter `cd', `nd' * will be non-zero: * - if `cd' is non zero, the scope was a class pointed to by cd. * - if `nd' is non zero, the scope was a namespace pointed to by nd. @@ -4002,7 +4011,7 @@ bool explicitGlobalScope=FALSE; if (scopeName.at(0)==':' && scopeName.at(1)==':') { - scopeName=scopeName.right(scopeName.length()-2); + scopeName=scopeName.right(scopeName.length()-2); explicitGlobalScope=TRUE; } @@ -4016,11 +4025,11 @@ if ((cd=getClass(fullName)) && cd->isLinkable()) { - return TRUE; // class link written => quit + return TRUE; // class link written => quit } else if ((nd=Doxygen::namespaceSDict->find(fullName)) && nd->isLinkable()) { - return TRUE; // namespace link written => quit + return TRUE; // namespace link written => quit } if (scopeOffset==0) { @@ -4041,12 +4050,12 @@ // if (p==0) return TRUE; // int c; // while ((c=*p++)) if (!islower(c)) return FALSE; -// return TRUE; +// return TRUE; //} -/*! Returns an object to reference to given its name and context +/*! Returns an object to reference to given its name and context * @post return value TRUE implies *resContext!=0 or *resMember!=0 */ bool resolveRef(/* in */ const char *scName, @@ -4076,7 +4085,7 @@ NamespaceDef *nd=0; //if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName)) - //{ // link to lower case only name => do not try to autolink + //{ // link to lower case only name => do not try to autolink // return FALSE; //} @@ -4096,7 +4105,7 @@ } return TRUE; } - else if (scName==fullName || (!inSeeBlock && scopePos==-1)) + else if (scName==fullName || (!inSeeBlock && scopePos==-1)) // nothing to link => output plain text { //printf("found scName=%s fullName=%s scName==fullName=%d " @@ -4115,7 +4124,7 @@ if (bracePos!=-1) argsStr=fullName.right(fullName.length()-bracePos); // strip template specifier - // TODO: match against the correct partial template instantiation + // TODO: match against the correct partial template instantiation int templPos=nameStr.find('<'); bool tryUnspecializedVersion = FALSE; if (templPos!=-1 && nameStr.find("operator")==-1) @@ -4212,20 +4221,20 @@ /*! * generate a reference to a class, namespace or member. - * `scName' is the name of the scope that contains the documentation + * `scName' is the name of the scope that contains the documentation * string that is returned. * `name' is the name that we want to link to. * `name' may have five formats: * 1) "ScopeName" - * 2) "memberName()" one of the (overloaded) function or define + * 2) "memberName()" one of the (overloaded) function or define * with name memberName. - * 3) "memberName(...)" a specific (overloaded) function or define + * 3) "memberName(...)" a specific (overloaded) function or define * with name memberName * 4) "::name a global variable or define * 4) "\#memberName member variable, global variable or define - * 5) ("ScopeName::")+"memberName()" - * 6) ("ScopeName::")+"memberName(...)" - * 7) ("ScopeName::")+"memberName" + * 5) ("ScopeName::")+"memberName()" + * 6) ("ScopeName::")+"memberName(...)" + * 7) ("ScopeName::")+"memberName" * instead of :: the \# symbol may also be used. */ @@ -4365,7 +4374,7 @@ //---------------------------------------------------------------------- // General function that generates the HTML code for a reference to some -// file, class or member from text `lr' within the context of class `clName'. +// file, class or member from text `lr' within the context of class `clName'. // This link has the text 'lt' (if not 0), otherwise `lr' is used as a // basis for the link's text. // returns TRUE if a link could be generated. @@ -4383,14 +4392,14 @@ if (compound) // link to compound { if (lt==0 && anchor.isEmpty() && /* compound link */ - compound->definitionType()==Definition::TypeGroup /* is group */ + compound->definitionType()==Definition::TypeGroup /* is group */ ) { linkText=((GroupDef *)compound)->groupTitle(); // use group's title as link } else if (compound->definitionType()==Definition::TypeFile) { - linkText=linkToText(lt,TRUE); + linkText=linkToText(lt,TRUE); } od.writeObjectLink(compound->getReference(), compound->getOutputFileBase(),anchor,linkText); @@ -4419,12 +4428,12 @@ //FileInfo *fi; FileDef *fd; bool ambig; - if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) && - fd->isLinkable()) + if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) && + fd->isLinkable()) // link to documented input file od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,linkText); else - od.docify(linkText); + od.docify(linkText); } //---------------------------------------------------------------------- @@ -4531,7 +4540,7 @@ if (slashPos!=-1) { path=name.left(slashPos+1); - name=name.right(name.length()-slashPos-1); + name=name.right(name.length()-slashPos-1); } //printf("findFileDef path=`%s' name=`%s'\n",path.data(),name.data()); if (name.isEmpty()) goto exit; @@ -4557,10 +4566,10 @@ for (fni.toFirst();(fd=fni.current());++fni) { QCString fdStripPath = stripFromIncludePath(fd->getPath()); - if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped) - { - count++; - lastMatch=fd; + if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped) + { + count++; + lastMatch=fd; } } @@ -4587,7 +4596,7 @@ if (slashPos!=-1) { path=name.left(slashPos+1); - name=name.right(name.length()-slashPos-1); + name=name.right(name.length()-slashPos-1); } FileName *fn; if ((fn=(*fnDict)[name])) @@ -4626,7 +4635,7 @@ /*! Returns the character index within \a name of the first prefix * in Config_getList("IGNORE_PREFIX") that matches \a name at the left hand side, * or zero if no match was found - */ + */ int getPrefixIndex(const QCString &name) { if (name.isEmpty()) return 0; @@ -4728,7 +4737,7 @@ case ')': result+="_08"; break; case '+': result+="_09"; break; case '=': result+="_0A"; break; - default: + default: if (c<0) { static char map[] = "0123456789ABCDEF"; @@ -4748,7 +4757,7 @@ else { result+="_"; - result+=tolower(c); + result+=tolower(c); } break; } @@ -4757,7 +4766,7 @@ } /*! This function determines the file name on disk of an item - * given its name, which could be a class name with template + * given its name, which could be a class name with template * arguments, so special characters need to be escaped. */ QCString convertNameToFile(const char *name,bool allowDots) @@ -4782,7 +4791,7 @@ { num = *value; } - result.sprintf("a%05d",num); + result.sprintf("a%05d",num); } else // long names { @@ -4795,17 +4804,17 @@ QCString sigStr(33); MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig); MD5SigToString(md5_sig,sigStr.data(),33); - result=result.left(128-32)+sigStr; + result=result.left(128-32)+sigStr; } } if (createSubdirs) { int l1Dir=0,l2Dir=0; -#if MAP_ALGO==ALGO_COUNT +#if MAP_ALGO==ALGO_COUNT // old algorithm, has the problem that after regeneration the // output can be located in a different dir. - if (Doxygen::htmlDirMap==0) + if (Doxygen::htmlDirMap==0) { Doxygen::htmlDirMap=new QDict(100003); Doxygen::htmlDirMap->setAutoDelete(TRUE); @@ -4814,7 +4823,7 @@ int *dirNum = Doxygen::htmlDirMap->find(result); if (dirNum==0) // new name { - Doxygen::htmlDirMap->insert(result,new int(curDirNum)); + Doxygen::htmlDirMap->insert(result,new int(curDirNum)); l1Dir = (curDirNum)&0xf; // bits 0-3 l2Dir = (curDirNum>>4)&0xff; // bits 4-11 curDirNum++; @@ -4898,7 +4907,7 @@ goto done; } p=clName.length()-2; - while (p>=0 && (i=clName.findRev("::",p))!=-1) + while (p>=0 && (i=clName.findRev("::",p))!=-1) // see if the first part is a namespace (and not a class) { //printf("Trying %s\n",clName.left(i).data()); @@ -4908,7 +4917,7 @@ namespaceName=nd->name().copy(); className=clName.right(clName.length()-i-2); goto done; - } + } p=i-2; // try a smaller piece of the scope } //printf("not found!\n"); @@ -4937,16 +4946,16 @@ int si,pi=0; ClassDef *cd=0; while ( - (si=scope.find("::",pi))!=-1 && !getClass(scope.left(si)+templ) && - ((cd=getClass(scope.left(si)))==0 || cd->templateArguments()==0) - ) - { - //printf("Tried `%s'\n",(scope.left(si)+templ).data()); - pi=si+2; + (si=scope.find("::",pi))!=-1 && !getClass(scope.left(si)+templ) && + ((cd=getClass(scope.left(si)))==0 || cd->templateArguments()==0) + ) + { + //printf("Tried `%s'\n",(scope.left(si)+templ).data()); + pi=si+2; } if (si==-1) // not nested => append template specifier { - result+=templ; + result+=templ; } else // nested => insert template specifier before after first class name { @@ -4975,7 +4984,7 @@ char c=result.at(p); switch (c) { - case ':': + case ':': //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); return result.right(l-p-1); case '>': @@ -4990,7 +4999,7 @@ { case '>': count++; break; case '<': count--; if (count<=0) done=TRUE; break; - default: + default: //printf("c=%c count=%d\n",c,count); break; } @@ -5024,7 +5033,7 @@ char c=result.at(p); switch (c) { - case ':': + case ':': //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); return result.right(l-p-1); case '>': @@ -5048,10 +5057,10 @@ c=result.at(p--); switch (c) { - case '>': - count++; + case '>': + count++; break; - case '<': + case '<': if (p>0) { if (result.at(p-1) == '<') // skip << operator @@ -5060,10 +5069,10 @@ break; } } - count--; + count--; foundMatch = count==0; break; - default: + default: //printf("c=%c count=%d\n",c,count); break; } @@ -5098,7 +5107,7 @@ case '<': result+="<"; break; case '>': result+=">"; break; case '&': result+="&"; break; - case '\'': result+="'"; break; + case '\'': result+="'"; break; case '"': result+="""; break; default: result+=c; break; } @@ -5140,10 +5149,10 @@ } else { - result+="&"; + result+="&"; } break; - case '\'': result+="'"; break; + case '\'': result+="'"; break; case '"': result+="""; break; default: result+=c; break; } @@ -5374,11 +5383,11 @@ int brCount=1; while (te') + if (type.at(te)=='>') { if (te') te++; else brCount--; } @@ -5386,7 +5395,7 @@ } } name = type.mid(i,l); - if (te>ts) + if (te>ts) { templSpec = type.mid(ts,te-ts),tl+=te-ts; pos=i+l+tl; @@ -5450,12 +5459,12 @@ // replace formal argument with the actual argument of the instance if (actArg->name.isEmpty()) { - result += actArg->type+" "; + result += actArg->type+" "; } else // for case where the actual arg is something like "unsigned int" // the "int" part is in actArg->name. { - result += actArg->type+" "+actArg->name+" "; + result += actArg->type+" "+actArg->name+" "; } found=TRUE; } @@ -5486,7 +5495,7 @@ /*! Makes a deep copy of argument list \a src. Will allocate memory, that - * is owned by the caller. + * is owned by the caller. */ ArgumentList *copyArgumentList(const ArgumentList *src) { @@ -5505,7 +5514,7 @@ return dst; } -/*! Makes a deep copy of the list of argument lists \a srcLists. +/*! Makes a deep copy of the list of argument lists \a srcLists. * Will allocate memory, that is owned by the caller. */ QList *copyArgumentLists(const QList *srcLists) @@ -5522,12 +5531,12 @@ return dstLists; } -/*! Strips template specifiers from scope \a fullName, except those - * that make up specialized classes. The switch \a parentOnly - * determines whether or not a template "at the end" of a scope - * should be considered, e.g. with \a parentOnly is \c TRUE, A::B will - * try to strip \ and not \, while \a parentOnly is \c FALSE will - * strip both unless A or B are specialized template classes. +/*! Strips template specifiers from scope \a fullName, except those + * that make up specialized classes. The switch \a parentOnly + * determines whether or not a template "at the end" of a scope + * should be considered, e.g. with \a parentOnly is \c TRUE, A::B will + * try to strip \ and not \, while \a parentOnly is \c FALSE will + * strip both unless A or B are specialized template classes. */ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, @@ -5546,11 +5555,11 @@ while (e') + else if (c=='>') { count--; done = count==0; @@ -5558,12 +5567,12 @@ } int si= fullName.find("::",e); - if (parentOnly && si==-1) break; + if (parentOnly && si==-1) break; // we only do the parent scope, so we stop here if needed result+=fullName.mid(p,i-p); //printf(" trying %s\n",(result+fullName.mid(i,e-i)).data()); - if (getClass(result+fullName.mid(i,e-i))!=0) + if (getClass(result+fullName.mid(i,e-i))!=0) { result+=fullName.mid(i,e-i); //printf("2:result+=%s\n",fullName.mid(i,e-i-1).data()); @@ -5585,10 +5594,10 @@ * Example1: \c A::B and \c B::C will result in \c A::B::C
* Example2: \c A and \c B will be \c A::B
* Example3: \c A::B and B will be \c A::B - * + * * @param leftScope the left hand part of the scope. * @param rightScope the right hand part of the scope. - * @returns the merged scope. + * @returns the merged scope. */ QCString mergeScopes(const QCString &leftScope,const QCString &rightScope) { @@ -5692,7 +5701,7 @@ else // new page { QCString baseName=name; - if (baseName.right(4)==".tex") + if (baseName.right(4)==".tex") baseName=baseName.left(baseName.length()-4); else if (baseName.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension) baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length()); @@ -5764,14 +5773,14 @@ for (slii.toFirst();(lii=slii.current());++slii) { RefList *refList = Doxygen::xrefLists->find(lii->type); - if (refList && + if (refList && ( // either not a built-in list or the list is enabled - (lii->type!="todo" || Config_getBool("GENERATE_TODOLIST")) && - (lii->type!="test" || Config_getBool("GENERATE_TESTLIST")) && - (lii->type!="bug" || Config_getBool("GENERATE_BUGLIST")) && + (lii->type!="todo" || Config_getBool("GENERATE_TODOLIST")) && + (lii->type!="test" || Config_getBool("GENERATE_TESTLIST")) && + (lii->type!="bug" || Config_getBool("GENERATE_BUGLIST")) && (lii->type!="deprecated" || Config_getBool("GENERATE_DEPRECATEDLIST")) - ) + ) ) { RefItem *item = refList->getRefItem(lii->itemId); @@ -5815,7 +5824,7 @@ bool first=TRUE; for (gli.toFirst();(gd=gli.current());++gli) { - if (!first) { ol.docify(","); ol.writeNonBreakableSpace(1); } else first=FALSE; + if (!first) { ol.docify(","); ol.writeNonBreakableSpace(1); } else first=FALSE; ol.writeObjectLink(gd->getReference(), gd->getOutputFileBase(),0,gd->groupTitle()); } @@ -5868,7 +5877,7 @@ case 219: t << "\\^{U}"; break; case 220: t << "\\\"{U}"; break; case 221: t << "\\'{Y}"; break; - case 223: t << "\\ss{}"; break; + case 223: t << "\\ss{}"; break; case 224: t << "\\`{a}"; break; case 225: t << "\\'{a}"; break; case 226: t << "\\^{a}"; break; @@ -5897,7 +5906,7 @@ case 251: t << "\\^{u}"; break; case 252: t << "\\\"{u}"; break; case 253: t << "\\'{y}"; break; - case 255: t << "\\\"{y}"; break; + case 255: t << "\\\"{y}"; break; default: t << (char)c; } } @@ -6029,7 +6038,7 @@ static bool isRussian = theTranslator->idLanguage()=="russian"; static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; static bool isSlovene = theTranslator->idLanguage()=="solvene"; - static bool isChinese = theTranslator->idLanguage()=="chinese" || + static bool isChinese = theTranslator->idLanguage()=="chinese" || theTranslator->idLanguage()=="chinese-traditional"; static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; static bool isGreek = theTranslator->idLanguage()=="greek"; @@ -6052,15 +6061,15 @@ case '{': t << "\\{"; break; case '}': t << "\\}"; break; case '_': t << "\\_"; break; - default: + default: t << (char)c; #if 0 { // Some languages use wide characters if (c>=128 && (isJapanese || isKorean || isChinese || isSerbian)) - { + { t << (char)c; - if (*p) + if (*p) { c = *p++; t << (char)c; @@ -6068,7 +6077,7 @@ } else { - t << (char)c; + t << (char)c; } break; } @@ -6085,8 +6094,8 @@ case '^': t << "$^\\wedge$"; break; case '&': t << "\\&"; break; case '*': t << "$\\ast$"; break; - case '_': t << "\\_"; - if (!insideTabbing) t << "\\-"; + case '_': t << "\\_"; + if (!insideTabbing) t << "\\-"; break; case '{': t << "\\{"; break; case '}': t << "\\}"; break; @@ -6094,8 +6103,8 @@ case '>': t << "$>$"; break; case '|': t << "$|$"; break; case '~': t << "$\\sim$"; break; - case '[': if (Config_getBool("PDF_HYPERLINKS") || insideItem) - t << "\\mbox{[}"; + case '[': if (Config_getBool("PDF_HYPERLINKS") || insideItem) + t << "\\mbox{[}"; else t << "["; break; @@ -6103,34 +6112,34 @@ if (Config_getBool("PDF_HYPERLINKS") || insideItem) t << "\\mbox{]}"; else - t << "]"; + t << "]"; break; - case '-': if (*p=='>') + case '-': if (*p=='>') { t << " $\\rightarrow$ "; p++; } else { t << (char)c; } break; - case '\\': if (*p=='<') + case '\\': if (*p=='<') { t << "$<$"; p++; } else if (*p=='>') - { t << "$>$"; p++; } - else + { t << "$>$"; p++; } + else { t << "$\\backslash$"; } - break; + break; case '"': { t << "\\char`\\\"{}"; } break; - default: + default: t << (char)c; #if 0 { // Some languages use wide characters if (isJapanese || isKorean || isChinese || isSerbian) - { - if (c>=128) + { + if (c>=128) { t << (char)c; - if (*p) + if (*p) { c = *p++; t << (char)c; @@ -6139,8 +6148,8 @@ else // ascii char => see if we can insert a hypenation hint { if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; - t << (char)c; - } + t << (char)c; + } } else if (isCzech || isRussian || isUkrainian || isSlovene) { @@ -6172,7 +6181,7 @@ latin2ToLatex(t,c); } else - { + { // see if we can insert an hyphenation hint if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; t << (char)c; @@ -6185,7 +6194,7 @@ latin1ToLatex(t,c); } else - { + { // see if we can insert an hyphenation hint if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; t << (char)c; @@ -6298,11 +6307,11 @@ int p=0,i,l; while ((i=wordExp.match(s,p,&l))!=-1) { - if (s.mid(i,l)==word) + if (s.mid(i,l)==word) { - if (i>0 && isspace(s.at(i-1))) + if (i>0 && isspace(s.at(i-1))) i--,l++; - else if (i+l<(int)s.length() && isspace(s.at(i+l))) + else if (i+l<(int)s.length() && isspace(s.at(i+l))) l++; s = s.left(i)+s.mid(i+l); // remove word + spacing return TRUE; @@ -6377,7 +6386,7 @@ const char *langName; const char *parserName; SrcLangExt parserId; -} +} g_lang2extMap[] = { // language parser parser option @@ -6393,6 +6402,7 @@ { "python", "python", SrcLangExt_Python }, { "fortran", "fortran", SrcLangExt_F90 }, { "vhdl", "vhdl", SrcLangExt_VHDL }, + { "actionscript", "c", SrcLangExt_ActionScript}, { 0, 0, (SrcLangExt)0 } }; @@ -6434,15 +6444,15 @@ void initDefaultExtensionMapping() { g_extLookup.setAutoDelete(TRUE); - updateLanguageMapping(".idl", "idl"); - updateLanguageMapping(".ddl", "idl"); - updateLanguageMapping(".odl", "idl"); + updateLanguageMapping(".idl", "idl"); + updateLanguageMapping(".ddl", "idl"); + updateLanguageMapping(".odl", "idl"); updateLanguageMapping(".java", "java"); - updateLanguageMapping(".as", "javascript"); + updateLanguageMapping(".as", "javascript"); updateLanguageMapping(".js", "javascript"); updateLanguageMapping(".cs", "c#"); updateLanguageMapping(".d", "d"); - updateLanguageMapping(".php", "php"); + updateLanguageMapping(".php", "php"); updateLanguageMapping(".php4", "php"); updateLanguageMapping(".php5", "php"); updateLanguageMapping(".inc", "php"); @@ -6455,6 +6465,7 @@ updateLanguageMapping(".f90", "fortran"); updateLanguageMapping(".vhd", "vhdl"); updateLanguageMapping(".vhdl", "vhdl"); + updateLanguageMapping(".as", "actionscript"); } SrcLangExt getLanguageFromFileName(const QCString fileName) @@ -6468,7 +6479,7 @@ int *pVal=g_extLookup.find(extStr); if (pVal) // listed extension { - return (SrcLangExt)*pVal; + return (SrcLangExt)*pVal; } } } @@ -6564,9 +6575,9 @@ { for (i=80;i<100;i++) // search for nice truncation point { - if (result.at(i).isSpace() || - result.at(i)==',' || - result.at(i)=='.' || + if (result.at(i).isSpace() || + result.at(i)==',' || + result.at(i)=='.' || result.at(i)=='?') { break; @@ -6690,7 +6701,7 @@ int count=1; int l = argList.length(); int i; - for (i=0;i'%s'\n",args.data(),args.mid(pos+1,i-pos-1).data()); return args.mid(pos+1,i-pos-1); @@ -6743,7 +6754,7 @@ void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al) { if (al==0) return; - ol.startConstraintList(theTranslator->trTypeConstraints()); + ol.startConstraintList(theTranslator->trTypeConstraints()); ArgumentListIterator ali(*al); Argument *a; for (;(a=ali.current());++ali) @@ -6775,7 +6786,7 @@ static char cmd[40960]; char *p = cmd; p += sprintf(p,"/usr/bin/atos -p %d ", (int)getpid()); - for (int x = 0; x < frameCount; x++) + for (int x = 0; x < frameCount; x++) { p += sprintf(p,"%p ", backtraceFrames[x]); } Index: src/doxygen.cpp =================================================================== --- src/doxygen.cpp (revision 661) +++ src/doxygen.cpp (working copy) @@ -1802,7 +1802,7 @@ md->typeString(),memName,md->argsString(), md->excpString(),root->protection,root->virt, md->isStatic(),Member,md->memberType(), - templAl.pointer(),al.pointer() + templAl.pointer(),al.pointer(), root->declArgList,root->suffixSpacer,root->suffixType ); } newMd->setMemberClass(cd); @@ -1972,7 +1972,7 @@ root->fileName,root->startLine, root->type,name,root->args,0, prot,Normal,root->stat,related, - mtype,0,0); + mtype,0,0,0,root->suffixSpacer, root->suffixType); md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); // also sets outer scope (i.e. getOuterScope()) //md->setDefFile(root->fileName); @@ -2154,7 +2154,7 @@ root->fileName,root->startLine, root->type,name,root->args,0, Public, Normal,root->stat,Member, - mtype,0,0); + mtype,0,0,0,root->suffixSpacer,root->suffixType); md->setTagInfo(rootNav->tagInfo()); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); @@ -2676,7 +2676,9 @@ root->stat && root->relatesType != MemberOf, root->relates.isEmpty() ? Member : root->relatesType == MemberOf ? Foreign : Related, - mtype,root->tArgLists ? root->tArgLists->last() : 0,root->argList); + mtype,root->tArgLists ? root->tArgLists->last() : 0,root->argList, + root->declArgList, root->suffixSpacer, root->suffixType); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setDocumentation(root->doc,root->docFile,root->docLine); @@ -3019,7 +3021,8 @@ root->fileName,root->startLine, root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,Member, - MemberDef::Function,tArgList,root->argList); + MemberDef::Function,tArgList,root->argList, root->declArgList, + root->suffixSpacer, root->suffixType); md->setTagInfo(rootNav->tagInfo()); //md->setDefFile(root->fileName); @@ -5654,7 +5657,7 @@ root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,Member, - mtype,tArgList,root->argList); + mtype,tArgList,root->argList, root->declArgList,root->suffixSpacer,root->suffixType); //printf("new specialized member %s args=`%s'\n",md->name().data(),funcArgs.data()); md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); @@ -5718,7 +5721,7 @@ root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,Related, - mtype,tArgList,root->argList); + mtype,tArgList,root->argList,root->declArgList,root->suffixSpacer, root->suffixType); md->setTagInfo(rootNav->tagInfo()); md->setTypeConstraints(root->typeConstr); md->setMemberClass(cd); @@ -5851,7 +5854,7 @@ isMemberOf ? Foreign : isRelated ? Related : Member, mtype, (root->tArgLists ? root->tArgLists->last() : 0), - funcArgs.isEmpty() ? 0 : root->argList); + funcArgs.isEmpty() ? 0 : root->argList, root->declArgList, root->suffixSpacer, root->suffixType); // // we still have the problem that // MemberDef::writeDocumentation() in memberdef.cpp @@ -5975,7 +5978,7 @@ root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,Member, - MemberDef::Function,0,root->argList); + MemberDef::Function,0,root->argList, root->declArgList,root->suffixSpacer, root->suffixType); md->setTagInfo(rootNav->tagInfo()); md->makeImplementationDetail(); md->setMemberClass(cd); @@ -6303,7 +6306,7 @@ root->protection,Normal,FALSE, isMemberOf ? Foreign : isRelated ? Related : Member, MemberDef::Enumeration, - 0,0); + 0,0,0,root->suffixSpacer, root->suffixType); md->setTagInfo(rootNav->tagInfo()); if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd); md->setBodySegment(root->bodyLine,root->endBodyLine); @@ -7501,7 +7504,8 @@ { MemberDef *md=new MemberDef("",1, "#define",root->name,root->args,0, - Public,Normal,FALSE,Member,MemberDef::Define,0,0); + Public,Normal,FALSE,Member,MemberDef::Define,0,0,0, + root->suffixSpacer,root->suffixType); md->setTagInfo(rootNav->tagInfo()); //printf("Searching for `%s' fd=%p\n",filePathName.data(),fd); md->setFileDef(rootNav->parent()->fileDef()); Index: src/util.h =================================================================== --- src/util.h (revision 661) +++ src/util.h (working copy) @@ -95,7 +95,8 @@ SrcLangExt_JS = 0x0400, SrcLangExt_Python = 0x0800, SrcLangExt_F90 = 0x1000, - SrcLangExt_VHDL = 0x2000 + SrcLangExt_VHDL = 0x2000, + SrcLangExt_ActionScript = 0x4000 }; //-------------------------------------------------------------------- Index: src/pre.l =================================================================== --- src/pre.l (revision 661) +++ src/pre.l (working copy) @@ -1042,7 +1042,7 @@ MemberDef *md=new MemberDef( g_yyFileName,g_yyLineNr, "#define",g_defName,g_defArgsStr,0, - Public,Normal,FALSE,Member,MemberDef::Define,0,0); + Public,Normal,FALSE,Member,MemberDef::Define,0,0,0,0,0); if (!g_defArgsStr.isEmpty()) { ArgumentList *argList = new ArgumentList; Index: src/entry.cpp =================================================================== --- src/entry.cpp (revision 661) +++ src/entry.cpp (working copy) @@ -63,6 +63,7 @@ anchors = new QList; // Doxygen::sectionDict takes ownership of the items! argList = new ArgumentList; argList->setAutoDelete(TRUE); + declArgList = 0; //printf("Entry::Entry() tArgList=0\n"); tArgLists = 0; typeConstr = 0; @@ -75,6 +76,31 @@ reset(); } + +static ArgumentList * copyArgList(const ArgumentList *argList) +{ + + if (NULL == argList) + return NULL; + + ArgumentList *newArgList; + newArgList = new ArgumentList; + newArgList->setAutoDelete(TRUE); + + QListIterator ali(*argList); + Argument *a; + for (;(a=ali.current());++ali) + { + newArgList->append(new Argument(*a)); + } + newArgList->constSpecifier = argList->constSpecifier; + newArgList->volatileSpecifier = argList->volatileSpecifier; + newArgList->pureSpecifier = argList->pureSpecifier; + + return newArgList; +} + + Entry::Entry(const Entry &e) { //printf("Entry::Entry(%p):copy\n",this); @@ -129,12 +155,13 @@ groups = new QList; groups->setAutoDelete(TRUE); anchors = new QList; - argList = new ArgumentList; - argList->setAutoDelete(TRUE); + typeConstr = new ArgumentList; typeConstr->setAutoDelete(TRUE); tArgLists = 0; groupDocType = e.groupDocType; + suffixSpacer = e.suffixSpacer.copy(); + suffixType = e.suffixType.copy(); // deep copy of the child entry list QListIterator eli(*e.m_sublist); @@ -167,18 +194,13 @@ anchors->append(new SectionInfo(*s)); } - // deep copy argument list - QListIterator ali(*e.argList); - Argument *a; - for (;(a=ali.current());++ali) - { - argList->append(new Argument(*a)); - } - argList->constSpecifier = e.argList->constSpecifier; - argList->volatileSpecifier = e.argList->volatileSpecifier; - argList->pureSpecifier = e.argList->pureSpecifier; + // deep copy argument lists + argList = copyArgList(e.argList); + declArgList = copyArgList(e.declArgList); + // deep copy type contraint list + Argument *a; if (e.typeConstr) { QListIterator tcli(*e.typeConstr); @@ -461,3 +483,24 @@ m_noLoad=TRUE; } + + + +ArgumentList::ArgumentList(const ArgumentList &toCopy) +{ + setAutoDelete(TRUE); + ArgumentListIterator ali(toCopy); + Argument *a; + for (;(a=ali.current());++ali) + { + //printf("copy argument %s (doc=%s)\n",a->name.data(),a->docs.data()); + append(new Argument(*a)); + } + constSpecifier = toCopy.constSpecifier; + volatileSpecifier = toCopy.volatileSpecifier; + pureSpecifier = toCopy.pureSpecifier; + +} + + + Index: src/outputlist.h =================================================================== --- src/outputlist.h (revision 661) +++ src/outputlist.h (working copy) @@ -381,6 +381,12 @@ void endParameterList() { forall(&OutputGenerator::endParameterList); } + void startSuffix() + { forall(&OutputGenerator::startSuffix); } + + void endSuffix() + { forall(&OutputGenerator::endSuffix); } + void startConstraintList(const char *header) { forall(&OutputGenerator::startConstraintList,header); } void startConstraintParam() Index: src/htmlgen.cpp =================================================================== --- src/htmlgen.cpp (revision 661) +++ src/htmlgen.cpp (working copy) @@ -1464,20 +1464,35 @@ t << " "; if (closeBracket) t << ")"; t << "" << endl; - t << " "; + t << ""; } } else - { + { t << "" << endl; t << " " << endl; } + } + +void HtmlGenerator::startSuffix() +{ + DBG_HTML(t << "" << endl;) + t << ""; +} + + +void HtmlGenerator::endSuffix() +{ + DBG_HTML(t << "" << endl;) + t << ""; +} + void HtmlGenerator::endParameterList() { DBG_HTML(t << "" << endl;) - t << "" << endl; + t << "" << endl; t << " " << endl; } Index: src/outputgen.h =================================================================== --- src/outputgen.h (revision 661) +++ src/outputgen.h (working copy) @@ -384,6 +384,9 @@ virtual void startParameterList(bool) = 0; virtual void endParameterList() = 0; + virtual void startSuffix(){}; + virtual void endSuffix(){}; + virtual void startConstraintList(const char *) = 0; virtual void startConstraintParam() = 0; virtual void endConstraintParam() = 0; Index: src/scanner.l =================================================================== --- src/scanner.l (revision 661) +++ src/scanner.l (working copy) @@ -1,12 +1,12 @@ /***************************************************************************** * - * * + * * Copyright (C) 1997-2008 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -14,7 +14,7 @@ * input used in their production; they are not affected by this license. * */ - + %{ /* @@ -31,7 +31,7 @@ #include #include #include - + #include "scanner.h" #include "entry.h" #include "message.h" @@ -85,8 +85,8 @@ static Entry* firstTypedefEntry = 0 ; static Entry* memspecEntry = 0 ; static int yyLineNr = 1 ; -static int anonCount = 0 ; -static int anonNSCount = 0 ; +static int anonCount = 0 ; +static int anonNSCount = 0 ; static QCString yyFileName; static MethodTypes mtype; static bool gstat; @@ -115,7 +115,9 @@ static bool insideObjC = FALSE; //!< processing Objective C code? static bool insideCli = FALSE; //!< processing C++/CLI code? static bool insideJS = FALSE; //!< processing JavaScript code? +static bool insideActionScript = FALSE; + static bool insideCppQuote = FALSE; static bool insideProtocolList = FALSE; @@ -208,7 +210,7 @@ static void initEntry() { - if (insideJava) + if (insideJava) { protection = (current_root->spec & Entry::Interface) ? Public : Package; } @@ -234,7 +236,7 @@ //{ // /* remove auto group name from current entry and discard it */ // Grouping *g = current->groups->first(); -// int i=0; +// int i=0; // while (g) // { // if (g->pri <= Grouping::GROUPING_AUTO_DEF) @@ -250,7 +252,7 @@ // if ( newgroup ) // { // current->groups->append(new Grouping(*newgroup, pri)); -// } +// } //} // //static int newMemberGroupId() @@ -274,14 +276,14 @@ static void addType( Entry* current ) { uint tl=current->type.length(); - if( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') + if( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') { current->type += ' ' ; } current->type += current->name ; current->name.resize(0) ; tl=current->type.length(); - if( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') + if( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') { current->type += ' ' ; } @@ -328,11 +330,13 @@ SrcLangExt langExt = getLanguageFromFileName(fileName); insideIDL = langExt==SrcLangExt_IDL; insideJava = langExt==SrcLangExt_Java; - insideCS = langExt==SrcLangExt_CSharp; + insideCS = langExt==SrcLangExt_CSharp; insideD = langExt==SrcLangExt_D; insidePHP = langExt==SrcLangExt_PHP; insideObjC = langExt==SrcLangExt_ObjC; insideJS = langExt==SrcLangExt_JS; + insideActionScript = langExt == (SrcLangExt_ActionScript); + if ( insidePHP ) { useOverrideCommands = TRUE; @@ -370,8 +374,8 @@ { dstAl->append(new Argument(*a)); //printf("appending argument %s %s\n",a->type.data(),a->name.data()); - } - current->tArgLists->insert(0,dstAl); + } + current->tArgLists->insert(0,dstAl); } } } @@ -404,7 +408,7 @@ { static QRegExp re("([^)]*)"); int bi1 = current->args.findRev(re); - int bi2 = bi1!=-1 ? current->args.findRev(re,bi1-1) : -1; + int bi2 = bi1!=-1 ? current->args.findRev(re,bi1-1) : -1; char c; if (bi1!=-1 && bi2!=-1) // found something like "int (*func)(int arg)" { @@ -556,7 +560,7 @@ CMD ("\\"|"@") SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"xrefitem"|"ingroup"|"callgraph"|"callergraph"|"latexonly"|"htmlonly"|"xmlonly"|"{"|"verbatim"|"dotfile"|"dot"|"defgroup"|"addtogroup"|"weakgroup"|"class"|"namespace"|"union"|"struct"|"fn"|"var"|"details"|"typedef"|"def"|"overload")|("<"{PRE}">") BN [ \t\n\r] -BL [ \t\r]*"\n" +BL [ \t\r]*"\n" B [ \t] BS ^(({B}*"//")?)(({B}*"*"+)?){B}* FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+] @@ -695,6 +699,12 @@ %x IDLProp %x IDLPropName +%x ASMethod +%x ASMethodParam +%x ASMethodParamType +%x ASMethodReturnType +%x ASVar + /** Prototype scanner states */ %x Prototype @@ -714,7 +724,7 @@ "{" { curlyCount=0; needsSemi = TRUE; - BEGIN(SkipCurlyBlock); + BEGIN(SkipCurlyBlock); } "(" { roundCount=0; @@ -730,9 +740,9 @@ BEGIN( NextSemi ) ; } "{" { - ++curlyCount ; + ++curlyCount ; } -"}" { +"}" { if( curlyCount ) { --curlyCount ; @@ -758,14 +768,218 @@ lastStringContext=NextSemi; BEGIN(SkipString); } -[;,] { +[;,] { unput(*yytext); - BEGIN( FindMembers ); + BEGIN( FindMembers ); } [;,] { unput(*yytext); BEGIN( FindMembers ); } +{BN}*"var "{B}* { + + if (!insideActionScript) + { + REJECT; + } + else + { + lineCount(); + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + current->section = Entry::VARIABLE_SEC; + current->proto = true; + //current->protection = protection = Public ; + if (QCString(yytext).stripWhiteSpace()[0] != 'f') + { + if (QCString(yytext).contains("private",false) > 0) + { + current->protection = protection = Private ; } + if (QCString(yytext).contains("protected",false) > 0) + { + current->protection = protection = Protected ; + } + } + current->mtype = mtype = Method; + current->type.resize(0); + current->name.resize(0); + current->args.resize(0); + current->argList->clear(); + BEGIN( ASVar ); + } +} +{B}*{ID}{B}* { + current->name = QCString(yytext).stripWhiteSpace(); + current->type = "var"; +} +{BN}*":"{BN}*({ID}".")*{ID} { + + current->suffixType = QCString(yytext).right(QCString(yytext).size() - 2).stripWhiteSpace(); + current->suffixSpacer = QCString(":"); + BEGIN(FindMembers); +} + +";" { +//an untyped variable + unput(';'); + BEGIN(FindMembers); +} + + +{B}*"function"{B}* { + if (!insideActionScript) + { + REJECT; + } + else + { + //printf("*** insideActionScript\n"); + lineCount(); + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + current->section = Entry::FUNCTION_SEC; + current->proto = true; + + + + current->mtype = mtype = Method; + current->type.resize(0); + current->type = QCString("Void"); + current->name.resize(0); + current->args.resize(0); + current->argList->clear(); + + + BEGIN( ASMethod ); + + } + } + +{B}*"get"{B}+{ID}{B}* { //A getter function + + //remove the "get" from the start of the name + current->name = QCString(yytext).right(QCString(yytext).size() - 4).stripWhiteSpace(); + current->type = QCString("function get"); + +} + + +{B}*"set"{B}+{ID}{B}* { //A setter function + + //remove the "set" from the start of the name + current->name = QCString(yytext).right(QCString(yytext).size() - 4).stripWhiteSpace(); + current->type = QCString("function set"); +} + + +{B}*{ID}{B}* { //Method Name + current->name = QCString(yytext).stripWhiteSpace(); + current->type = QCString("function"); + + //printf("*** ASMethod %s\n", current->name.data()); + } +"("{B}* { //Start of parameter + BEGIN(ASMethodParam); + } + +{ID} { // parameter name + Argument *a = new Argument; + a->name = QCString(yytext); + //printf("*** ASMethodParam %s\n", a->name.data()); + current->argList->append(a); + BEGIN(ASMethodParamType); + } + + +{BN}*", "{BN}* { // no type, there's another param + //QCString text = QCString(yytext); + // Argument *a = current->argList->getLast(); + BEGIN(ASMethodParam); + } + +{B}*")"{B}* { //no more parameters + BEGIN(ASMethodReturnType); + } + +{B}*")"{B}* { // no type, end of parameter list + BEGIN(ASMethodReturnType); + } + + +{BN}*":"{BN}*({ID}".")*{ID} { //param type + + Argument *a = current->argList->getLast(); + a->type = ""; + a->suffixType = QCString(yytext).stripWhiteSpace(); + + if (QCString(a->suffixType)[0] == ':') + { + a->suffixType = QCString(a->suffixType).right(QCString(a->suffixType).size() - 2); + } + + a->suffixSpacer = QCString(":"); + BEGIN(ASMethodParam); + } + +{BN}*", "{BN}* { //other param + QCString text = QCString(yytext); + // Argument *a = current->argList->getLast(); + BEGIN(ASMethodParam); + } + +{BN}*":"{B}*({ID}".")*{ID} { + current->suffixType = QCString(yytext).right(QCString(yytext).size() - 2).stripWhiteSpace(); + current->suffixSpacer = QCString(":"); + if (QCString(current->suffixType)[0] == ':') + { + current->suffixType = QCString(current->suffixType).right(QCString(current->suffixType).size() - 2); + } + } + +{BN}*"{" { + + current->args = argListToString(current->argList); + + current->declArgList = new ArgumentList(*(current->argList)); + current->declArgList->setAutoDelete(FALSE); + + unput('{'); + + BEGIN( Function ); + } + + +{BN}*";" { + + current->args = argListToString(current->argList); + + current->declArgList = new ArgumentList(*(current->argList)); + current->declArgList->setAutoDelete(FALSE); + + unput(';'); + + BEGIN( Function ); + } + + +{B}*"intrinsic class"{BN}+ { + lineCount(); + isTypedef=FALSE; + current->section = Entry::CLASS_SEC; + current->protection = protection = Public ; + addType( current ) ; + current->type += " intrinsic " ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + BEGIN( CompoundName ); + } + + + + "{B}*("properties"){BN}*":"{BN}* { // IDL or Borland C++ builder property +{B}*("properties"){BN}*":"{BN}* { // IDL or Borland C++ builder property current->mtype = mtype = Property; current->protection = protection = Public ; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; @@ -810,18 +1024,18 @@ {B}*"k_dcop"{BN}*":"{BN}* { current->mtype = mtype = DCOP; current->protection = protection = Public ; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; } {B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* { current->mtype = mtype = Signal; - + current->protection = protection = Public ; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; @@ -830,8 +1044,8 @@ {B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* { current->protection = protection = Public ; current->mtype = mtype = Slot; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount(); @@ -840,8 +1054,8 @@ {B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* { current->protection = protection = Protected ; current->mtype = mtype = Slot; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount(); @@ -850,17 +1064,17 @@ {B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* { current->protection = protection = Private ; current->mtype = mtype = Slot; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount(); } -{B}*("public"|"methods"|"__published"){BN}*":"{BN}* { +{B}*("public"|"methods"|"__published"){BN}*":"{BN}* { current->protection = protection = Public ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; @@ -868,31 +1082,31 @@ {B}*"internal"{BN}*":"{BN}* { // for now treat C++/CLI's internal as package... current->protection = protection = Package ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; } -{B}*"protected"{BN}*":"{BN}* { +{B}*"protected"{BN}*":"{BN}* { current->protection = protection = Protected ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; } -{B}*"private"{BN}*":"{BN}* { +{B}*"private"{BN}*":"{BN}* { current->protection = protection = Private ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; } -{B}*"event"{BN}+ { +{B}*"event"{BN}+ { if (insideCli) { // C++/CLI event @@ -961,13 +1175,13 @@ . { current->name+=yytext; } -{B}*"property"{BN}+ { +{B}*"property"{BN}+ { if (!current->type.isEmpty()) { REJECT; } else - { + { current->mtype = mtype = Property; lineCount(); } @@ -975,8 +1189,8 @@ {B}*"@private"{BN}+ { current->protection = protection = Private ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; @@ -984,8 +1198,8 @@ {B}*"@protected"{BN}+ { current->protection = protection = Protected ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; @@ -993,14 +1207,14 @@ {B}*"@public"{BN}+ { current->protection = protection = Public ; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); lineCount() ; } [\-+]{BN}* { - if (!insideObjC) + if (!insideObjC) { REJECT; } @@ -1016,8 +1230,8 @@ current->virt = Virtual; current->stat=yytext[0]=='+'; current->mtype = mtype = Method; - current->type.resize(0); - current->name.resize(0); + current->type.resize(0); + current->name.resize(0); current->args.resize(0); current->argList->clear(); BEGIN( ObjCMethod ); @@ -1078,7 +1292,7 @@ current->argList->append(a); } /* -":" { +":" { current->name += ':'; } */ @@ -1138,10 +1352,10 @@ REJECT; } } -"getter="{ID} { +"getter="{ID} { current->read = yytext+7; } -"setter="{ID} { +"setter="{ID} { current->write = yytext+7; } "readonly" { @@ -1230,8 +1444,8 @@ current->virt = Virtual; lineCount(); } -{B}*"abstract"{BN}+ { - if (!insidePHP) +{B}*"abstract"{BN}+ { + if (!insidePHP) { current->type += " abstract "; current->virt = Pure; @@ -1243,21 +1457,21 @@ lineCount(); } {B}*"inline"{BN}+ { current->spec|=Entry::Inline; - lineCount(); + lineCount(); } {B}*"mutable"{BN}+ { current->spec|=Entry::Mutable; - lineCount(); + lineCount(); } {B}*"explicit"{BN}+ { current->spec|=Entry::Explicit; - lineCount(); + lineCount(); } {B}*"@required"{BN}+ { // Objective C 2.0 protocol required section current->spec=(current->spec & ~Entry::Optional) | Entry::Required; - lineCount(); + lineCount(); } {B}*"@optional"{BN}+ { // Objective C 2.0 protocol optional section current->spec=(current->spec & ~Entry::Required) | Entry::Optional; - lineCount(); + lineCount(); } /* {B}*"import"{BN}+ { // IDL import keyword @@ -1265,7 +1479,7 @@ } */ {B}*"typename"{BN}+ { lineCount(); } -{B}*"namespace"{BN}*/[^a-z_A-Z0-9] { +{B}*"namespace"{BN}*/[^a-z_A-Z0-9] { isTypedef=FALSE; current->section = Entry::NAMESPACE_SEC; current->type = "namespace" ; @@ -1273,9 +1487,9 @@ current->startLine = yyLineNr; current->bodyLine = yyLineNr; lineCount(); - BEGIN( CompoundName ); + BEGIN( CompoundName ); } -{B}*"module"{BN}+ { +{B}*"module"{BN}+ { lineCount(); if (insideIDL) { @@ -1285,7 +1499,7 @@ current->fileName = yyFileName; current->startLine = yyLineNr; current->bodyLine = yyLineNr; - BEGIN( CompoundName ); + BEGIN( CompoundName ); } else if (insideD) { @@ -1298,7 +1512,7 @@ current->name = QCString(yytext).stripWhiteSpace(); } } -{B}*"library"{BN}+ { +{B}*"library"{BN}+ { lineCount(); if (insideIDL) { @@ -1308,7 +1522,7 @@ current->fileName = yyFileName; current->startLine = yyLineNr; current->bodyLine = yyLineNr; - BEGIN( CompoundName ); + BEGIN( CompoundName ); } else { @@ -1318,7 +1532,7 @@ } {B}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba IDL/Java interface lineCount(); - if (insideIDL || insideJava || insideCS || insideD || insidePHP) + if (insideIDL || insideJava || insideActionScript || insideCS || insideD || insidePHP) { isTypedef=FALSE; current->section = Entry::CLASS_SEC; @@ -1391,7 +1605,7 @@ } "@class" | // for Objective C class declarations {B}*{TYPEDEFPREFIX}"class{" | -{B}*{TYPEDEFPREFIX}"class"{BN}+ { +{B}*{TYPEDEFPREFIX}"class"{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::CLASS_SEC; addType( current ) ; @@ -1471,8 +1685,8 @@ lineCount(); } } -{B}*{TYPEDEFPREFIX}"struct{" | -{B}*{TYPEDEFPREFIX}"struct"/{BN}+ { +{B}*{TYPEDEFPREFIX}"struct{" | +{B}*{TYPEDEFPREFIX}"struct"/{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::CLASS_SEC ; current->spec = Entry::Struct; @@ -1528,7 +1742,7 @@ BEGIN( CompoundName ) ; } {B}*{TYPEDEFPREFIX}"union{" | -{B}*{TYPEDEFPREFIX}"union"{BN}+ { +{B}*{TYPEDEFPREFIX}"union"{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::CLASS_SEC; current->spec = Entry::Union; @@ -1569,7 +1783,7 @@ unput(';'); BEGIN( FindMembers ) ; } -[^(] { +[^(] { lineCount(); current->name += *yytext ; } @@ -1597,7 +1811,7 @@ BEGIN( ReadTempArgs ); } "namespace"{BN}+/{ID}{BN}*"=" { // namespace alias - lineCount(); + lineCount(); BEGIN( NSAliasName ); } {ID} { @@ -1625,7 +1839,7 @@ lineCount(); QCString scope=yytext; current->name=removeRedundantWhiteSpace(substitute(scope.left(scope.length()-2),".","::")); - current->fileName = yyFileName; + current->fileName = yyFileName; current->section=Entry::USINGDIR_SEC; current_root->addSubEntry(current); current = new Entry ; @@ -1636,8 +1850,8 @@ lineCount(); QCString scope=yytext; current->name=removeRedundantWhiteSpace(substitute(scope,".","::")); - current->fileName = yyFileName; - if (insideD) + current->fileName = yyFileName; + if (insideD) { current->section=Entry::USINGDIR_SEC; } @@ -1651,26 +1865,26 @@ initEntry(); BEGIN(Using); } -"using"{BN}+ { - current->startLine=yyLineNr; - lineCount(); - BEGIN(Using); +"using"{BN}+ { + current->startLine=yyLineNr; + lineCount(); + BEGIN(Using); } "namespace"{BN}+ { lineCount(); BEGIN(UsingDirective); } {ID}{BN}*({BN}*("::"|"."){BN}*{ID})* { lineCount(); current->name=yytext; - current->fileName = yyFileName; + current->fileName = yyFileName; current->section=Entry::USINGDECL_SEC; current_root->addSubEntry(current); current = new Entry ; - if (insideCS) /* Hack: in C# a using declaration and + if (insideCS) /* Hack: in C# a using declaration and directive have the same syntax, so we also add it as a using directive here */ { current->name=yytext; - current->fileName = yyFileName; + current->fileName = yyFileName; current->startLine = yyLineNr; current->section=Entry::USINGDIR_SEC; current_root->addSubEntry(current); @@ -1680,7 +1894,7 @@ BEGIN(Using); } {SCOPENAME} { current->name=removeRedundantWhiteSpace(yytext); - current->fileName = yyFileName; + current->fileName = yyFileName; current->section=Entry::USINGDIR_SEC; current_root->addSubEntry(current); current = new Entry ; @@ -1719,12 +1933,12 @@ } "<<" { current->name+=yytext; - // *currentTemplateSpec+=yytext; + // *currentTemplateSpec+=yytext; } -"<" { +"<" { current->name+='<'; - // *currentTemplateSpec+='<'; - sharpCount++; + // *currentTemplateSpec+='<'; + sharpCount++; } ">>" { if (insideJava || insideCS || insideCli) @@ -1737,18 +1951,18 @@ { current->name+=yytext; } - // *currentTemplateSpec+=yytext; + // *currentTemplateSpec+=yytext; } ">" { current->name+='>'; // *currentTemplateSpec+='>'; if (--sharpCount<=0) - { + { //printf("Found %s\n",current->name.data()); BEGIN(FindMembers); } } -">"{BN}*"(" { +">"{BN}*"(" { lineCount(); current->name+='>'; // *currentTemplateSpec+='>'; @@ -1776,9 +1990,9 @@ BEGIN(FindMemberName); } } -. { +. { current->name+=*yytext; - // *currentTemplateSpec+=*yytext; + // *currentTemplateSpec+=*yytext; } "define"{BN}*"("{BN}*["'] { if (insidePHP) @@ -1849,7 +2063,7 @@ { BEGIN(CppQuote); } - else if ((insideIDL || insideJava || insideD) && yyleng==6 && strcmp(yytext,"import")==0) + else if ((insideIDL || insideJava || insideActionScript || insideD) && yyleng==6 && strcmp(yytext,"import")==0) { if (insideIDL) BEGIN(NextSemi); @@ -1870,11 +2084,11 @@ insideTryBlock=FALSE; BEGIN(TryFunctionBlock); } - else if (insideJS && strcmp(yytext,"var")==0) + else if ((insideJS || insideActionScript) && strcmp(yytext,"var")==0) { // javascript variable current->type="var"; } - else if (insideJS && strcmp(yytext,"function")==0) + else if ((insideJS || insideActionScript )&& strcmp(yytext,"function")==0) { // javascript function current->type="function"; } @@ -1884,7 +2098,7 @@ { addType( current ) ; } - bool javaLike = insideJava || insideCS || insideD || insidePHP || insideJS; + bool javaLike = insideJava || insideActionScript || insideCS || insideD || insidePHP || insideJS; if (javaLike && strcmp(yytext,"public")==0) { current->protection = Public; @@ -1955,7 +2169,7 @@ [0-9]{ID} { // some number where we did not expect one } "." { - if (insideJava || insideCS || insideD) + if (insideJava || insideActionScript || insideCS || insideD) { current->name+="."; } @@ -1972,14 +2186,14 @@ \n { yyLineNr++; } . \n { yyLineNr++; } -"{" { +"{" { curlyCount=0; lastCurlyContext = TryFunctionBlockEnd ; BEGIN( SkipCurly ); } . "catch" { BEGIN(TryFunctionBlock); } -. { unput(*yytext); +. { unput(*yytext); BEGIN( FindMembers ); } ")" { @@ -2083,7 +2297,7 @@ BEGIN(SkipString); } } -. +. {ID}["']{BN}*","{BN}* { current->name = yytext; current->name = current->name.stripWhiteSpace(); @@ -2101,15 +2315,15 @@ if (insideCli) { addType( current ); - current->name = yytext ; + current->name = yytext ; } else { REJECT; } } -[*&]+ { - current->name += yytext ; +[*&]+ { + current->name += yytext ; addType( current ); } ";"{BN}*("/**"|"//!"|"/*!"|"///")"<" { @@ -2177,7 +2391,7 @@ BEGIN( DocBlock ); } } - + ("//"([!/]?){B}*{CMD}"{")|("/*"([!*]?){B}*{CMD}"{") { //handleGroupStartCommand(current->name); if (previous && previous->section==Entry::GROUPDOC_SEC) @@ -2244,14 +2458,14 @@ lastRoundContext=YY_START; pCopyRoundGString=¤t->initializer; roundCount=0; - current->initializer+=*yytext; + current->initializer+=*yytext; BEGIN(GCopyRound); } "{" { lastCurlyContext=YY_START; pCopyCurlyGString=¤t->initializer; curlyCount=0; - current->initializer+=*yytext; + current->initializer+=*yytext; BEGIN(GCopyCurly); } [;,] { @@ -2268,7 +2482,7 @@ } else { - current->initializer+=*yytext; + current->initializer+=*yytext; } } \" { @@ -2279,59 +2493,59 @@ else { lastStringContext=YY_START; - current->initializer+=*yytext; + current->initializer+=*yytext; pCopyQuotedGString=¤t->initializer; BEGIN(CopyGString); } } "->" { - current->initializer+=yytext; + current->initializer+=yytext; } "<<" { - current->initializer+=yytext; + current->initializer+=yytext; } ">>" { - current->initializer+=yytext; + current->initializer+=yytext; } [<\[{(] { initBracketCount++; - current->initializer+=*yytext; + current->initializer+=*yytext; } [>\]})] { initBracketCount--; - current->initializer+=*yytext; + current->initializer+=*yytext; } -\' { +\' { if (insidePHP) { - current->initializer+=yytext; + current->initializer+=yytext; pCopyQuotedGString = ¤t->initializer; lastStringContext=YY_START; BEGIN(CopyPHPGString); } else { - current->initializer+=yytext; + current->initializer+=yytext; } } -{CHARLIT} { - if (insidePHP) +{CHARLIT} { + if (insidePHP) { REJECT; } else - { - current->initializer+=yytext; + { + current->initializer+=yytext; } - } + } \n { current->initializer+=*yytext; yyLineNr++; } -"@\"" { +"@\"" { //printf("insideCS=%d\n",insideCS); current->initializer+=yytext; - if (!insideCS && !insideObjC) + if (!insideCS && !insideObjC) { REJECT; } @@ -2366,21 +2580,21 @@ else current->initializer+=yytext; } -. { - current->initializer+=*yytext; +. { + current->initializer+=*yytext; } /* generic quoted string copy rules */ \\. { *pCopyQuotedString+=yytext; } -\" { +\" { *pCopyQuotedString+=*yytext; - BEGIN( lastStringContext ); + BEGIN( lastStringContext ); } -\' { +\' { *pCopyQuotedString+=*yytext; - BEGIN( lastStringContext ); + BEGIN( lastStringContext ); } "/*"|"*/"|"//" { *pCopyQuotedString+=yytext; @@ -2397,13 +2611,13 @@ \\. { *pCopyQuotedGString+=yytext; } -\" { +\" { *pCopyQuotedGString+=*yytext; - BEGIN( lastStringContext ); + BEGIN( lastStringContext ); } -\' { +\' { *pCopyQuotedGString+=*yytext; - BEGIN( lastStringContext ); + BEGIN( lastStringContext ); } "/*"|"*/"|"//" { *pCopyQuotedGString+=yytext; @@ -2439,7 +2653,7 @@ \' { if (insidePHP) { - current->initializer+=yytext; + current->initializer+=yytext; pCopyQuotedString = pCopyRoundString; lastStringContext=YY_START; BEGIN(CopyPHPString); @@ -2449,14 +2663,14 @@ *pCopyRoundString+=yytext; } } -{CHARLIT} { +{CHARLIT} { if (insidePHP) { REJECT; } else { - *pCopyRoundString+=yytext; + *pCopyRoundString+=yytext; } } [^"'()\n]+ { @@ -2489,7 +2703,7 @@ \' { if (insidePHP) { - current->initializer+=yytext; + current->initializer+=yytext; pCopyQuotedGString = pCopyRoundGString; lastStringContext=YY_START; BEGIN(CopyPHPGString); @@ -2499,14 +2713,14 @@ *pCopyRoundGString+=yytext; } } -{CHARLIT} { +{CHARLIT} { if (insidePHP) { REJECT; } else { - *pCopyRoundGString+=yytext; + *pCopyRoundGString+=yytext; } } [^"'()\n]+ { @@ -2539,15 +2753,15 @@ "}" { *pCopyCurlyString+=*yytext; if (--curlyCount<0) - BEGIN(lastCurlyContext); + BEGIN(lastCurlyContext); } -{CHARLIT} { if (insidePHP) - { - REJECT; - } - else +{CHARLIT} { if (insidePHP) + { + REJECT; + } + else { - *pCopyCurlyString+=yytext; + *pCopyCurlyString+=yytext; } } [^"'{}\/\n]+ { @@ -2597,15 +2811,15 @@ "}" { *pCopyCurlyGString+=*yytext; if (--curlyCount<0) - BEGIN(lastCurlyContext); + BEGIN(lastCurlyContext); } -{CHARLIT} { if (insidePHP) - { - REJECT; - } - else +{CHARLIT} { if (insidePHP) + { + REJECT; + } + else { - *pCopyCurlyGString+=yytext; + *pCopyCurlyGString+=yytext; } } [^"'{}\/\n]+ { @@ -2635,7 +2849,7 @@ . { current->bitfields+=*yytext; } -[;,] { +[;,] { QCString oldType = current->type.copy(); if (current->bodyLine==-1) { @@ -2673,7 +2887,7 @@ current->doc.resize(0); current->initializer.resize(0); current->bitfields.resize(0); - int i=oldType.length(); + int i=oldType.length(); while (i>0 && (oldType[i-1]=='*' || oldType[i-1]=='&' || oldType[i-1]==' ')) i--; current->type = oldType.left(i); } @@ -2692,9 +2906,9 @@ BEGIN( FindMembers ) ; } -"[" { - if (!insideCS && - current->name.isEmpty() || +"[" { + if (!insideCS && + current->name.isEmpty() || current->name=="typedef" ) // IDL function property { @@ -2808,7 +3022,7 @@ BEGIN( Function ) ; } "[" { current->args += *yytext ; - squareCount++; + squareCount++; } . { current->args += *yytext ; } "[" { squareCount++; } @@ -2818,7 +3032,7 @@ } \" { lastStringContext=YY_START; - BEGIN( SkipString ); + BEGIN( SkipString ); } [^\n\[\]\"]+ "<" { addType( current ) ; @@ -2830,7 +3044,7 @@ BEGIN( FindMembers ) ; } "<" { current->type += *yytext ; - sharpCount++; + sharpCount++; } {BN}+ { lineCount(); @@ -2876,7 +3090,7 @@ REJECT; } } -\n { +\n { yyLineNr++; } [^\n]* @@ -2903,7 +3117,7 @@ current = new Entry ; initEntry(); } - else // probably a redundant , + else // probably a redundant , { current->reset(); } @@ -2918,17 +3132,17 @@ */ [^\r\n\#{}"@'/]* { current->program += yytext ; } "//".* { current->program += yytext ; } -"#".* { if (!insidePHP) +"#".* { if (!insidePHP) REJECT; // append PHP comment. current->program += yytext ; } -@\" { current->program += yytext ; +@\" { current->program += yytext ; pSkipVerbString = ¤t->program; lastSkipVerbStringContext=YY_START; BEGIN( SkipVerbString ); } -\" { current->program += yytext ; +\" { current->program += yytext ; pCopyQuotedGString = ¤t->program; lastStringContext=YY_START; BEGIN( CopyGString ); @@ -2955,15 +3169,15 @@ BEGIN(CopyPHPGString); } } -{CHARLIT} { - if (insidePHP) +{CHARLIT} { + if (insidePHP) { - REJECT; // for PHP code single quotes + REJECT; // for PHP code single quotes // are used for strings of arbitrary length } else { - current->program += yytext; + current->program += yytext; } } "{" { current->program += yytext ; @@ -3006,7 +3220,7 @@ current->type = current->type.simplifyWhiteSpace(); current->name = current->name.stripWhiteSpace(); //printf("adding `%s' `%s' `%s' brief=%s insideObjC=%d %x\n",current->type.data(),current->name.data(),current->args.data(),current->brief.data(),insideObjC,current->section); - if (insideObjC && + if (insideObjC && ((current->spec&Entry::Interface) || (current->spec==Entry::Category)) ) // method definition follows { @@ -3017,9 +3231,9 @@ current_root->addSubEntry( current ) ; memspecEntry = current; current = new Entry(*current); - if (current->section==Entry::NAMESPACE_SEC || + if (current->section==Entry::NAMESPACE_SEC || (current->spec==Entry::Interface) || - insideJava || insidePHP || insideCS || insideD || insideJS + insideJava || insidePHP || insideCS || insideD || insideJS || insideActionScript ) { // namespaces and interfaces and java classes ends with a closing bracket without semicolon current->reset(); @@ -3079,7 +3293,7 @@ current = new Entry; initEntry(); isTypedef=TRUE; // to undo reset by initEntry() - BEGIN(MemberSpecSkip); + BEGIN(MemberSpecSkip); } ";" { /* typedef of anonymous type */ current->name.sprintf("@%d",anonCount++); @@ -3102,7 +3316,7 @@ while (ispec&Entry::Struct) { @@ -3133,9 +3347,9 @@ [,;] { //printf("current->name=`%s' msName=`%s'\n",current->name.data(),msName.data()); if (msName.isEmpty() && !current->name.isEmpty()) - { + { // see if the compound does not have a name or is inside another - // annonymous compound. If so we insert a + // annonymous compound. If so we insert a // special `annonymous' variable. //Entry *p=current_root; Entry *p=current; @@ -3151,7 +3365,7 @@ { // annonymous compound inside -> insert dummy variable name //printf("Adding annonymous variable for scope %s\n",p->name.data()); - msName.sprintf("@%d",anonCount++); + msName.sprintf("@%d",anonCount++); break; } } @@ -3163,13 +3377,13 @@ if (!msName.isEmpty() && msName!=current->name) // skip typedef T {} T; { static bool typedefHidesStruct = Config_getBool("TYPEDEF_HIDES_STRUCT"); - // case 1: typedef struct _S { ... } S_t; + // case 1: typedef struct _S { ... } S_t; // -> omit typedef and use S_t as the struct name - if (typedefHidesStruct && - isTypedef && + if (typedefHidesStruct && + isTypedef && ((current->spec&(Entry::Struct|Entry::Union)) || current->section==Entry::ENUM_SEC )&& - msType.stripWhiteSpace().isEmpty() && + msType.stripWhiteSpace().isEmpty() && memspecEntry) { memspecEntry->name=msName; @@ -3184,7 +3398,7 @@ varEntry->section = Entry::VARIABLE_SEC; varEntry->name = msName.stripWhiteSpace(); varEntry->type = current->type.simplifyWhiteSpace()+" "; - varEntry->args = msArgs; + varEntry->args = msArgs; if (isTypedef) { varEntry->type.prepend("typedef "); @@ -3249,7 +3463,7 @@ current->brief.resize(0); } } -"=" { +"=" { lastInitializerContext=YY_START; initBracketCount=0; BEGIN(ReadInitializer); @@ -3273,7 +3487,7 @@ current=new Entry; initEntry(); insideObjC=FALSE; - BEGIN( FindMembers ); + BEGIN( FindMembers ); } . { current->program += yytext ; } @@ -3347,7 +3561,7 @@ current->args += ")"; BEGIN(FindMembers); } -"(" { // a function returning a function or +"(" { // a function returning a function or // a function returning a pointer to an array current->args += *yytext ; //roundCount=0; @@ -3413,7 +3627,7 @@ current->type += *yytext; } "("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")(" { // for catching typedef void (__stdcall *f)() like definitions - if (current->type.left(7)=="typedef" && current->bodyLine==-1) + if (current->type.left(7)=="typedef" && current->bodyLine==-1) // the bodyLine check is to prevent this guard to be true more than once { current->bodyLine = yyLineNr; @@ -3438,7 +3652,7 @@ roundCount=0; BEGIN( FuncPtr ); } -"(" { +"(" { if (!current->name.isEmpty()) { current->args = yytext; @@ -3453,21 +3667,21 @@ /* "("{BN}*("void"{BN}*)?")" { lineCount(); - current->args = "()"; + current->args = "()"; BEGIN( FuncQual ); } */ /*- Function argument reading rules ---------------------------------------*/ -[^ \/\r\t\n\)\(\"\'#]+ { *copyArgString+=yytext; +[^ \/\r\t\n\)\(\"\'#]+ { *copyArgString+=yytext; fullArgString+=yytext; } -[^\n\\\"\']+ { *copyArgString+=yytext; +[^\n\\\"\']+ { *copyArgString+=yytext; fullArgString+=yytext; } -[^\/\n\)\(\"\']+ { - *copyArgString+=yytext; +[^\/\n\)\(\"\']+ { + *copyArgString+=yytext; fullArgString+=yytext; } {BN}* { @@ -3484,15 +3698,16 @@ "(" { *copyArgString+=*yytext; fullArgString+=*yytext; - argRoundCount=0; + argRoundCount=0; lastCopyArgContext = YY_START; - BEGIN( CopyArgRound ); + BEGIN( CopyArgRound ); } -")" { +")" { *copyArgString+=*yytext; fullArgString+=*yytext; stringToArgumentList(fullArgString,current->argList); - if (insideJS) + + if (insideJS || insideActionScript) { fixArgumentListForJavaScript(current->argList); } @@ -3509,11 +3724,11 @@ BEGIN( currentArgumentContext ); } /* a special comment */ -("/*"[*!]|"//"[/!])("<"?) { +("/*"[*!]|"//"[/!])("<"?) { if (currentArgumentContext==DefineEnd) { // for defines we interpret a comment - // as documentation for the define + // as documentation for the define int i;for (i=yyleng-1;i>=0;i--) { unput(yytext[i]); @@ -3547,8 +3762,8 @@ /* "'#" { if (insidePHP) REJECT; - *copyArgString+=yytext; - fullArgString+=yytext; + *copyArgString+=yytext; + fullArgString+=yytext; } "#" { if (!insidePHP) @@ -3563,7 +3778,7 @@ if (currentArgumentContext==DefineEnd) { // for defines we interpret a comment - // as documentation for the define + // as documentation for the define int i;for (i=yyleng-1;i>0;i--) { unput(yytext[i]); @@ -3589,12 +3804,12 @@ BEGIN( CopyArgComment ); } } -^{B}*"*"+/{BN}+ +^{B}*"*"+/{BN}+ [^\n\\\@\*]+ { fullArgString+=yytext; } -"*/" { fullArgString+=yytext; +"*/" { fullArgString+=yytext; if (lastCopyArgChar!=0) - unput(lastCopyArgChar); - BEGIN( lastCommentInArgContext ); + unput(lastCopyArgChar); + BEGIN( lastCommentInArgContext ); } \n { fullArgString+=yytext; yyLineNr++; @@ -3662,9 +3877,9 @@ ")" { *copyArgString+=*yytext; fullArgString+=*yytext; - if (argRoundCount>0) + if (argRoundCount>0) argRoundCount--; - else + else BEGIN( lastCopyArgContext ); } "<" { @@ -3701,34 +3916,34 @@ fullArgString+=*yytext; BEGIN( lastCopyArgStringContext ); } -{CHARLIT} { +{CHARLIT} { if (insidePHP) { REJECT; } else { - *copyArgString+=yytext; - fullArgString+=yytext; + *copyArgString+=yytext; + fullArgString+=yytext; } } -\' { - *copyArgString+=yytext; - fullArgString+=yytext; +\' { + *copyArgString+=yytext; + fullArgString+=yytext; if (insidePHP) { lastCopyArgStringContext=YY_START; BEGIN(CopyArgPHPString); } } -\n { - yyLineNr++; - *copyArgString+=*yytext; - fullArgString+=*yytext; +\n { + yyLineNr++; + *copyArgString+=*yytext; + fullArgString+=*yytext; } -. { - *copyArgString+=*yytext; - fullArgString+=*yytext; +. { + *copyArgString+=*yytext; + fullArgString+=*yytext; } @@ -3739,7 +3954,7 @@ "(" { current->args += *yytext ; ++roundCount ; } -")" { current->args += *yytext ; +")" { current->args += *yytext ; if ( roundCount ) --roundCount ; else @@ -3753,8 +3968,8 @@ } */ [{:;,] { - if ( strcmp(yytext,";")==0 && - insidePHP && + if ( strcmp(yytext,";")==0 && + insidePHP && !containsWord(current->type,"function") ) { current->reset(); @@ -3767,57 +3982,58 @@ } } {BN}*"abstract"{BN}* { // pure virtual member function - lineCount() ; + lineCount() ; current->virt = Pure; - current->args += " override "; + current->args += " override "; } {BN}*"override"{BN}* { // overridden virtual member function - lineCount() ; + lineCount() ; current->spec |= Entry::Override; - current->args += " override "; + current->args += " override "; } {BN}*"sealed"{BN}* { // sealed member function - lineCount() ; + lineCount() ; current->spec |= Entry::Sealed; - current->args += " sealed "; + current->args += " sealed "; } {BN}*"new"{BN}* { // new member function - lineCount() ; + lineCount() ; current->spec |= Entry::New; - current->args += " new "; + current->args += " new "; } {BN}*"const"{BN}* { // const member function - lineCount() ; - current->args += " const "; + lineCount() ; + current->args += " const "; current->argList->constSpecifier=TRUE; } {BN}*"volatile"{BN}* { // volatile member function - lineCount() ; - current->args += " volatile "; + lineCount() ; + current->args += " volatile "; current->argList->volatileSpecifier=TRUE; } {BN}*"="{BN}*"0"{BN}* { // pure virtual member function - lineCount() ; - current->args += " = 0"; - current->virt = Pure; + lineCount() ; + current->args += " = 0"; + current->virt = Pure; current->argList->pureSpecifier=TRUE; } -{BN}*","{BN}* { - lineCount() ; - current->args += ", " ; +{BN}*","{BN}* { + lineCount() ; + current->args += ", " ; } -{BN}+ { - lineCount() ; - current->args += ' ' ; +{BN}+ { + lineCount() ; + current->args += ' ' ; } -"#" { if (insidePHP) +"#" { + if (insidePHP) REJECT; lastCPPContext = YY_START; BEGIN(SkipCPP); - } -"=" { - if (insideCli && - (current_root->section&Entry::COMPOUND_MASK) + } +"=" { + if (insideCli && + (current_root->section&Entry::COMPOUND_MASK) ) { BEGIN(CliOverride); @@ -3832,7 +4048,7 @@ } {ID} { } -"{" { +"{" { unput(*yytext); BEGIN(FuncQual); } @@ -3846,13 +4062,13 @@ BEGIN(FuncQual); } \" { - current->args += *yytext; + current->args += *yytext; pCopyQuotedString=¤t->args; lastStringContext=FuncPtrInit; BEGIN(CopyString); } \' { - current->args += *yytext; + current->args += *yytext; if (insidePHP) { pCopyQuotedString=¤t->args; @@ -3867,22 +4083,22 @@ } else { - current->args += yytext; + current->args += yytext; } } {ID} { - current->args += yytext; + current->args += yytext; } . { - current->args += *yytext; + current->args += *yytext; } \n { - current->args += *yytext; + current->args += *yytext; yyLineNr++; } {ID} { // typically a K&R style C function if (insideCS && strcmp(yytext,"where")==0) - { + { // type contraint for a method delete current->typeConstr; current->typeConstr = new ArgumentList; @@ -3893,13 +4109,13 @@ else if (checkForKnRstyleC()) { //fprintf(stderr,"===> got a K&R style function\n"); - current->args = yytext; + current->args = yytext; oldStyleArgType.resize(0); BEGIN(OldStyleArgs); } else { - current->args += yytext; + current->args += yytext; } } [,;] { @@ -3930,7 +4146,7 @@ } . { current->args += *yytext; } . { current->args += *yytext; } -{BN}*"try"{BN}+ { /* try-function-block */ +{BN}*"try"{BN}+ { /* try-function-block */ insideTryBlock=TRUE; lineCount(); } @@ -3954,7 +4170,7 @@ "(" { current->exception += *yytext ; ++roundCount ; } -")" { current->exception += *yytext ; +")" { current->exception += *yytext ; if ( roundCount ) --roundCount ; else @@ -3985,7 +4201,7 @@ ":" { if (!insidePHP) BEGIN(SkipInits); } -[;{,] { +[;{,] { current->name=current->name.simplifyWhiteSpace(); current->type=current->type.simplifyWhiteSpace(); current->args=removeRedundantWhiteSpace(current->args); @@ -4004,7 +4220,7 @@ //printf("Scanner.l: found in class variable: `%s' `%s' `%s'\n", current->type.data(),current->name.data(),current->args.data()); current->section = Entry::VARIABLE_SEC ; } - else + else { //printf("Scanner.l: found in class function: `%s' `%s' `%s'\n", current->type.data(),current->name.data(),current->args.data()); current->section = Entry::FUNCTION_SEC ; @@ -4014,7 +4230,7 @@ else // a global function prototype or function variable { //printf("Scanner.l: prototype? type=`%s' name=`%s' args=`%s'\n",current->type.data(),current->name.data(),current->args.data()); - if (!current->type.isEmpty() && + if (!current->type.isEmpty() && (current->type.find(re,0)!=-1 || current->type.left(8)=="typedef ")) { //printf("Scanner.l: found function variable!\n"); @@ -4075,7 +4291,7 @@ } if ( *yytext == '{' ) { - if ( !insidePHP && (current_root->section & Entry::COMPOUND_MASK) ) + if ( !insideActionScript && !insidePHP && (current_root->section & Entry::COMPOUND_MASK) ) { previous->spec |= Entry::Inline; } @@ -4091,19 +4307,19 @@ } } } -"{" { +"{" { //addToBody(yytext); //lastCurlyContext = FindMembers; //curlyCount=0; - //BEGIN( SkipCurly ) ; + //BEGIN( SkipCurly ) ; unput('{'); BEGIN( Function ); } -"{" { +"{" { //addToBody(yytext); - ++curlyCount ; + ++curlyCount ; } -"}" { +"}" { //addToBody(yytext); if( curlyCount ) { @@ -4112,7 +4328,7 @@ else { #if 0 - if (!Config_getBool("HIDE_IN_BODY_DOCS") && + if (!Config_getBool("HIDE_IN_BODY_DOCS") && !current->doc.isEmpty()) { // copy documentation found inside the body @@ -4142,7 +4358,7 @@ BEGIN( lastCurlyContext ) ; } } -"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { +"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { lineCount(); if ( curlyCount ) { @@ -4197,12 +4413,12 @@ current = tempEntry; BEGIN( lastCurlyContext ); } -\" { +\" { //addToBody(yytext); lastStringContext=SkipCurly; - BEGIN( SkipString ); + BEGIN( SkipString ); } -^{B}*"#" { +^{B}*"#" { if (insidePHP) REJECT; //addToBody(yytext); @@ -4215,15 +4431,15 @@ [^\n#"'@\\/{}]+ { //addToBody(yytext); } -\n { +\n { //addToBody(yytext); - yyLineNr++; + yyLineNr++; lastCurlyContext = FindMembers; - BEGIN( SkipCurly ); + BEGIN( SkipCurly ); } -\\[\r]*"\n"[\r]* { +\\[\r]*"\n"[\r]* { //addToBody(yytext); - yyLineNr++; + yyLineNr++; } "/*" { //addToBody(yytext); @@ -4237,7 +4453,7 @@ } \" { lastStringContext=YY_START; - BEGIN( SkipString ); + BEGIN( SkipString ); } ; { warn(yyFileName,yyLineNr, @@ -4272,18 +4488,18 @@ } . { } \\. { } -\" { - BEGIN( lastStringContext ); +\" { + BEGIN( lastStringContext ); } -\' { - BEGIN( lastStringContext ); +\' { + BEGIN( lastStringContext ); } "/*"|"*/"|"//" { } \n { yyLineNr++; } . { } -";" { +";" { current->section = Entry::EMPTY_SEC ; current->type.resize(0) ; current->name.resize(0) ; @@ -4367,7 +4583,7 @@ } BEGIN( FindMembers ); } -{SCOPENAME}/"(" { +{SCOPENAME}/"(" { current->name = yytext ; lineCount(); if (current->spec & Entry::Protocol) @@ -4376,7 +4592,7 @@ } BEGIN( ClassVar ); } -{SCOPENAME} { +{SCOPENAME} { current->name = yytext ; lineCount(); if (current->spec & Entry::Protocol) @@ -4420,7 +4636,7 @@ BEGIN(FindMembers); } else - { + { // Multiple class forward declaration } } @@ -4431,7 +4647,7 @@ current->spec |= Entry::SealedClass; else // abstract current->spec |= Entry::AbstractClass; - BEGIN( ClassVar ); + BEGIN( ClassVar ); } else { @@ -4445,7 +4661,7 @@ roundCount=0; BEGIN(SkipUnionSwitch); } - else if ((insideJava || insidePHP || insideJS) && (strcmp(yytext,"implements")==0 || strcmp(yytext,"extends")==0)) + else if ((insideJava || insidePHP || insideJS || insideActionScript) && (strcmp(yytext,"implements")==0 || strcmp(yytext,"extends")==0)) { current->type.resize(0); baseProt=Public; @@ -4478,7 +4694,7 @@ current->type += ' ' ; current->type += current->name ; current->name = yytext ; - + if (nameIsOperator(current->name)) { BEGIN( Operator ); @@ -4572,12 +4788,12 @@ } BEGIN( ClassVar ); } -":" { +":" { current->type.resize(0); - if ((current->spec & Entry::Interface) || - (current->spec & Entry::Struct) || - (current->spec & Entry::Ref) || - (current->spec & Entry::Value) || + if ((current->spec & Entry::Interface) || + (current->spec & Entry::Struct) || + (current->spec & Entry::Ref) || + (current->spec & Entry::Value) || insidePHP || insideCS || insideD || insideObjC ) baseProt=Public; @@ -4628,7 +4844,7 @@ BEGIN( ReadBodyIntf ); } } -{B}*"{"{B}* { +{B}*"{"{B}* { current->fileName = yyFileName ; current->startLine = yyLineNr ; current->name = removeRedundantWhiteSpace(current->name); @@ -4676,10 +4892,10 @@ "private"{BN}+ { lineCount(); baseProt = Private; } {BN} { lineCount(); } . { unput(*yytext); BEGIN(Bases); } -("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID} { +("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID} { QCString baseScope = yytext; if (insideCS && baseScope.stripWhiteSpace()=="where") - { + { // type contraint for a class delete current->typeConstr; current->typeConstr = new ArgumentList; @@ -4701,7 +4917,7 @@ current->args += name; } \n/{BN}* { - if (!insideObjC) + if (!insideObjC) { REJECT; } @@ -4713,21 +4929,21 @@ } "@end" { // empty ObjC interface unput('d'); // insert fake body: {}@end - unput('n'); - unput('e'); - unput('@'); - unput('}'); + unput('n'); + unput('e'); + unput('@'); + unput('}'); unput('{'); } "<" { current->name += *yytext; - sharpCount=1; + sharpCount=1; roundCount=0; lastSkipSharpContext = YY_START; specName = ¤t->name; BEGIN ( Specialization ); } -"<" { - sharpCount=1; +"<" { + sharpCount=1; roundCount=0; lastSkipSharpContext = YY_START; if (insideObjC) // start of protocol list @@ -4763,7 +4979,7 @@ } else // for C++ >> is a bitshift operator and > > would end a nested template { - *specName += yytext; + *specName += yytext; } } "typename"{BN}+ { lineCount(); } @@ -4787,7 +5003,7 @@ } else { - current->args += ',' ; + current->args += ',' ; } current->name = removeRedundantWhiteSpace(current->name); if (!baseName.isEmpty()) @@ -4796,8 +5012,8 @@ new BaseInfo(baseName,baseProt,baseVirt) ); } - if ((current->spec & Entry::Interface) || - insideJava || insidePHP || insideCS || + if ((current->spec & Entry::Interface) || + insideJava || insidePHP || insideCS || insideD || insideObjC) { baseProt=Public; @@ -4856,11 +5072,11 @@ } } \n { yyLineNr++; } -. +. {BN}+ { current->program += yytext ; lineCount() ; } -"/*" { current->program += yytext ; } +"/*" { current->program += yytext ; } "//" { current->program += yytext ; } {CMD}("code"|"verbatim") { insideCode=TRUE; @@ -4876,7 +5092,7 @@ } . { current->program += *yytext ; } -("//"{B}*)?"/*!" { +("//"{B}*)?"/*!" { //printf("Start doc block at %d\n",yyLineNr); removeSlashes=(yytext[1]=='/'); tmpDocType=-1; @@ -4965,7 +5181,7 @@ startCommentBlock(FALSE); BEGIN( DocBlock ); } -"//!" { +"//!" { #if 0 if (YY_START!=SkipCurly) { @@ -4991,7 +5207,7 @@ startCommentBlock(current->brief.isEmpty()); BEGIN( DocLine ); } -"///"/[^/] { +"///"/[^/] { #if 0 if (YY_START!=SkipCurly) { @@ -5022,12 +5238,12 @@ externC=TRUE; } "{" { - if (externC) + if (externC) { externC=FALSE; } - else if (insideCS && - !current->name.isEmpty() && + else if (insideCS && + !current->name.isEmpty() && !current->type.isEmpty()) { if (containsWord(current->type,"event")) // event @@ -5035,7 +5251,7 @@ current->mtype = mtype = Event; } else // property - { + { current->mtype = mtype = Property; } current->bodyLine = yyLineNr; @@ -5059,7 +5275,7 @@ { current->name="[instance initializer]"; } - unput(*yytext); + unput(*yytext); BEGIN( Function ); } else @@ -5075,10 +5291,10 @@ } } "{" { curlyCount++; } -"}" { - if (curlyCount) +"}" { + if (curlyCount) { - curlyCount--; + curlyCount--; } else { @@ -5127,7 +5343,7 @@ "//" { // slashes in the middle of a comment block docBlock+=yytext; } -"/*" { // start of a new comment in the +"/*" { // start of a new comment in the // middle of a comment block docBlock+=yytext; } @@ -5268,17 +5484,17 @@ "{" { BEGIN( PrototypeSkipLine); } -{B}*"const"{B}* { - current->args += " const "; +{B}*"const"{B}* { + current->args += " const "; current->argList->constSpecifier=TRUE; } -{B}*"volatile"{B}* { - current->args += " volatile "; +{B}*"volatile"{B}* { + current->args += " volatile "; current->argList->volatileSpecifier=TRUE; } -{B}*"="{B}*"0"{B}* { - current->args += " = 0"; - current->virt = Pure; +{B}*"="{B}*"0"{B}* { + current->args += " = 0"; + current->virt = Pure; current->argList->pureSpecifier=TRUE; } "throw"{B}*"(" { @@ -5305,7 +5521,7 @@ /* ------------ Generic rules -------------- */ -.*/\n { +.*/\n { BEGIN( lastCContext ) ; } [^\*\n]+ @@ -5316,7 +5532,7 @@ BEGIN(EndCppQuote); } } -<*>"#" { +<*>"#" { if (!insidePHP) REJECT; lastCContext = YY_START ; @@ -5342,7 +5558,7 @@ BEGIN( SkipComment ) ; } {B}*"*/" { BEGIN( lastCContext ) ; } -<*>"//" { +<*>"//" { lastCContext = YY_START ; BEGIN( SkipCxxComment ) ; } @@ -5363,7 +5579,7 @@ current->docLine = yyLineNr; } } - + //---------------------------------------------------------------------------- static void newEntry() @@ -5387,14 +5603,14 @@ doc, // text yyFileName, // file brief ? current->briefLine : current->docLine, // line of block start - docBlockInBody ? FALSE : brief, + docBlockInBody ? FALSE : brief, docBlockInBody ? FALSE : docBlockAutoBrief, docBlockInBody, protection, position, needsEntry ) - ) + ) { //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position); if (needsEntry) newEntry(); @@ -5440,14 +5656,14 @@ a->docs, // text yyFileName, // file current->docLine, // line of block start - FALSE, FALSE, FALSE, + FALSE, protection, position, needsEntry ) - ) + ) { //printf("handleParametersCommentBlock position=%d [%s]\n",position,doc.data()+position); if (needsEntry) newEntry(); @@ -5507,13 +5723,13 @@ if( ce->section==Entry::CLASS_SEC ) // class { - if (insidePHP || insideD || insideJS) + if (insidePHP || insideD || insideJS || insideActionScript) { - current->protection = protection = Public ; + current->protection = protection = Public ; } else if (insideJava) { - current->protection = protection = Package ; + current->protection = protection = Package ; } else if (ce->spec&(Entry::Interface | Entry::Ref | Entry::Value | Entry::Struct | Entry::Union)) { @@ -5526,7 +5742,7 @@ current->protection = protection = Public ; } } - else + else { current->protection = protection = Private ; } @@ -5555,13 +5771,13 @@ //memberGroupRelates.resize(0); //memberGroupInside.resize(0); groupEnterCompound(yyFileName,yyLineNr,ce->name); - + scanYYlex() ; g_lexInit=TRUE; //forceEndGroup(); groupLeaveCompound(yyFileName,yyLineNr,ce->name); - + delete current; current=0; ce->program.resize(0); @@ -5597,7 +5813,7 @@ inputFile.setName(fileName); if (inputFile.open(IO_ReadOnly)) { - yyLineNr= 1 ; + yyLineNr= 1 ; yyFileName = fileName; setContext(); msg("Parsing file %s...\n",yyFileName.data()); @@ -5658,7 +5874,7 @@ static void parsePrototype(const QCString &text) { //printf("**** parsePrototype(%s) begin\n",text.data()); - if (text.isEmpty()) + if (text.isEmpty()) { warn(yyFileName,yyLineNr,"Empty prototype found!"); return; @@ -5668,11 +5884,11 @@ int orgInputPosition; YY_BUFFER_STATE orgState; bool orgInputFromFile; - + // save scanner state orgState = YY_CURRENT_BUFFER; yy_switch_to_buffer(yy_create_buffer(scanYYin, YY_BUF_SIZE)); - orgInputString = inputString; + orgInputString = inputString; orgInputPosition = inputPosition; orgInputFromFile = g_inputFromFile; @@ -5693,7 +5909,7 @@ YY_BUFFER_STATE tmpState = YY_CURRENT_BUFFER; yy_switch_to_buffer(orgState); yy_delete_buffer(tmpState); - inputString = orgInputString; + inputString = orgInputString; inputPosition = orgInputPosition; g_inputFromFile = orgInputFromFile; @@ -5749,9 +5965,9 @@ bool CLanguageScanner::needsPreprocessing(const QCString &extension) { QCString fe=extension.lower(); - return - !( fe==".java" || fe==".as" || fe==".d" || fe==".php" || - fe==".php4" || fe==".inc" || fe==".phtml" + return + !( fe==".java" || fe==".as" || fe==".d" || fe==".php" || + fe==".php4" || fe==".inc" || fe==".phtml" ); } @@ -5767,10 +5983,10 @@ //---------------------------------------------------------------------------- -#if !defined(YY_FLEX_SUBMINOR_VERSION) +#if !defined(YY_FLEX_SUBMINOR_VERSION) //---------------------------------------------------------------------------- extern "C" { // some bogus code to keep the compiler happy - void scannerYYdummy() { yy_flex_realloc(0,0); } + void scannerYYdummy() { yy_flex_realloc(0,0); } } #endif Index: src/memberdef.cpp =================================================================== --- src/memberdef.cpp (revision 661) +++ src/memberdef.cpp (working copy) @@ -84,6 +84,135 @@ return result; } + + +static void writeArgType(OutputList &ol, + ClassDef *cd, + MemberDef *md, + LockingPtr &defArgList, + QCString &cName, + const Argument *a, + const bool first) +{ + + ol.startParameterType(first,md->isObjCMethod()?"dummy":0); + + + QRegExp re(")("),res("(.*\\*"); + int vp=a->type.find(re); + int wp=a->type.find(res); + + // use the following to put the function pointer type before the name + bool hasFuncPtrType=FALSE; + + // or use the following to put the function pointer as it appears in + // the prototype. + //bool hasFuncPtrType=vp!=-1 && wp!=-1 && wpattrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute + { + ol.docify(a->attrib+" "); + } + if (hasFuncPtrType) // argument type is a function pointer + { + //printf("a->type=`%s' a->name=`%s'\n",a->type.data(),a->name.data()); + QCString n=a->type.left(vp); + if (hasFuncPtrType) n=a->type.left(wp); + if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } + if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); + } + else // non-function pointer type + { + QCString n=a->type; + if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } + if (a->type!="...") + { + if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); + } + } + + if (!md->isDefine()) + { + ol.endParameterType(); + } +} + +static void writeArgName(OutputList &ol, + ClassDef *cd, + MemberDef *md, + LockingPtr &defArgList, + QCString &cName, + const Argument *a, + const bool first, + const bool last, + const bool hasFuncPtrType) +{ + if (!md->isDefine()) + { + ol.startParameterName(defArgList->count()<2); + } + QRegExp re(")("),res("(.*\\*"); + int vp=a->type.find(re); + int wp=a->type.find(res); + + if (hasFuncPtrType) + { ol.docify(a->type.mid(wp,vp-wp)); + } + if (!a->name.isEmpty() || (a->name.isEmpty() && a->type=="...")) // argument has a name + { + if (!hasFuncPtrType) + { + ol.docify(" "); + } + ol.disable(OutputGenerator::Man); + ol.startEmphasis(); + ol.enable(OutputGenerator::Man); + if (a->name.isEmpty()) ol.docify(a->type); else ol.docify(a->name); + ol.disable(OutputGenerator::Man); + ol.endEmphasis(); + ol.enable(OutputGenerator::Man); + } + if (!a->array.isEmpty()) + { + ol.docify(a->array); + } + if (hasFuncPtrType) // write the part of the argument type + // that comes after the name + { + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), + md->name(),a->type.right(a->type.length()-vp)); + } + + + if (!a->defval.isEmpty()) // write the default value + { + QCString n=a->defval; + if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); + ol.docify(" = "); + + ol.startTypewriter(); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n,FALSE,TRUE,TRUE); + ol.endTypewriter(); + + } + + + if (!a->suffixType.isEmpty()) + { + + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), a->suffixType, + a->suffixSpacer + a->suffixType); + } + + if (!last &&!md->isObjCMethod()) + ol.docify(", "); + + ol.endParameterName(last,(first && last),!md->isObjCMethod()); +} + + static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, const QCString & /*scopeName*/,MemberDef *md) { @@ -140,91 +269,21 @@ //if (!md->isDefine()) ol.startParameter(TRUE); else ol.docify(" "); bool first=TRUE; + Argument *next = NULL; while (a) { - if (md->isDefine() || first) ol.startParameterType(first,md->isObjCMethod()?"dummy":0); - QRegExp re(")("),res("(.*\\*"); - int vp=a->type.find(re); - int wp=a->type.find(res); + // ol.startParameter(first, md->isObjCMethod()?"dummy":0 ); + + next = defArgList->next(); + bool last = (next==0); - // use the following to put the function pointer type before the name - bool hasFuncPtrType=FALSE; + writeArgType(ol,cd,md,defArgList,cName,a,first); + writeArgName(ol,cd,md,defArgList,cName,a, first, last, FALSE); - // or use the following to put the function pointer as it appears in - // the prototype. - //bool hasFuncPtrType=vp!=-1 && wp!=-1 && wpattrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute - { - ol.docify(a->attrib+" "); - } - if (hasFuncPtrType) // argument type is a function pointer - { - //printf("a->type=`%s' a->name=`%s'\n",a->type.data(),a->name.data()); - QCString n=a->type.left(vp); - if (hasFuncPtrType) n=a->type.left(wp); - if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } - if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); - } - else // non-function pointer type - { - QCString n=a->type; - if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } - if (a->type!="...") - { - if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); - } - } - if (!md->isDefine()) - { - ol.endParameterType(); - ol.startParameterName(defArgList->count()<2); - } - if (hasFuncPtrType) - { - ol.docify(a->type.mid(wp,vp-wp)); - } - if (!a->name.isEmpty() || (a->name.isEmpty() && a->type=="...")) // argument has a name - { - if (!hasFuncPtrType) - { - ol.docify(" "); - } - ol.disable(OutputGenerator::Man); - ol.startEmphasis(); - ol.enable(OutputGenerator::Man); - if (a->name.isEmpty()) ol.docify(a->type); else ol.docify(a->name); - ol.disable(OutputGenerator::Man); - ol.endEmphasis(); - ol.enable(OutputGenerator::Man); - } - if (!a->array.isEmpty()) - { - ol.docify(a->array); - } - if (hasFuncPtrType) // write the part of the argument type - // that comes after the name - { - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), - md->name(),a->type.right(a->type.length()-vp)); - } - if (!a->defval.isEmpty()) // write the default value - { - QCString n=a->defval; - if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); - ol.docify(" = "); - - ol.startTypewriter(); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n,FALSE,TRUE,TRUE); - ol.endTypewriter(); - - } - a=defArgList->next(); + a = next; if (a) { - if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments + if (!md->isDefine()) { QCString key; @@ -235,8 +294,6 @@ key=a->attrib.mid(1,a->attrib.length()-2); if (key!=",") key+=":"; // for normal keywords add colon } - ol.endParameterName(FALSE,FALSE,!md->isObjCMethod()); - ol.startParameterType(FALSE,key); } } first=FALSE; @@ -244,23 +301,30 @@ ol.pushGeneratorState(); bool htmlOn = ol.isEnabled(OutputGenerator::Html); ol.disable(OutputGenerator::Html); + //if (!first) ol.writeString(" "); if (!md->isObjCMethod()) ol.docify(")"); // end argument list ol.enableAll(); ol.disableAllBut(OutputGenerator::Html); if (!htmlOn) ol.disable(OutputGenerator::Html); + if (!md->isDefine()) { - if (first) ol.startParameterName(defArgList->count()<2); - ol.endParameterName(TRUE,defArgList->count()<2,!md->isObjCMethod()); + if (first) + { + //ie, there were no parameters + ol.startParameterType(first,0); + ol.endParameterName(TRUE,TRUE,!md->isObjCMethod()); + } } - else + else { ol.endParameterType(); ol.startParameterName(TRUE); ol.endParameterName(TRUE,TRUE,!md->isObjCMethod()); } - ol.popGeneratorState(); + + ol.popGeneratorState(); if (md->extraTypeChars()) { ol.docify(md->extraTypeChars()); @@ -308,7 +372,8 @@ void init(Definition *def,const char *t,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r, MemberDef::MemberType mt,const ArgumentList *tal, - const ArgumentList *al + const ArgumentList *al, const ArgumentList *declAl, + const char *suffixSpacer, const char *suffixType ); ClassDef *classDef; // member of or related to @@ -410,6 +475,9 @@ bool docsForDefinition; // TRUE => documentation block is put before // definition. // FALSE => block is put before declaration. + + QCString suffixType; + QCString suffixSpacer; }; MemberDefImpl::MemberDefImpl() : @@ -442,7 +510,10 @@ const char *t,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r, MemberDef::MemberType mt,const ArgumentList *tal, - const ArgumentList *al + const ArgumentList *al, + const ArgumentList *declAl, + const char *sfxSpacer, + const char *sfxType ) { classDef=0; @@ -463,6 +534,7 @@ hasCallerGraph = FALSE; initLines=0; type=t; + if (mt==MemberDef::Typedef) type.stripPrefix("typedef "); // type.stripPrefix("struct "); // type.stripPrefix("class " ); @@ -470,7 +542,15 @@ type=removeRedundantWhiteSpace(type); args=a; args=removeRedundantWhiteSpace(args); - if (type.isEmpty()) decl=def->name()+args; else decl=type+" "+def->name()+args; + + suffixSpacer = sfxSpacer; + suffixType = sfxType; + + + if (type.isEmpty()) + decl = def->name()+args; + else + decl = type + " " + def->name()+args; memberGroup=0; virt=v; @@ -533,8 +613,16 @@ // convert function declaration arguments (if any) if (!args.isEmpty()) { - declArgList = new ArgumentList; - stringToArgumentList(args,declArgList,&extraTypeChars); + if (declAl) + { + declArgList = new ArgumentList(*declAl); + declArgList->setAutoDelete(FALSE); + } + else + { + declArgList = new ArgumentList(); + stringToArgumentList(args,declArgList,&extraTypeChars); + } //printf("setDeclArgList %s to %s const=%d\n",args.data(), // argListToString(declArgList).data(),declArgList->constSpecifier); } @@ -578,20 +666,24 @@ * \param mt The kind of member. See #MemberDef::MemberType for a list of * all types. * \param tal The template arguments of this member. - * \param al The arguments of this member. This is a structured form of - * the string past as argument \a a. + * \param al The arguments of this member. + * \param declAl The arguments of the declaration of this member. This is a + * structured form of the string passed as argument \a a. + * \param suffixType The string representing the type of the member, where the type + * should appear as a suffix to the member's name. */ MemberDef::MemberDef(const char *df,int dl, const char *t,const char *na,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r,MemberType mt, - const ArgumentList *tal,const ArgumentList *al + const ArgumentList *tal,const ArgumentList *al, const ArgumentList *declAl, + const char *suffixSpacer,const char *suffixType ) : Definition(df,dl,removeRedundantWhiteSpace(na)) { m_storagePos=-1; m_cacheHandle=-1; m_impl = new MemberDefImpl; - m_impl->init(this,t,a,e,p,v,s,r,mt,tal,al); + m_impl->init(this,t,a,e,p,v,s,r,mt,tal,al, declAl,suffixSpacer, suffixType); m_flushPending = FALSE; } @@ -1067,6 +1159,102 @@ } + + +void MemberDef::writeSuffixType(OutputList &ol, Definition *d) +{ + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(), m_impl->suffixType, m_impl->suffixSpacer + m_impl->suffixType); + +} + + + +void MemberDef::writeType(OutputList &ol, + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + ClassDef *annoClassDef, + Definition *d, + bool inGroup, + bool &endAnonScopeNeeded) + +{ + + QCString ltype(m_impl->type); + if (m_impl->mtype==Typedef) ltype.prepend("typedef "); + // strip `friend' keyword from ltype + ltype.stripPrefix("friend "); + static QRegExp r("@[0-9]+"); + + endAnonScopeNeeded=FALSE; + int l,i=r.match(ltype,0,&l); + if (i!=-1) // member has an anonymous type + { + //printf("annoClassDef=%p annMemb=%p scopeName=`%s' anonymous=`%s'\n", + // annoClassDef,annMemb,cname.data(),ltype.mid(i,l).data()); + + if (annoClassDef) // type is an anonymous compound + { + int ir=i+l; + //printf("<<<<<<<<<<<<<<\n"); + ol.startAnonTypeScope(s_indentLevel++); + annoClassDef->writeDeclaration(ol,m_impl->annMemb,inGroup); + //printf(">>>>>>>>>>>>>> startMemberItem(2)\n"); + ol.startMemberItem(2); + int j; + for (j=0;j< s_indentLevel-1;j++) + { + ol.writeNonBreakableSpace(3); + } + QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace(); + //printf(">>>>>> indDepth=%d ltype=`%s' varName=`%s'\n",indDepth,ltype.data(),varName.data()); + ol.docify("}"); + if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@')) + { + ol.docify(";"); + } + endAnonScopeNeeded=TRUE; + } + else + { + if (getAnonymousEnumType()) // type is an anonymous enum + { + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype.left(i),TRUE); + getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd); + //ol+=*getAnonymousEnumType()->enumDecl(); + linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,name(),ltype.right(ltype.length()-i-l),TRUE); + } + else + { + ltype = ltype.left(i) + " { ... } " + removeAnonymousScopes(ltype.right(ltype.length()-i-l)); + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype,TRUE); + } + } + } + else if (ltype=="@") // rename type from enum values + { + ltype=""; + } + else + { + if (isObjCMethod()) + { + ltype.prepend("("); + ltype.append(")"); + } + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype,TRUE); + } + bool htmlOn = ol.isEnabled(OutputGenerator::Html); + if (htmlOn && Config_getBool("HTML_ALIGN_MEMBERS") && !ltype.isEmpty()) + { + ol.disable(OutputGenerator::Html); + } + if (!ltype.isEmpty()) ol.docify(" "); + if (htmlOn) + { + ol.enable(OutputGenerator::Html); + } +} + + void MemberDef::writeDeclaration(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool inGroup @@ -1195,81 +1383,11 @@ } // *** write type - QCString ltype(m_impl->type); - if (m_impl->mtype==Typedef) ltype.prepend("typedef "); - // strip `friend' keyword from ltype - ltype.stripPrefix("friend "); - static QRegExp r("@[0-9]+"); + bool endAnonScopeNeeded=FALSE; + writeType(ol, cd,nd,fd,gd,annoClassDef,d,inGroup,endAnonScopeNeeded); + - bool endAnonScopeNeeded=FALSE; - int l,i=r.match(ltype,0,&l); - if (i!=-1) // member has an anonymous type - { - //printf("annoClassDef=%p annMemb=%p scopeName=`%s' anonymous=`%s'\n", - // annoClassDef,annMemb,cname.data(),ltype.mid(i,l).data()); - if (annoClassDef) // type is an anonymous compound - { - int ir=i+l; - //printf("<<<<<<<<<<<<<<\n"); - ol.startAnonTypeScope(s_indentLevel++); - annoClassDef->writeDeclaration(ol,m_impl->annMemb,inGroup); - //printf(">>>>>>>>>>>>>> startMemberItem(2)\n"); - ol.startMemberItem(2); - int j; - for (j=0;j< s_indentLevel-1;j++) - { - ol.writeNonBreakableSpace(3); - } - QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace(); - //printf(">>>>>> indDepth=%d ltype=`%s' varName=`%s'\n",indDepth,ltype.data(),varName.data()); - ol.docify("}"); - if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@')) - { - ol.docify(";"); - } - endAnonScopeNeeded=TRUE; - } - else - { - if (getAnonymousEnumType()) // type is an anonymous enum - { - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype.left(i),TRUE); - getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd); - //ol+=*getAnonymousEnumType()->enumDecl(); - linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,name(),ltype.right(ltype.length()-i-l),TRUE); - } - else - { - ltype = ltype.left(i) + " { ... } " + removeAnonymousScopes(ltype.right(ltype.length()-i-l)); - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype,TRUE); - } - } - } - else if (ltype=="@") // rename type from enum values - { - ltype=""; - } - else - { - if (isObjCMethod()) - { - ltype.prepend("("); - ltype.append(")"); - } - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),ltype,TRUE); - } - bool htmlOn = ol.isEnabled(OutputGenerator::Html); - if (htmlOn && Config_getBool("HTML_ALIGN_MEMBERS") && !ltype.isEmpty()) - { - ol.disable(OutputGenerator::Html); - } - if (!ltype.isEmpty()) ol.docify(" "); - if (htmlOn) - { - ol.enable(OutputGenerator::Html); - } - if (m_impl->annMemb) { ol.pushGeneratorState(); @@ -1367,6 +1485,11 @@ ol.docify(excpString()); } + if (!m_impl->suffixType.isEmpty()) + { + writeSuffixType(ol, d); + } + // *** write bitfields if (!m_impl->bitfields.isEmpty()) // add bitfields { @@ -1788,6 +1911,12 @@ hasParameterList=writeDefArgumentList(ol,cd,scopeName,this); } + if (!m_impl->suffixType.isEmpty()) + { + ol.startSuffix(); + writeSuffixType(ol,container); + ol.endSuffix(); + } if (hasOneLineInitializer()) // add initializer { if (!isDefine()) @@ -2547,7 +2676,8 @@ methodName, substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs), m_impl->exception, m_impl->prot, - m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0 + m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0, + 0,0,0 ); imd->setArgumentList(actualArgList); imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs)); @@ -3863,6 +3993,8 @@ marshalBool (Doxygen::symbolStorage,m_impl->tspec); marshalBool (Doxygen::symbolStorage,m_impl->groupHasDocs); marshalBool (Doxygen::symbolStorage,m_impl->docsForDefinition); + marshalQCString (Doxygen::symbolStorage,m_impl->suffixSpacer); + marshalQCString (Doxygen::symbolStorage,m_impl->suffixType); marshalUInt(Doxygen::symbolStorage,END_MARKER); // function doesn't modify the object conceptually but compiler doesn't know this. @@ -3963,6 +4095,9 @@ m_impl->tspec = unmarshalBool (Doxygen::symbolStorage); m_impl->groupHasDocs = unmarshalBool (Doxygen::symbolStorage); m_impl->docsForDefinition = unmarshalBool (Doxygen::symbolStorage); + m_impl->suffixSpacer = unmarshalQCString (Doxygen::symbolStorage); + m_impl->suffixType = unmarshalQCString (Doxygen::symbolStorage); + marker = unmarshalUInt(Doxygen::symbolStorage); assert(marker==END_MARKER); } Index: src/htmlgen.h =================================================================== --- src/htmlgen.h (revision 661) +++ src/htmlgen.h (working copy) @@ -224,6 +224,9 @@ void startParameterList(bool); void endParameterList(); + + void startSuffix(); + void endSuffix(); void startConstraintList(const char *); void startConstraintParam(); void endConstraintParam(); Index: src/marshal.cpp =================================================================== --- src/marshal.cpp (revision 661) +++ src/marshal.cpp (working copy) @@ -52,6 +52,24 @@ if (l>0) s->write(str.data(),l); } + + +void marshalArgument(StorageIntf *s, const Argument *a) +{ + marshalQCString(s,a->attrib); + marshalQCString(s,a->type); + marshalQCString(s,a->canType); + marshalQCString(s,a->name); + marshalQCString(s,a->array); + marshalQCString(s,a->defval); + marshalQCString(s,a->docs); + marshalQCString(s,a->suffixSpacer); + marshalQCString(s,a->suffixType); + +} + + + void marshalArgumentList(StorageIntf *s,ArgumentList *argList) { if (argList==0) @@ -67,13 +85,7 @@ Argument *a; for (ali.toFirst();(a=ali.current());++ali) { - marshalQCString(s,a->attrib); - marshalQCString(s,a->type); - marshalQCString(s,a->canType); - marshalQCString(s,a->name); - marshalQCString(s,a->array); - marshalQCString(s,a->defval); - marshalQCString(s,a->docs); + marshalArgument(s, a); } } marshalBool(s,argList->constSpecifier); @@ -82,6 +94,10 @@ } } + + + + void marshalArgumentLists(StorageIntf *s,QList *argLists) { if (argLists==0) @@ -381,6 +397,7 @@ marshalQCString(s,e->bitfields); marshalArgumentList(s,e->argList); marshalArgumentLists(s,e->tArgLists); + marshalArgumentList(s,e->declArgList); marshalQGString(s,e->program); marshalQGString(s,e->initializer); marshalQCString(s,e->includeFile); @@ -414,6 +431,9 @@ marshalBool(s,e->hidden); marshalBool(s,e->artificial); marshalInt(s,(int)e->groupDocType); + marshalQCString(s, e->suffixSpacer); + marshalQCString(s,e->suffixType); + } void marshalEntryTree(StorageIntf *s,Entry *e) @@ -484,6 +504,24 @@ return result; } + +Argument *unmarshalArgument(StorageIntf *s) +{ + Argument *a = new Argument; + a->attrib = unmarshalQCString(s); + a->type = unmarshalQCString(s); + a->canType = unmarshalQCString(s); + a->name = unmarshalQCString(s); + a->array = unmarshalQCString(s); + a->defval = unmarshalQCString(s); + a->docs = unmarshalQCString(s); + a->suffixSpacer = unmarshalQCString(s); + a->suffixType = unmarshalQCString(s); + return a; +} + + + ArgumentList *unmarshalArgumentList(StorageIntf *s) { uint i; @@ -494,14 +532,7 @@ //printf("unmarshalArgumentList: %d\n",count); for (i=0;iattrib = unmarshalQCString(s); - a->type = unmarshalQCString(s); - a->canType = unmarshalQCString(s); - a->name = unmarshalQCString(s); - a->array = unmarshalQCString(s); - a->defval = unmarshalQCString(s); - a->docs = unmarshalQCString(s); + Argument *a = unmarshalArgument(s); result->append(a); } result->constSpecifier = unmarshalBool(s); @@ -774,6 +805,8 @@ delete e->argList; e->argList = unmarshalArgumentList(s); e->tArgLists = unmarshalArgumentLists(s); + delete e->declArgList; + e->declArgList = unmarshalArgumentList(s); e->program = unmarshalQGString(s); e->initializer = unmarshalQGString(s); e->includeFile = unmarshalQCString(s); @@ -810,6 +843,8 @@ e->hidden = unmarshalBool(s); e->artificial = unmarshalBool(s); e->groupDocType = (Entry::GroupDocType)unmarshalInt(s); + e->suffixSpacer = unmarshalQCString(s); + e->suffixType = unmarshalQCString(s); return e; } Index: src/memberdef.h =================================================================== --- src/memberdef.h (revision 661) +++ src/memberdef.h (working copy) @@ -69,7 +69,8 @@ const char *type,const char *name,const char *args, const char *excp,Protection prot,Specifier virt,bool stat, Relationship related,MemberType t,const ArgumentList *tal, - const ArgumentList *al); + const ArgumentList *al, const ArgumentList *declAl, + const char *suffixSpacer, const char *suffixType); ~MemberDef(); DefType definitionType() const { return TypeMember; } @@ -363,6 +364,16 @@ ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool onlyText=FALSE); + void writeType(OutputList &ol, + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + ClassDef *annoClassDef, + Definition *d, + bool inGroup, + bool &endAnonScopeNeeded); + + void writeSuffixType(OutputList &ol, Definition *d); + + MemberDefImpl *m_impl; int m_cacheHandle; off_t m_storagePos; // location where the item is stored in file (if impl==0)