Doxygen
docparser.cpp 文件参考
#include <stdio.h>
#include <stdlib.h>
#include <cassert>
#include <ctype.h>
#include "qcstring.h"
#include "regex.h"
#include "doxygen.h"
#include "debug.h"
#include "util.h"
#include "pagedef.h"
#include "docparser.h"
#include "doctokenizer.h"
#include "cmdmapper.h"
#include "printdocvisitor.h"
#include "message.h"
#include "section.h"
#include "searchindex.h"
#include "language.h"
#include "portable.h"
#include "cite.h"
#include "arguments.h"
#include "vhdldocgen.h"
#include "groupdef.h"
#include "classlist.h"
#include "filedef.h"
#include "memberdef.h"
#include "namespacedef.h"
#include "reflist.h"
#include "formula.h"
#include "config.h"
#include "growbuf.h"
#include "markdown.h"
#include "htmlentity.h"
#include "emoji.h"
#include "fileinfo.h"
#include "dir.h"
+ docparser.cpp 的引用(Include)关系图:

浏览源代码.

struct  DocParserContext
 Parser's context to store all global variables. 更多...
 
class  DocParser
 
class  AutoNodeStack
 
struct  ActiveRowSpan
 Helper class to compute the grid for an HTML style table 更多...
 

宏定义

#define TK_COMMAND_CHAR(token)   ((token)==TK_COMMAND_AT ? "@" : "\\")
 
#define DBG(x)   do {} while(0)
 
#define INTERNAL_ASSERT(x)   do {} while(0)
 
#define CHECK_FOR_COMMAND(str, action)
 

类型定义

using DefinitionStack = std::vector< const Definition * >
 
using DocNodeStack = std::stack< const DocNode * >
 
using DocStyleChangeStack = std::stack< const DocStyleChange * >
 
typedef std::vector< ActiveRowSpanRowSpanList
 List of ActiveRowSpan classes. 更多...
 

函数

std::unique_ptr< IDocParsercreateDocParser ()
 
static void unescapeCRef (QCString &s)
 
static QCString stripKnownExtensions (const QCString &text)
 
static bool insidePRE (DocNode *n)
 
static bool insideLI (DocNode *n)
 
static bool insideUL (DocNode *n)
 
static bool insideOL (DocNode *n)
 
static bool insideTable (DocNode *n)
 
static void flattenParagraphs (DocNode *root, DocNodeList &children)
 
static bool findAttribute (const HtmlAttribList &tagHtmlAttribs, const char *attrName, QCString *result)
 
static QCString extractCopyDocId (const char *data, uint &j, uint len)
 
static uint isCopyBriefOrDetailsCmd (const char *data, uint i, uint len, bool &brief)
 
static uint isVerbatimSection (const char *data, uint i, uint len, QCString &endMarker)
 
static uint skipToEndMarker (const char *data, uint i, uint len, const QCString &endMarker)
 
DocRootvalidatingParseDoc (IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
 
DocTextvalidatingParseText (IDocParser &parserIntf, const QCString &input)
 
DocRefcreateRef (IDocParser &parserIntf, const QCString &target, const QCString &context)
 
void docFindSections (const QCString &input, const Definition *d, const QCString &fileName)
 

变量

static const char * g_sectionLevelToName []
 
static const std::set< std::string > g_plantumlEngine
 

宏定义说明

◆ CHECK_FOR_COMMAND

#define CHECK_FOR_COMMAND (   str,
  action 
)
值:
do if ((i+sizeof(str)<len) && qstrncmp(data+i+1,str,sizeof(str)-1)==0) \
{ j=i+sizeof(str); action; } while(0)

在文件 docparser.cpp7355 行定义.

◆ DBG

#define DBG (   x)    do {} while(0)

在文件 docparser.cpp58 行定义.

◆ INTERNAL_ASSERT

#define INTERNAL_ASSERT (   x)    do {} while(0)

在文件 docparser.cpp67 行定义.

◆ TK_COMMAND_CHAR

