Doxygen
docparser.h 文件参考
#include <stdio.h>
#include <vector>
#include <memory>
#include "qcstring.h"
#include "docvisitor.h"
#include "htmlattrib.h"
+ docparser.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  IDocParser
 
class  DocNode
 Abstract node interface with type information. 更多...
 
class  CompAccept< T >
 Default accept implementation for compound nodes in the abstract syntax tree. 更多...
 
class  DocWord
 Node representing a word 更多...
 
class  DocLinkedWord
 Node representing a word that can be linked to something 更多...
 
class  DocURL
 Node representing a URL (or email address) 更多...
 
class  DocLineBreak
 Node representing a line break 更多...
 
class  DocHorRuler
 Node representing a horizontal ruler 更多...
 
class  DocAnchor
 Node representing an anchor 更多...
 
class  DocCite
 Node representing a citation of some bibliographic reference 更多...
 
class  DocStyleChange
 Node representing a style change 更多...
 
class  DocSymbol
 Node representing a special symbol 更多...
 
struct  DocSymbol::PerlSymb
 
class  DocEmoji
 Node representing a n emoji 更多...
 
class  DocWhiteSpace
 Node representing some amount of white space 更多...
 
class  DocSeparator
 Node representing a separator 更多...
 
class  DocVerbatim
 Node representing a verbatim, unparsed text fragment 更多...
 
class  DocInclude
 Node representing an included text block from file 更多...
 
class  DocIncOperator
 Node representing a include/dontinclude operator block 更多...
 
class  DocFormula
 Node representing an item of a cross-referenced list 更多...
 
class  DocIndexEntry
 Node representing an entry in the index. 更多...
 
class  DocAutoList
 Node representing an auto List 更多...
 
class  DocAutoListItem
 Node representing an item of a auto list 更多...
 
class  DocTitle
 Node representing a simple section title 更多...
 
class  DocXRefItem
 Node representing an item of a cross-referenced list 更多...
 
class  DocImage
 Node representing an image 更多...
 
class  DocDiagramFileBase< T >
 
class  DocDotFile
 Node representing a dot file 更多...
 
class  DocMscFile
 Node representing a msc file 更多...
 
class  DocDiaFile
 Node representing a dia file 更多...
 
class  DocVhdlFlow
 Node representing a VHDL flow chart 更多...
 
class  DocLink
 Node representing a link to some item 更多...
 
class  DocRef
 Node representing a reference to some item 更多...
 
class  DocInternalRef
 Node representing an internal reference to some item 更多...
 
class  DocHRef
 Node representing a Hypertext reference 更多...
 
class  DocHtmlHeader
 Node Html heading 更多...
 
class  DocHtmlDescTitle
 Node representing a Html description item 更多...
 
class  DocHtmlDescList
 Node representing a Html description list 更多...
 
class  DocSection
 Node representing a normal section 更多...
 
class  DocSecRefItem
 Node representing a reference to a section 更多...
 
class  DocSecRefList
 Node representing a list of section references 更多...
 
class  DocInternal
 Node representing an internal section of documentation 更多...
 
class  DocParBlock
 Node representing an block of paragraphs 更多...
 
class  DocSimpleList
 Node representing a simple list 更多...
 
class  DocHtmlList
 Node representing a Html list 更多...
 
class  DocSimpleSect
 Node representing a simple section 更多...
 
class  DocSimpleSectSep
 Node representing a separator between two simple sections of the same type. 更多...
 
class  DocParamSect
 Node representing a parameter section 更多...
 
class  DocPara
 Node representing a paragraph in the documentation tree 更多...
 
class  DocParamList
 Node representing a parameter list. 更多...
 
class  DocSimpleListItem
 Node representing a simple list item 更多...
 
class  DocHtmlListItem
 Node representing a HTML list item 更多...
 
class  DocHtmlDescData
 Node representing a HTML description data 更多...
 
class  DocHtmlCell
 Node representing a HTML table cell 更多...
 
class  DocHtmlCaption
 Node representing a HTML table caption 更多...
 
class  DocHtmlRow
 Node representing a HTML table row 更多...
 
class  DocHtmlTable
 Node representing a HTML table 更多...
 
class  DocHtmlBlockQuote
 Node representing an HTML blockquote 更多...
 
class  DocText
 Root node of a text fragment 更多...
 
class  DocRoot
 Root node of documentation tree 更多...
 

类型定义

