My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TagFileParser Class Reference
Inheritance diagram for TagFileParser:

Classes

class  EndElementHandler
 
class  StartElementHandler
 

Public Member Functions

 TagFileParser (const char *tagName)
 
void setDocumentLocator (QXmlLocator *locator)
 
void setFileName (const QString &fileName)
 
void warn (const char *fmt)
 
void warn (const char *fmt, const char *s)
 
void startCompound (const QXmlAttributes &attrib)
 
void endCompound ()
 
void startMember (const QXmlAttributes &attrib)
 
void endMember ()
 
void startEnumValue (const QXmlAttributes &attrib)
 
void endEnumValue ()
 
void endDocAnchor ()
 
void endClass ()
 
void endNamespace ()
 
void endFile ()
 
void endPage ()
 
void endDir ()
 
void startStringValue (const QXmlAttributes &)
 
void startDocAnchor (const QXmlAttributes &attrib)
 
void endType ()
 
void endName ()
 
void startBase (const QXmlAttributes &attrib)
 
void endBase ()
 
void startIncludes (const QXmlAttributes &attrib)
 
void endIncludes ()
 
void endTemplateArg ()
 
void endFilename ()
 
void endPath ()
 
void endAnchor ()
 
void endClangId ()
 
void endAnchorFile ()
 
void endArglist ()
 
void endTitle ()
 
void endSubgroup ()
 
void startIgnoreElement (const QXmlAttributes &)
 
void endIgnoreElement ()
 
bool startDocument ()
 
bool startElement (const QString &, const QString &, const QString &name, const QXmlAttributes &attrib)
 
bool endElement (const QString &, const QString &, const QString &name)
 
bool characters (const QString &ch)
 
void dump ()
 
void buildLists (Entry *root)
 
void addIncludes ()
 

Private Types

enum  State {
  Invalid, InClass, InFile, InNamespace,
  InGroup, InPage, InMember, InEnumValue,
  InPackage, InDir, InTempArgList
}
 

Private Member Functions

void buildMemberList (Entry *ce, QList< TagMemberInfo > &members)
 
void addDocAnchors (Entry *e, const TagAnchorInfoList &l)
 

Private Attributes

QList< TagClassInfom_tagFileClasses
 
QList< TagFileInfom_tagFileFiles
 
QList< TagNamespaceInfom_tagFileNamespaces
 
QList< TagGroupInfom_tagFileGroups
 
QList< TagPageInfom_tagFilePages
 
QList< TagPackageInfom_tagFilePackages
 
QList< TagDirInfom_tagFileDirs
 
QDict< StartElementHandlerm_startElementHandlers
 
QDict< EndElementHandlerm_endElementHandlers
 
TagClassInfom_curClass
 
TagFileInfom_curFile
 
TagNamespaceInfom_curNamespace
 
TagPackageInfom_curPackage
 
TagGroupInfom_curGroup
 
TagPageInfom_curPage
 
TagDirInfom_curDir
 
TagMemberInfom_curMember
 
TagEnumValueInfom_curEnumValue
 
TagIncludeInfom_curIncludes
 
QCString m_curString
 
QCString m_tagName
 
QCString m_fileName
 
QCString m_title
 
State m_state
 
QStack< Statem_stateStack
 
QXmlLocator * m_locator
 
QCString m_inputFileName
 

Detailed Description

Tag file parser.

Reads an XML-structured tagfile and builds up the structure in memory. The method buildLists() is used to transfer/translate the structures to the doxygen engine.

Definition at line 211 of file tagreader.cpp.

Member Enumeration Documentation

enum TagFileParser::State
private
Enumerator
Invalid 
InClass 
InFile 
InNamespace 
InGroup 
InPage 
InMember 
InEnumValue 
InPackage 
InDir 
InTempArgList 

Definition at line 213 of file tagreader.cpp.

Constructor & Destructor Documentation

TagFileParser::TagFileParser ( const char *  tagName)
inline

Member Function Documentation

void TagFileParser::addDocAnchors ( Entry e,
const TagAnchorInfoList l 
)
private

Definition at line 1143 of file tagreader.cpp.

References SectionInfo::Anchor, Entry::anchors, SDict< T >::append(), TagAnchorInfo::fileName, TagAnchorInfo::label, m_tagName, Doxygen::sectionDict, TagAnchorInfo::title, and warn().

Referenced by buildLists(), and buildMemberList().