#define TK_COMMAND_CHAR (   token)    ((token)==TK_COMMAND_AT ? "@" : "\\")

在文件 docparser.cpp55 行定义.

类型定义说明

◆ DefinitionStack

using DefinitionStack = std::vector<const Definition *>

在文件 docparser.cpp93 行定义.

◆ DocNodeStack

using DocNodeStack = std::stack<const DocNode *>

在文件 docparser.cpp94 行定义.

◆ DocStyleChangeStack

using DocStyleChangeStack = std::stack<const DocStyleChange *>

在文件 docparser.cpp95 行定义.

◆ RowSpanList

typedef std::vector<ActiveRowSpan> RowSpanList

List of ActiveRowSpan classes.

在文件 docparser.cpp3671 行定义.

函数说明

◆ createDocParser()

◆ createRef()

DocRef* createRef ( IDocParser parserIntf,
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()

◆ extractCopyDocId()

static QCString extractCopyDocId ( const char *  data,
uint j,
uint  len 
)
static

在文件 docparser.cpp7296 行定义.

7297 {
7298  uint s=j;
7299  uint e=j;
7300  int round=0;
7301  bool insideDQuote=FALSE;
7302  bool insideSQuote=FALSE;
7303  bool found=FALSE;
7304  while (j<len && !found)
7305  {
7306  if (!insideSQuote && !insideDQuote)
7307  {
7308  switch (data[j])
7309  {
7310  case '(': round++; break;
7311  case ')': round--; break;
7312  case '"': insideDQuote=TRUE; break;
7313  case '\'': insideSQuote=TRUE; break;
7314  case ' ': // fall through
7315  case '\t': // fall through
7316  case '\n':
7317  found=(round==0);
7318  break;
7319  }
7320  }
7321  else if (insideSQuote) // look for single quote end
7322  {
7323  if (data[j]=='\'' && (j==0 || data[j]!='\\'))
7324  {
7325  insideSQuote=FALSE;
7326  }
7327  }
7328  else if (insideDQuote) // look for double quote end
7329  {
7330  if (data[j]=='"' && (j==0 || data[j]!='\\'))
7331  {
7332  insideDQuote=FALSE;
7333  }
7334  }
7335  if (!found) j++;
7336  }
7337  if (qstrncmp(data+j," const",6)==0)
7338  {
7339  j+=6;
7340  }
7341  else if (qstrncmp(data+j," volatile",9)==0)
7342  {
7343  j+=9;
7344  }
7345  e=j;
7346  QCString id(data+s,e-s);
7347  //printf("extractCopyDocId='%s' input='%s'\n",qPrint(id),&data[s]);
7348  return id;
7349 }

引用了 FALSE, qstrncmp() , 以及 TRUE.

被这些函数引用 DocParser::processCopyDoc().

◆ findAttribute()

static bool findAttribute ( const HtmlAttribList tagHtmlAttribs,
const char *  attrName,
QCString result 
)
static

在文件 docparser.cpp5949 行定义.

5952 {
5953 
5954  for (const auto &opt : tagHtmlAttribs)
5955  {
5956  if (opt.name==attrName)
5957  {
5958  *result = opt.value;
5959  return TRUE;
5960  }
5961  }
5962  return FALSE;
5963 }

引用了 FALSE , 以及 TRUE.

被这些函数引用 DocPara::handleHtmlStartTag().

◆ flattenParagraphs()

static void flattenParagraphs ( DocNode root,
DocNodeList children 
)
static

在文件 docparser.cpp2477 行定义.

2478 {
2479  DocNodeList newChildren;
2480  for (const auto &dn : children)
2481  {
2482  if (dn->kind()==DocNode::Kind_Para)
2483  {
2484  DocPara *para = (DocPara*)dn.get();
2485  // move the children of the paragraph to the end of the newChildren list
2486  newChildren.insert(newChildren.end(),
2487  std::make_move_iterator(para->children().begin()),
2488  std::make_move_iterator(para->children().end()));
2489  }
2490  }
2491 
2492  // replace the children list by the newChildren list
2493  children.clear();
2494  children.insert(children.end(),
2495  std::make_move_iterator(newChildren.begin()),
2496  std::make_move_iterator(newChildren.end()));
2497  // reparent the children
2498  for (const auto &cn : children)
2499  {
2500  cn->setParent(root);
2501  }
2502 }

引用了 CompAccept< T >::children(), DocNode::Kind_Para , 以及 DocNode::setParent().

被这些函数引用 DocRef::parse().

◆ insideLI()

static bool insideLI ( DocNode n)
static

Returns TRUE iff node n is a child of a html list item node

在文件 docparser.cpp571 行定义.

572 {
573  while (n)
574  {
575  if (n->kind()==DocNode::Kind_HtmlListItem) return TRUE;
576  n=n->parent();
577  }
578  return FALSE;
579 }

引用了 FALSE, DocNode::kind(), DocNode::Kind_HtmlListItem, DocNode::parent() , 以及 TRUE.

被这些函数引用 DocPara::handleHtmlEndTag() , 以及 DocParser::handleStyleArgument().

◆ insideOL()

static bool insideOL ( DocNode n)
static

Returns TRUE iff node n is a child of a ordered html list node

在文件 docparser.cpp598 行定义.

599 {
600  while (n)
601  {
602  if (n->kind()==DocNode::Kind_HtmlList &&
603  ((DocHtmlList *)n)->type()==DocHtmlList::Ordered) return TRUE;
604  n=n->parent();
605  }
606  return FALSE;
607 }

引用了 FALSE, DocNode::kind(), DocNode::Kind_HtmlList, DocHtmlList::Ordered, DocNode::parent() , 以及 TRUE.

被这些函数引用 DocPara::handleHtmlEndTag() , 以及 DocPara::handleHtmlStartTag().

◆ insidePRE()

static bool insidePRE ( DocNode n)
static

Returns TRUE iff node n is a child of a preformatted node

在文件 docparser.cpp558 行定义.

559 {
560  while (n)
561  {
562  if (n->isPreformatted()) return TRUE;
563  n=n->parent();
564  }
565  return FALSE;
566 }

引用了 FALSE, DocNode::isPreformatted(), DocNode::parent() , 以及 TRUE.

被这些函数引用 DocParser::defaultHandleToken() , 以及 DocPara::parse().

◆ insideTable()

static bool insideTable ( DocNode n)
static

在文件 docparser.cpp611 行定义.

612 {
613  while (n)
614  {
615  if (n->kind()==DocNode::Kind_HtmlTable) return TRUE;
616  n=n->parent();
617  }
618  return FALSE;
619 }

引用了 FALSE, DocNode::kind(), DocNode::Kind_HtmlTable, DocNode::parent() , 以及 TRUE.

被这些函数引用 filterLatexString() , 以及 DocPara::handleHtmlStartTag().

◆ insideUL()

static bool insideUL ( DocNode n)
static

Returns TRUE iff node n is a child of a unordered html list node

在文件 docparser.cpp584 行定义.

585 {
586  while (n)
587  {
588  if (n->kind()==DocNode::Kind_HtmlList &&
589  ((DocHtmlList *)n)->type()==DocHtmlList::Unordered) return TRUE;
590  n=n->parent();
591  }
592  return FALSE;
593 }

引用了 FALSE, DocNode::kind(), DocNode::Kind_HtmlList, DocNode::parent(), TRUE , 以及 DocHtmlList::Unordered.

被这些函数引用 DocPara::handleHtmlEndTag() , 以及 DocPara::handleHtmlStartTag().

◆ isCopyBriefOrDetailsCmd()

static uint isCopyBriefOrDetailsCmd ( const char *  data,
uint  i,
uint  len,
bool &  brief 
)
static

在文件 docparser.cpp7359 行定义.

7360 {
7361  int j=0;
7362  if (i==0 || (data[i-1]!='@' && data[i-1]!='\\')) // not an escaped command
7363  {
7364  CHECK_FOR_COMMAND("copybrief",brief=TRUE); // @copybrief or \copybrief
7365  CHECK_FOR_COMMAND("copydetails",brief=FALSE); // @copydetails or \copydetails
7366  }
7367  return j;
7368 }

引用了 CHECK_FOR_COMMAND, FALSE , 以及 TRUE.

被这些函数引用 DocParser::processCopyDoc().

◆ isVerbatimSection()

static uint isVerbatimSection ( const char *  data,
uint  i,
uint  len,
QCString endMarker 
)
static

在文件 docparser.cpp7370 行定义.

7371 {
7372  int j=0;
7373  if (i==0 || (data[i-1]!='@' && data[i-1]!='\\')) // not an escaped command
7374  {
7375  CHECK_FOR_COMMAND("dot",endMarker="enddot");
7376  CHECK_FOR_COMMAND("code",endMarker="endcode");
7377  CHECK_FOR_COMMAND("msc",endMarker="endmsc");
7378  CHECK_FOR_COMMAND("verbatim",endMarker="endverbatim");
7379  CHECK_FOR_COMMAND("latexonly",endMarker="endlatexonly");
7380  CHECK_FOR_COMMAND("htmlonly",endMarker="endhtmlonly");
7381  CHECK_FOR_COMMAND("xmlonly",endMarker="endxmlonly");
7382  CHECK_FOR_COMMAND("rtfonly",endMarker="endrtfonly");
7383  CHECK_FOR_COMMAND("manonly",endMarker="endmanonly");
7384  CHECK_FOR_COMMAND("docbookonly",endMarker="enddocbookonly");
7385  CHECK_FOR_COMMAND("startuml",endMarker="enduml");
7386  }
7387  //printf("isVerbatimSection(%s)=%d)\n",qPrint(QCString(&data[i]).left(10)),j);
7388  return j;
7389 }

引用了 CHECK_FOR_COMMAND.

被这些函数引用 DocParser::processCopyDoc().

◆ skipToEndMarker()

static uint skipToEndMarker ( const char *  data,
uint  i,
uint  len,
const QCString endMarker 
)
static

在文件 docparser.cpp7391 行定义.

7392 {
7393  while (i<len)
7394  {
7395  if ((data[i]=='@' || data[i]=='\\') && // start of command character
7396  (i==0 || (data[i-1]!='@' && data[i-1]!='\\'))) // that is not escaped
7397  {
7398  if (i+endMarker.length()+1<=len && qstrncmp(data+i+1,endMarker.data(),endMarker.length())==0)
7399  {
7400  return i+endMarker.length()+1;
7401  }
7402  }
7403  i++;
7404  }
7405  // oops no endmarker found...
7406  return i<len ? i+1 : len;
7407 }

引用了 QCString::data(), QCString::length() , 以及 qstrncmp().

被这些函数引用 DocParser::processCopyDoc().

◆ stripKnownExtensions()

static QCString stripKnownExtensions ( const QCString text)
static

Strips known html and tex extensions from text.

在文件 docparser.cpp539 行定义.

540 {
541  QCString result=text;
542  if (result.right(4)==".tex")
543  {
544  result=result.left(result.length()-4);
545  }
546  else if (result.right(Doxygen::htmlFileExtension.length())==
548  {
549  result=result.left(result.length()-Doxygen::htmlFileExtension.length());
550  }
551  return result;
552 }

引用了 Doxygen::htmlFileExtension, QCString::left(), QCString::length() , 以及 QCString::right().

被这些函数引用 DocLink::DocLink(), DocRef::DocRef() , 以及 DocSecRefItem::parse().

◆ unescapeCRef()

static void unescapeCRef ( QCString s)
static

在文件 docparser.cpp241 行定义.

242 {
243  QCString result;
244  const char *p = s.data();
245  if (p)
246  {
247  char c;
248  while ((c=*p++))
249  {
250  if (c=='{') c='<'; else if (c=='}') c='>';
251  result+=c;
252  }
253  }
254 
255  result=substitute(result,"&lt;","<");
256  result=substitute(result,"&gt;",">");
257  s = result;
258 }

引用了 QCString::data() , 以及 substitute().

被这些函数引用 DocPara::handleHtmlStartTag().

◆ 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 &&
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();
7550  }
7551  }
7552  else
7553  {
7554  parser.context.searchUrl="";
7555  }
7556 
7557  parser.context.fileName = fileName;
7558  parser.context.relPath = (!linkFromIndex && ctx) ?
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().

