Doxygen
DocText类 参考

Root node of a text fragment 更多...

#include <docparser.h>

+ 类 DocText 继承关系图:
+ DocText 的协作图:

Public 成员函数

 DocText (DocParser &parser)
 
Kind kind () const override
 
void parse ()
 
bool isEmpty () const
 
- Public 成员函数 继承自 CompAccept< DocText >
 CompAccept (DocParser &parser)
 
void accept (DocVisitor *v) override
 
const DocNodeListchildren () const
 
DocNodeListchildren ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

额外继承的成员函数

- Public 类型 继承自 DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52, Kind_Emoji = 53, Kind_Sep = 54
}
 
- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 CompAccept< DocText >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Root node of a text fragment

在文件 docparser.h1447 行定义.

构造及析构函数说明

◆ DocText()

DocText::DocText ( DocParser parser)
inline

在文件 docparser.h1450 行定义.

1450 : CompAccept<DocText>(parser) {}

成员函数说明

◆ isEmpty()

bool DocText::isEmpty ( ) const
inline

在文件 docparser.h1453 行定义.

1453 { return m_children.empty(); }

引用了 CompAccept< DocText >::m_children.

◆ kind()

Kind DocText::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1451 行定义.

1451 { return Kind_Text; }

引用了 DocNode::Kind_Text.

◆ parse()

void DocText::parse ( )

在文件 docparser.cpp7028 行定义.

7029 {
7030  DBG(("DocText::parse() start\n"));
7031  auto ns = AutoNodeStack(m_parser,this);
7033 
7034  int tok;
7035  while ((tok=m_parser.tokenizer.lex())) // get the next token
7036  {
7037  switch(tok)
7038  {
7039  case TK_WORD:
7040  m_children.push_back(std::make_unique<DocWord>(m_parser,this,m_parser.context.token->name));
7041  break;
7042  case TK_WHITESPACE:
7043  m_children.push_back(std::make_unique<DocWhiteSpace>(m_parser,this,m_parser.context.token->chars));
7044  break;
7045  case TK_SYMBOL:
7046  {
7048  if (s!=DocSymbol::Sym_Unknown)
7049  {
7050  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,s));
7051  }
7052  else
7053  {
7054  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unsupported symbol %s found",
7056  }
7057  }
7058  break;
7059  case TK_COMMAND_AT:
7060  // fall through
7061  case TK_COMMAND_BS:
7062  switch (Mappers::cmdMapper->map(m_parser.context.token->name))
7063  {
7064  case CMD_BSLASH:
7065  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_BSlash));
7066  break;
7067  case CMD_AT:
7068  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_At));
7069  break;
7070  case CMD_LESS:
7071  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Less));
7072  break;
7073  case CMD_GREATER:
7074  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Greater));
7075  break;
7076  case CMD_AMP:
7077  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Amp));
7078  break;
7079  case CMD_DOLLAR:
7080  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Dollar));
7081  break;
7082  case CMD_HASH:
7083  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Hash));
7084  break;
7085  case CMD_DCOLON:
7086  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_DoubleColon));
7087  break;
7088  case CMD_PERCENT:
7089  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Percent));
7090  break;
7091  case CMD_NDASH:
7092  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7093  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7094  break;
7095  case CMD_MDASH:
7096  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7097  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7098  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7099  break;
7100  case CMD_QUOTE:
7101  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Quot));
7102  break;
7103  case CMD_PUNT:
7104  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Dot));
7105  break;
7106  case CMD_PLUS:
7107  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Plus));
7108  break;
7109  case CMD_MINUS:
7110  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Minus));
7111  break;
7112  case CMD_EQUAL:
7113  m_children.push_back(std::make_unique<DocSymbol>(m_parser,this,DocSymbol::Sym_Equal));
7114  break;
7115  default:
7116  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected command '%s' found",
7118  break;
7119  }
7120  break;
7121  default:
7124  break;
7125  }
7126  }
7127 
7129 
7130  DBG(("DocText::parse() end\n"));
7131 }

引用了 TokenInfo::chars, CMD_AMP, CMD_AT, CMD_BSLASH, CMD_DCOLON, CMD_DOLLAR, CMD_EQUAL, CMD_GREATER, CMD_HASH, CMD_LESS, CMD_MDASH, CMD_MINUS, CMD_NDASH, CMD_PERCENT, CMD_PLUS, CMD_PUNT, CMD_QUOTE, Mappers::cmdMapper, DocParser::context, DBG, DocSymbol::decodeSymbol(), DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handleUnclosedStyleCommands(), DocTokenizer::lex(), CompAccept< DocText >::m_children, DocNode::m_parser, TokenInfo::name, qPrint(), DocTokenizer::setStateText(), DocSymbol::Sym_Amp, DocSymbol::Sym_At, DocSymbol::Sym_BSlash, DocSymbol::Sym_Dollar, DocSymbol::Sym_Dot, DocSymbol::Sym_DoubleColon, DocSymbol::Sym_Equal, DocSymbol::Sym_Greater, DocSymbol::Sym_Hash, DocSymbol::Sym_Less, DocSymbol::Sym_Minus, DocSymbol::Sym_Percent, DocSymbol::Sym_Plus, DocSymbol::Sym_Quot, DocSymbol::Sym_Unknown, TK_COMMAND_AT, TK_COMMAND_BS, TK_SYMBOL, TK_WHITESPACE, TK_WORD, DocParserContext::token, DocParser::tokenizer, DocTokenizer::tokToString() , 以及 warn_doc_error().

