Skip to main content

The DocParamList Class Reference

Node representing a parameter list. More...

Declaration

class DocParamList { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocNode

Abstract node interface with type information. More...

Public Constructors Index

DocParamList (DocParser *parser, DocNodeVariant *parent, DocParamSect::Type t, DocParamSect::Direction d)

Public Member Functions Index

const DocNodeList &parameters () const
const DocNodeList &paramTypes () const
const DocNodeList &paragraphs () const
DocParamSect::Typetype () const
DocParamSect::Directiondirection () const
voidmarkFirst (bool b=TRUE)
voidmarkLast (bool b=TRUE)
boolisFirst () const
boolisLast () const
Tokenparse (const QCString &cmdName)
TokenparseXml (const QCString &paramName)

Private Member Attributes Index

DocNodeListm_paragraphs
DocNodeListm_params
DocNodeListm_paramTypes
DocParamSect::Typem_type = DocParamSect::Unknown
DocParamSect::Directionm_dir = DocParamSect::Unspecified
boolm_isFirst = false
boolm_isLast = false

Description

Node representing a parameter list.

Definition at line 1124 of file docnode.h.

Public Constructors

DocParamList()

Public Member Functions

direction()

DocParamSect::Direction DocParamList::direction ()
inline

isFirst()

bool DocParamList::isFirst ()
inline

Definition at line 1136 of file docnode.h.

1136 bool isFirst() const { return m_isFirst; }

Reference m_isFirst.

isLast()

bool DocParamList::isLast ()
inline

Definition at line 1137 of file docnode.h.

1137 bool isLast() const { return m_isLast; }

Reference m_isLast.

Referenced by ManDocVisitor::operator().

markFirst()

void DocParamList::markFirst (bool b=TRUE)
inline

Definition at line 1134 of file docnode.h.

1134 void markFirst(bool b=TRUE) { m_isFirst=b; }

References m_isFirst and TRUE.

Referenced by parseXml.

markLast()

void DocParamList::markLast (bool b=TRUE)
inline

Definition at line 1135 of file docnode.h.

1135 void markLast(bool b=TRUE) { m_isLast=b; }

References m_isLast and TRUE.

Referenced by DocParamSect::parse and parseXml.

paragraphs()

const DocNodeList & DocParamList::paragraphs ()
inline

parameters()

paramTypes()

const DocNodeList & DocParamList::paramTypes ()
inline

parse()

Token DocParamList::parse (const QCString & cmdName)

Declaration at line 1138 of file docnode.h, definition at line 3148 of file docnode.cpp.

3149{
3150 AUTO_TRACE();
3151 Token retval = Token::make_RetVal_OK();
3152 auto ns = AutoNodeStack(parser(),thisVariant());
3153 DocPara *par=nullptr;
3154 QCString saveCmdName = cmdName;
3155
3156 Token tok=parser()->tokenizer.lex();
3157 if (!tok.is(TokenRetval::TK_WHITESPACE))
3158 {
3159 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\{} command",
3160 saveCmdName);
3161 retval = Token::make_RetVal_EndParBlock();
3162 goto endparamlist;
3163 }
3165 tok=parser()->tokenizer.lex();
3166 while (tok.is(TokenRetval::TK_WORD)) /* there is a parameter name */
3167 {
3169 {
3170 int typeSeparator = parser()->context.token->name.find('#'); // explicit type position
3171 if (typeSeparator!=-1)
3172 {
3173 parser()->handleParameterType(thisVariant(),m_paramTypes,parser()->context.token->name.left(typeSeparator));
3174 parser()->context.token->name = parser()->context.token->name.mid(typeSeparator+1);
3177 if (parent() && std::holds_alternative<DocParamSect>(*parent()))
3178 {
3179 std::get<DocParamSect>(*parent()).m_hasTypeSpecifier=true;
3180 }
3181 }
3182 else
3183 {
3186 }
3187 }
3189 {
3192 }
3193 //m_params.append(parser()->context.token->name);
3195 tok=parser()->tokenizer.lex();
3196 }
3198 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF)) // premature end of comment
3199 {
3200 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3201 "argument of command {}",saveCmdName);
3202 retval = Token::make_RetVal_EndParBlock();
3203 goto endparamlist;
3204 }
3205 if (!tok.is(TokenRetval::TK_WHITESPACE)) /* premature end of comment block */
3206 {
3207 if (!tok.is(TokenRetval::TK_NEWPARA)) /* empty param description */
3208 {
3209 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} in comment block while parsing the "
3210 "argument of command {}",tok.to_string(),saveCmdName);
3211 }
3212 retval = Token::make_RetVal_EndParBlock();
3213 goto endparamlist;
3214 }
3215
3217 par = m_paragraphs.get_last<DocPara>();
3218 retval = par->parse();
3219 par->markFirst();
3220 par->markLast();
3221
3222endparamlist:
3223 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3224 return retval;
3225}