{
QListIterator<TagAnchorInfo> tli(l);
for (tli.toFirst();(ta=tli.current());++tli)
{
if (Doxygen::sectionDict->find(ta->label)==0)
{
//printf("New sectionInfo file=%s anchor=%s\n",
// ta->fileName.data(),ta->label.data());
SectionInfo *si=new SectionInfo(ta->fileName,-1,ta->label,ta->title,
e->anchors->append(si);
}
else
{
warn("Duplicate anchor %s found\n",ta->label.data());
}
}
}
void TagFileParser::addIncludes ( )

Definition at line 1480 of file tagreader.cpp.

References FileDef::addIncludeDependency(), FileDef::getOutputFileBase(), FileDef::getPath(), TagIncludeInfo::id, TagFileInfo::includes, Doxygen::inputNameDict, TagIncludeInfo::isImported, TagIncludeInfo::isLocal, m_tagFileFiles, m_tagName, TagIncludeInfo::name, TagFileInfo::name, TagFileInfo::path, and TagIncludeInfo::text.

Referenced by parseTagFile().

{
QListIterator<TagFileInfo> fit(m_tagFileFiles);
for (fit.toFirst();(tfi=fit.current());++fit)
{
//printf("tag file tagName=%s path=%s name=%s\n",m_tagName.data(),tfi->path.data(),tfi->name.data());
if (fn)
{
//printf("found\n");
FileNameIterator fni(*fn);
FileDef *fd;
for (;(fd=fni.current());++fni)
{
//printf("input file path=%s name=%s\n",fd->getPath().data(),fd->name().data());
if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
{
//printf("found\n");
QListIterator<TagIncludeInfo> mii(tfi->includes);
for (;(ii=mii.current());++mii)
{
//printf("ii->name=`%s'\n",ii->name.data());
ASSERT(ifn!=0);
if (ifn)
{
FileNameIterator ifni(*ifn);
FileDef *ifd;
for (;(ifd=ifni.current());++ifni)
{
//printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
// ifd->getOutputFileBase().data(),ii->id.data());
if (ifd->getOutputFileBase()==QCString(ii->id))
{
fd->addIncludeDependency(ifd,ii->text,ii->isLocal,ii->isImported,FALSE);
}
}
}
}
}
}
}
}
}
void TagFileParser::buildLists ( Entry root)

Injects the info gathered by the XML parser into the Entry tree. This tree contains the information extracted from the input in a "unrelated" form.

Definition at line 1304 of file tagreader.cpp.

References addDocAnchors(), Entry::addSubEntry(), Entry::args, TagClassInfo::bases, buildMemberList(), TagClassInfo::Category, Entry::Category, TagClassInfo::clangId, TagNamespaceInfo::clangId, TagClassInfo::Class, Entry::CLASS_SEC, TagClassInfo::docAnchors, TagNamespaceInfo::docAnchors, TagPackageInfo::docAnchors, TagFileInfo::docAnchors, TagGroupInfo::docAnchors, TagPageInfo::docAnchors, TagClassInfo::Enum, Entry::Enum, TagClassInfo::Exception, Entry::Exception, Entry::extends, TagInfo::fileName, TagClassInfo::filename, TagNamespaceInfo::filename, TagPackageInfo::filename, TagFileInfo::filename, TagGroupInfo::filename, TagPageInfo::filename, Entry::fileName, Entry::GROUPDOC_SEC, guessSection(), Entry::id, Doxygen::inputNameDict, Doxygen::inputNameList, TagClassInfo::Interface, Entry::Interface, TagClassInfo::isObjC, TagClassInfo::kind, Entry::lang, m_tagFileClasses, m_tagFileFiles, m_tagFileGroups, m_tagFileNamespaces, m_tagFilePackages, m_tagFilePages, m_tagName, Entry::MAINPAGEDOC_SEC, TagClassInfo::members, TagNamespaceInfo::members, TagPackageInfo::members, TagFileInfo::members, TagGroupInfo::members, Argument::name, TagClassInfo::name, TagNamespaceInfo::name, TagPackageInfo::name, TagFileInfo::name, TagGroupInfo::name, TagPageInfo::name, Entry::name, Entry::NAMESPACE_SEC, Entry::PACKAGE_SEC, Entry::PAGEDOC_SEC, TagFileInfo::path, TagClassInfo::Protocol, Entry::Protocol, Entry::section, TagClassInfo::Service, Entry::Service, TagClassInfo::Singleton, Entry::Singleton, Entry::spec, SrcLangExt_ObjC, SrcLangExt_Unknown, stripPath(), TagClassInfo::Struct, Entry::Struct, Entry::tagInfo, TagInfo::tagName, Entry::tArgLists, TagClassInfo::templateArguments, TagGroupInfo::title, TagPageInfo::title, Argument::type, Entry::type, TagClassInfo::Union, and Entry::Union.

Referenced by parseTagFile().

{
// build class list
QListIterator<TagClassInfo> cit(m_tagFileClasses);
for (cit.toFirst();(tci=cit.current());++cit)
{
Entry *ce = new Entry;
switch (tci->kind)
{
case TagClassInfo::Class: break;
case TagClassInfo::Enum: ce->spec = Entry::Enum; break;
}
ce->name = tci->name;
{
ce->name+="-p";
}
TagInfo *ti = new TagInfo;
ti->fileName = tci->filename;
ce->id = tci->clangId;
ce->tagInfo = ti;
// transfer base class list
if (tci->bases)
{
delete ce->extends;
ce->extends = tci->bases; tci->bases = 0;
}
{
if (ce->tArgLists==0)
{
ce->tArgLists = new QList<ArgumentList>;
ce->tArgLists->setAutoDelete(TRUE);
}
ce->tArgLists->append(al);
QListIterator<QCString> sli(*tci->templateArguments);
QCString *argName;
for (;(argName=sli.current());++sli)
{
Argument *a = new Argument;
a->type = "class";
a->name = *argName;
al->append(a);
}
}
root->addSubEntry(ce);
}
// build file list
QListIterator<TagFileInfo> fit(m_tagFileFiles);
for (fit.toFirst();(tfi=fit.current());++fit)
{
Entry *fe = new Entry;
fe->section = guessSection(tfi->name);
fe->name = tfi->name;
TagInfo *ti = new TagInfo;
ti->fileName = tfi->filename;
fe->tagInfo = ti;
QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
fe->fileName = fullName;
//printf("new FileDef() filename=%s\n",tfi->filename.data());
FileDef *fd = new FileDef(m_tagName+":"+tfi->path,
tfi->filename
);
FileName *mn;
if ((mn=Doxygen::inputNameDict->find(tfi->name)))
{
mn->append(fd);
}
else
{
mn = new FileName(fullName,tfi->name);
mn->append(fd);
Doxygen::inputNameDict->insert(tfi->name,mn);
}
root->addSubEntry(fe);
}
// build namespace list
QListIterator<TagNamespaceInfo> nit(m_tagFileNamespaces);
for (nit.toFirst();(tni=nit.current());++nit)
{
Entry *ne = new Entry;
ne->name = tni->name;
TagInfo *ti = new TagInfo;
ti->fileName = tni->filename;
ne->id = tni->clangId;
ne->tagInfo = ti;
root->addSubEntry(ne);
}
// build package list
QListIterator<TagPackageInfo> pit(m_tagFilePackages);
for (pit.toFirst();(tpgi=pit.current());++pit)
{
Entry *pe = new Entry;
pe->name = tpgi->name;
TagInfo *ti = new TagInfo;
ti->fileName = tpgi->filename;
pe->tagInfo = ti;
root->addSubEntry(pe);
}
// build group list
QListIterator<TagGroupInfo> git(m_tagFileGroups);
for (git.toFirst();(tgi=git.current());++git)
{
Entry *ge = new Entry;
ge->name = tgi->name;
ge->type = tgi->title;
TagInfo *ti = new TagInfo;
ti->fileName = tgi->filename;
ge->tagInfo = ti;
root->addSubEntry(ge);
}
// build page list
QListIterator<TagPageInfo> pgit(m_tagFilePages);
for (pgit.toFirst();(tpi=pgit.current());++pgit)
{
Entry *pe = new Entry;
pe->name = tpi->name;
pe->args = tpi->title;
TagInfo *ti = new TagInfo;
ti->fileName = tpi->filename;
pe->tagInfo = ti;
root->addSubEntry(pe);
}
}
void TagFileParser::buildMemberList ( Entry ce,
QList< TagMemberInfo > &  members 
)
private

Definition at line 1165 of file tagreader.cpp.

References addDocAnchors(), Entry::addSubEntry(), TagInfo::anchor, TagEnumValueInfo::anchor, TagMemberInfo::anchor, TagMemberInfo::anchorFile, TagMemberInfo::arglist, Entry::argList, Entry::args, TagEnumValueInfo::clangid, TagMemberInfo::clangId, DCOP, Entry::DEFINE_SEC, TagMemberInfo::docAnchors, Entry::ENUM_SEC, TagMemberInfo::enumValues, Event, TagEnumValueInfo::file, TagInfo::fileName, Entry::fileName, Entry::FUNCTION_SEC, Entry::GROUPDOC_SEC, Grouping::GROUPING_INGROUP, Entry::groups, Entry::id, TagMemberInfo::isStatic, TagMemberInfo::kind, m_tagName, Method, Entry::mtype, TagEnumValueInfo::name, TagMemberInfo::name, Entry::name, Property, TagMemberInfo::prot, Entry::protection, Entry::section, Signal, Slot, Entry::spec, Entry::stat, stringToArgumentList(), Entry::Strong, Entry::tagInfo, TagInfo::tagName, TagMemberInfo::type, Entry::type, Entry::VARIABLE_SEC, TagMemberInfo::virt, and Entry::virt.

Referenced by buildLists().

{
QListIterator<TagMemberInfo> mii(members);
for (;(tmi=mii.current());++mii)
{
Entry *me = new Entry;
me->type = tmi->type;
me->name = tmi->name;
me->args = tmi->arglist;
if (!me->args.isEmpty())
{
delete me->argList;
me->argList = new ArgumentList;
}
if (tmi->enumValues.count()>0)
{
QListIterator<TagEnumValueInfo> evii(tmi->enumValues);
for (evii.toFirst();(evi=evii.current());++evii)
{
Entry *ev = new Entry;
ev->type = "@";
ev->name = evi->name;
ev->id = evi->clangid;
TagInfo *ti = new TagInfo;
ti->anchor = evi->anchor;
ti->fileName = evi->file;
ev->tagInfo = ti;
me->addSubEntry(ev);
}
}
me->protection = tmi->prot;
me->virt = tmi->virt;
me->stat = tmi->isStatic;
me->fileName = ce->fileName;
me->id = tmi->clangId;
{
}
TagInfo *ti = new TagInfo;
ti->anchor = tmi->anchor;
ti->fileName = tmi->anchorFile;
me->tagInfo = ti;
if (tmi->kind=="define")
{
me->type="#define";
}
else if (tmi->kind=="enumvalue")
{
me->mtype = Method;
}
else if (tmi->kind=="property")
{
me->mtype = Property;
}
else if (tmi->kind=="event")
{
me->mtype = Event;
}
else if (tmi->kind=="variable")
{
me->mtype = Method;
}
else if (tmi->kind=="typedef")
{
me->section = Entry::VARIABLE_SEC; //Entry::TYPEDEF_SEC;
me->type.prepend("typedef ");
me->mtype = Method;
}
else if (tmi->kind=="enumeration")
{
me->mtype = Method;
}
else if (tmi->kind=="function")
{
me->mtype = Method;
}
else if (tmi->kind=="signal")
{
me->mtype = Signal;
}
else if (tmi->kind=="prototype")
{
me->mtype = Method;
}
else if (tmi->kind=="friend")
{
me->type.prepend("friend ");
me->mtype = Method;
}
else if (tmi->kind=="dcop")
{
me->mtype = DCOP;
}
else if (tmi->kind=="slot")
{
me->mtype = Slot;
}
ce->addSubEntry(me);
}
}
bool TagFileParser::characters ( const QString &  ch)
inline

Definition at line 901 of file tagreader.cpp.

References m_curString.

{
m_curString+=ch.utf8();
return TRUE;
}
void TagFileParser::dump ( )

Dumps the internal structures. For debugging only!

Definition at line 973 of file tagreader.cpp.

References TagMemberInfo::anchor, TagMemberInfo::arglist, TagClassInfo::bases, TagNamespaceInfo::classList, TagFileInfo::classList, TagGroupInfo::classList, TagGroupInfo::fileList, TagDirInfo::fileList, TagClassInfo::filename, TagNamespaceInfo::filename, TagFileInfo::filename, TagGroupInfo::filename, TagPageInfo::filename, TagIncludeInfo::id, TagFileInfo::includes, TagMemberInfo::kind, m_tagFileClasses, m_tagFileDirs, m_tagFileFiles, m_tagFileGroups, m_tagFileNamespaces, m_tagFilePages, TagClassInfo::members, TagNamespaceInfo::members, TagFileInfo::members, TagGroupInfo::members, msg(), BaseInfo::name, TagMemberInfo::name, TagClassInfo::name, TagNamespaceInfo::name, TagIncludeInfo::name, TagFileInfo::name, TagGroupInfo::name, TagPageInfo::name, TagDirInfo::name, TagFileInfo::namespaceList, TagGroupInfo::namespaceList, TagGroupInfo::pageList, TagDirInfo::path, TagDirInfo::subdirList, TagGroupInfo::subgroupList, and TagPageInfo::title.

{
msg("Result:\n");
QListIterator<TagClassInfo> lci(m_tagFileClasses);
//============== CLASSES
for (;(cd=lci.current());++lci)
{
msg("class `%s'\n",cd->name.data());
msg(" filename `%s'\n",cd->filename.data());
if (cd->bases)
{
QListIterator<BaseInfo> bii(*cd->bases);
BaseInfo *bi;
for ( bii.toFirst() ; (bi=bii.current()) ; ++bii)
{
msg( " base: %s \n", bi->name.data() );
}
}
QListIterator<TagMemberInfo> mci(cd->members);
for (;(md=mci.current());++mci)
{
msg(" member:\n");
msg(" kind: `%s'\n",md->kind.data());
msg(" name: `%s'\n",md->name.data());
msg(" anchor: `%s'\n",md->anchor.data());
msg(" arglist: `%s'\n",md->arglist.data());
}
}
//============== NAMESPACES
QListIterator<TagNamespaceInfo> lni(m_tagFileNamespaces);
for (;(nd=lni.current());++lni)
{
msg("namespace `%s'\n",nd->name.data());
msg(" filename `%s'\n",nd->filename.data());
QStringList::Iterator it;
for ( it = nd->classList.begin();
it != nd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).latin1() );
}
QListIterator<TagMemberInfo> mci(nd->members);
for (;(md=mci.current());++mci)
{
msg(" member:\n");
msg(" kind: `%s'\n",md->kind.data());
msg(" name: `%s'\n",md->name.data());
msg(" anchor: `%s'\n",md->anchor.data());
msg(" arglist: `%s'\n",md->arglist.data());
}
}
//============== FILES
QListIterator<TagFileInfo> lfi(m_tagFileFiles);
for (;(fd=lfi.current());++lfi)
{
msg("file `%s'\n",fd->name.data());
msg(" filename `%s'\n",fd->filename.data());
QStringList::Iterator it;
for ( it = fd->namespaceList.begin();
it != fd->namespaceList.end(); ++it )
{
msg( " namespace: %s \n", (*it).latin1() );
}
for ( it = fd->classList.begin();
it != fd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).latin1() );
}
QListIterator<TagMemberInfo> mci(fd->members);
for (;(md=mci.current());++mci)
{
msg(" member:\n");
msg(" kind: `%s'\n",md->kind.data());
msg(" name: `%s'\n",md->name.data());
msg(" anchor: `%s'\n",md->anchor.data());
msg(" arglist: `%s'\n",md->arglist.data());
}
QListIterator<TagIncludeInfo> mii(fd->includes);
for (;(ii=mii.current());++mii)
{
msg(" includes id: %s name: %s\n",ii->id.data(),ii->name.data());
}
}
//============== GROUPS
QListIterator<TagGroupInfo> lgi(m_tagFileGroups);
for (;(gd=lgi.current());++lgi)
{
msg("group `%s'\n",gd->name.data());
msg(" filename `%s'\n",gd->filename.data());
QStringList::Iterator it;
for ( it = gd->namespaceList.begin();
it != gd->namespaceList.end(); ++it )
{
msg( " namespace: %s \n", (*it).latin1() );
}
for ( it = gd->classList.begin();
it != gd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).latin1() );
}
for ( it = gd->fileList.begin();
it != gd->fileList.end(); ++it )
{
msg( " file: %s \n", (*it).latin1() );
}
for ( it = gd->subgroupList.begin();
it != gd->subgroupList.end(); ++it )
{
msg( " subgroup: %s \n", (*it).latin1() );
}
for ( it = gd->pageList.begin();
it != gd->pageList.end(); ++it )
{
msg( " page: %s \n", (*it).latin1() );
}
QListIterator<TagMemberInfo> mci(gd->members);
for (;(md=mci.current());++mci)
{
msg(" member:\n");
msg(" kind: `%s'\n",md->kind.data());
msg(" name: `%s'\n",md->name.data());
msg(" anchor: `%s'\n",md->anchor.data());
msg(" arglist: `%s'\n",md->arglist.data());
}
}
//============== PAGES
QListIterator<TagPageInfo> lpi(m_tagFilePages);
for (;(pd=lpi.current());++lpi)
{
msg("page `%s'\n",pd->name.data());
msg(" title `%s'\n",pd->title.data());
msg(" filename `%s'\n",pd->filename.data());
}
//============== DIRS
QListIterator<TagDirInfo> ldi(m_tagFileDirs);
for (;(dd=ldi.current());++ldi)
{
msg("dir `%s'\n",dd->name.data());
msg(" path `%s'\n",dd->path.data());
QStringList::Iterator it;
for ( it = dd->fileList.begin();
it != dd->fileList.end(); ++it )
{
msg( " file: %s \n", (*it).latin1() );
}
for ( it = dd->subdirList.begin();
it != dd->subdirList.end(); ++it )
{
msg( " subdir: %s \n", (*it).latin1() );
}
}
}
void TagFileParser::endAnchor ( )
inline

