Doxygen
Loading...
Searching...
No Matches
DocText Class Reference

Root node of a text fragment. More...

#include <src/docnode.h>

+ Inheritance diagram for DocText:
+ Collaboration diagram for DocText:

Public Member Functions

 DocText (DocParser *parser)
 
void parse ()
 
bool isEmpty () const
 
- Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
 
DocNodeListchildren ()
 
const DocNodeListchildren () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Root node of a text fragment.

Definition at line 1283 of file docnode.h.

Constructor & Destructor Documentation

◆ DocText()

DocText::DocText ( DocParser * parser)
inline

Definition at line 1286 of file docnode.h.

1286: DocCompoundNode(parser,nullptr) {}
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
DocParser * parser()
Definition docnode.h:97

References DocCompoundNode::DocCompoundNode(), and DocNode::parser().

Member Function Documentation

◆ isEmpty()

bool DocText::isEmpty ( ) const
inline

Definition at line 1288 of file docnode.h.

1288{ return children().empty(); }
DocNodeList & children()
Definition docnode.h:142
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocCompoundNode::children(), and GrowVector< T >::empty().

◆ parse()

void DocText::parse ( )

Definition at line 5926 of file docnode.cpp.

5927{
5928 AUTO_TRACE();
5929 auto ns = AutoNodeStack(parser(),thisVariant());
5931
5932 Token tok = parser()->tokenizer.lex();
5933 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF)) // get the next token
5934 {
5935 switch(tok.value())
5936 {
5937 case TokenRetval::TK_WORD:
5939 break;
5940 case TokenRetval::TK_WHITESPACE:
5941 children().append<DocWhiteSpace>(parser(),thisVariant(),parser()->context.token->chars);
5942 break;
5943 case TokenRetval::TK_SYMBOL:
5944 {
5945 HtmlEntityMapper::SymType s = DocSymbol::decodeSymbol(parser()->context.token->name);
5947 {
5948 children().append<DocSymbol>(parser(),thisVariant(),s);
5949 }
5950 else
5951 {
5952 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported symbol '%s' found",
5953 qPrint(parser()->context.token->name));
5954 }
5955 }
5956 break;
5957 case TokenRetval::TK_COMMAND_AT:
5958 // fall through
5959 case TokenRetval::TK_COMMAND_BS:
5960 switch (Mappers::cmdMapper->map(parser()->context.token->name))
5961 {
5964 break;
5967 break;
5970 break;
5973 break;
5976 break;
5979 break;
5982 break;
5985 break;
5988 break;
5992 break;
5997 break;
6000 break;
6003 break;
6006 break;
6009 break;
6012 break;
6013 default:
6014 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected command '%s' found",
6015 qPrint(parser()->context.token->name));
6016 break;
6017 }
6018 break;
6019 default:
6020 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected token %s",
6021 tok.to_string());
6022 break;
6023 }
6024 tok = parser()->tokenizer.lex();
6025 }
6026
6028
6029}
DocNodeVariant * thisVariant()
Definition docnode.h:92
DocTokenizer tokenizer
DocParserContext context
void handleUnclosedStyleCommands()
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
Definition docnode.cpp:152
void setStateText()
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
const Mapper< CommandType > * cmdMapper
const char * qPrint(const char *s)
Definition qcstring.h:661
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1379
TokenInfo * token
Definition docparser_p.h:92
QCString chars
QCString name

References DocNodeList::append(), AUTO_TRACE, TokenInfo::chars, DocCompoundNode::children(), 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, DocSymbol::decodeSymbol(), DocParser::handleUnclosedStyleCommands(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), DocTokenizer::setStateText(), HtmlEntityMapper::Sym_Amp, HtmlEntityMapper::Sym_At, HtmlEntityMapper::Sym_BSlash, HtmlEntityMapper::Sym_Dollar, HtmlEntityMapper::Sym_Dot, HtmlEntityMapper::Sym_DoubleColon, HtmlEntityMapper::Sym_Equal, HtmlEntityMapper::Sym_Greater, HtmlEntityMapper::Sym_Hash, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_Minus, HtmlEntityMapper::Sym_Percent, HtmlEntityMapper::Sym_Plus, HtmlEntityMapper::Sym_Quot, HtmlEntityMapper::Sym_Unknown, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, Token::value(), and warn_doc_error.


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