References AUTO_TRACE, AUTO_TRACE_EXIT, DocParser::checkArgumentName, DocParser::checkRetvalName, DocParser::context, QCString::find, DocParser::handleLinkedWord, DocParser::handleParameterType, DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, Token::is, Token::is_any_of, DocTokenizer::lex, m_paragraphs, m_params, m_paramTypes, m_type, DocPara::markFirst, DocPara::markLast, QCString::mid, TokenInfo::name, DocParamSect::Param, DocNode::parent, DocPara::parse, DocNode::parser, DocParamSect::RetVal, DocTokenizer::setStatePara, DocTokenizer::setStateParam, DocNode::thisVariant, Token::to_string, DocParserContext::token, DocParser::tokenizer, TRUE and warn_doc_error.

parseXml()

Token DocParamList::parseXml (const QCString & paramName)

Declaration at line 1139 of file docnode.h, definition at line 3227 of file docnode.cpp.

3228{
3229 AUTO_TRACE();
3230 Token retval = Token::make_RetVal_OK();
3231 auto ns = AutoNodeStack(parser(),thisVariant());
3232
3233 parser()->context.token->name = paramName;
3235 {
3238 }
3240 {
3243 }
3244
3246
3247 do
3248 {
3250 DocPara *par = m_paragraphs.get_last<DocPara>();
3251 retval = par->parse();
3252 if (par->isEmpty()) // avoid adding an empty paragraph for the whitespace
3253 // after </para> and before </param>
3254 {
3255 m_paragraphs.pop_back();
3256 break;
3257 }
3258 else // append the paragraph to the list
3259 {
3260 if (!m_paragraphs.empty())
3261 {
3262 m_paragraphs.get_last<DocPara>()->markLast(FALSE);
3263 }
3264 bool markFirst = m_paragraphs.empty();
3265 par = &std::get<DocPara>(m_paragraphs.back());
3266 if (markFirst)
3267 {
3268 par->markFirst();
3269 }
3270 par->markLast();
3271 }
3272
3273 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF)) break;
3274
3275 } while (retval.is(TokenRetval::RetVal_CloseXml) &&
3276 Mappers::htmlTagMapper->map(parser()->context.token->name)!=HtmlTagType::XML_PARAM &&
3277 Mappers::htmlTagMapper->map(parser()->context.token->name)!=HtmlTagType::XML_TYPEPARAM &&
3278 Mappers::htmlTagMapper->map(parser()->context.token->name)!=HtmlTagType::XML_EXCEPTION);
3279
3280 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF)) /* premature end of comment block */
3281 {
3282 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unterminated param or exception tag");
3283 }
3284 else
3285 {
3286 retval = Token::make_RetVal_OK();
3287 }
3288
3289 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3290 return retval;
3291}

References AUTO_TRACE, AUTO_TRACE_EXIT, DocParser::checkArgumentName, DocParser::checkRetvalName, DocParser::context, FALSE, DocParser::handleLinkedWord, DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, Mappers::htmlTagMapper, Token::is, Token::is_any_of, m_paragraphs, m_params, m_type, markFirst, markLast, TokenInfo::name, DocParamSect::Param, DocNode::parser, DocParamSect::RetVal, DocNode::thisVariant, Token::to_string, DocParserContext::token, TRUE, warn_doc_error, XML_EXCEPTION, XML_PARAM and XML_TYPEPARAM.

type()

DocParamSect::Type DocParamList::type ()
inline

Definition at line 1132 of file docnode.h.

1132 DocParamSect::Type type() const { return m_type; }

Reference m_type.

Private Member Attributes

m_dir

DocParamSect::Direction DocParamList::m_dir = DocParamSect::Unspecified

Definition at line 1146 of file docnode.h.

Referenced by direction and DocParamList.

m_isFirst

bool DocParamList::m_isFirst = false

Definition at line 1147 of file docnode.h.

1147 bool m_isFirst = false;

Referenced by isFirst and markFirst.

m_isLast

bool DocParamList::m_isLast = false

Definition at line 1148 of file docnode.h.

1148 bool m_isLast = false;

Referenced by isLast and markLast.

m_paragraphs

DocNodeList DocParamList::m_paragraphs

Definition at line 1142 of file docnode.h.

Referenced by paragraphs, parse and parseXml.

m_params

DocNodeList DocParamList::m_params

Definition at line 1143 of file docnode.h.

Referenced by parameters, parse and parseXml.

m_paramTypes

DocNodeList DocParamList::m_paramTypes

Definition at line 1144 of file docnode.h.

Referenced by paramTypes and parse.

m_type

DocParamSect::Type DocParamList::m_type = DocParamSect::Unknown

Definition at line 1145 of file docnode.h.

Referenced by DocParamList, parse, parseXml and type.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.