Definition at line 711 of file tagreader.cpp.

References TagMemberInfo::anchor, InMember, m_curMember, m_curString, m_state, and warn().

Referenced by startDocument().

{
{
}
else
{
warn("Unexpected tag `anchor' found\n");
}
}
void TagFileParser::endAnchorFile ( )
inline

Definition at line 745 of file tagreader.cpp.

References TagMemberInfo::anchorFile, InMember, m_curMember, m_curString, m_state, and warn().

Referenced by startDocument().

{
{
}
else
{
warn("Unexpected tag `anchorfile' found\n");
}
}
void TagFileParser::endArglist ( )
inline

Definition at line 757 of file tagreader.cpp.

References TagMemberInfo::arglist, InMember, m_curMember, m_curString, m_state, and warn().

Referenced by startDocument().

{
{
}
else
{
warn("Unexpected tag `arglist' found\n");
}
}
void TagFileParser::endBase ( )
inline

Definition at line 634 of file tagreader.cpp.

References TagClassInfo::bases, InClass, m_curClass, m_curString, m_state, and warn().

Referenced by startDocument().

{
{
m_curClass->bases->getLast()->name = m_curString;
}
else
{
warn("Unexpected tag `base' found\n");
}
}
void TagFileParser::endClangId ( )
inline
void TagFileParser::endClass ( )
inline
void TagFileParser::endCompound ( )
inline
void TagFileParser::endDir ( )
inline