变量说明

◆ g_plantumlEngine

const std::set<std::string> g_plantumlEngine
static
初始值:
{
"uml", "bpm", "wire", "dot", "ditaa",
"salt", "math", "latex", "gantt", "mindmap",
"wbs", "yaml", "creole", "json", "flow",
"board", "git"
}

在文件 docparser.cpp82 行定义.

被这些函数引用 DocPara::handleCommand().

◆ g_sectionLevelToName

const char* g_sectionLevelToName[]
static
初始值:
=
{
"page",
"section",
"subsection",
"subsubsection",
"paragraph",
"subparagraph"
}

在文件 docparser.cpp72 行定义.

被这些函数引用 DocSection::parse().

DocParserContext::searchUrl
QCString searchUrl
Definition: docparser.cpp:120
DocParser::popContext
void popContext()
Definition: docparser.cpp:222
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
toGroupDef
GroupDef * toGroupDef(Definition *d)
Definition: groupdef.cpp:1766
DocNode::isPreformatted
bool isPreformatted() const
Definition: docparser.h:177
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
qstrncmp
int qstrncmp(const char *str1, const char *str2, size_t len)
Definition: qcstring.h:91
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
DocHtmlList::Ordered
@ Ordered
Definition: docparser.h:1096
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
DocNode::kind
virtual Kind kind() const =0
DocHtmlList::Unordered
@ Unordered
Definition: docparser.h:1096
DocNodeList
std::vector< std::unique_ptr< DocNode > > DocNodeList
Definition: docparser.h:190
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
DocParserContext::includeFileOffset
uint includeFileOffset
Definition: docparser.cpp:124
DocParserContext::markdownSupport
bool markdownSupport
Definition: docparser.cpp:131
DocNode::Kind_Para
@ Kind_Para
Definition: docparser.h:103
Definition::name
virtual QCString name() const =0
DocNode::setParent
void setParent(DocNode *parent)
Definition: docparser.h:169
DocNode::Kind_HtmlList
@ Kind_HtmlList
Definition: docparser.h:116
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
TRUE
#define TRUE
Definition: qcstring.h:36
Definition::getOutputFileBase
virtual QCString getOutputFileBase() const =0
DocHtmlList
Node representing a Html list
Definition: docparser.h:1093
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
Definition::definitionType
virtual DefType definitionType() const =0
DocNode::Kind_HtmlTable
@ Kind_HtmlTable
Definition: docparser.h:121
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
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Definition::anchor
virtual QCString anchor() const =0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DocParser::checkUnOrMultipleDocumentedParams
void checkUnOrMultipleDocumentedParams()
Definition: docparser.cpp:468
Doxygen::htmlFileExtension
static QCString htmlFileExtension
Definition: doxygen.h:103
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
CompAccept::children
const DocNodeList & children() const
Definition: docparser.h:207
DocParserContext::includeFileText
QCString includeFileText
Definition: docparser.cpp:123
DocParserContext::insideHtmlLink
bool insideHtmlLink
Definition: docparser.cpp:105
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocRoot::parse
void parse()
Definition: docparser.cpp:7136
CHECK_FOR_COMMAND
#define CHECK_FOR_COMMAND(str, action)
Definition: docparser.cpp:7355
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
Debug::PrintTree
@ PrintTree
Definition: debug.h:34
FALSE
#define FALSE
Definition: qcstring.h:33
DocNode::Kind_HtmlListItem
@ Kind_HtmlListItem
Definition: docparser.h:117
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108