被这些函数引用 validatingParseText().


该类的文档由以下文件生成:
CMD_DOLLAR
@ CMD_DOLLAR
Definition: cmdmapper.h:42
DocSymbol::Sym_Amp
@ Sym_Amp
Definition: docparser.h:445
CMD_BSLASH
@ CMD_BSLASH
Definition: cmdmapper.h:38
DocSymbol::SymType
SymType
Definition: docparser.h:388
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocTokenizer::tokToString
static const char * tokToString(int token)
CMD_LESS
@ CMD_LESS
Definition: cmdmapper.h:65
TK_WORD
@ TK_WORD
Definition: doctokenizer.h:46
CMD_AT
@ CMD_AT
Definition: cmdmapper.h:33
DocSymbol::Sym_Dot
@ Sym_Dot
Definition: docparser.h:447
CompAccept< DocText >
DocSymbol::Sym_Equal
@ Sym_Equal
Definition: docparser.h:447
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
TokenInfo::chars
QCString chars
Definition: doctokenizer.h:105
DocSymbol::Sym_Percent
@ Sym_Percent
Definition: docparser.h:446
DocSymbol::Sym_Dollar
@ Sym_Dollar
Definition: docparser.h:446
DocSymbol::Sym_Hash
@ Sym_Hash
Definition: docparser.h:446
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
DocSymbol::decodeSymbol
static SymType decodeSymbol(const QCString &symName)
Definition: docparser.cpp:1713
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
TK_WHITESPACE
@ TK_WHITESPACE
Definition: doctokenizer.h:48
DocSymbol::Sym_Minus
@ Sym_Minus
Definition: docparser.h:447
TK_SYMBOL
@ TK_SYMBOL
Definition: doctokenizer.h:53
TK_COMMAND_AT
@ TK_COMMAND_AT
Definition: doctokenizer.h:51
DocSymbol::Sym_Less
@ Sym_Less
Definition: docparser.h:445
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
CMD_HASH
@ CMD_HASH
Definition: cmdmapper.h:56
DocSymbol::Sym_At
@ Sym_At
Definition: docparser.h:445
CMD_GREATER
@ CMD_GREATER
Definition: cmdmapper.h:55
DocSymbol::Sym_Unknown
@ Sym_Unknown
Definition: docparser.h:388
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocParser::handleUnclosedStyleCommands
void handleUnclosedStyleCommands()
Definition: docparser.cpp:1002
DocTokenizer::getLineNr
int getLineNr(void)
DocSymbol::Sym_DoubleColon
@ Sym_DoubleColon
Definition: docparser.h:446
CMD_MDASH
@ CMD_MDASH
Definition: cmdmapper.h:129
DocSymbol::Sym_Greater
@ Sym_Greater
Definition: docparser.h:445
DocTokenizer::setStateText
void setStateText()
CMD_PERCENT
@ CMD_PERCENT
Definition: cmdmapper.h:73
CMD_PUNT
@ CMD_PUNT
Definition: cmdmapper.h:133
CMD_QUOTE
@ CMD_QUOTE
Definition: cmdmapper.h:111
DocSymbol::Sym_Plus
@ Sym_Plus
Definition: docparser.h:447
CMD_PLUS
@ CMD_PLUS
Definition: cmdmapper.h:134
DocSymbol::Sym_Quot
@ Sym_Quot
Definition: docparser.h:447
CMD_AMP
@ CMD_AMP
Definition: cmdmapper.h:31
DocSymbol::Sym_BSlash
@ Sym_BSlash
Definition: docparser.h:445
CMD_DCOLON
@ CMD_DCOLON
Definition: cmdmapper.h:113
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
CMD_MINUS
@ CMD_MINUS
Definition: cmdmapper.h:135
Mappers::cmdMapper
static Mapper * cmdMapper
Definition: cmdmapper.h:234
AutoNodeStack
Definition: docparser.cpp:186
DocTokenizer::lex
int lex()
DocNode::Kind_Text
@ Kind_Text
Definition: docparser.h:147
CMD_NDASH
@ CMD_NDASH
Definition: cmdmapper.h:128
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocText >::m_children
DocNodeList m_children
Definition: docparser.h:211
TK_COMMAND_BS
@ TK_COMMAND_BS
Definition: doctokenizer.h:57
CMD_EQUAL
@ CMD_EQUAL
Definition: cmdmapper.h:140