Definition at line 551 of file tagreader.cpp.

References InDir, m_curDir, m_curString, m_state, TagDirInfo::subdirList, and warn().

Referenced by startDocument().

{
switch(m_state)
{
case InDir: m_curDir->subdirList.append(m_curString); break;
default: warn("Unexpected tag `page' found\n"); break;
}
}
void TagFileParser::endDocAnchor ( )
inline
bool TagFileParser::endElement ( const QString &  ,
const QString &  ,
const QString &  name 
)
inline

Definition at line 886 of file tagreader.cpp.

References m_endElementHandlers, and warn().

{
//printf("endElement `%s'\n",name.data());
EndElementHandler *handler = m_endElementHandlers[name.utf8()];
if (handler)
{
(*handler)();
}
else
{
warn("Unknown tag `%s' found!\n",name.data());
}
return TRUE;
}
void TagFileParser::endEnumValue ( )
inline
void TagFileParser::endFile ( )
inline

Definition at line 532 of file tagreader.cpp.

References TagGroupInfo::fileList, TagDirInfo::fileList, InDir, InGroup, m_curDir, m_curGroup, m_curString, m_state, and warn().

Referenced by startDocument().

{
switch(m_state)
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
case InDir: m_curDir->fileList.append(m_curString); break;
default: warn("Unexpected tag `file' found\n"); break;
}
}
void TagFileParser::endFilename ( )
inline
void TagFileParser::endIgnoreElement ( )
inline