using DocNodeList = std::vector< std::unique_ptr< DocNode > >
 
using DocParaList = std::vector< std::unique_ptr< DocPara > >
 

函数

std::unique_ptr< IDocParsercreateDocParser ()
 
DocRootvalidatingParseDoc (IDocParser &parser, const QCString &fileName, int startLine, const Definition *context, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
 
DocTextvalidatingParseText (IDocParser &parser, const QCString &input)
 
void docFindSections (const QCString &input, const Definition *d, const QCString &fileName)
 
DocRefcreateRef (IDocParser &parser, const QCString &target, const QCString &context)
 

类型定义说明

◆ DocNodeList

using DocNodeList = std::vector< std::unique_ptr<DocNode> >

在文件 docparser.h190 行定义.

◆ DocParaList

using DocParaList = std::vector< std::unique_ptr<DocPara> >

在文件 docparser.h1225 行定义.

函数说明

◆ createDocParser()

◆ createRef()

DocRef* createRef ( IDocParser parser,
const QCString target,
const QCString context 
)

在文件 docparser.cpp7675 行定义.

7676 {
7677  DocParser &parser = dynamic_cast<DocParser&>(parserIntf);
7678  return new DocRef(parser,0,target,context);
7679 }

被这些函数引用 convertMapFile() , 以及 replaceRef().

◆ docFindSections()

◆ validatingParseDoc()

DocRoot* validatingParseDoc ( IDocParser parser,
const QCString fileName,
int  startLine,
const Definition context,
const MemberDef md,
const QCString input,
bool  indexWords,
bool  isExample,
const QCString exampleName,
bool  singleLine,
bool  linkFromIndex,
bool  markdownSupport 
)

Main entry point for the documentation parser.

参数
parserThe parser object created via createDocParser()
fileNameFile in which the documentation block is found (or the name of the example file in case isExample is TRUE).
startLineLine at which the documentation block is found.
contextClass or namespace to which this block belongs.
mdMember definition to which the documentation belongs. Can be 0.
inputString representation of the documentation block.
indexWordsIndicates whether or not words should be put in the search index.
isExampleTRUE if the documentation belongs to an example.
exampleNameBase name of the example file (0 if isExample is FALSE).
singleLineOutput should be presented on a single line, so without starting a new paragraph at the end.
linkFromIndexTRUE if the documentation is generated from an index page. In this case context is not used to determine the relative path when making a link.
markdownSupportTRUE if the input needs to take markdown markup into account.
返回
Root node of the abstract syntax tree. Ownership of the pointer is handed over to the caller.

在文件 docparser.cpp7495 行定义.

7502 {
7503  DocParser &parser = dynamic_cast<DocParser&>(parserIntf);
7504  //printf("validatingParseDoc(%s,%s)=[%s]\n",ctx?qPrint(ctx->name()):"<none>",
7505  // md?qPrint(md->name()):"<none>",
7506  // input);
7507  //printf("========== validating %s at line %d\n",qPrint(fileName),startLine);
7508  //printf("---------------- input --------------------\n%s\n----------- end input -------------------\n",qPrint(input));
7509  //parser.context.token = new TokenInfo;
7510 
7511  // store parser state so we can re-enter this function if needed
7512  //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
7513  parser.pushContext();
7514 
7515  if (ctx && ctx!=Doxygen::globalScope &&
7516  (ctx->definitionType()==Definition::TypeClass ||
7517  ctx->definitionType()==Definition::TypeNamespace
7518  )
7519  )
7520  {
7521  parser.context.context = ctx->name();
7522  }
7523  else if (ctx && ctx->definitionType()==Definition::TypePage)
7524  {
7525  const Definition *scope = (toPageDef(ctx))->getPageScope();
7526  if (scope && scope!=Doxygen::globalScope) parser.context.context = scope->name();
7527  }
7528  else if (ctx && ctx->definitionType()==Definition::TypeGroup)
7529  {
7530  const Definition *scope = (toGroupDef(ctx))->getGroupScope();
7531  if (scope && scope!=Doxygen::globalScope) parser.context.context = scope->name();
7532  }
7533  else
7534  {
7535  parser.context.context = "";
7536  }
7537  parser.context.scope = ctx;
7538 
7539  if (indexWords && Doxygen::searchIndex)
7540  {
7541  if (md)
7542  {
7543  parser.context.searchUrl=md->getOutputFileBase();
7545  }
7546  else if (ctx)
7547  {
7548  parser.context.searchUrl=ctx->getOutputFileBase();
7549  Doxygen::searchIndex->setCurrentDoc(ctx,ctx->anchor(),FALSE);
7550  }
7551  }
7552  else
7553  {
7554  parser.context.searchUrl="";
7555  }
7556 
7557  parser.context.fileName = fileName;
7558  parser.context.relPath = (!linkFromIndex && ctx) ?
7559  QCString(relativePathToRoot(ctx->getOutputFileBase())) :
7560  QCString("");
7561  //printf("ctx->name=%s relPath=%s\n",qPrint(ctx->name()),qPrint(parser.context.relPath));
7562  parser.context.memberDef = md;
7563  while (!parser.context.nodeStack.empty()) parser.context.nodeStack.pop();
7564  while (!parser.context.styleStack.empty()) parser.context.styleStack.pop();
7565  while (!parser.context.initialStyleStack.empty()) parser.context.initialStyleStack.pop();
7566  parser.context.inSeeBlock = FALSE;
7567  parser.context.xmlComment = FALSE;
7568  parser.context.insideHtmlLink = FALSE;
7569  parser.context.includeFileText = "";
7570  parser.context.includeFileOffset = 0;
7571  parser.context.includeFileLength = 0;
7572  parser.context.isExample = isExample;
7573  parser.context.exampleName = exampleName;
7574  parser.context.hasParamCommand = FALSE;
7575  parser.context.hasReturnCommand = FALSE;
7576  parser.context.retvalsFound.clear();
7577  parser.context.paramsFound.clear();
7578  parser.context.markdownSupport = markdownSupport;
7579 
7580  //printf("Starting comment block at %s:%d\n",qPrint(parser.context.fileName),startLine);
7581  parser.tokenizer.setLineNr(startLine);
7582  uint ioLen = input.length();
7583  QCString inpStr = parser.processCopyDoc(input.data(),ioLen);
7584  if (inpStr.isEmpty() || inpStr.at(inpStr.length()-1)!='\n')
7585  {
7586  inpStr+='\n';
7587  }
7588  //printf("processCopyDoc(in='%s' out='%s')\n",input,qPrint(inpStr));
7589  parser.tokenizer.init(inpStr.data(),parser.context.fileName,markdownSupport);
7590 
7591  // build abstract syntax tree
7592  DocRoot *root = new DocRoot(parser,md!=0,singleLine);
7593  root->parse();
7594 
7595 
7597  {
7598  // pretty print the result
7600  root->accept(v);
7601  delete v;
7602  }
7603 
7606 
7607  // TODO: These should be called at the end of the program.
7608  //parser.tokenizer.cleanup();
7609  //Mappers::cmdMapper->freeInstance();
7610  //Mappers::htmlTagMapper->freeInstance();
7611 
7612  // restore original parser state
7613  parser.popContext();
7614 
7615  //printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?qPrint(ctx->name()):"<none>",
7616  // md?qPrint(md->name()):"<none>");
7617 
7618  return root;
7619 }

引用了 CompAccept< T >::accept(), MemberDef::anchor(), Definition::anchor(), QCString::at(), DocParser::checkUnOrMultipleDocumentedParams(), DocParserContext::context, DocParser::context, QCString::data(), Definition::definitionType(), MemberDef::detectUndocumentedParams(), DocParserContext::exampleName, FALSE, DocParserContext::fileName, MemberDef::getOutputFileBase(), Definition::getOutputFileBase(), Doxygen::globalScope, DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, DocParserContext::includeFileLength, DocParserContext::includeFileOffset, DocParserContext::includeFileText, DocTokenizer::init(), DocParserContext::initialStyleStack, DocParserContext::inSeeBlock, DocParserContext::insideHtmlLink, QCString::isEmpty(), DocParserContext::isExample, Debug::isFlagSet(), QCString::length(), DocParserContext::markdownSupport, DocParserContext::memberDef, Definition::name(), DocParserContext::nodeStack, DocParserContext::paramsFound, DocRoot::parse(), DocParser::popContext(), Debug::PrintTree, DocParser::processCopyDoc(), DocParser::pushContext(), relativePathToRoot(), DocParserContext::relPath, DocParserContext::retvalsFound, DocParserContext::scope, Doxygen::searchIndex, DocParserContext::searchUrl, SearchIndexIntf::setCurrentDoc(), DocTokenizer::setLineNr(), DocParserContext::styleStack, toGroupDef(), DocParser::tokenizer, toPageDef(), Definition::TypeClass, Definition::TypeGroup, Definition::TypeNamespace, Definition::TypePage , 以及 DocParserContext::xmlComment.

被这些函数引用 addPerlModDocBlock(), generateBriefDoc(), OutputList::generateDoc(), parseCommentAsText(), parseDoc(), ConceptDefImpl::writeBriefDescription(), DirDefImpl::writeBriefDescription(), NamespaceDefImpl::writeBriefDescription(), GroupDefImpl::writeBriefDescription(), FileDefImpl::writeBriefDescription(), MemberDefImpl::writeDeclaration(), ConceptDefImpl::writeDeclarationLink(), ClassDefImpl::writeDeclarationLink(), MemberList::writePlainDeclarations() , 以及 writeXMLDocBlock().

◆ validatingParseText()

DocText* validatingParseText ( IDocParser parser,
const QCString input 
)

Main entry point for parsing simple text fragments. These fragments are limited to words, whitespace and symbols.

在文件 docparser.cpp7621 行定义.

7622 {
7623  DocParser &parser = dynamic_cast<DocParser&>(parserIntf);
7624  // store parser state so we can re-enter this function if needed
7625  parser.pushContext();
7626 
7627  //printf("------------ input ---------\n%s\n"
7628  // "------------ end input -----\n",input);
7629  //parser.context.token = new TokenInfo;
7630  parser.context.context = "";
7631  parser.context.fileName = "<parseText>";
7632  parser.context.relPath = "";
7633  parser.context.memberDef = 0;
7634  while (!parser.context.nodeStack.empty()) parser.context.nodeStack.pop();
7635  while (!parser.context.styleStack.empty()) parser.context.styleStack.pop();
7636  while (!parser.context.initialStyleStack.empty()) parser.context.initialStyleStack.pop();
7637  parser.context.inSeeBlock = FALSE;
7638  parser.context.xmlComment = FALSE;
7639  parser.context.insideHtmlLink = FALSE;
7640  parser.context.includeFileText = "";
7641  parser.context.includeFileOffset = 0;
7642  parser.context.includeFileLength = 0;
7643  parser.context.isExample = FALSE;
7644  parser.context.exampleName = "";
7645  parser.context.hasParamCommand = FALSE;
7646  parser.context.hasReturnCommand = FALSE;
7647  parser.context.retvalsFound.clear();
7648  parser.context.paramsFound.clear();
7649  parser.context.searchUrl="";
7650 
7651  DocText *txt = new DocText(parser);
7652 
7653  if (!input.isEmpty())
7654  {
7655  parser.tokenizer.setLineNr(1);
7656  parser.tokenizer.init(input.data(),parser.context.fileName,Config_getBool(MARKDOWN_SUPPORT));
7657 
7658  // build abstract syntax tree
7659  txt->parse();
7660 
7662  {
7663  // pretty print the result
7665  txt->accept(v);
7666  delete v;
7667  }
7668  }
7669 
7670  // restore original parser state
7671  parser.popContext();
7672  return txt;
7673 }

引用了 CompAccept< T >::accept(), Config_getBool, DocParserContext::context, DocParser::context, QCString::data(), DocParserContext::exampleName, FALSE, DocParserContext::fileName, DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, DocParserContext::includeFileLength, DocParserContext::includeFileOffset, DocParserContext::includeFileText, DocTokenizer::init(), DocParserContext::initialStyleStack, DocParserContext::inSeeBlock, DocParserContext::insideHtmlLink, QCString::isEmpty(), DocParserContext::isExample, Debug::isFlagSet(), DocParserContext::memberDef, DocParserContext::nodeStack, DocParserContext::paramsFound, DocText::parse(), DocParser::popContext(), Debug::PrintTree, DocParser::pushContext(), DocParserContext::relPath, DocParserContext::retvalsFound, DocParserContext::searchUrl, DocTokenizer::setLineNr(), DocParserContext::styleStack, DocParser::tokenizer , 以及 DocParserContext::xmlComment.

被这些函数引用 RTFGenerator::endIndexSection() , 以及 OutputList::parseText().

DocParserContext::searchUrl
QCString searchUrl
Definition: docparser.cpp:120
DocParser::popContext
void popContext()
Definition: docparser.cpp:222
toGroupDef
GroupDef * toGroupDef(Definition *d)
Definition: groupdef.cpp:1766
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocParserContext::scope
const Definition * scope
Definition: docparser.cpp:101
DocParserContext::relPath
QCString relPath
Definition: docparser.cpp:111
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
relativePathToRoot
QCString relativePathToRoot(const QCString &name)
Definition: util.cpp:3656
DocParserContext::retvalsFound
StringMultiSet retvalsFound
Definition: docparser.cpp:115
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
DocTokenizer::findSections
void findSections(const QCString &input, const Definition *d, const QCString &fileName)
DocParserContext::nodeStack
DocNodeStack nodeStack
Definition: docparser.cpp:106
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
Definition::TypePage
@ TypePage
Definition: definition.h:93
DocTokenizer::init
void init(const char *input, const QCString &fileName, bool markdownSupport)
Doxygen::globalScope
static NamespaceDefMutable * globalScope
Definition: doxygen.h:102
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
Definition::TypeGroup
@ TypeGroup
Definition: definition.h:91
DocParser
Definition: docparser.cpp:134
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
CompAccept::accept
void accept(DocVisitor *v) override
Definition: docparser.h:200
DocText
Root node of a text fragment
Definition: docparser.h:1447
DocParserContext::hasReturnCommand
bool hasReturnCommand
Definition: docparser.cpp:114
DocParser::processCopyDoc
QCString processCopyDoc(const char *data, uint &len)
Definition: docparser.cpp:7409
DocParserContext::exampleName
QCString exampleName
Definition: docparser.cpp:119
Debug::isFlagSet
static bool isFlagSet(DebugMask mask)
Definition: debug.cpp:99
toPageDef
PageDef * toPageDef(Definition *d)
Definition: pagedef.cpp:408
DocParserContext::memberDef
const MemberDef * memberDef
Definition: docparser.cpp:117
DocParserContext::inSeeBlock
bool inSeeBlock
Definition: docparser.cpp:103
uint
unsigned uint
Definition: qcstring.h:40
MemberDef::anchor
virtual QCString anchor() const =0
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
Definition::TypeNamespace
@ TypeNamespace
Definition: definition.h:89
DocParserContext::includeFileOffset
uint includeFileOffset
Definition: docparser.cpp:124
DocParserContext::markdownSupport
bool markdownSupport
Definition: docparser.cpp:131
Definition::name
virtual QCString name() const =0
DocParserContext::context
QCString context
Definition: docparser.cpp:102
DocParserContext::xmlComment
bool xmlComment
Definition: docparser.cpp:104
DocRef
Node representing a reference to some item
Definition: docparser.h:891
DocParserContext::styleStack
DocStyleChangeStack styleStack
Definition: docparser.cpp:107
MemberDef::detectUndocumentedParams
virtual void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const =0
DocParser::pushContext
void pushContext()
Definition: docparser.cpp:208
Definition::TypeClass
@ TypeClass
Definition: definition.h:87
DocParserContext::includeFileLength
uint includeFileLength
Definition: docparser.cpp:125
PrintDocVisitor
Definition: printdocvisitor.h:28
DocParserContext::initialStyleStack
DocStyleChangeStack initialStyleStack
Definition: docparser.cpp:108
Doxygen::searchIndex
static SearchIndexIntf * searchIndex
Definition: doxygen.h:105
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DocParser::checkUnOrMultipleDocumentedParams
void checkUnOrMultipleDocumentedParams()
Definition: docparser.cpp:468
DocParserContext::isExample
bool isExample
Definition: docparser.cpp:118
DocTokenizer::setLineNr
void setLineNr(int lineno)
SearchIndexIntf::setCurrentDoc
virtual void setCurrentDoc(const Definition *ctx, const QCString &anchor, bool isSourceFile)=0
DocParserContext::paramsFound
StringMultiSet paramsFound
Definition: docparser.cpp:116
DocText::parse
void parse()
Definition: docparser.cpp:7028
DocParserContext::hasParamCommand
bool hasParamCommand
Definition: docparser.cpp:113
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
DocParserContext::includeFileText
QCString includeFileText
Definition: docparser.cpp:123
DocParserContext::insideHtmlLink
bool insideHtmlLink
Definition: docparser.cpp:105
DocRoot::parse
void parse()
Definition: docparser.cpp:7136
Debug::PrintTree
@ PrintTree
Definition: debug.h:34
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108