Definition at line 794 of file tagreader.cpp.

Referenced by startDocument().

{
}
void TagFileParser::endIncludes ( )
inline

Definition at line 664 of file tagreader.cpp.

References m_curIncludes, m_curString, and TagIncludeInfo::text.

Referenced by startDocument().

void TagFileParser::endMember ( )
inline
void TagFileParser::endName ( )
inline
void TagFileParser::endNamespace ( )
inline

Definition at line 521 of file tagreader.cpp.

References TagNamespaceInfo::classList, InFile, InGroup, InNamespace, m_curFile, m_curGroup, m_curNamespace, m_curString, m_state, TagFileInfo::namespaceList, TagGroupInfo::namespaceList, and warn().

Referenced by startDocument().

{
switch(m_state)
{
case InFile: m_curFile->namespaceList.append(m_curString); break;
default: warn("Unexpected tag `namespace' found\n"); break;
}
}
void TagFileParser::endPage ( )
inline

Definition at line 542 of file tagreader.cpp.

References TagGroupInfo::fileList, InGroup, m_curGroup, m_curString, m_state, and warn().

Referenced by startDocument().

{
switch(m_state)
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
default: warn("Unexpected tag `page' found\n"); break;
}
}
void TagFileParser::endPath ( )
inline

Definition at line 701 of file tagreader.cpp.

References InDir, InFile, m_curDir, m_curFile, m_curString, m_state, TagFileInfo::path, TagDirInfo::path, and warn().

Referenced by startDocument().

{
switch (m_state)
{
case InFile: m_curFile->path = m_curString; break;
case InDir: m_curDir->path = m_curString; break;
default: warn("Unexpected tag `path' found\n"); break;
}
}
void TagFileParser::endSubgroup ( )
inline

Definition at line 778 of file tagreader.cpp.

References InGroup, m_curGroup, m_curString, m_state, TagGroupInfo::subgroupList, and warn().

Referenced by startDocument().

{
{
}
else
{
warn("Unexpected tag `subgroup' found\n");
}
}
void TagFileParser::endTemplateArg ( )
inline

Definition at line 669 of file tagreader.cpp.

References InClass, m_curClass, m_curString, m_state, TagClassInfo::templateArguments, and warn().

Referenced by startDocument().

{
{
{
m_curClass->templateArguments = new QList<QCString>;
m_curClass->templateArguments->setAutoDelete(TRUE);
}
m_curClass->templateArguments->append(new QCString(m_curString));
}
else
{
warn("Unexpected tag `templarg' found\n");
}
}
void TagFileParser::endTitle ( )
inline

Definition at line 768 of file tagreader.cpp.

References InGroup, InPage, m_curGroup, m_curPage, m_curString, m_state, TagGroupInfo::title, TagPageInfo::title, and warn().

Referenced by startDocument().

{
switch (m_state)
{
case InPage: m_curPage->title = m_curString; break;
default: warn("Unexpected tag `title' found\n"); break;
}
}
void TagFileParser::endType ( )
inline

Definition at line 572 of file tagreader.cpp.

References InMember, m_curMember, m_curString, m_state, TagMemberInfo::type, and warn().

Referenced by startDocument().

{
{
}
else
{
warn("Unexpected tag `type' found\n");
}
}
void TagFileParser::setDocumentLocator ( QXmlLocator *  locator)
inline

Definition at line 268 of file tagreader.cpp.

References m_locator.

{
m_locator = locator;
}
void TagFileParser::setFileName ( const QString &  fileName)
inline

Definition at line 273 of file tagreader.cpp.

References m_inputFileName.

Referenced by parseTagFile().

{
m_inputFileName = fileName.utf8();
}
void TagFileParser::startBase ( const QXmlAttributes &  attrib)
inline

Definition at line 600 of file tagreader.cpp.

References TagClassInfo::bases, InClass, m_curClass, m_curString, m_state, Normal, Private, Protected, Public, Virtual, and warn().

Referenced by startDocument().

{
{
QString protStr = attrib.value("protection");
QString virtStr = attrib.value("virtualness");
Specifier virt = Normal;
if (protStr=="protected")
{
prot = Protected;
}
else if (protStr=="private")
{
prot = Private;
}
if (virtStr=="virtual")
{
virt = Virtual;
}
if (m_curClass->bases==0)
{
m_curClass->bases = new QList<BaseInfo>;
m_curClass->bases->setAutoDelete(TRUE);
}
m_curClass->bases->append(new BaseInfo(m_curString,prot,virt));
}
else
{
warn("Unexpected tag `base' found\n");
}
}
void TagFileParser::startCompound ( const QXmlAttributes &  attrib)
inline

Definition at line 287 of file tagreader.cpp.

References TagClassInfo::Category, TagClassInfo::Class, TagClassInfo::Enum, TagClassInfo::Exception, InClass, InDir, InFile, InGroup, InNamespace, InPackage, InPage, TagClassInfo::Interface, Invalid, TagClassInfo::isObjC, TagClassInfo::kind, m_curClass, m_curDir, m_curFile, m_curGroup, m_curNamespace, m_curPackage, m_curPage, m_curString, m_state, TagClassInfo::Protocol, TagClassInfo::Service, TagClassInfo::Singleton, TagClassInfo::Struct, TagClassInfo::Union, and warn().

Referenced by startDocument().

{
QString kind = attrib.value("kind");
QString isObjC = attrib.value("objc");
if (kind=="class")
{
}
else if (kind=="struct")
{
}
else if (kind=="union")
{
}
else if (kind=="interface")
{
}
else if (kind=="enum")
{
}
else if (kind=="exception")
{
}
else if (kind=="protocol")
{
}
else if (kind=="category")
{
}
else if (kind=="service")
{
}
else if (kind=="singleton")
{
}
else if (kind=="file")
{
}
else if (kind=="namespace")
{
}
else if (kind=="group")
{
}
else if (kind=="page")
{
}
else if (kind=="package")
{
}
else if (kind=="dir")
{
}
else
{
warn("Unknown compound attribute `%s' found!\n",kind.data());
}
if (isObjC=="yes" && m_curClass)
{
m_curClass->isObjC = TRUE;
}
}
void TagFileParser::startDocAnchor ( const QXmlAttributes &  attrib)
inline

Definition at line 565 of file tagreader.cpp.

References m_curString, m_fileName, and m_title.

Referenced by startDocument().

{
m_fileName = attrib.value("file").utf8();
m_title = attrib.value("title").utf8();
}
bool TagFileParser::startDocument ( )
inline

Definition at line 798 of file tagreader.cpp.

References endAnchor(), endAnchorFile(), endArglist(), endBase(), endClangId(), endClass(), endCompound(), endDir(), endDocAnchor(), endEnumValue(), endFile(), endFilename(), endIgnoreElement(), endIncludes(), endMember(), endName(), endNamespace(), endPage(), endPath(), endSubgroup(), endTemplateArg(), endTitle(), endType(), Invalid, m_curClass, m_curDir, m_curFile, m_curGroup, m_curNamespace, m_curPackage, m_curPage, m_endElementHandlers, m_startElementHandlers, m_state, m_stateStack, m_tagFileClasses, m_tagFileDirs, m_tagFileFiles, m_tagFileGroups, m_tagFileNamespaces, m_tagFilePackages, m_tagFilePages, startBase(), startCompound(), startDocAnchor(), startEnumValue(), startIgnoreElement(), startIncludes(), startMember(), and startStringValue().

{
m_stateStack.setAutoDelete(TRUE);
m_tagFileClasses.setAutoDelete(TRUE);
m_tagFileFiles.setAutoDelete(TRUE);
m_tagFileNamespaces.setAutoDelete(TRUE);
m_tagFileGroups.setAutoDelete(TRUE);
m_tagFilePages.setAutoDelete(TRUE);
m_tagFilePackages.setAutoDelete(TRUE);
m_tagFileDirs.setAutoDelete(TRUE);
m_startElementHandlers.insert("compound", new StartElementHandler(this,&TagFileParser::startCompound));
m_startElementHandlers.insert("member", new StartElementHandler(this,&TagFileParser::startMember));
m_startElementHandlers.insert("enumvalue", new StartElementHandler(this,&TagFileParser::startEnumValue));
m_startElementHandlers.insert("name", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("base", new StartElementHandler(this,&TagFileParser::startBase));
m_startElementHandlers.insert("filename", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("includes", new StartElementHandler(this,&TagFileParser::startIncludes));
m_startElementHandlers.insert("path", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("anchorfile", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("anchor", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("clangid", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("arglist", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("title", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("subgroup", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("class", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("namespace", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("file", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("dir", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("page", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("docanchor", new StartElementHandler(this,&TagFileParser::startDocAnchor));
m_startElementHandlers.insert("tagfile", new StartElementHandler(this,&TagFileParser::startIgnoreElement));
m_startElementHandlers.insert("templarg", new StartElementHandler(this,&TagFileParser::startStringValue));
m_startElementHandlers.insert("type", new StartElementHandler(this,&TagFileParser::startStringValue));
m_endElementHandlers.insert("compound", new EndElementHandler(this,&TagFileParser::endCompound));
m_endElementHandlers.insert("member", new EndElementHandler(this,&TagFileParser::endMember));
m_endElementHandlers.insert("enumvalue", new EndElementHandler(this,&TagFileParser::endEnumValue));
m_endElementHandlers.insert("name", new EndElementHandler(this,&TagFileParser::endName));
m_endElementHandlers.insert("base", new EndElementHandler(this,&TagFileParser::endBase));
m_endElementHandlers.insert("filename", new EndElementHandler(this,&TagFileParser::endFilename));
m_endElementHandlers.insert("includes", new EndElementHandler(this,&TagFileParser::endIncludes));
m_endElementHandlers.insert("path", new EndElementHandler(this,&TagFileParser::endPath));
m_endElementHandlers.insert("anchorfile", new EndElementHandler(this,&TagFileParser::endAnchorFile));
m_endElementHandlers.insert("anchor", new EndElementHandler(this,&TagFileParser::endAnchor));
m_endElementHandlers.insert("clangid", new EndElementHandler(this,&TagFileParser::endClangId));
m_endElementHandlers.insert("arglist", new EndElementHandler(this,&TagFileParser::endArglist));
m_endElementHandlers.insert("title", new EndElementHandler(this,&TagFileParser::endTitle));
m_endElementHandlers.insert("subgroup", new EndElementHandler(this,&TagFileParser::endSubgroup));
m_endElementHandlers.insert("class" , new EndElementHandler(this,&TagFileParser::endClass));
m_endElementHandlers.insert("namespace", new EndElementHandler(this,&TagFileParser::endNamespace));
m_endElementHandlers.insert("file", new EndElementHandler(this,&TagFileParser::endFile));
m_endElementHandlers.insert("dir", new EndElementHandler(this,&TagFileParser::endDir));
m_endElementHandlers.insert("page", new EndElementHandler(this,&TagFileParser::endPage));
m_endElementHandlers.insert("docanchor", new EndElementHandler(this,&TagFileParser::endDocAnchor));
m_endElementHandlers.insert("tagfile", new EndElementHandler(this,&TagFileParser::endIgnoreElement));
m_endElementHandlers.insert("templarg", new EndElementHandler(this,&TagFileParser::endTemplateArg));
m_endElementHandlers.insert("type", new EndElementHandler(this,&TagFileParser::endType));
return TRUE;
}
bool TagFileParser::startElement ( const QString &  ,
const QString &  ,
const QString &  name,
const QXmlAttributes &  attrib 
)
inline

Definition at line 870 of file tagreader.cpp.

References m_startElementHandlers, and warn().

{
//printf("startElement `%s'\n",name.data());
StartElementHandler *handler = m_startElementHandlers[name.utf8()];
if (handler)
{
(*handler)(attrib);
}
else
{
warn("Unknown tag `%s' found!\n",name.data());
}
return TRUE;
}
void TagFileParser::startEnumValue ( const QXmlAttributes &  attrib)
inline

Definition at line 462 of file tagreader.cpp.

References TagEnumValueInfo::anchor, TagEnumValueInfo::clangid, TagEnumValueInfo::file, InEnumValue, InMember, m_curEnumValue, m_curString, m_state, m_stateStack, and warn().

Referenced by startDocument().

{
{
m_curEnumValue->file = attrib.value("file").utf8();
m_curEnumValue->anchor = attrib.value("anchor").utf8();
m_curEnumValue->clangid = attrib.value("clangid").utf8();
}
else
{
warn("Found enumvalue tag outside of member tag\n");
}
}
void TagFileParser::startIgnoreElement ( const QXmlAttributes &  )
inline

Definition at line 790 of file tagreader.cpp.

Referenced by startDocument().

{
}
void TagFileParser::startIncludes ( const QXmlAttributes &  attrib)
inline

Definition at line 646 of file tagreader.cpp.

References TagIncludeInfo::id, TagFileInfo::includes, InFile, TagIncludeInfo::isImported, TagIncludeInfo::isLocal, m_curFile, m_curIncludes, m_curString, m_state, TagIncludeInfo::name, and warn().

Referenced by startDocument().

{
{
m_curIncludes->id = attrib.value("id").utf8();
m_curIncludes->name = attrib.value("name").utf8();
m_curIncludes->isLocal = attrib.value("local").utf8()=="yes" ? TRUE : FALSE;
m_curIncludes->isImported = attrib.value("imported").utf8()=="yes" ? TRUE : FALSE;
}
else
{
warn("Unexpected tag `includes' found\n");
}
}
void TagFileParser::startMember ( const QXmlAttributes &  attrib)
inline

Definition at line 416 of file tagreader.cpp.

References InMember, TagMemberInfo::isStatic, TagMemberInfo::kind, m_curMember, m_state, m_stateStack, Private, TagMemberInfo::prot, Protected, Pure, TagMemberInfo::virt, and Virtual.

Referenced by startDocument().

{
m_curMember->kind = attrib.value("kind").utf8();
QCString protStr = attrib.value("protection").utf8();
QCString virtStr = attrib.value("virtualness").utf8();
QCString staticStr = attrib.value("static").utf8();
if (protStr=="protected")
{
}
else if (protStr=="private")
{
}
if (virtStr=="virtual")
{
}
else if (virtStr=="pure")
{
}
if (staticStr=="yes")
{
}
}
void TagFileParser::startStringValue ( const QXmlAttributes &  )
inline

Definition at line 560 of file tagreader.cpp.

References m_curString.

Referenced by startDocument().

{
}
void TagFileParser::warn ( const char *  fmt)
inline
void TagFileParser::warn ( const char *  fmt,
const char *  s 
)
inline

Definition at line 282 of file tagreader.cpp.

References m_inputFileName, m_locator, and warn().

{
::warn(m_inputFileName,m_locator->lineNumber(),fmt,s);
}

Member Data Documentation

TagClassInfo* TagFileParser::m_curClass
private
TagDirInfo* TagFileParser::m_curDir
private
TagEnumValueInfo* TagFileParser::m_curEnumValue
private

Definition at line 931 of file tagreader.cpp.

Referenced by endEnumValue(), startEnumValue(), and TagFileParser().

TagFileInfo* TagFileParser::m_curFile
private
TagGroupInfo* TagFileParser::m_curGroup
private
TagIncludeInfo* TagFileParser::m_curIncludes
private

Definition at line 932 of file tagreader.cpp.

Referenced by endIncludes(), startIncludes(), and TagFileParser().

TagMemberInfo* TagFileParser::m_curMember
private
TagNamespaceInfo* TagFileParser::m_curNamespace
private
TagPackageInfo* TagFileParser::m_curPackage
private
TagPageInfo* TagFileParser::m_curPage
private
QCString TagFileParser::m_curString
private
QDict<EndElementHandler> TagFileParser::m_endElementHandlers
private

Definition at line 922 of file tagreader.cpp.

Referenced by endElement(), startDocument(), and TagFileParser().

QCString TagFileParser::m_fileName
private

Definition at line 935 of file tagreader.cpp.

Referenced by endDocAnchor(), and startDocAnchor().

QCString TagFileParser::m_inputFileName
private

Definition at line 940 of file tagreader.cpp.

Referenced by setFileName(), and warn().

QXmlLocator* TagFileParser::m_locator
private

Definition at line 939 of file tagreader.cpp.

Referenced by setDocumentLocator(), TagFileParser(), and warn().

QDict<StartElementHandler> TagFileParser::m_startElementHandlers
private

Definition at line 921 of file tagreader.cpp.

Referenced by startDocument(), startElement(), and TagFileParser().

State TagFileParser::m_state
private
QStack<State> TagFileParser::m_stateStack
private

Definition at line 938 of file tagreader.cpp.

Referenced by endEnumValue(), endMember(), startDocument(), startEnumValue(), and startMember().

QList<TagClassInfo> TagFileParser::m_tagFileClasses
private

Definition at line 914 of file tagreader.cpp.

Referenced by buildLists(), dump(), endCompound(), and startDocument().

QList<TagDirInfo> TagFileParser::m_tagFileDirs
private

Definition at line 920 of file tagreader.cpp.

Referenced by dump(), endCompound(), and startDocument().

QList<TagFileInfo> TagFileParser::m_tagFileFiles
private

Definition at line 915 of file tagreader.cpp.

Referenced by addIncludes(), buildLists(), dump(), endCompound(), and startDocument().

QList<TagGroupInfo> TagFileParser::m_tagFileGroups
private

Definition at line 917 of file tagreader.cpp.

Referenced by buildLists(), dump(), endCompound(), and startDocument().

QList<TagNamespaceInfo> TagFileParser::m_tagFileNamespaces
private

Definition at line 916 of file tagreader.cpp.

Referenced by buildLists(), dump(), endCompound(), and startDocument().

QList<TagPackageInfo> TagFileParser::m_tagFilePackages
private

Definition at line 919 of file tagreader.cpp.

Referenced by buildLists(), endCompound(), and startDocument().

QList<TagPageInfo> TagFileParser::m_tagFilePages
private

Definition at line 918 of file tagreader.cpp.

Referenced by buildLists(), dump(), endCompound(), and startDocument().

QCString TagFileParser::m_tagName
private

Definition at line 934 of file tagreader.cpp.

Referenced by addDocAnchors(), addIncludes(), buildLists(), and buildMemberList().

QCString TagFileParser::m_title
private

Definition at line 936 of file tagreader.cpp.

Referenced by endDocAnchor(), and startDocAnchor().


The documentation for this class was generated from the following file: