Doxygen
Loading...
Searching...
No Matches
commentscan.l File Reference
#include <stdint.h>
#include <map>
#include <stack>
#include <string>
#include <mutex>
#include <functional>
#include <unordered_map>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include "qcstring.h"
#include "fileinfo.h"
#include "cite.h"
#include "commentscan.h"
#include "condparser.h"
#include "config.h"
#include "debug.h"
#include "docgroup.h"
#include "doxygen.h"
#include "entry.h"
#include "formula.h"
#include "language.h"
#include "message.h"
#include "parserintf.h"
#include "reflist.h"
#include "section.h"
#include "regex.h"
#include "util.h"
#include "trace.h"
#include "stringutil.h"
#include "doxygen_lex.h"
#include "commentscan.l.h"
Include dependency graph for commentscan.l:

Go to the source code of this file.

Classes

struct  DocCmdMap
 
struct  HtmlContextInfo
 
struct  commentscanYY_state
 
struct  CommentScanner::Private
 

Macros

#define YY_TYPEDEF_YY_SCANNER_T
 
#define YY_NO_INPUT   1
 
#define YY_NO_UNISTD_H   1
 
#define YY_NEVER_INTERACTIVE   1
 
#define unput_string(yytext, yyleng)
 
#define YY_INPUT(buf, result, max_size)
 

Typedefs

typedef yyguts_t * yyscan_t
 
typedef bool(* DocCmdFunc) (yyscan_t yyscanner, const QCString &name, const StringVector &optList)
 
typedef EntryType(* MakeEntryType) ()
 
using HtmlContextStack = std::vector<HtmlContextInfo>
 

Enumerations

enum  CommandSpacing { Invisible , Inline , Block , XRef }
 
enum  SectionHandling { Allowed , Replace , Escape , Break }
 
enum  XRefKind {
  XRef_Item , XRef_Todo , XRef_Test , XRef_Bug ,
  XRef_Deprecated , XRef_None
}
 
enum  OutputContext { OutputDoc , OutputBrief , OutputXRef , OutputInbody }
 
enum  GuardType { Guard_If , Guard_IfNot , Guard_ElseIf }
 

Functions

static bool handleBrief (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleFn (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleDef (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleOverload (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleEnum (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleDefGroup (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleAddToGroup (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleWeakGroup (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleNamespace (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePackage (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleConcept (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleClass (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHeaderFile (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleProtocol (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCategory (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleUnion (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleStruct (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleInterface (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIdlException (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePage (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleMainpage (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleFile (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleDir (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleExample (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleDetails (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleRaiseWarning (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleNoop (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleName (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleTodo (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleTest (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleBug (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleSubpage (yyscan_t yyscanner, const QCString &s, const StringVector &)
 
static bool handleDeprecated (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleXRefItem (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleRelated (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleRelatedAlso (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleMemberOf (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleRefItem (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleSection (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleAnchor (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleImage (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCite (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleFormatBlock (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleAddIndex (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIf (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIfNot (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleElseIf (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleElse (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleEndIf (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIngroup (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleNoSubGrouping (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleShowInitializer (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideInitializer (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCallgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideCallgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCallergraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideCallergraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIncludegraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIncludedBygraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleShowEnumValues (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideEnumValues (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleShowInlineSource (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideInlineSource (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideIncludegraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideIncludedBygraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleDirectoryGraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideDirectoryGraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCollaborationgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideCollaborationgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleInheritanceGraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideInheritanceGraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleReferencedByRelation (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideReferencedByRelation (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleReferencesRelation (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideReferencesRelation (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleGroupgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleHideGroupgraph (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleInternal (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleStatic (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePure (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePrivate (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePrivateSection (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleProtected (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleProtectedSection (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handlePublic (yyscan_t yyscanner, const QCString &s, const StringVector &)
 
static bool handlePublicSection (yyscan_t yyscanner, const QCString &s, const StringVector &)
 
static bool handleQualifier (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleToc (yyscan_t yyscanner, const QCString &s, const StringVector &)
 
static bool handleInherit (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleExtends (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCopyDoc (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCopyBrief (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleCopyDetails (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleParBlock (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleEndParBlock (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleParam (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleRetval (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleFileInfo (yyscan_t yyscanner, const QCString &cmdName, const StringVector &optList)
 
static bool handleFileInfoSection (yyscan_t yyscanner, const QCString &cmdName, const StringVector &optList)
 
static bool handleFileInfoResult (yyscan_t yyscanner, const QCString &, const StringVector &optList, bool isSection)
 
static bool handleLineInfo (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleModule (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIFile (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleILine (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIRaise (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static bool handleIPrefix (yyscan_t yyscanner, const QCString &, const StringVector &)
 
static const char * stateToString (int state)
 
static QCString stripQuotes (const char *s)
 
static SectionType sectionLevelToType (int level)
 
static void stripTrailingWhiteSpace (QCString &s)
 
static void initParser (yyscan_t yyscanner)
 
static bool checkStructuralIndicator (yyscan_t yyscanner)
 
static bool makeStructuralIndicator (yyscan_t yyscanner, MakeEntryType maker)
 
static void lineCount (yyscan_t yyscanner)
 
static void addXRefItem (yyscan_t yyscanner, const QCString &listName, const QCString &itemTitle, const QCString &listTitle, bool append)
 
static QCString addFormula (yyscan_t yyscanner)
 
static void checkFormula (yyscan_t yyscanner)
 
static void addSection (yyscan_t yyscanner, bool addYYtext=true)
 
static void setOutput (yyscan_t yyscanner, OutputContext ctx)
 
static void addAnchor (yyscan_t yyscanner, const QCString &anchor, const QCString &title="")
 
static void addOutput (yyscan_t yyscanner, const char *s)
 
static void addOutput (yyscan_t yyscanner, const QCString &s)
 
static void addOutput (yyscan_t yyscanner, char c)
 
static void endBrief (yyscan_t yyscanner)
 
static void handleGuard (yyscan_t yyscanner, const QCString &expr)
 
static int yyread (yyscan_t yyscanner, char *buf, int max_size)
 
static void addCite (yyscan_t yyscanner)
 
static void addIline (yyscan_t yyscanner, int lineNr)
 
static void addIlineBreak (yyscan_t yyscanner, int lineNr)
 
static const char * getLexerFILE ()
 
int yylex (yyscan_t yyscanner)
 

Variables

static const std::map< std::string, DocCmdMapdocCmdMap
 
static std::mutex g_sectionMutex
 
static std::mutex g_formulaMutex
 
static std::mutex g_citeMutex
 
static const reg::Ex nonBrief_re (R"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))")
 

Macro Definition Documentation

◆ unput_string

#define unput_string ( yytext,
yyleng )
Value:
do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)

Definition at line 558 of file commentscan.l.

Referenced by DocTokenizer::unputString().

◆ YY_INPUT

#define YY_INPUT ( buf,
result,
max_size )
Value:
result=yyread(yyscanner,buf,max_size);
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
Definition code.l:3989

Definition at line 563 of file commentscan.l.

◆ YY_NEVER_INTERACTIVE

#define YY_NEVER_INTERACTIVE   1

Definition at line 412 of file commentscan.l.

◆ YY_NO_INPUT

#define YY_NO_INPUT   1

Definition at line 410 of file commentscan.l.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H   1

Definition at line 411 of file commentscan.l.

◆ YY_TYPEDEF_YY_SCANNER_T

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 23 of file commentscan.l.

Typedef Documentation

◆ DocCmdFunc

typedef bool(* DocCmdFunc) (yyscan_t yyscanner, const QCString &name, const StringVector &optList)

Definition at line 180 of file commentscan.l.

◆ HtmlContextStack

using HtmlContextStack = std::vector<HtmlContextInfo>

Definition at line 452 of file commentscan.l.

◆ MakeEntryType

typedef EntryType(* MakeEntryType) ()

Definition at line 181 of file commentscan.l.

◆ yyscan_t

typedef yyguts_t* yyscan_t

Definition at line 25 of file commentscan.l.

Enumeration Type Documentation

◆ CommandSpacing

enum CommandSpacing
strong
Enumerator
Invisible 

command sets some property but does not appear in the output.

Inline 

command appears inline in the output which can be a brief description.

Block 

command starts a new paragraphs / ends a brief description.

XRef 

command is a cross reference (todo, bug, test, deprecated, xrefitem).

Definition at line 183 of file commentscan.l.

184{
185 Invisible, //!< command sets some property but does not appear in the output.
186 Inline, //!< command appears inline in the output which can be a brief description.
187 Block, //!< command starts a new paragraphs / ends a brief description.
188 XRef //!< command is a cross reference (todo, bug, test, deprecated, xrefitem).
@ Inline
command appears inline in the output which can be a brief description.
@ XRef
command is a cross reference (todo, bug, test, deprecated, xrefitem).
@ Invisible
command sets some property but does not appear in the output.
@ Block
command starts a new paragraphs / ends a brief description.
189};

◆ GuardType

enum GuardType
Enumerator
Guard_If 
Guard_IfNot 
Guard_ElseIf 

Definition at line 433 of file commentscan.l.

434{
435 Guard_If,
@ Guard_If
@ Guard_ElseIf
@ Guard_IfNot
438};

◆ OutputContext

Enumerator
OutputDoc 
OutputBrief 
OutputXRef 
OutputInbody 

Definition at line 425 of file commentscan.l.

426{
427 OutputDoc,
@ OutputXRef
@ OutputDoc
@ OutputBrief
@ OutputInbody
431};

◆ SectionHandling

enum SectionHandling
strong
Enumerator
Allowed 

command is allowed without restrictions in section title

Replace 

command will be handled in here / needs special handling here

Escape 

command is not-allowed in section title, it will be escaped

Break 

command is not-allowed in section title, it will end the section title

Definition at line 191 of file commentscan.l.

192{
193 Allowed, //!< command is allowed without restrictions in section title
194 Replace, //!< command will be handled in here / needs special handling here
195 Escape, //!< command is not-allowed in section title, it will be escaped
196 Break //!< command is not-allowed in section title, it will end the section title
@ Escape
command is not-allowed in section title, it will be escaped
@ Replace
command will be handled in here / needs special handling here
@ Allowed
command is allowed without restrictions in section title
@ Break
command is not-allowed in section title, it will end the section title
197};

◆ XRefKind

enum XRefKind
Enumerator
XRef_Item 
XRef_Todo 
XRef_Test 
XRef_Bug 
XRef_Deprecated 
XRef_None 

Definition at line 415 of file commentscan.l.

416{
417 XRef_Item,
418 XRef_Todo,
419 XRef_Test,
420 XRef_Bug,
@ XRef_Item
@ XRef_Deprecated
@ XRef_Todo
@ XRef_Test
@ XRef_Bug
@ XRef_None
423};

Function Documentation

◆ addAnchor()

void addAnchor ( yyscan_t yyscanner,
const QCString & anchor,
const QCString & title = "" )
static

Definition at line 4563 of file commentscan.l.

4564{
4565 std::unique_lock<std::mutex> lock(g_sectionMutex);
4566 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4568 const SectionInfo *si = sm.find(anchor);
4569 if (si)
4570 {
4571 if (!si->ref().isEmpty()) // we are from a tag file
4572 {
4573 si = sm.replace(anchor,yyextra->fileName,yyextra->lineNr,QCString(),SectionType::Anchor,0);
4574 yyextra->current->anchors.push_back(si);
4575 }
4576 else if (si->lineNr() != -1)
4577 {
4578 warn(yyextra->fileName,yyextra->lineNr,
4579 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4580 anchor,si->fileName(),si->lineNr());
4581 }
4582 else
4583 {
4584 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4585 anchor,si->fileName());
4586 }
4587 }
4588 else
4589 {
4590 si = sm.add(anchor,yyextra->fileName,yyextra->lineNr,title,SectionType::Anchor,0);
4591 yyextra->current->anchors.push_back(si);
4592 }
const T * find(const std::string &key) const
Definition linkedmap.h:47
This is an alternative implementation of QCString.
Definition qcstring.h:101
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
class that provide information about a section.
Definition section.h:57
QCString ref() const
Definition section.h:71
QCString fileName() const
Definition section.h:73
int lineNr() const
Definition section.h:72
singleton class that owns the list of all sections
Definition section.h:134
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
Definition section.h:154
SectionInfo * add(const SectionInfo &si)
Definition section.h:138
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:175
static constexpr int Anchor
Definition section.h:40
static std::mutex g_sectionMutex
#define warn(file, line, fmt,...)
Definition message.h:97
4593}

References SectionManager::add(), SectionType::Anchor, SectionInfo::fileName(), LinkedMap< T, Hash, KeyEqual, Map >::find(), g_sectionMutex, SectionManager::instance(), QCString::isEmpty(), SectionInfo::lineNr(), SectionInfo::ref(), SectionManager::replace(), and warn.

Referenced by handleImage().

◆ addCite()

void addCite ( yyscan_t yyscanner)
static

Definition at line 4366 of file commentscan.l.

4367{
4368 std::unique_lock<std::mutex> lock(g_citeMutex);
4369 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4370 QCString name(yytext);
4371 if (yytext[0] =='"')
4372 {
4373 name=yytext+1;
4374 name=name.left((int)yyleng-2);
4375 }
static CitationManager & instance()
Definition cite.cpp:80
void insert(const QCString &label)
Insert a citation identified by label into the database.
Definition cite.cpp:90
static std::mutex g_citeMutex
4377}

References g_citeMutex, CitationManager::insert(), CitationManager::instance(), and QCString::left().

◆ addFormula()

QCString addFormula ( yyscan_t yyscanner)
static

Definition at line 4290 of file commentscan.l.

4291{
4292 std::unique_lock<std::mutex> lock(g_formulaMutex);
4293 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4294 QCString formLabel;
4295 QCString formula = (yyextra->formulaPreText +
4296 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4297 yyextra->formulaPostText).stripWhiteSpace();
4298 //printf("formulaText=\n=1=\n{%s}\n=2=\n{%s}\n=3=\n{%s}\n===",
4299 // qPrint(yyextra->formulaText),
4300 // qPrint(yyextra->formulaText.stripLeadingAndTrailingEmptyLines()),
4301 // qPrint(formula)
4302 // );
4303 int id = FormulaManager::instance().addFormula(formula.str());
4304 formLabel.sprintf("\\_form#%d",id);
4305 for (int i=0;i<yyextra->formulaNewLines;i++) formLabel+="@_fakenl"; // add fake newlines to
4306 // keep the warnings
4307 // correctly aligned.
4308 return formLabel;
int addFormula(const std::string &formulaText, int width=-1, int height=-1)
Definition formula.cpp:691
static FormulaManager & instance()
Definition formula.cpp:54
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
static std::mutex g_formulaMutex
4309}

References FormulaManager::addFormula(), g_formulaMutex, FormulaManager::instance(), QCString::sprintf(), QCString::str(), and QCString::stripWhiteSpace().

◆ addIline()

void addIline ( yyscan_t yyscanner,
int lineNr )
static

Definition at line 4618 of file commentscan.l.

4619{
4620 char cmd[30];
4621 qsnprintf(cmd,30," \\iline %d ",lineNr);
4622 addOutput(yyscanner, cmd);
static void addOutput(yyscan_t yyscanner, const char *s)
#define qsnprintf
Definition qcstring.h:49
4623}

References addOutput(), and qsnprintf.

Referenced by endBrief().

◆ addIlineBreak()

void addIlineBreak ( yyscan_t yyscanner,
int lineNr )
static

Definition at line 4625 of file commentscan.l.

4626{
4627 char cmd[30];
4628 qsnprintf(cmd,30," \\iline %d \\ilinebr ",lineNr);
4629 addOutput(yyscanner, cmd);
4630}

References addOutput(), and qsnprintf.

◆ addOutput() [1/3]

void addOutput ( yyscan_t yyscanner,
char c )
inlinestatic

Definition at line 4612 of file commentscan.l.

4613{
4614 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4615 *yyextra->pOutputString+=c;
4616}

◆ addOutput() [2/3]

void addOutput ( yyscan_t yyscanner,
const char * s )
inlinestatic

◆ addOutput() [3/3]

void addOutput ( yyscan_t yyscanner,
const QCString & s )
inlinestatic

Definition at line 4604 of file commentscan.l.

4605{
4606 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4607 //printf("addOutput(yyscanner,%s)\n",s);
4608 *yyextra->pOutputString+=s;
4609}

◆ addSection()

void addSection ( yyscan_t yyscanner,
bool addYYtext = true )
static

Definition at line 4319 of file commentscan.l.

4320{
4321 std::unique_lock<std::mutex> lock(g_sectionMutex);
4322 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4324 const SectionInfo *si = sm.find(yyextra->sectionLabel);
4325 if (si)
4326 {
4327 if (!si->ref().isEmpty()) // we are from a tag file
4328 {
4329 // create a new section element
4330 if (addYYtext) yyextra->sectionTitle+=yytext;
4331 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4332 si = sm.replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4333 yyextra->sectionTitle,sectionLevelToType(yyextra->sectionLevel),
4334 yyextra->sectionLevel);
static SectionType sectionLevelToType(int level)
4335
4336 // add section to this entry
4337 yyextra->current->anchors.push_back(si);
4338 }
4339 else if (si->lineNr() != -1)
4340 {
4341 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4342 yyextra->sectionLabel,si->fileName(),si->lineNr());
4343 }
4344 else
4345 {
4346 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding section, (first occurrence: {})",
4347 yyextra->sectionLabel,si->fileName());
4348 }
4349 }
4350 else
4351 {
4352 // create a new section element
4353 if (addYYtext) yyextra->sectionTitle+=yytext;
4354 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4355 si = sm.add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4356 yyextra->sectionTitle,sectionLevelToType(yyextra->sectionLevel),
4357 yyextra->sectionLevel);
4358
4359 // add section to this entry
4360 yyextra->current->anchors.push_back(si);
4361 }
4362}

References SectionManager::add(), SectionInfo::fileName(), LinkedMap< T, Hash, KeyEqual, Map >::find(), g_sectionMutex, SectionManager::instance(), QCString::isEmpty(), SectionInfo::lineNr(), SectionInfo::ref(), SectionManager::replace(), sectionLevelToType(), and warn.

◆ addXRefItem()

void addXRefItem ( yyscan_t yyscanner,
const QCString & listName,
const QCString & itemTitle,
const QCString & listTitle,
bool append )
static

Definition at line 4200 of file commentscan.l.

4203{
4204 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4205 if (listName.isEmpty()) return;
4206 //printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append);
4207
4208 std::unique_lock<std::mutex> lock(g_sectionMutex);
4209
4210 RefList *refList = RefListManager::instance().add(listName,listTitle,itemTitle);
4211 RefItem *item = nullptr;
4212 for (auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4213 {
4214 RefItem *i = *it;
4215 if (i && i->list()->listName()==listName)
4216 {
4217 //printf("found %s lii->type=%s\n",listName,qPrint(i->list()->listName()));
4218 item = i;
4219 break;
4220 }
4221 }
4222 if (item && append) // already found item of same type just before this one
4223 {
4224 //printf("listName=%s item id = %d existing\n",listName,item->id());
4225 item->setText(item->text() + " <p>" + yyextra->outputXRef);
4226 //printf("%s: text +=%s\n",listName,qPrint(item->text));
4227 }
4228 else // new item
4229 {
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
This struct represents an item in the list of references.
Definition reflist.h:32
QCString text() const
Definition reflist.h:45
void setText(const QCString &text)
Definition reflist.h:36
RefList * list() const
Definition reflist.h:53
List of cross-referenced items.
Definition reflist.h:80
QCString listName() const
Definition reflist.h:101
static RefListManager & instance()
Definition reflist.h:121
4230
4231 // if we have already an item from the same list type (e.g. a second @todo)
4232 // in the same Entry (i.e. lii!=0) then we reuse its link anchor.
4233 item = refList->add();
4234 //printf("listName=%s item id = %d new yyextra->current=%p\n",listName,item->id(),yyextra->current);
4235 QCString anchorLabel;
4236 anchorLabel.sprintf("_%s%06d",listName.data(),item->id());
4237 item->setText(yyextra->outputXRef);
4238 item->setAnchor(anchorLabel);
4239 yyextra->current->sli.push_back(item);
4240 QCString cmdString;
4241 cmdString.sprintf(" \\xrefitem %s %d.",qPrint(listName),item->id());
4242 if (yyextra->inBody)
4243 {
4244 yyextra->current->inbodyDocs += cmdString;
4245 }
4246 else
4247 {
4248 yyextra->current->doc += cmdString;
4249 }
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:159
int id() const
Definition reflist.h:52
void setAnchor(const QCString &anchor)
Definition reflist.h:37
RefItem * add()
Definition reflist.cpp:30
const char * qPrint(const char *s)
Definition qcstring.h:672
4250
4251 {
4253 const SectionInfo *si = sm.find(anchorLabel);
4254 if (si)
4255 {
4256 if (!si->ref().isEmpty()) // we are from a tag file
4257 {
4258 si = sm.replace(anchorLabel,listName,yyextra->lineNr,
4259 yyextra->sectionTitle,SectionType::Anchor,
4260 yyextra->sectionLevel);
4261 yyextra->current->anchors.push_back(si);
4262 }
4263 else if (si->lineNr() != -1)
4264 {
4265 warn(listName,yyextra->lineNr,"multiple use of section label '{}', (first occurrence: {}, line {})",
4266 anchorLabel,si->fileName(),si->lineNr());
4267 }
4268 else
4269 {
4270 warn(listName,yyextra->lineNr,"multiple use of section label '{}', (first occurrence: {})",
4271 anchorLabel,si->fileName());
4272 }
4273 }
4274 else
4275 {
4276 si = sm.add(anchorLabel,listName,yyextra->lineNr,
4277 yyextra->sectionTitle,SectionType::Anchor,
4278 yyextra->sectionLevel);
4279 yyextra->current->anchors.push_back(si);
4280 }
4281 }
4282 }
4283 yyextra->outputXRef.clear();
4284}

References LinkedMap< T, Hash, KeyEqual, Map >::add(), RefList::add(), SectionManager::add(), SectionType::Anchor, QCString::data(), SectionInfo::fileName(), LinkedMap< T, Hash, KeyEqual, Map >::find(), g_sectionMutex, RefItem::id(), RefListManager::instance(), SectionManager::instance(), QCString::isEmpty(), SectionInfo::lineNr(), RefItem::list(), RefList::listName(), qPrint(), SectionInfo::ref(), SectionManager::replace(), RefItem::setAnchor(), RefItem::setText(), QCString::sprintf(), RefItem::text(), and warn.

Referenced by setOutput().

◆ checkFormula()

void checkFormula ( yyscan_t yyscanner)
static

Definition at line 4678 of file commentscan.l.

4679{
4680 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4681 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4682 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4683 YY_START==ReadFormulaLong)
4684 {
4685 warn(yyextra->fileName,yyextra->lineNr,"End of comment block while inside formula.");
4686 }
4687}

References warn.

Referenced by CommentScanner::parseCommentBlock().

◆ checkStructuralIndicator()

bool checkStructuralIndicator ( yyscan_t yyscanner)
static

Definition at line 4144 of file commentscan.l.

4145{
4146 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4147 //printf("yyextra->current->section=%x\n",yyextra->current->section);
4148 return yyextra->current->section.isDoc();
4149}

Referenced by handleCategory(), handleClass(), handleConcept(), handleDef(), handleEnum(), handleFn(), handleIdlException(), handleInterface(), handleModule(), handleNamespace(), handleProtocol(), handleStruct(), and handleUnion().

◆ endBrief()

void endBrief ( yyscan_t yyscanner)
static

Definition at line 4632 of file commentscan.l.

4633{
4634 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4635 std::string_view str = yyextra->current->brief.view();
4637 if (!stripWhiteSpace(str).empty() && !reg::match(str,match,nonBrief_re))
4638 { // only go to the detailed description if we have
4639 // found some brief description and not just whitespace
4640 yyextra->briefEndsAtDot=FALSE;
4641 setOutput(yyscanner,OutputDoc);
4642 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4643 {
4644 yyextra->current->docLine = yyextra->lineNr;
4645 yyextra->current->doc = "";
4646 }
4647 else
4648 {
4649 addIline(yyscanner,yyextra->lineNr);
4650 }
4651 addOutput(yyscanner,yytext);
4652 }
4653 else
4654 {
4655 int saveLineNr = yyextra->lineNr;
4656 lineCount(yyscanner);
4657 yyextra->current->briefLine = yyextra->lineNr;
4658 yyextra->lineNr = saveLineNr;
4659 }
Object representing the matching results.
Definition regex.h:153
static const reg::Ex nonBrief_re(R"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))")
static void setOutput(yyscan_t yyscanner, OutputContext ctx)
static void addIline(yyscan_t yyscanner, int lineNr)
#define lineCount(s, len)
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition regex.cpp:759
#define FALSE
Definition qcstring.h:34
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
Definition stringutil.h:72
4660}

References addIline(), addOutput(), FALSE, lineCount, reg::match(), nonBrief_re, OutputDoc, setOutput(), and stripWhiteSpace().

◆ getLexerFILE()

const char * getLexerFILE ( )
inlinestatic

Definition at line 566 of file commentscan.l.

566{return __FILE__;}

◆ handleAddIndex()

bool handleAddIndex ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3407 of file commentscan.l.

3408{
3409 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3410 addOutput(yyscanner,yytext);
3411 BEGIN(LineParam);
3412 return FALSE;
3413}

References addOutput(), and FALSE.

◆ handleAddToGroup()

bool handleAddToGroup ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2907 of file commentscan.l.

2908{
2909 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2910 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
2911 yyextra->current->groupDocType = Entry::GROUPDOC_ADD;
2912 BEGIN( GroupDocArg1 );
2913 return stop;
@ GROUPDOC_ADD
addtogroup
Definition entry.h:122
static bool makeStructuralIndicator(yyscan_t yyscanner, MakeEntryType maker)
2914}

References Entry::GROUPDOC_ADD, and makeStructuralIndicator().

◆ handleAnchor()

bool handleAnchor ( yyscan_t yyscanner,
const QCString & s,
const StringVector & optList )
static

Definition at line 3330 of file commentscan.l.

3331{
3332 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3333 addOutput(yyscanner,"@"+s+" ");
3334 if (optList.empty())
3335 {
3336 yyextra -> anchorTitle = "";
3337 }
3338 else
3339 {
3340 yyextra -> anchorTitle = join(optList," ");
3341 }
3342 BEGIN(AnchorLabel);
3343 return FALSE;
std::string join(const StringVector &sv, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
Definition util.cpp:7145
3344}

References addOutput(), FALSE, and join().

◆ handleBrief()

bool handleBrief ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2853 of file commentscan.l.

2854{
2855 //printf("handleBrief\n");
2856 setOutput(yyscanner,OutputBrief);
2857 return FALSE;
2858}

References FALSE, OutputBrief, and setOutput().

◆ handleBug()

bool handleBug ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3172 of file commentscan.l.

3173{
3174 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3175 yyextra->newXRefKind = XRef_Bug;
3176 setOutput(yyscanner,OutputXRef);
3177 yyextra->xrefKind = XRef_Bug;
3178 return FALSE;
3179}

References FALSE, OutputXRef, setOutput(), and XRef_Bug.

◆ handleCallergraph()

bool handleCallergraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3730 of file commentscan.l.

3731{
3732 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3733 yyextra->current->commandOverrides.override_callerGraph(true); // ON
3734 return FALSE;
3735}

References FALSE.

◆ handleCallgraph()

bool handleCallgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3716 of file commentscan.l.

3717{
3718 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3719 yyextra->current->commandOverrides.override_callGraph(true); // ON
3720 return FALSE;
3721}

References FALSE.

◆ handleCategory()

bool handleCategory ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2984 of file commentscan.l.

2985{ // Obj-C category
2986 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2987 yyextra->currentCmd = cmd;
2988 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
2989 BEGIN( CategoryDocArg1 );
2990 return checkStructuralIndicator(yyscanner);
static bool checkStructuralIndicator(yyscan_t yyscanner)
2991}

References checkStructuralIndicator().

◆ handleCite()

bool handleCite ( yyscan_t yyscanner,
const QCString & s,
const StringVector &  )
static

Definition at line 3371 of file commentscan.l.

3372{
3373 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3374 if (!yyextra->spaceBeforeCmd.isEmpty())
3375 {
3376 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3377 yyextra->spaceBeforeCmd.clear();
3378 }
3379 addOutput(yyscanner,"@"+s+" ");
3380 BEGIN(CiteLabel);
3381 return FALSE;
3382}

References addOutput(), and FALSE.

◆ handleClass()

bool handleClass ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2941 of file commentscan.l.

2942{
2943 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2944 yyextra->currentCmd = cmd;
2945 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
2946 BEGIN( ClassDocArg1 );
2947 return checkStructuralIndicator(yyscanner);
2948}

References checkStructuralIndicator().

◆ handleCollaborationgraph()

bool handleCollaborationgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3814 of file commentscan.l.

3815{
3816 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3817 yyextra->current->commandOverrides.override_collaborationGraph(true); // ON
3818 return FALSE;
3819}

References FALSE.

◆ handleConcept()

bool handleConcept ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2950 of file commentscan.l.

2951{
2952 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2953 yyextra->currentCmd = cmd;
2954 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
2955 BEGIN( ConceptDocArg1 );
2956 return checkStructuralIndicator(yyscanner);
2957}

References checkStructuralIndicator().

◆ handleCopyBrief()

bool handleCopyBrief ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 4079 of file commentscan.l.

4080{
4081 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4082 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4083 { // if we don't have a brief or detailed description yet,
4084 // then the @copybrief should end up in the brief description.
4085 // otherwise it will be copied inline (see bug691315 & bug700788)
4086 setOutput(yyscanner,OutputBrief);
4087 }
4088 if (!yyextra->spaceBeforeCmd.isEmpty())
4089 {
4090 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4091 yyextra->spaceBeforeCmd.clear();
4092 }
4093 addOutput(yyscanner,"\\copybrief ");
4094 return FALSE;
4095}

References addOutput(), FALSE, OutputBrief, and setOutput().

◆ handleCopyDetails()

bool handleCopyDetails ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 4097 of file commentscan.l.

4098{
4099 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4100 setOutput(yyscanner,OutputDoc);
4101 if (!yyextra->spaceBeforeCmd.isEmpty())
4102 {
4103 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4104 yyextra->spaceBeforeCmd.clear();
4105 }
4106 addOutput(yyscanner,"\\copydetails ");
4107 return FALSE;
4108}

References addOutput(), FALSE, OutputDoc, and setOutput().

◆ handleCopyDoc()

bool handleCopyDoc ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 4110 of file commentscan.l.

4111{
4112 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4113 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4114 { // if we don't have a brief or detailed description yet,
4115 // then the @copybrief should end up in the brief description.
4116 // otherwise it will be copied inline (see bug691315 & bug700788)
4117 setOutput(yyscanner,OutputBrief);
4118 }
4119 if (!yyextra->spaceBeforeCmd.isEmpty())
4120 {
4121 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4122 yyextra->spaceBeforeCmd.clear();
4123 }
4124 addOutput(yyscanner,"\\copybrief ");
4125 yyextra->copyDocArg.clear();
4126 yyextra->braceCount = 0;
4127 BEGIN(CopyDoc);
4128 return FALSE;
4129}

References addOutput(), FALSE, OutputBrief, and setOutput().

◆ handleDef()

bool handleDef ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2871 of file commentscan.l.

2872{
2873 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2874 yyextra->functionProto.clear();
2875 yyextra->braceCount=0;
2876 yyextra->currentCmd = cmd;
2877 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2878 BEGIN( FnParam );
2879 return checkStructuralIndicator(yyscanner);
2880}

References checkStructuralIndicator().

◆ handleDefGroup()

bool handleDefGroup ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2898 of file commentscan.l.

2899{
2900 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2901 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
2902 yyextra->current->groupDocType = Entry::GROUPDOC_NORMAL;
2903 BEGIN( GroupDocArg1 );
2904 return stop;
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:121
2905}

References Entry::GROUPDOC_NORMAL, and makeStructuralIndicator().

◆ handleDeprecated()

bool handleDeprecated ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3181 of file commentscan.l.

3182{
3183 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3184 yyextra->newXRefKind = XRef_Deprecated;
3185 setOutput(yyscanner,OutputXRef);
3186 yyextra->xrefKind = XRef_Deprecated;
3187 return FALSE;
3188}

References FALSE, OutputXRef, setOutput(), and XRef_Deprecated.

◆ handleDetails()

bool handleDetails ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3111 of file commentscan.l.

3112{
3113 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3114 if (yyextra->inContext!=OutputBrief)
3115 {
3116 addOutput(yyscanner," \\ilinebr\\ilinebr "); // treat @details outside brief description
3117 // as a new paragraph
3118 }
3119 setOutput(yyscanner,OutputDoc);
3120 return FALSE;
3121}

References addOutput(), FALSE, OutputBrief, OutputDoc, and setOutput().

◆ handleDir()

bool handleDir ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3080 of file commentscan.l.

3081{
3082 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3083 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeDirDoc);
3084 if (!stop) yyextra->current->name = yyextra->fileName;
3085 BEGIN( FileDocArg1 );
3086 return stop;
3087}

References makeStructuralIndicator().

◆ handleDirectoryGraph()

bool handleDirectoryGraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3800 of file commentscan.l.

3801{
3802 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3803 yyextra->current->commandOverrides.override_directoryGraph(true); // ON
3804 return FALSE;
3805}

References FALSE.

◆ handleElse()

bool handleElse ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3618 of file commentscan.l.

3619{
3620 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3621 if (yyextra->guards->empty())
3622 {
3623 warn(yyextra->fileName,yyextra->lineNr,
3624 "found \\else without matching start command");
3625 }
3626 else if (yyextra->guards->top().hasElse())
3627 {
3628 warn(yyextra->fileName,yyextra->lineNr,
3629 "found multiple \\else commands in same \\if construct");
3630 yyextra->guards->top().setEnabled(false);
3631 yyextra->guards->top().setElse();
3632 BEGIN( SkipGuardedSection );
3633 }
3634 else
3635 {
3636 yyextra->guards->top().setElse();
3637 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3638 if (yyextra->guards->top().isEnabledFound())
3639 {
3640 yyextra->guards->top().setEnabled(false);
3641 BEGIN( SkipGuardedSection );
3642 }
3643 else
3644 {
3645 yyextra->guards->top().setEnabled(true);
3646 BEGIN( GuardParamEnd );
3647 }
3648 }
3649 return FALSE;
3650}

References FALSE, and warn.

◆ handleElseIf()

bool handleElseIf ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3591 of file commentscan.l.

3592{
3593 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3594 if (yyextra->guards->empty())
3595 {
3596 warn(yyextra->fileName,yyextra->lineNr,
3597 "found \\elseif without matching start command");
3598 }
3599 else if (yyextra->guards->top().hasElse())
3600 {
3601 warn(yyextra->fileName,yyextra->lineNr,
3602 "found \\elseif command after \\else command was given in \\if construct");
3603 yyextra->guardType = Guard_ElseIf;
3604 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3605 yyextra->guards->top().setEnabled(false);
3606 BEGIN(GuardParam);
3607 }
3608 else
3609 {
3610 yyextra->guardType = Guard_ElseIf;
3611 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3612 yyextra->guards->top().setEnabled(false);
3613 BEGIN(GuardParam);
3614 }
3615 return FALSE;
3616}

References FALSE, Guard_ElseIf, and warn.

◆ handleEndIf()

bool handleEndIf ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3652 of file commentscan.l.

3653{
3654 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3655 if (yyextra->guards->empty())
3656 {
3657 warn(yyextra->fileName,yyextra->lineNr,
3658 "found \\endif without matching start command");
3659 }
3660 else
3661 {
3662 yyextra->guards->pop();
3663 }
3664 if (!yyextra->spaceBeforeCmd.isEmpty())
3665 {
3666 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3667 yyextra->spaceBeforeCmd.clear();
3668 }
3669 if (yyextra->guards->empty())
3670 {
3671 BEGIN( GuardParamEnd );
3672 }
3673 else
3674 {
3675 if (yyextra->guards->top().isEnabled())
3676 {
3677 BEGIN( GuardParamEnd );
3678 }
3679 else
3680 {
3681 BEGIN( SkipGuardedSection );
3682 }
3683 }
3684 return FALSE;
3685}

References addOutput(), FALSE, and warn.

◆ handleEndParBlock()

bool handleEndParBlock ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3216 of file commentscan.l.

3217{
3218 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3219 if (!yyextra->insideParBlock)
3220 {
3221 warn(yyextra->fileName,yyextra->lineNr,
3222 "found \\endparblock command without matching \\parblock!");
3223 }
3224 addOutput(yyscanner,"@endparblock");
3225 setOutput(yyscanner,OutputDoc); // to end a parblock inside a xrefitem like context
3226 yyextra->insideParBlock = FALSE;
3227 return FALSE;
3228}

References addOutput(), FALSE, OutputDoc, setOutput(), and warn.

◆ handleEnum()

bool handleEnum ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2890 of file commentscan.l.

2891{
2892 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2893 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2894 BEGIN( EnumDocArg1 );
2895 return checkStructuralIndicator(yyscanner);
2896}

References checkStructuralIndicator().

◆ handleExample()

bool handleExample ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector & optList )
static

Definition at line 3089 of file commentscan.l.

3090{
3091 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3092 MakeEntryType sectionMaker = EntryType::makeExample;
3093 for (const auto &opt : optList)
3094 {
3095 if (opt=="lineno")
3096 {
3097 sectionMaker=EntryType::makeExampleLineno;
3098 }
3099 else
3100 {
3101 warn(yyextra->fileName,yyextra->lineNr,
3102 "unsupported option '{}' for command '\\{}'",opt,cmd);
3103 }
3104 }
3105 bool stop=makeStructuralIndicator(yyscanner,sectionMaker);
3106 if (!stop) yyextra->current->name = yyextra->fileName;
3107 BEGIN( FileDocArg1 );
3108 return stop;
EntryType(* MakeEntryType)()
3109}

References makeStructuralIndicator(), and warn.

◆ handleExtends()

bool handleExtends ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 4071 of file commentscan.l.

4072{
4073 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4074 yyextra->currentCmd = cmd;
4075 BEGIN(ExtendsParam);
4076 return FALSE;
4077}

References FALSE.

◆ handleFile()

bool handleFile ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3050 of file commentscan.l.

3051{
3052 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3053 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeFileDoc);
3054 if (!stop)
3055 {
3056 yyextra->current->name = yyextra->fileName;
3057 }
3058 BEGIN( FileDocArg1 );
3059 return stop;
3060}

References makeStructuralIndicator().

◆ handleFileInfo()

bool handleFileInfo ( yyscan_t yyscanner,
const QCString & cmdName,
const StringVector & optList )
static

Definition at line 3415 of file commentscan.l.

3416{
3417 return handleFileInfoResult(yyscanner,cmdName, optList, false);
static bool handleFileInfoResult(yyscan_t yyscanner, const QCString &, const StringVector &optList, bool isSection)
3418}

References handleFileInfoResult().

◆ handleFileInfoResult()

bool handleFileInfoResult ( yyscan_t yyscanner,
const QCString & ,
const StringVector & optList,
bool isSection )
static

Definition at line 3423 of file commentscan.l.

3424{
3425 using OutputWriter = std::function<void(yyscan_t,FileInfo &,bool)>;
3426 static std::unordered_map<std::string,OutputWriter> options =
3427 { // name, writer
3428 { "name", [](yyscan_t s,FileInfo &fi,bool isSect) { addOutput(s,fi.baseName());
3429 if (isSect)
3430 {
3431 struct yyguts_t *yyg = (struct yyguts_t*)s;
3432 yyextra->sectionTitle+=fi.baseName();
3433 }
3434 } },
3435 { "extension", [](yyscan_t s,FileInfo &fi,bool isSect) { addOutput(s,fi.extension(true));
3436 if (isSect)
3437 {
3438 struct yyguts_t *yyg = (struct yyguts_t*)s;
3439 yyextra->sectionTitle+=fi.extension(true);
3440 }
3441 } },
3442 { "filename", [](yyscan_t s,FileInfo &fi,bool isSect) { addOutput(s,fi.fileName());
3443 if (isSect)
3444 {
3445 struct yyguts_t *yyg = (struct yyguts_t*)s;
3446 yyextra->sectionTitle+=fi.fileName();
3447 }
3448 } },
3449 { "directory", [](yyscan_t s,FileInfo &fi,bool isSect) { addOutput(s,fi.dirPath());
3450 if (isSect)
3451 {
3452 struct yyguts_t *yyg = (struct yyguts_t*)s;
3453 yyextra->sectionTitle+=fi.dirPath();
3454 }
3455 } },
3456 { "full", [](yyscan_t s,FileInfo &fi,bool isSect) { addOutput(s,fi.absFilePath());
3457 if (isSect)
3458 {
3459 struct yyguts_t *yyg = (struct yyguts_t*)s;
3460 yyextra->sectionTitle+=fi.absFilePath();
3461 }
3462 } },
3463 };
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
yyguts_t * yyscan_t
Definition code.l:24
3464
3465 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3466 if (!yyextra->spaceBeforeCmd.isEmpty())
3467 {
3468 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3469 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3470 yyextra->spaceBeforeCmd.clear();
3471 }
3472 bool first = true;
3473 FileInfo fi(yyextra->fileName.str());
3474 for (const auto &opt_ : optList)
3475 {
3476 QCString optStripped = QCString(opt_).stripWhiteSpace();
3477 std::string opt = optStripped.lower().str();
3478 auto it = options.find(opt);
3479 if (it != options.end())
3480 {
3481 if (!first)
3482 {
3483 warn(yyextra->fileName,yyextra->lineNr,"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3484 }
3485 else
3486 {
3487 it->second(yyscanner,fi,isSection);
3488 }
3489 first = false;
3490 }
3491 else
3492 {
3493 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\fileinfo: '{}'", optStripped);
3494 }
3495 }
3496 if (first) // no options specified
3497 {
3498 if (Config_getBool(FULL_PATH_NAMES))
3499 {
3500 if (isSection) yyextra->sectionTitle+=stripFromPath(yyextra->fileName);
3501 addOutput(yyscanner,stripFromPath(yyextra->fileName));
3502 }
3503 else
3504 {
3505 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3506 addOutput(yyscanner,yyextra->fileName);
3507 }
3508 }
3509 return false;
QCString lower() const
Definition qcstring.h:234
#define Config_getBool(name)
Definition config.h:33
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
3510}

References addOutput(), Config_getBool, QCString::lower(), QCString::str(), stripFromPath(), QCString::stripWhiteSpace(), and warn.

Referenced by handleFileInfo(), and handleFileInfoSection().

◆ handleFileInfoSection()

bool handleFileInfoSection ( yyscan_t yyscanner,
const QCString & cmdName,
const StringVector & optList )
static

Definition at line 3419 of file commentscan.l.

3420{
3421 return handleFileInfoResult(yyscanner,cmdName, optList, true);
3422}

References handleFileInfoResult().

◆ handleFn()

bool handleFn ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2860 of file commentscan.l.

2861{
2862 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2863 yyextra->braceCount=0;
2864 yyextra->functionProto.clear();
2865 yyextra->currentCmd = cmd;
2866 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2867 BEGIN( FnParam );
2868 return checkStructuralIndicator(yyscanner);
2869}

References checkStructuralIndicator().

◆ handleFormatBlock()

bool handleFormatBlock ( yyscan_t yyscanner,
const QCString & s,
const StringVector & optList )
static

Definition at line 3384 of file commentscan.l.

3385{
3386 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3387 if (!yyextra->spaceBeforeCmd.isEmpty())
3388 {
3389 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3390 yyextra->spaceBeforeCmd.clear();
3391 }
3392 if (optList.empty())
3393 {
3394 addOutput(yyscanner,"@"+s+" ");
3395 }
3396 else
3397 {
3398 addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
3399 }
3400 //printf("handleFormatBlock(%s) with option(%s)\n",qPrint(s),qPrint(opt));
3401 yyextra->blockName=s;
3402 yyextra->commentCount=0;
3403 BEGIN(FormatBlock);
3404 return FALSE;
3405}

References addOutput(), FALSE, and join().

◆ handleGroupgraph()

bool handleGroupgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3828 of file commentscan.l.

3829{
3830 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3831 yyextra->current->commandOverrides.override_groupGraph(true); // ON
3832 return FALSE;
3833}

References FALSE.

◆ handleGuard()

void handleGuard ( yyscan_t yyscanner,
const QCString & expr )
static

Definition at line 4840 of file commentscan.l.

4841{
4842 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4843 CondParser prs;
4844 bool sectionEnabled = false;
4845 if (!expr.isEmpty())
4846 {
4847 sectionEnabled=prs.parse(yyextra->fileName,yyextra->lineNr,expr.stripWhiteSpace());
4848 }
4849 bool parentEnabled = yyextra->guards->top().parentVisible();
4850 if (parentEnabled)
4851 {
4852 if (
4853 (sectionEnabled && yyextra->guardType==Guard_If) ||
4854 (!sectionEnabled && yyextra->guardType==Guard_IfNot)
4855 ) // section is visible
4856 {
Copyright (C) 1997-2015 by Dimitri van Heesch.
Definition condparser.h:28
bool parse(const QCString &fileName, int lineNr, const QCString &expr)
Copyright (C) 1997-2015 by Dimitri van Heesch.
4857
4858 yyextra->guards->top().setEnabled(true);
4859 yyextra->guards->top().setEnabledFound();
4860 BEGIN( GuardParamEnd );
4861 }
4862 else if (yyextra->guardType==Guard_ElseIf)
4863 {
4864 if (yyextra->guards->top().isEnabledFound())
4865 {
4866 yyextra->guards->top().setEnabled(false);
4867 BEGIN( SkipGuardedSection );
4868 }
4869 else if (sectionEnabled)
4870 {
4871 yyextra->guards->top().setEnabled(true);
4872 yyextra->guards->top().setEnabledFound();
4873 BEGIN( GuardParamEnd );
4874 }
4875 else
4876 {
4877 yyextra->guards->top().setEnabled(false);
4878 BEGIN( SkipGuardedSection );
4879 }
4880 }
4881 else // section is invisible
4882 {
4883 BEGIN( SkipGuardedSection );
4884 }
4885 }
4886 else // invisible because of parent
4887 {
4888 BEGIN( SkipGuardedSection );
4889 }
4890}

References Guard_ElseIf, Guard_If, Guard_IfNot, QCString::isEmpty(), CondParser::parse(), and QCString::stripWhiteSpace().

◆ handleHeaderFile()

bool handleHeaderFile ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2968 of file commentscan.l.

2969{
2970 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2971 BEGIN( ClassDocArg2 );
2972 return FALSE;
2973}

References FALSE.

◆ handleHideCallergraph()

bool handleHideCallergraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3737 of file commentscan.l.

3738{
3739 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3740 yyextra->current->commandOverrides.override_callerGraph(false); // OFF
3741 return FALSE;
3742}

References FALSE.

◆ handleHideCallgraph()

bool handleHideCallgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3723 of file commentscan.l.

3724{
3725 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3726 yyextra->current->commandOverrides.override_callGraph(false); // OFF
3727 return FALSE;
3728}

References FALSE.

◆ handleHideCollaborationgraph()

bool handleHideCollaborationgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3821 of file commentscan.l.

3822{
3823 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3824 yyextra->current->commandOverrides.override_collaborationGraph(false); // OFF
3825 return FALSE;
3826}

References FALSE.

◆ handleHideDirectoryGraph()

bool handleHideDirectoryGraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3807 of file commentscan.l.

3808{
3809 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3810 yyextra->current->commandOverrides.override_directoryGraph(false); // OFF
3811 return FALSE;
3812}

References FALSE.

◆ handleHideEnumValues()

bool handleHideEnumValues ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3751 of file commentscan.l.

3752{
3753 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3754 yyextra->current->commandOverrides.override_enumValues(false); // OFF
3755 return FALSE;
3756}

References FALSE.

◆ handleHideGroupgraph()

bool handleHideGroupgraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3835 of file commentscan.l.

3836{
3837 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3838 yyextra->current->commandOverrides.override_groupGraph(false); // OFF
3839 return FALSE;
3840}

References FALSE.

◆ handleHideIncludedBygraph()

bool handleHideIncludedBygraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3793 of file commentscan.l.

3794{
3795 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3796 yyextra->current->commandOverrides.override_includedByGraph(false); // OFF
3797 return FALSE;
3798}

References FALSE.

◆ handleHideIncludegraph()

bool handleHideIncludegraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3786 of file commentscan.l.

3787{
3788 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3789 yyextra->current->commandOverrides.override_includeGraph(false); // OFF
3790 return FALSE;
3791}

References FALSE.

◆ handleHideInheritanceGraph()

bool handleHideInheritanceGraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3881 of file commentscan.l.

3882{
3883 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3884 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO); // OFF
3885 return FALSE;
3886}

References FALSE.

◆ handleHideInitializer()

bool handleHideInitializer ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3709 of file commentscan.l.

3710{
3711 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3712 yyextra->current->initLines = 0; // OFF
3713 return FALSE;
3714}

References FALSE.

◆ handleHideInlineSource()

bool handleHideInlineSource ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3765 of file commentscan.l.

3766{
3767 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3768 yyextra->current->commandOverrides.override_inlineSource(false); // OFF
3769 return FALSE;
3770}

References FALSE.

◆ handleHideReferencedByRelation()

bool handleHideReferencedByRelation ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3895 of file commentscan.l.

3896{
3897 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3898 yyextra->current->commandOverrides.override_referencedByRelation(false); // OFF
3899 return FALSE;
3900}

References FALSE.

◆ handleHideReferencesRelation()

bool handleHideReferencesRelation ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3909 of file commentscan.l.

3910{
3911 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3912 yyextra->current->commandOverrides.override_referencesRelation(false); // OFF
3913 return FALSE;
3914}

References FALSE.

◆ handleIdlException()

bool handleIdlException ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3020 of file commentscan.l.

3021{
3022 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3023 yyextra->currentCmd = cmd;
3024 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3025 BEGIN( ClassDocArg1 );
3026 return checkStructuralIndicator(yyscanner);
3027}

References checkStructuralIndicator().

◆ handleIf()

bool handleIf ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3555 of file commentscan.l.

3556{
3557 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3558 yyextra->guardType = Guard_If;
3559 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3560 if (yyextra->guards->empty())
3561 {
3562 yyextra->guards->emplace(true);
3563 }
3564 else
3565 {
3566 bool enabled = yyextra->guards->top().isEnabled();
3567 yyextra->guards->emplace(enabled);
3568 }
3569 BEGIN(GuardParam);
3570 return FALSE;
3571}

References FALSE, and Guard_If.

◆ handleIFile()

bool handleIFile ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3532 of file commentscan.l.

3533{
3534 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3535 addOutput(yyscanner,yytext);
3536 BEGIN(IFile);
3537 return FALSE;
3538}

References addOutput(), and FALSE.

◆ handleIfNot()

bool handleIfNot ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3573 of file commentscan.l.

3574{
3575 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3576 yyextra->guardType = Guard_IfNot;
3577 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3578 if (yyextra->guards->empty())
3579 {
3580 yyextra->guards->emplace(true);
3581 }
3582 else
3583 {
3584 bool enabled = yyextra->guards->top().isEnabled();
3585 yyextra->guards->emplace(enabled);
3586 }
3587 BEGIN(GuardParam);
3588 return FALSE;
3589}

References FALSE, and Guard_IfNot.

◆ handleILine()

bool handleILine ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3524 of file commentscan.l.

3525{
3526 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3527 addOutput(yyscanner,yytext);
3528 BEGIN(ILine);
3529 return FALSE;
3530}

References addOutput(), and FALSE.

◆ handleImage()

bool handleImage ( yyscan_t yyscanner,
const QCString & s,
const StringVector & optList )
static

Definition at line 3346 of file commentscan.l.

3347{
3348 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3349 for (const auto &opt : optList)
3350 {
3351 QCString locOpt(opt);
3352 locOpt = locOpt.stripWhiteSpace();
3353 if (locOpt.lower().startsWith("anchor:"))
3354 {
3355 addAnchor(yyscanner,locOpt.mid(7));
3356 break; // real option handling will be done later on
3357 }
3358 }
3359 if (optList.empty())
3360 {
3361 addOutput(yyscanner,"@"+s+" ");
3362 }
3363 else
3364 {
3365 addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
3366 }
3367 BEGIN(Comment);
3368 return FALSE;
static void addAnchor(yyscan_t yyscanner, const QCString &anchor, const QCString &title="")
3369}

References addAnchor(), addOutput(), FALSE, join(), QCString::lower(), QCString::mid(), QCString::startsWith(), and QCString::stripWhiteSpace().

◆ handleIncludedBygraph()

bool handleIncludedBygraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3779 of file commentscan.l.

3780{
3781 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3782 yyextra->current->commandOverrides.override_includedByGraph(true); // ON
3783 return FALSE;
3784}

References FALSE.

◆ handleIncludegraph()

bool handleIncludegraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3772 of file commentscan.l.

3773{
3774 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3775 yyextra->current->commandOverrides.override_includeGraph(true); // ON
3776 return FALSE;
3777}

References FALSE.

◆ handleIngroup()

bool handleIngroup ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3687 of file commentscan.l.

3688{
3689 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3690 yyextra->inGroupParamFound=FALSE;
3691 BEGIN( InGroupParam );
3692 return FALSE;
3693}

References FALSE.

◆ handleInherit()

bool handleInherit ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 4064 of file commentscan.l.

4065{
4066 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4067 BEGIN(InheritParam);
4068 return FALSE;
4069}

References FALSE.

◆ handleInheritanceGraph()

bool handleInheritanceGraph ( yyscan_t yyscanner,
const QCString & ,
const StringVector & optList )
static

Definition at line 3842 of file commentscan.l.

3843{
3844 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3845 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3846 for (const auto &opt_ : optList)
3847 {
3848 QCString opt = QCString(opt_).stripWhiteSpace().lower();
3849 if (!opt.isEmpty())
3850 {
3851 if (opt == "yes")
3852 {
3853 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3854 }
3855 else if (opt == "graph")
3856 {
3857 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3858 }
3859 else if (opt == "builtin")
3860 {
3861 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3862 }
3863 else if (opt == "text")
3864 {
3865 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3866 }
3867 else if (opt == "no")
3868 {
3869 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3870 }
3871 else
3872 {
3873 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\inheritancegraph: '{}'",
3874 QCString(opt_).stripWhiteSpace());
3875 }
3876 }
3877 }
3878 return FALSE;
3879}

References FALSE, QCString::isEmpty(), QCString::lower(), QCString::stripWhiteSpace(), stripWhiteSpace(), and warn.

◆ handleInterface()

bool handleInterface ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3011 of file commentscan.l.

3012{
3013 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3014 yyextra->currentCmd = cmd;
3015 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3016 BEGIN( ClassDocArg1 );
3017 return checkStructuralIndicator(yyscanner);
3018}

References checkStructuralIndicator().

◆ handleInternal()

bool handleInternal ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3924 of file commentscan.l.

3925{
3926 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3927 if (!Config_getBool(INTERNAL_DOCS))
3928 {
3929 // make sure some whitespace before a \internal command
3930 // is not treated as "documentation"
3931 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3932 {
3933 yyextra->current->doc.clear();
3934 }
3935 yyextra->condCount=0;
3936 BEGIN( SkipInternal );
3937 }
3938 else
3939 {
3940 // re-enabled for bug640828
3941 addOutput(yyscanner," \\internal ");
3942 yyextra->inInternalDocs = TRUE;
3943 }
3944 return FALSE;
#define TRUE
Definition qcstring.h:37
3945}

References addOutput(), Config_getBool, FALSE, and TRUE.

◆ handleIPrefix()

bool handleIPrefix ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3547 of file commentscan.l.

3548{
3549 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3550 addOutput(yyscanner,"@iprefix ");
3551 BEGIN(IRaisePrefix);
3552 return FALSE;
3553}

References addOutput(), and FALSE.

◆ handleIRaise()

bool handleIRaise ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3540 of file commentscan.l.

3541{
3542 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3543 BEGIN(IRaise);
3544 return FALSE;
3545}

References FALSE.

◆ handleLineInfo()

bool handleLineInfo ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3512 of file commentscan.l.

3513{
3514 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3515 if (!yyextra->spaceBeforeCmd.isEmpty())
3516 {
3517 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3518 yyextra->spaceBeforeCmd.clear();
3519 }
3520 addOutput(yyscanner,QCString().setNum(yyextra->lineNr));
3521 return FALSE;
3522}

References addOutput(), and FALSE.

◆ handleMainpage()

bool handleMainpage ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3037 of file commentscan.l.

3038{
3039 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3040 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeMainpageDoc);
3041 if (!stop)
3042 {
3043 yyextra->current->name = "mainpage";
3044 }
3045 setOutput(yyscanner,OutputDoc);
3046 BEGIN( PageDocArg2 );
3047 return stop;
3048}

References makeStructuralIndicator(), OutputDoc, and setOutput().

◆ handleMemberOf()

bool handleMemberOf ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3258 of file commentscan.l.

3259{
3260 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3261 if (!yyextra->current->relates.isEmpty())
3262 {
3263 warn(yyextra->fileName,yyextra->lineNr,
3264 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3265 }
3266 yyextra->current->relatesType = RelatesType::MemberOf;
3267 yyextra->currentCmd = cmd;
3268 BEGIN(RelatesParam1);
3269 return FALSE;
3270}

References FALSE, and warn.

◆ handleModule()

bool handleModule ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2959 of file commentscan.l.

2960{
2961 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2962 yyextra->currentCmd = cmd;
2963 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
2964 BEGIN( ModuleDocArg1 );
2965 return checkStructuralIndicator(yyscanner);
2966}

References checkStructuralIndicator().

◆ handleName()

bool handleName ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3138 of file commentscan.l.

3139{
3140 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3141 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeMemberGrp);
3142 if (!stop)
3143 {
3144 yyextra->docGroup.clearHeader();
3145 BEGIN( NameParam );
3146 if (!yyextra->docGroup.isEmpty()) // end of previous member group
3147 {
3148 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,TRUE,true);
3149 }
3150 }
3151 return stop;
3152}

References makeStructuralIndicator(), and TRUE.

◆ handleNamespace()

bool handleNamespace ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2925 of file commentscan.l.

2926{
2927 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2928 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
2929 BEGIN( NameSpaceDocArg1 );
2930 return checkStructuralIndicator(yyscanner);
2931}

References checkStructuralIndicator().

◆ handleNoop()

bool handleNoop ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3131 of file commentscan.l.

3132{
3133 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3134 BEGIN( Noop );
3135 return FALSE;
3136}

References FALSE.

◆ handleNoSubGrouping()

bool handleNoSubGrouping ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3695 of file commentscan.l.

3696{
3697 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3698 yyextra->current->subGrouping = FALSE;
3699 return FALSE;
3700}

References FALSE.

◆ handleOverload()

bool handleOverload ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2882 of file commentscan.l.

2883{
2884 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2885 yyextra->functionProto.clear();
2886 BEGIN(OverloadParam);
2887 return FALSE;
2888}

References FALSE.

◆ handlePackage()

bool handlePackage ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2933 of file commentscan.l.

2934{
2935 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2936 bool stop=makeStructuralIndicator(yyscanner,EntryType::makePackageDoc);
2937 BEGIN( PackageDocArg1 );
2938 return stop;
2939}

References makeStructuralIndicator().

◆ handlePage()

bool handlePage ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3029 of file commentscan.l.

3030{
3031 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3032 bool stop=makeStructuralIndicator(yyscanner,EntryType::makePageDoc);
3033 BEGIN( PageDocArg1 );
3034 return stop;
3035}

References makeStructuralIndicator().

◆ handleParam()

bool handleParam ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3062 of file commentscan.l.

3063{
3064 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3065 // we need process param and retval arguments to escape leading underscores in case of
3066 // markdown processing, see bug775493
3067 addOutput(yyscanner,"@param ");
3068 BEGIN( ParamArg1 );
3069 return FALSE;
3070}

References addOutput(), and FALSE.

◆ handleParBlock()

bool handleParBlock ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3198 of file commentscan.l.

3199{
3200 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3201 if (yyextra->insideParBlock)
3202 {
3203 warn(yyextra->fileName,yyextra->lineNr,
3204 "found \\parblock command while already in a parblock!");
3205 }
3206 if (!yyextra->spaceBeforeCmd.isEmpty())
3207 {
3208 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3209 yyextra->spaceBeforeCmd.clear();
3210 }
3211 addOutput(yyscanner,"@parblock ");
3212 yyextra->insideParBlock = TRUE;
3213 return FALSE;
3214}

References addOutput(), FALSE, TRUE, and warn.

◆ handlePrivate()

bool handlePrivate ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3961 of file commentscan.l.

3962{
3963 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3964 yyextra->current->protection = Protection::Private;
3965 return FALSE;
3966}

References FALSE.

◆ handlePrivateSection()

bool handlePrivateSection ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3968 of file commentscan.l.

3969{
3970 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3971 yyextra->current->protection = yyextra->protection = Protection::Private;
3972 return FALSE;
3973}

References FALSE.

◆ handleProtected()

bool handleProtected ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3975 of file commentscan.l.

3976{
3977 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3978 yyextra->current->protection = Protection::Protected;
3979 return FALSE;
3980}

References FALSE.

◆ handleProtectedSection()

bool handleProtectedSection ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3982 of file commentscan.l.

3983{
3984 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3985 yyextra->current->protection = yyextra->protection = Protection::Protected ;
3986 return FALSE;
3987}

References FALSE.

◆ handleProtocol()

bool handleProtocol ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2975 of file commentscan.l.

2976{ // Obj-C protocol
2977 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2978 yyextra->currentCmd = cmd;
2979 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
2980 BEGIN( ClassDocArg1 );
2981 return checkStructuralIndicator(yyscanner);
2982}

References checkStructuralIndicator().

◆ handlePublic()

bool handlePublic ( yyscan_t yyscanner,
const QCString & s,
const StringVector &  )
static

Definition at line 3989 of file commentscan.l.

3990{
3991 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3992 yyextra->current->protection = Protection::Public;
3993 return FALSE;
3994}

References FALSE.

◆ handlePublicSection()

bool handlePublicSection ( yyscan_t yyscanner,
const QCString & s,
const StringVector &  )
static

Definition at line 3996 of file commentscan.l.

3997{
3998 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3999 yyextra->current->protection = yyextra->protection = Protection::Public;
4000 return FALSE;
4001}

References FALSE.

◆ handlePure()

bool handlePure ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3954 of file commentscan.l.

3955{
3956 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3957 yyextra->current->virt = Specifier::Pure;
3958 return FALSE;
3959}

References FALSE.

◆ handleQualifier()

bool handleQualifier ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3916 of file commentscan.l.

3917{
3918 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3919 yyextra->currentCmd = cmd;
3920 BEGIN(Qualifier);
3921 return FALSE;
3922}

References FALSE.

◆ handleRaiseWarning()

bool handleRaiseWarning ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3123 of file commentscan.l.

3124{
3125 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3126 yyextra->raiseWarning = "";
3127 BEGIN( RaiseWarning );
3128 return FALSE;
3129}

References FALSE.

◆ handleReferencedByRelation()

bool handleReferencedByRelation ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3888 of file commentscan.l.

3889{
3890 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3891 yyextra->current->commandOverrides.override_referencedByRelation(true); // ON
3892 return FALSE;
3893}

References FALSE.

◆ handleReferencesRelation()

bool handleReferencesRelation ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3902 of file commentscan.l.

3903{
3904 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3905 yyextra->current->commandOverrides.override_referencesRelation(true); // ON
3906 return FALSE;
3907}

References FALSE.

◆ handleRefItem()

bool handleRefItem ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3272 of file commentscan.l.

3273{
3274 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3275 addOutput(yyscanner,"@refitem ");
3276 BEGIN(LineParam);
3277 return FALSE;
3278}

References addOutput(), and FALSE.

◆ handleRelated()

bool handleRelated ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3230 of file commentscan.l.

3231{
3232 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3233 if (!yyextra->current->relates.isEmpty())
3234 {
3235 warn(yyextra->fileName,yyextra->lineNr,
3236 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3237 }
3238 yyextra->current->relatesType = RelatesType::Simple;
3239 yyextra->currentCmd = cmd;
3240 BEGIN(RelatesParam1);
3241 return FALSE;
3242}

References FALSE, and warn.

◆ handleRelatedAlso()

bool handleRelatedAlso ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3244 of file commentscan.l.

3245{
3246 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3247 if (!yyextra->current->relates.isEmpty())
3248 {
3249 warn(yyextra->fileName,yyextra->lineNr,
3250 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3251 }
3252 yyextra->current->relatesType = RelatesType::Duplicate;
3253 yyextra->currentCmd = cmd;
3254 BEGIN(RelatesParam1);
3255 return FALSE;
3256}

References FALSE, and warn.

◆ handleRetval()

bool handleRetval ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3072 of file commentscan.l.

3073{
3074 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3075 addOutput(yyscanner,"@retval ");
3076 BEGIN( ParamArg1 );
3077 return FALSE;
3078}

References addOutput(), and FALSE.

◆ handleSection()

bool handleSection ( yyscan_t yyscanner,
const QCString & s,
const StringVector &  )
static

Definition at line 3280 of file commentscan.l.

3281{
3282 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3283 setOutput(yyscanner,OutputDoc);
3284 //printf("handleSection(%s) raiseLevel=%d\n",qPrint(s),yyextra->raiseLevel);
3285 BEGIN(SectionLabel);
3286 // determine natural section level
3287 if (s=="section") yyextra->sectionLevel=SectionType::Section;
3288 else if (s=="subsection") yyextra->sectionLevel=SectionType::Subsection;
3289 else if (s=="subsubsection") yyextra->sectionLevel=SectionType::Subsubsection;
3290 else if (s=="paragraph") yyextra->sectionLevel=SectionType::Paragraph;
3291 else if (s=="subparagraph") yyextra->sectionLevel=SectionType::Subparagraph;
3292 else if (s=="subsubparagraph") yyextra->sectionLevel=SectionType::Subsubparagraph;
3293 // raise it if requested
3294 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,SectionType::MaxLevel);
3295 // rewrite the update section level to the output
3296 switch (yyextra->sectionLevel)
3297 {
3298 case SectionType::Section: addOutput(yyscanner,"@section "); break;
3299 case SectionType::Subsection: addOutput(yyscanner,"@subsection "); break;
3300 case SectionType::Subsubsection: addOutput(yyscanner,"@subsubsection "); break;
3301 case SectionType::Paragraph: addOutput(yyscanner,"@paragraph "); break;
3302 case SectionType::Subparagraph: addOutput(yyscanner,"@subparagraph "); break;
3303 case SectionType::Subsubparagraph: addOutput(yyscanner,"@subsubparagraph "); break;
3304 default: addOutput(yyscanner,"@"+s+" "); break;
3305 }
3306 return FALSE;
static constexpr int Section
Definition section.h:33
static constexpr int MaxLevel
Definition section.h:39
static constexpr int Subsection
Definition section.h:34
static constexpr int Subsubsection
Definition section.h:35
static constexpr int Paragraph
Definition section.h:36
static constexpr int Subsubparagraph
Definition section.h:38
static constexpr int Subparagraph
Definition section.h:37
3307}

References addOutput(), FALSE, SectionType::MaxLevel, OutputDoc, SectionType::Paragraph, SectionType::Section, setOutput(), SectionType::Subparagraph, SectionType::Subsection, SectionType::Subsubparagraph, and SectionType::Subsubsection.

◆ handleShowEnumValues()

bool handleShowEnumValues ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3744 of file commentscan.l.

3745{
3746 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3747 yyextra->current->commandOverrides.override_enumValues(true); // ON
3748 return FALSE;
3749}

References FALSE.

◆ handleShowInitializer()

bool handleShowInitializer ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3702 of file commentscan.l.

3703{
3704 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3705 yyextra->current->initLines = 100000; // ON
3706 return FALSE;
3707}

References FALSE.

◆ handleShowInlineSource()

bool handleShowInlineSource ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3758 of file commentscan.l.

3759{
3760 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3761 yyextra->current->commandOverrides.override_inlineSource(true); // ON
3762 return FALSE;
3763}

References FALSE.

◆ handleStatic()

bool handleStatic ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3947 of file commentscan.l.

3948{
3949 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3950 yyextra->current->isStatic = TRUE;
3951 return FALSE;
3952}

References FALSE, and TRUE.

◆ handleStruct()

bool handleStruct ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 3002 of file commentscan.l.

3003{
3004 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3005 yyextra->currentCmd = cmd;
3006 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3007 BEGIN( ClassDocArg1 );
3008 return checkStructuralIndicator(yyscanner);
3009}

References checkStructuralIndicator().

◆ handleSubpage()

bool handleSubpage ( yyscan_t yyscanner,
const QCString & s,
const StringVector &  )
static

Definition at line 3309 of file commentscan.l.

3310{
3311 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3312 if (!yyextra->current->section.isEmpty() &&
3313 !yyextra->current->section.isPageDoc() &&
3314 !yyextra->current->section.isMainpageDoc()
3315 )
3316 {
3317 warn(yyextra->fileName,yyextra->lineNr,
3318 "found \\subpage command in a comment block that is not marked as a page!");
3319 }
3320 if (!yyextra->spaceBeforeCmd.isEmpty())
3321 {
3322 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3323 yyextra->spaceBeforeCmd.clear();
3324 }
3325 addOutput(yyscanner,"@"+s+" ");
3326 BEGIN(SubpageLabel);
3327 return FALSE;
3328}

References addOutput(), FALSE, and warn.

◆ handleTest()

bool handleTest ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3163 of file commentscan.l.

3164{
3165 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3166 yyextra->newXRefKind = XRef_Test;
3167 setOutput(yyscanner,OutputXRef);
3168 yyextra->xrefKind = XRef_Test;
3169 return FALSE;
3170}

References FALSE, OutputXRef, setOutput(), and XRef_Test.

◆ handleToc()

bool handleToc ( yyscan_t yyscanner,
const QCString & s,
const StringVector & optList )
static

Definition at line 4003 of file commentscan.l.

4004{
4005 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4006 if (yyextra->current->section.isPageDoc() ||
4007 yyextra->current->section.isMainpageDoc())
4008 {
4009 for (const auto &opt_ : optList)
4010 {
4011 QCString opt = QCString(opt_).stripWhiteSpace().lower();
4012 int level = SectionType::MaxLevel;
4013 int i = opt.find(':');
4014 if (i>0) // found ':' but not on position 0 what would mean just a level
4015 {
4016 char dum=0;
4017 if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1)
4018 {
4019 warn(yyextra->fileName,yyextra->lineNr,"Unknown option:level specified with \\tableofcontents: '{}'",
4021 opt = "";
4022 }
4023 else
4024 {
4025 level = level<=0 ? SectionType::MaxLevel : std::min(level,SectionType::MaxLevel);
4026 opt = opt.left(i).stripWhiteSpace();
4027 }
4028 }
4029 if (!opt.isEmpty())
4030 {
4031 if (opt == "html")
4032 {
4033 yyextra->current->localToc.enableHtml(level);
4034 }
4035 else if (opt == "latex")
4036 {
4037 yyextra->current->localToc.enableLatex(level);
4038 }
4039 else if (opt == "xml")
4040 {
4041 yyextra->current->localToc.enableXml(level);
4042 }
4043 else if (opt == "docbook")
4044 {
4045 yyextra->current->localToc.enableDocbook(level);
4046 }
4047 else
4048 {
4049 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\tableofcontents: '{}'",
4050 QCString(opt_).stripWhiteSpace());
4051 }
4052 }
4053 }
4054 if (yyextra->current->localToc.nothingEnabled())
4055 {
4056 // for backward compatibility
4057 yyextra->current->localToc.enableHtml(SectionType::MaxLevel);
4058 yyextra->current->localToc.enableXml(SectionType::MaxLevel);
4059 }
4060 }
4061 return FALSE;
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString right(size_t len) const
Definition qcstring.h:219
QCString left(size_t len) const
Definition qcstring.h:214
4062}

References QCString::data(), FALSE, QCString::find(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), SectionType::MaxLevel, qPrint(), QCString::right(), QCString::stripWhiteSpace(), stripWhiteSpace(), and warn.

◆ handleTodo()

bool handleTodo ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3154 of file commentscan.l.

3155{
3156 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3157 yyextra->newXRefKind = XRef_Todo;
3158 setOutput(yyscanner,OutputXRef);
3159 yyextra->xrefKind = XRef_Todo;
3160 return FALSE;
3161}

References FALSE, OutputXRef, setOutput(), and XRef_Todo.

◆ handleUnion()

bool handleUnion ( yyscan_t yyscanner,
const QCString & cmd,
const StringVector &  )
static

Definition at line 2993 of file commentscan.l.

2994{
2995 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2996 yyextra->currentCmd = cmd;
2997 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
2998 BEGIN( ClassDocArg1 );
2999 return checkStructuralIndicator(yyscanner);
3000}

References checkStructuralIndicator().

◆ handleWeakGroup()

bool handleWeakGroup ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 2916 of file commentscan.l.

2917{
2918 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2919 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
2920 yyextra->current->groupDocType = Entry::GROUPDOC_WEAK;
2921 BEGIN( GroupDocArg1 );
2922 return stop;
@ GROUPDOC_WEAK
weakgroup
Definition entry.h:123
2923}

References Entry::GROUPDOC_WEAK, and makeStructuralIndicator().

◆ handleXRefItem()

bool handleXRefItem ( yyscan_t yyscanner,
const QCString & ,
const StringVector &  )
static

Definition at line 3190 of file commentscan.l.

3191{
3192 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3193 yyextra->newXRefKind = XRef_Item;
3194 BEGIN(XRefItemParam1);
3195 return FALSE;
3196}

References FALSE, and XRef_Item.

◆ initParser()

void initParser ( yyscan_t yyscanner)
static

Definition at line 4133 of file commentscan.l.

4134{
4135 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4136 yyextra->sectionLabel.clear();
4137 yyextra->sectionTitle.clear();
4138 yyextra->docGroup.clearHeader();
4139 yyextra->insideParBlock = FALSE;
4140}

References FALSE.

Referenced by CommentScanner::parseCommentBlock(), parseMain(), and parseMain().

◆ lineCount()

void lineCount ( yyscan_t yyscanner)
static

Definition at line 4177 of file commentscan.l.

4178{
4179 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4180 for( const char* c = yytext ; *c ; ++c )
4181 yyextra->lineNr += (*c == '\n') ;
4182}

◆ makeStructuralIndicator()

bool makeStructuralIndicator ( yyscan_t yyscanner,
MakeEntryType maker )
static

Definition at line 4151 of file commentscan.l.

4152{
4153 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4154 assert(maker!=nullptr); // detect programming error
4155 //printf("yyextra->current->section=%x\n",yyextra->current->section);
4156 if (yyextra->current->section.isDoc())
4157 {
4158 return true;
4159 }
4160 else if (maker)
4161 {
4162 yyextra->needNewEntry = true;
4163 yyextra->current->section = maker();
4164 yyextra->current->fileName = yyextra->fileName;
4165 yyextra->current->startLine = yyextra->lineNr;
4166 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4167 return false;
4168 }
4169 else
4170 {
4171 return false;
4172 }
4173}

Referenced by handleAddToGroup(), handleDefGroup(), handleDir(), handleExample(), handleFile(), handleMainpage(), handleName(), handlePackage(), handlePage(), and handleWeakGroup().

◆ sectionLevelToType()

SectionType sectionLevelToType ( int level)
static

Definition at line 4313 of file commentscan.l.

4314{
4315 if (level>=0 && level<SectionType::MaxLevel) return SectionType(level);
4316 return SectionType::Anchor;
4317}

References SectionType::Anchor, and SectionType::MaxLevel.

Referenced by addSection().

◆ setOutput()

void setOutput ( yyscan_t yyscanner,
OutputContext ctx )
inlinestatic

Definition at line 4411 of file commentscan.l.

4412{
4413 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4414 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4415 // determine append flag for the next item (i.e. the end of this item)
4416 yyextra->xrefAppendFlag = !yyextra->inBody &&
4417 yyextra->inContext==OutputXRef && ctx==OutputXRef && // two consecutive xref items
4418 yyextra->newXRefKind==yyextra->xrefKind && // of the same kind
4419 (yyextra->xrefKind!=XRef_Item ||
4420 yyextra->newXRefItemKey==yyextra->xrefItemKey); // with the same key if \xrefitem
4421 //printf("%d && %d && %d && (%d || %d)\n",
4422 // yyextra->inContext==OutputXRef,
4423 // ctx==OutputXRef,
4424 // yyextra->newXRefKind==yyextra->xrefKind,
4425 // yyextra->xrefKind!=XRef_Item,
4426 // yyextra->newXRefItemKey==yyextra->xrefItemKey);
4427 //printf("refKind=%d yyextra->newXRefKind=%d xrefAppendToPrev=%d yyextra->xrefAppendFlag=%d\n",
4428 // yyextra->xrefKind,yyextra->newXRefKind,xrefAppendToPrev,yyextra->xrefAppendFlag);
4429
4430 //printf("setOutput(yyscanner,yyextra->inContext=%d ctx=%d)\n",yyextra->inContext,ctx);
4431 if (yyextra->inContext==OutputXRef) // end of XRef section => add the item
4432 {
4433 // See if we can append this new xref item to the previous one.
4434 // We know this at the start of the next item of the same
4435 // type and need to remember this until the end of that item.
4436 switch(yyextra->xrefKind)
4437 {
4438 case XRef_Todo:
4439 addXRefItem(yyscanner,QCString("todo"),
4440 theTranslator->trTodo(),
4441 theTranslator->trTodoList(),
4442 xrefAppendToPrev
4443 );
4444 break;
4445 case XRef_Test:
4446 addXRefItem(yyscanner,QCString("test"),
4447 theTranslator->trTest(),
4448 theTranslator->trTestList(),
4449 xrefAppendToPrev
4450 );
4451 break;
4452 case XRef_Bug:
4453 addXRefItem(yyscanner,QCString("bug"),
4454 theTranslator->trBug(),
4455 theTranslator->trBugList(),
4456 xrefAppendToPrev
4457 );
4458 break;
4459 case XRef_Deprecated:
4460 addXRefItem(yyscanner,QCString("deprecated"),
4461 theTranslator->trDeprecated(),
4462 theTranslator->trDeprecatedList(),
4463 xrefAppendToPrev
4464 );
4465 break;
4466 case XRef_Item: // user defined list
4467 addXRefItem(yyscanner,yyextra->xrefItemKey,
4468 yyextra->xrefItemTitle,
4469 yyextra->xrefListTitle,
4470 xrefAppendToPrev
4471 );
4472 break;
4473 case XRef_None:
4474 ASSERT(0);
4475 break;
4476 }
4477 }
4478 yyextra->xrefItemKey = yyextra->newXRefItemKey;
static void addXRefItem(yyscan_t yyscanner, const QCString &listName, const QCString &itemTitle, const QCString &listTitle, bool append)
Translator * theTranslator
Definition language.cpp:71
#define ASSERT(x)
Definition qcstring.h:39
4479
4480 int oldContext = yyextra->inContext;
4481 yyextra->inContext = ctx;
4482 if (yyextra->inContext!=OutputXRef && yyextra->inBody) yyextra->inContext=OutputInbody;
4483 switch(yyextra->inContext)
4484 {
4485 case OutputDoc:
4486 if (oldContext!=yyextra->inContext)
4487 {
4488 stripTrailingWhiteSpace(yyextra->current->doc);
4489 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4490 if (yyextra->current->docFile.isEmpty())
4491 {
4492 yyextra->current->docFile = yyextra->fileName;
4493 yyextra->current->docLine = yyextra->lineNr;
4494 }
4495 }
4496 yyextra->pOutputString = &yyextra->current->doc;
4497 break;
4498 case OutputBrief:
4499 {
4500 if (oldContext!=yyextra->inContext)
4501 {
4502 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4503 if (yyextra->current->briefFile.isEmpty())
4504 {
4505 yyextra->current->briefFile = yyextra->fileName;
4506 yyextra->current->briefLine = yyextra->lineNr;
4507 }
4508 }
4509 bool foundMatch = false;
4510 if (yyextra->current->brief.stripWhiteSpace().isEmpty()) // we only want one brief
4511 // description even if multiple
4512 // are given...
4513 {
4514 foundMatch = true;
4515 }
4516 else
4517 {
4518 std::string str = yyextra->current->brief.str();
4520 if (reg::match(str,match,nonBrief_re)) // match found
4521 {
4522 size_t cnt = 0;
4523 for (size_t i = 0; i < match[2].str().size(); i++)
4524 {
4525 if (match[2].str()[i] == '\n') cnt++;
4526 }
4527 if (cnt>0)
4528 {
4529 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4530 // set warning line correct
4531 yyextra->current->brief += " \\iline " + QCString().setNum(cnt + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
4532 }
4533 foundMatch = true;
4534 }
4535 }
4536 if (foundMatch)
4537 {
4538 yyextra->pOutputString = &yyextra->current->brief;
4539 }
4540 else
4541 {
4542 if (!yyextra->current->doc.isEmpty()) // when appending parts add a new line
4543 {
4544 yyextra->current->doc += "\n";
4545 }
4546 yyextra->pOutputString = &yyextra->current->doc;
4547 yyextra->inContext = OutputDoc; // need to switch to detailed docs, see bug 631380
4548 }
4549 }
4550 break;
4551 case OutputXRef:
4552 yyextra->pOutputString = &yyextra->outputXRef;
4553 // first item found, so can't append to previous
4554 //yyextra->xrefAppendFlag = FALSE;
4555 break;
4556 case OutputInbody:
4557 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4558 break;
4559 }
QCString & setNum(short n)
Definition qcstring.h:444
static void stripTrailingWhiteSpace(QCString &s)
4560}

References addXRefItem(), ASSERT, reg::match(), nonBrief_re, OutputBrief, OutputDoc, OutputInbody, OutputXRef, QCString::setNum(), stripTrailingWhiteSpace(), theTranslator, XRef_Bug, XRef_Deprecated, XRef_Item, XRef_None, XRef_Test, and XRef_Todo.

Referenced by endBrief(), handleBrief(), handleBug(), handleCopyBrief(), handleCopyDetails(), handleCopyDoc(), handleDeprecated(), handleDetails(), handleEndParBlock(), handleMainpage(), handleSection(), handleTest(), handleTodo(), and CommentScanner::parseCommentBlock().

◆ stateToString()

const char * stateToString ( int state)
static

◆ stripQuotes()

QCString stripQuotes ( const char * s)
static

Definition at line 4186 of file commentscan.l.

4187{
4188 QCString name;
4189 if (s==nullptr || *s==0) return name;
4190 name=s;
4191 if (name.at(0)=='"' && name.at(name.length()-1)=='"')
4192 {
4193 name=name.mid(1,name.length()-2);
4194 }
4195 return name;
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
4196}

References QCString::at(), QCString::length(), and QCString::mid().

◆ stripTrailingWhiteSpace()

void stripTrailingWhiteSpace ( QCString & s)
static

Definition at line 4383 of file commentscan.l.

4384{
4385 size_t len = s.length();
4386 int i = (int)len-1;
4387 while (i>=0)
4388 {
4389 char c = s.at(i);
4390 if (c==' ' || c=='\t' || c=='\r') // normal whitespace
4391 {
4392 i--;
4393 }
4394 else if (c=='r' && i>=7 && literal_at(s.data()+i-7,"\\ilinebr")) // special line break marker
4395 {
4396 i-=8;
4397 }
4398 else // non-whitespace
4399 {
4400 break;
4401 }
4402 }
4403 //printf("stripTrailingWhitespace(%s) i=%d len=%d\n",qPrint(s),i,len);
4404 if (i!=(int)len-1)
4405 {
4406 s.resize(i+1); // string up to and including char at pos i
4407 }
void resize(size_t newlen)
Definition qcstring.h:167
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
Definition stringutil.h:98
4408}

References QCString::at(), QCString::data(), QCString::length(), literal_at(), and QCString::resize().

Referenced by setOutput().

◆ yylex()

int yylex ( yyscan_t yyscanner)

Definition at line 697 of file commentscan.l.

716 {CMD}{CMD}[a-z_A-Z]+{B}* { // escaped command
717 addOutput(yyscanner,yytext);
718 }
719<Comment>{CMD}{CMD}"~"[a-z_A-Z]* { // escaped command
720 addOutput(yyscanner,yytext);
721 }
722<Comment>{MAILADDR} { // mail address
723 addOutput(yyscanner,yytext);
724 }
725<Comment>"\""[^"\n]*"\"" { // quoted text
726 addOutput(yyscanner,yytext);
727 }
728<Comment>("\\"[a-z_A-Z]+)+"\\" { // directory (or chain of commands!)
729 addOutput(yyscanner,yytext);
730 }
731<Comment>"<"{DETAILEDHTML}{ATTR}">" { // HTML command that ends a brief description
732 QCString htmlOpenTag(yytext);
733 int spacePos = htmlOpenTag.find(' '); // check for optional attributes
734 if (spacePos==-1) spacePos=yyleng-1;
735 QCString htmlTagName = htmlOpenTag.mid(1,spacePos-1);
736 //printf("found open tag '%s'\n",qPrint(htmlTagName));
737 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
738 if (yyextra->inContext==OutputBrief)
739 {
740 setOutput(yyscanner,OutputDoc);
741 }
742 // continue with the same input
743 REJECT;
744 }
745<Comment>"</"{DETAILEDHTML}">" { // HTML command that ends a brief description
746 QCString htmlCloseTag(yytext);
747 QCString htmlTagName = htmlCloseTag.mid(2,htmlCloseTag.length()-3);
748 //printf("found close tag '%s'\n",qPrint(htmlTagName));
749 if (!yyextra->htmlContextStack.empty() &&
750 yyextra->htmlContextStack.back().tagName==htmlTagName)
751 {
752 if (yyextra->inContext==OutputXRef && yyextra->htmlContextStack.back().context!=OutputXRef)
753 {
754 //printf("switching back to OutputDoc\n");
755 setOutput(yyscanner,OutputDoc);
756 }
757 yyextra->htmlContextStack.pop_back();
758 }
759 REJECT;
760 }
761<Comment>"<"{DETAILEDHTMLOPT}">" { // HTML <code> command that ends a brief description
762 // without attributes
763 if (yyextra->current->lang==SrcLangExt::CSharp)
764 {
765 yyextra->CScode=true;
766 setOutput(yyscanner,OutputDoc);
767 addOutput(yyscanner,"@code{cs}");
768 }
769 else
770 {
771 // continue with the same input
772 REJECT;
773 }
774 }
775<Comment>"<"{DETAILEDHTMLOPTEND}">" { // HTML command that ends a brief description
776 if (yyextra->CScode)
777 {
778 addOutput(yyscanner,"@endcode");
779 yyextra->CScode=false;
780 }
781 else
782 {
783 yyextra->CScode=false;
784 // continue with the same input
785 REJECT;
786 }
787 }
788<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" { // HTML <code> command that ends a brief description
789 // with attributes, so cannot be CS.
790 if (yyextra->current->lang==SrcLangExt::CSharp)
791 {
792 setOutput(yyscanner,OutputDoc);
793 }
794 // continue with the same input
795 REJECT;
796 }
797<Comment>"<"{DETAILS}{ATTR}">" { // start of a HTML style details description
798 yyextra->htmlDetailsStack.push_back(0);
799 yyextra->htmlContextStack.emplace_back("details",yyextra->inContext);
800 if (yyextra->inContext==OutputBrief)
801 {
802 setOutput(yyscanner,OutputDoc);
803 }
804 addOutput(yyscanner,yytext);
805 }
806<Comment>"</"{DETAILS}">" { // end of a HTML style details description
807 if (!yyextra->htmlDetailsStack.empty())
808 {
809 yyextra->htmlDetailsStack.pop_back();
810 }
811 if (!yyextra->htmlContextStack.empty() &&
812 yyextra->htmlContextStack.back().tagName=="details")
813 {
814 if (yyextra->inContext==OutputXRef && yyextra->htmlContextStack.back().context!=OutputXRef)
815 {
816 //printf("switching back to OutputDoc\n");
817 setOutput(yyscanner,OutputDoc);
818 }
819 yyextra->htmlContextStack.pop_back();
820 }
821 addOutput(yyscanner,yytext);
822 }
823<Comment>"<"{AHTML} { // potential start of HTML anchor, see issue 9200
824 yyextra->htmlAnchorStr = yytext;
825 yyextra->htmlAnchor = false;
826 BEGIN(HtmlA);
827 }
828<HtmlA>{ANCHTML} { // only labels that can be converted to doxygen anchor
829 yyextra->htmlAnchorStr += yytext;
830 QCString tag(yytext);
831 int s=tag.find("=");
832 char c=tag[s+1];
833 QCString id;
834 if (c=='\'' || c=='"') // valid start
835 {
836 int e=tag.find(c,s+2);
837 if (e!=-1) // found matching end
838 {
839 id=tag.mid(s+2,e-s-2); // extract id
840 addAnchor(yyscanner,id);
841 }
842 }
843 else
844 {
845 id=tag.mid(s+1);
846 addAnchor(yyscanner,id);
847 }
848 if (!id.isEmpty() && !yyextra->htmlAnchor)
849 {
850 // only use first analogous to what is in docparser
851 addOutput(yyscanner,"@anchor ");
852 addOutput(yyscanner,id.data());
853 addOutput(yyscanner," ");
854 yyextra->htmlAnchor = true;
855 }
856 }
857<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
858 yyextra->htmlAnchorStr += yytext;
859 }
860<HtmlA>">"|"/>" {
861 if (!yyextra->htmlAnchor)
862 {
863 addOutput(yyscanner,yyextra->htmlAnchorStr);
864 addOutput(yyscanner,yytext);
865 }
866 else
867 {
868 if (yyleng == 1) // to keep <a></a> pairs, otherwise single </a> present
869 {
870 addOutput(yyscanner,"<a>");
871 }
872 }
873 BEGIN(Comment);
874 }
875<HtmlA>{DOCNL} { // newline
876 yyextra->htmlAnchorStr += yytext;
877 if (*yytext == '\n') yyextra->lineNr++;
878 }
879<HtmlA>. { // catch-all for anything else
880 yyextra->htmlAnchorStr += yytext;
881 }
882<Comment>"<"{SUMMARY}">" { // start of a .NET XML style brief description
883 if (yyextra->htmlDetailsStack.empty())
884 {
885 setOutput(yyscanner,OutputBrief);
886 }
887 else // HTML5 style <summary> as part of <details> section.
888 {
889 addOutput(yyscanner,yytext);
890 }
891 }
892<Comment>"<"{REMARKS}">" { // start of a .NET XML style detailed description
893 setOutput(yyscanner,OutputDoc);
894 addOutput(yyscanner,yytext);
895 }
896<Comment>"</"{SUMMARY}">" { // start of a .NET XML style detailed description
897 if (!yyextra->htmlDetailsStack.empty())
898 {
899 addOutput(yyscanner,yytext);
900 }
901 else
902 {
903 setOutput(yyscanner,OutputDoc);
904 }
905 }
906<Comment>"</"{REMARKS}">" { // end of a brief or detailed description
907 setOutput(yyscanner,OutputDoc);
908 addOutput(yyscanner,yytext);
909 }
910<Comment>"<"{CAPTION}{ATTR}">" {
911 QCString tag(yytext);
912 int s=tag.find("id=");
913 if (s!=-1) // command has id attribute
914 {
915 char c=tag[s+3];
916 if (c=='\'' || c=='"') // valid start
917 {
918 int e=tag.find(c,s+4);
919 if (e!=-1) // found matching end
920 {
921 QCString id=tag.mid(s+4,e-s-4); // extract id
922 addAnchor(yyscanner,id);
923 }
924 }
925 }
926 addOutput(yyscanner,yytext);
927 }
928<Comment>"<"{PRE}{ATTR}">" {
929 yyextra->insidePre=TRUE;
930 addOutput(yyscanner,yytext);
931 }
932<Comment>"</"{PRE}">" {
933 yyextra->insidePre=FALSE;
934 addOutput(yyscanner,yytext);
935 }
936<Comment>{RCSTAG} { // RCS tag which end a brief description
937 setOutput(yyscanner,OutputDoc);
938 REJECT;
939 }
940<Comment>"<!--" {
941 BEGIN(HtmlComment);
942 }
943<Comment>"<!\[CDATA\[" {
944 BEGIN(CdataSection);
945 }
946<Comment>{B}*{CMD}"endinternal"{B}* {
947 addOutput(yyscanner," \\endinternal ");
948 if (!yyextra->inInternalDocs)
949 warn(yyextra->fileName,yyextra->lineNr,
950 "found \\endinternal without matching \\internal"
951 );
952 yyextra->inInternalDocs = FALSE;
953 }
954<Comment>{B}*"\\ilinebr "{B}* { // preserve spacing around \\ilinebr
955 addOutput(yyscanner,yytext);
956 }
957<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ { // at least one blank line (or blank line command)
958 if (yyextra->inContext==OutputBrief)
959 {
960 endBrief(yyscanner);
961 }
962 else
963 {
964 REJECT;
965 }
966 }
static void endBrief(yyscan_t yyscanner)
967<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
968<Comment>{B}*{CMD}[a-z_A-Z]+{B}* { // potentially interesting command
969 // the {B}* in the front was added for bug620924
970 QCString fullMatch = QCString(yytext);
971 int idx = fullMatch.find('{');
972 /* handle `f{` command as special case */
973 if ((idx > 1) && (yytext[idx-1] == 'f') && (yytext[idx-2] == '\\' || yytext[idx-2] =='@')) REJECT;
974 int idxEnd = fullMatch.find("}",idx+1);
975 QCString cmdName;
976 StringVector optList;
977 if (idx == -1) // no options
978 {
979 cmdName = QCString(yytext).stripWhiteSpace().mid(1); // to remove {CMD}
980 }
981 else // options present
982 {
983 cmdName = fullMatch.left(idx).stripWhiteSpace().mid(1); // to remove {CMD}
984 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
985 optList = split(optStr.str(),",");
986 }
987 auto it = docCmdMap.find(cmdName.str());
988 //printf("lookup command '%s' found=%d\n",qPrint(cmdName),it!=docCmdMap.end());
989 if (it!=docCmdMap.end()) // special action is required
990 {
991 int i=0;
992 while (yytext[i]==' ' || yytext[i]=='\t') i++;
993 yyextra->spaceBeforeCmd = QCString(yytext).left(i);
994 CommandSpacing spacing = it->second.spacing;
995 if ((spacing==CommandSpacing::Block || spacing==CommandSpacing::XRef) &&
996 !(yyextra->inContext==OutputXRef && cmdName=="parblock"))
997 {
998 yyextra->briefEndsAtDot=FALSE;
999 bool insideXRef = yyextra->inContext==OutputXRef && spacing==CommandSpacing::XRef;
1000 // this command forces the end of brief description
1001 setOutput(yyscanner,insideXRef ? OutputXRef : OutputDoc);
1002 }
1003 //if (i>0) addOutput(yyscanner,QCString(yytext).left(i)); // removed for bug 689341
1004 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1005 {
1006 // implicit split of the comment block into two
1007 // entries. Restart the next block at the start
1008 // of this command.
1009 yyextra->parseMore=TRUE;
static const std::map< std::string, DocCmdMap > docCmdMap
CommandSpacing
std::vector< std::string > StringVector
Definition containers.h:33
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:7094
1010
1011 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1012 yyterminate();
1013 }
1014 else if (it->second.handler==nullptr)
1015 {
1016 // command without handler, to be processed
1017 // later by parsedoc.cpp
1018 addOutput(yyscanner,yytext);
1019 }
1020 }
1021 else // command not relevant
1022 {
1023 addOutput(yyscanner,yytext);
1024 }
1025 }
#define yyterminate()
1026<Comment>{B}*({CMD}{CMD})"f"[$\[{] { // escaped formula command
1027 addOutput(yyscanner,yytext);
1028 }
1029<Comment>{B}*{CMD}"~"[a-z_A-Z-]* { // language switch command
1030 QCString langId = QCString(yytext).stripWhiteSpace().mid(2);
1031 if (!langId.isEmpty() &&
1032 qstricmp(Config_getEnumAsString(OUTPUT_LANGUAGE),langId)!=0)
1033 { // enable language specific section
1034 if (!Config_isAvailableEnum(OUTPUT_LANGUAGE,langId))
1035 {
1036 warn(yyextra->fileName,yyextra->lineNr,
1037 "non supported language '{}' specified in '{}'",langId,QCString(yytext).stripWhiteSpace());
1038 }
1039 BEGIN(SkipLang);
1040 }
1041 }
#define Config_getEnumAsString(name)
Definition config.h:36
#define Config_isAvailableEnum(name, value)
Definition config.h:45
int qstricmp(const char *s1, const char *s2)
Definition qcstring.cpp:442
1042<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) { // start of a formula with custom environment
1043 setOutput(yyscanner,OutputDoc);
1044 yyextra->formulaText="";
1045 yyextra->formulaPreText="\\begin";
1046 yyextra->formulaPostText="";
1047 yyextra->formulaEnv=QCString(yytext).stripWhiteSpace().mid(2);
1048 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)=='{')
1049 {
1050 // remove trailing open brace
1051 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1052 }
1053 yyextra->formulaPreText+=yyextra->formulaEnv;
1054 yyextra->formulaNewLines=0;
1055 BEGIN(ReadFormulaLong);
1056 }
1057<Comment>{B}*{CMD}"f$" { // start of a inline formula
1058 yyextra->formulaText="";
1059 yyextra->formulaPreText="$";
1060 yyextra->formulaPostText="";
1061 yyextra->formulaNewLines=0;
1062 BEGIN(ReadFormulaShort);
1063 }
1064<Comment>{B}*{CMD}"f(" { // start of a inline formula
1065 yyextra->formulaText="";
1066 yyextra->formulaPreText="";
1067 yyextra->formulaPostText="";
1068 yyextra->formulaNewLines=0;
1069 BEGIN(ReadFormulaRound);
1070 }
1071<Comment>{B}*{CMD}"f[" { // start of a block formula
1072 setOutput(yyscanner,OutputDoc);
1073 yyextra->formulaText="";
1074 yyextra->formulaPreText="\\[";
1075 yyextra->formulaPostText="";
1076 yyextra->formulaNewLines=0;
1077 BEGIN(ReadFormulaLong);
1078 }
1079<Comment>{B}*{CMD}"{" { // begin of a group
1080 //yyextra->langParser->handleGroupStartCommand(yyextra->memberGroupHeader);
1081 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1082 }
1083<Comment>{B}*{CMD}"}" { // end of a group
1084 //yyextra->langParser->handleGroupEndCommand();
1085 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,TRUE);
1086 yyextra->docGroup.clearHeader();
1087 yyextra->parseMore=TRUE;
1088 yyextra->needNewEntry = TRUE;
1089 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1090 yyterminate();
1091 }
1092<Comment>{B}*{CMD}[$@\\&~<>#%] { // escaped character
1093 addOutput(yyscanner,yytext);
1094 }
1095<Comment>[a-z_A-Z]+ { // normal word
1096 addOutput(yyscanner,yytext);
1097 }
1098<Comment>^{B}*"."{Bopt}/\n { // explicit end autolist: e.g " ."
1099 addOutput(yyscanner,yytext);
1100 }
1101<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1102<Comment>^{B}*[*+]{B}+ { // start of autolist
1103 if (!yyextra->markdownSupport)
1104 {
1105 REJECT;
1106 }
1107 else
1108 {
1109 if (yyextra->inContext!=OutputXRef)
1110 {
1111 yyextra->briefEndsAtDot=FALSE;
1112 setOutput(yyscanner,OutputDoc);
1113 }
1114 addOutput(yyscanner,yytext);
1115 }
1116 }
1117<Comment>^{B}*"-"{B}+ { // start of autolist
1118 if (yyextra->inContext!=OutputXRef)
1119 {
1120 yyextra->briefEndsAtDot=FALSE;
1121 setOutput(yyscanner,OutputDoc);
1122 }
1123 addOutput(yyscanner,yytext);
1124 }
1125<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n { // horizontal line (dashed)
1126 addOutput(yyscanner,yytext);
1127 }
1128<Comment>{CMD}"---" { // escaped mdash
1129 addOutput(yyscanner,yytext);
1130 }
1131<Comment>{CMD}"--" { // escaped mdash
1132 addOutput(yyscanner,yytext);
1133 }
1134<Comment>"---" { // mdash
1135 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext : "&mdash;");
1136 }
1137<Comment>"--" { // ndash
1138 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext : "&ndash;");
1139 }
1140<Comment>"-#"{B}+ { // numbered item
1141 if (yyextra->inContext!=OutputXRef)
1142 {
1143 yyextra->briefEndsAtDot=FALSE;
1144 setOutput(yyscanner,OutputDoc);
1145 }
1146 addOutput(yyscanner,yytext);
1147 }
1148<Comment>[?!][a-z_A-Z0-9\‍(\‍)=<] |
1149<Comment>("."+)[a-z_A-Z0-9\‍)] { // . at start or in the middle of a word, or ellipsis
1150 // ? or ! in middle of word or followed by equal sign or round bracket.
1151 addOutput(yyscanner,yytext);
1152 }
1153<Comment>{CMD}[\.?!] { // we have to be a bit careful with the special commands
1154 // \. \? and \! as they might otherwise terminate a brief description
1155 addOutput(yyscanner,yytext);
1156 }
1157<Comment>".\\"[ \t] { // . with escaped space.
1158 addOutput(yyscanner,yytext[0]);
1159 addOutput(yyscanner,yytext[2]);
1160 }
1161<Comment>"."[,:;] { // . with some puntuations such as "e.g.," or "e.g.:"
1162 addOutput(yyscanner,yytext);
1163 }
1164<Comment>"...\\"[ \t] { // ellipsis with escaped space.
1165 addOutput(yyscanner,"... ");
1166 }
1167<Comment>"..."/[^\.] { // ellipsis
1168 addOutput(yyscanner,"...");
1169 }
1170<Comment>".."[\.]?/[^ \t\n] { // internal ellipsis
1171 addOutput(yyscanner,yytext);
1172 }
1173<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ { // at least one blank line (or blank line command)
1174 if (yyextra->inContext==OutputXRef)
1175 {
1176 // see bug 613024, we need to put the newlines after ending the XRef section.
1177 if (!yyextra->insideParBlock) setOutput(yyscanner,OutputDoc);
1178 yy_size_t i;
1179 for (i=0;i<(yy_size_t)yyleng;)
1180 {
1181 if (yytext[i]=='\n') addOutput(yyscanner,'\n'),i++;
1182 else if (strncmp(yytext+i,"\\ilinebr ",9)==0) addOutput(yyscanner,"\\ilinebr "),i+=9;
1183 else i++;
1184 }
1185 }
1186 else if (yyextra->inContext!=OutputBrief)
1187 {
1188 yy_size_t i;
1189 for (i=0;i<(yy_size_t)yyleng;)
1190 {
1191 if (yytext[i]=='\n') addOutput(yyscanner,'\n'),i++;
1192 else if (strncmp(yytext+i,"\\ilinebr ",9)==0) addOutput(yyscanner,"\\ilinebr "),i+=9;
1193 else i++;
1194 }
1195 setOutput(yyscanner,OutputDoc);
1196 }
1197 else // yyextra->inContext==OutputBrief
1198 { // only go to the detailed description if we have
1199 // found some brief description and not just whitespace
1200 endBrief(yyscanner);
1201 }
1202 lineCount(yyscanner);
1203 }
1204<Comment>"."[?!] |
1205<Comment>[\.?!] { // potential end of a JavaDoc style comment
1206 addOutput(yyscanner,yytext);
1207 if (yyextra->briefEndsAtDot)
1208 {
1209 setOutput(yyscanner,OutputDoc);
1210 yyextra->briefEndsAtDot=FALSE;
1211 }
1212 }
1213<Comment>{DOCNL} { // newline
1214 addOutput(yyscanner,yytext);
1215 if (*yytext == '\n') yyextra->lineNr++;
1216 }
1217<Comment>"<"[/]?{TABLEDEL}">" { // In case in xrefitem type some special handling is required
1218 if (yyextra->inContext==OutputXRef)
1219 {
1220 setOutput(yyscanner,OutputDoc);
1221 addOutput(yyscanner,yytext);
1222 }
1223 else
1224 {
1225 REJECT;
1226 }
1227 }
1228<Comment>. { // catch-all for anything else
1229 addOutput(yyscanner,*yytext);
1230 }
1231
1232
1233 /* -------------- Rules for handling HTML comments ----------- */
1234
1235<HtmlComment>"---"[!]?">"{B}* {
1236 warn(yyextra->fileName,yyextra->lineNr,
1237 "incorrect HTML end comment --->"
1238 );
1239 }
1240<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1241<HtmlComment>{DOCNL} {
1242 if (*yytext=='\n')
1243 {
1244 yyextra->lineNr++;
1245 addOutput(yyscanner," \\iline "+QCString().setNum(yyextra->lineNr)+" ");
1246 }
1247 }
1248<HtmlComment>[^\\\n\-]+ { // ignore unimportant characters
1249 }
1250<HtmlComment>. { // ignore every else
1251 }
1252
1253<CdataSection>"\]\]>" {
1254 BEGIN( Comment );
1255 }
1256<CdataSection>{DOCNL} {
1257 addOutput(yyscanner,'\n');
1258 if (*yytext=='\n') yyextra->lineNr++;
1259 }
1260<CdataSection>[<>&] { // the special XML characters for iwhich the CDATA section is especially used
1261 addOutput(yyscanner,'\\');
1262 addOutput(yyscanner,*yytext);
1263 }
1264<CdataSection>[^\\\n\]<>&]+ {
1265 addOutput(yyscanner,yytext);
1266 }
1267<CdataSection>. {
1268 addOutput(yyscanner,*yytext);
1269 }
1270
1271 /* -------------- Rules for handling formulas ---------------- */
1272
1273<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" { // end of inline formula
1274 yyextra->formulaPostText+="$";
1275 QCString form = addFormula(yyscanner);
1276 addOutput(yyscanner," "+form);
1277 if (YY_START == ReadFormulaShort)
1278 {
1279 BEGIN(Comment);
1280 }
1281 else
1282 {
1283 yyextra->sectionTitle+= " "+form;
1284 BEGIN(SectionTitle);
1285 }
1286 }
static QCString addFormula(yyscan_t yyscanner)
1287<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" { // end of inline formula
1288 QCString form = addFormula(yyscanner);
1289 addOutput(yyscanner," "+form);
1290 if (YY_START == ReadFormulaRound)
1291 {
1292 BEGIN(Comment);
1293 }
1294 else
1295 {
1296 yyextra->sectionTitle+= " "+form;
1297 BEGIN(SectionTitle);
1298 }
1299 }
1300<ReadFormulaLong>{CMD}"f]" { // end of block formula
1301 yyextra->formulaPostText+="\\]";
1302 addOutput(yyscanner," "+addFormula(yyscanner));
1303 BEGIN(Comment);
1304 }
1305<ReadFormulaLong>{CMD}"f}" { // end of custom env formula
1306 yyextra->formulaPostText+="\\end";
1307 yyextra->formulaPostText+=yyextra->formulaEnv;
1308 addOutput(yyscanner," "+addFormula(yyscanner));
1309 BEGIN(Comment);
1310 }
1311<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ { // any non-special character
1312 yyextra->formulaText+=yytext;
1313 }
1314<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n { // new line
1315 yyextra->formulaNewLines++;
1316 yyextra->formulaText+=*yytext;
1317 yyextra->lineNr++;
1318 addIline(yyscanner,yyextra->lineNr);
1319 }
1320<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. { // any other character
1321 yyextra->formulaText+=*yytext;
1322 }
1323
1324 /* ------------ handle argument of enum command --------------- */
1325
1326<EnumDocArg1>{SCOPEID} { // handle argument
1327 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1328 yyextra->current->name = yytext;
1329 BEGIN( Comment );
1330 }
1331<EnumDocArg1>{LC} { // line continuation
1332 yyextra->lineNr++;
1333 addOutput(yyscanner,'\n');
1334 }
1335<EnumDocArg1>{DOCNL} { // missing argument
1336 warn(yyextra->fileName,yyextra->lineNr,
1337 "missing argument after '\\enum'."
1338 );
1339 unput_string(yytext,yyleng);
1340 BEGIN( Comment );
1341 }
#define unput_string(yytext, yyleng)
1342<EnumDocArg1>. { // ignore other stuff
1343 }
1344
1345 /* ------------ handle argument of namespace command --------------- */
1346
1347<NameSpaceDocArg1>{SCOPENAME} { // handle argument
1348 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1349 lineCount(yyscanner);
1350 yyextra->current->name = substitute(removeRedundantWhiteSpace(QCString(yytext)),QCString("."),QCString("::"));
1351 BEGIN( Comment );
1352 }
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:578
1353<NameSpaceDocArg1>{LC} { // line continuation
1354 yyextra->lineNr++;
1355 addOutput(yyscanner,'\n');
1356 }
1357<NameSpaceDocArg1>{DOCNL} { // missing argument
1358 warn(yyextra->fileName,yyextra->lineNr,
1359 "missing argument after '\\namespace'."
1360 );
1361 unput_string(yytext,yyleng);
1362 BEGIN( Comment );
1363 }
1364<NameSpaceDocArg1>. { // ignore other stuff
1365 }
1366
1367 /* ------------ handle argument of package command --------------- */
1368
1369<PackageDocArg1>{ID}("."{ID})* { // handle argument
1370 yyextra->current->name = yytext;
1371 BEGIN( Comment );
1372 }
1373<PackageDocArg1>{LC} { // line continuation
1374 yyextra->lineNr++;
1375 addOutput(yyscanner,'\n');
1376 }
1377<PackageDocArg1>{DOCNL} { // missing argument
1378 warn(yyextra->fileName,yyextra->lineNr,
1379 "missing argument after \\package."
1380 );
1381 unput_string(yytext,yyleng);
1382 //addOutput(yyscanner,'\n');
1383 //if (*yytext=='\n') yyextra->lineNr++;
1384 BEGIN( Comment );
1385 }
1386<PackageDocArg1>. { // ignore other stuff
1387 }
1388
1389 /* ------------ handle argument of concept command --------------- */
1390
1391<ConceptDocArg1>{SCOPEID} { // handle argument
1392 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1393 yyextra->current->name = yytext;
1394 BEGIN( Comment );
1395 }
1396<ConceptDocArg1>{LC} { // line continuation
1397 yyextra->lineNr++;
1398 addOutput(yyscanner,'\n');
1399 }
1400<ConceptDocArg1>{DOCNL} { // missing argument
1401 warn(yyextra->fileName,yyextra->lineNr,
1402 "missing argument after '\\concept'."
1403 );
1404 unput_string(yytext,yyleng);
1405 BEGIN( Comment );
1406 }
1407<ConceptDocArg1>. { // ignore other stuff
1408 }
1409
1410 /* ------------ handle argument of module command --------------- */
1411<ModuleDocArg1>{MODULE_ID} { // handle argument
1412 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1413 yyextra->current->name = yytext;
1414 BEGIN( Comment );
1415 }
1416<ModuleDocArg1>{LC} { // line continuation
1417 yyextra->lineNr++;
1418 addOutput(yyscanner,'\n');
1419 }
1420<ModuleDocArg1>{DOCNL} { // missing argument
1421 warn(yyextra->fileName,yyextra->lineNr,
1422 "missing argument after '\\module'."
1423 );
1424 unput_string(yytext,yyleng);
1425 BEGIN( Comment );
1426 }
1427<ModuleDocArg1>. { // ignore other stuff
1428 }
1429
1430 /* ------ handle argument of class/struct/union command --------------- */
1431
1432<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1433 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1434 lineCount(yyscanner);
1435 yyextra->current->name = substitute(removeRedundantWhiteSpace(QCString(yytext)),".","::");
1436 BEGIN( ClassDocArg2 );
1437 }
1438<ClassDocArg1>{SCOPENAME} { // first argument
1439 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1440 lineCount(yyscanner);
1441 yyextra->current->name = substitute(QCString(yytext),".","::");
1442 if (yyextra->current->section.isProtocolDoc())
1443 {
1444 yyextra->current->name+="-p";
1445 }
1446 // prepend outer scope name
1447 BEGIN( ClassDocArg2 );
1448 }
1449<CategoryDocArg1>{SCOPENAME}{B}*"("[^\‍)]+")" {
1450 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
1451 lineCount(yyscanner);
1452 yyextra->current->name = substitute(QCString(yytext),".","::");
1453 BEGIN( ClassDocArg2 );
1454 }
1455<ClassDocArg1,CategoryDocArg1>{LC} { // line continuation
1456 yyextra->lineNr++;
1457 addOutput(yyscanner,'\n');
1458 }
1459<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1460 warn(yyextra->fileName,yyextra->lineNr,
1461 "missing argument after '\\{}'.",yyextra->currentCmd
1462 );
1463 unput_string(yytext,yyleng);
1464 BEGIN( Comment );
1465 }
1466<ClassDocArg1,CategoryDocArg1>. { // ignore other stuff
1467 }
1468
1469<ClassDocArg2>{DOCNL} {
1470 unput_string(yytext,yyleng);
1471 BEGIN( Comment );
1472 }
1473<ClassDocArg2>{FILE}|"<>" { // second argument; include file
1474 yyextra->current->includeFile = yytext;
1475 BEGIN( ClassDocArg3 );
1476 }
1477<ClassDocArg2>{LC} { // line continuation
1478 yyextra->lineNr++;
1479 addOutput(yyscanner,'\n');
1480 }
1481<ClassDocArg2>. { // ignore other stuff
1482 }
1483
1484<ClassDocArg3>[<"]?{FILE}?[">]? { // third argument; include file name
1485 yyextra->current->includeName = yytext;
1486 BEGIN( Comment );
1487 }
1488<ClassDocArg3>{LC} { // line continuation
1489 yyextra->lineNr++;
1490 addOutput(yyscanner,'\n');
1491 }
1492<ClassDocArg3>{DOCNL} {
1493 //if (*yytext=='\n') yyextra->lineNr++;
1494 unput_string(yytext,yyleng);
1495 BEGIN( Comment );
1496 }
1497<ClassDocArg3>. { // ignore other stuff
1498 }
1499
1500 /* --------- handle arguments of {def,add,weak}group commands --------- */
1501
1502<GroupDocArg1>{LABELID}(".html"|".xhtml")? { // group name
1503 yyextra->current->name = yytext;
1504 //lastDefGroup.groupname = yytext;
1505 //lastDefGroup.pri = yyextra->current->groupingPri();
1506 // the .html stuff is for Qt compatibility
1507 if (yyextra->current->name.endsWith(".html"))
1508 {
1509 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1510 }
1511 else if (yyextra->current->name.endsWith(".xhtml"))
1512 {
1513 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1514 }
1515 yyextra->current->type.clear();
1516 BEGIN(GroupDocArg2);
1517 }
1518<GroupDocArg1>"\\"{B}*"\n" { // line continuation
1519 yyextra->lineNr++;
1520 addOutput(yyscanner,'\n');
1521 }
1522<GroupDocArg1>{DOCNL} { // missing argument!
1523 warn(yyextra->fileName,yyextra->lineNr,
1524 "missing group name after {}",
1525 yyextra->current->groupDocCmd()
1526 );
1527 //addOutput(yyscanner,'\n');
1528 //if (*yytext=='\n') yyextra->lineNr++;
1529 unput_string(yytext,yyleng);
1530 BEGIN( Comment );
1531 }
1532<GroupDocArg1>. { // ignore other stuff
1533 }
1534<GroupDocArg2>"\\"{B}*"\n" { // line continuation
1535 yyextra->lineNr++;
1536 addOutput(yyscanner,'\n');
1537 }
1538<GroupDocArg2>[^\n\\]+ { // title (stored in type)
1539 yyextra->current->type += yytext;
1540 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1541 }
1542<GroupDocArg2>{DOCNL}+ {
1543 if ( yyextra->current->groupDocType==Entry::GROUPDOC_NORMAL &&
1544 yyextra->current->type.isEmpty()
1545 ) // defgroup requires second argument
1546 {
1547 warn(yyextra->fileName,yyextra->lineNr,
1548 "missing title after "
1549 "\\defgroup {}", yyextra->current->name
1550 );
1551 }
1552 unput_string(yytext,yyleng);
1553 int extraLineNr = 0;
1554 if (yyextra->inContext == OutputBrief)
1555 {
1556 for (int i = 0; i < yyleng; i++)
1557 {
1558 if (yytext[i]=='\n') extraLineNr++;
1559 }
1560 }
1561 //if (*yytext=='\n') yyextra->lineNr++;
1562 //addOutput(yyscanner,'\n');
1563 if ( yyextra->current->groupDocType!=Entry::GROUPDOC_NORMAL)
1564 {
1565 addOutput(yyscanner," \\ifile \""+ yyextra->fileName);
1566 addOutput(yyscanner,"\" \\iline " + QCString().setNum(yyextra->lineNr + extraLineNr) + " \\ilinebr ");
1567 }
1568 BEGIN( Comment );
1569 }
1570<GroupDocArg2>. { // title (stored in type)
1571 yyextra->current->type += yytext;
1572 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1573 }
1574
1575 /* --------- handle arguments of page/mainpage command ------------------- */
1576
1577<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} { // special case where the Markdown processor has rewritten
1578 // "@page label Title" as
1579 // "@page md_label Title\ilinebr @ianchor{Title} label"
1580 QCString text = yytext;
1581 int start = text.find('{');
1582 int end = text.find('}',start+1);
1583 yyextra->current->name = text.mid(end+2);
1584 int istart = yyextra->current->name.find("\\ilinebr");
1585 if (istart != -1)
1586 {
1587 QCString rest = yyextra->current->name.mid(istart);
1588 unput_string(rest,rest.length());
1589 yyextra->current->name = yyextra->current->name.mid(0,istart);
1590 }
1591 yyextra->current->args = text.mid(start+1,end-start-1);
1592 //printf("name='%s' title='%s'\n",qPrint(yyextra->current->name),qPrint(yyextra->current->args));
1593 BEGIN( PageDocArg2 );
1594 }
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
1595<PageDocArg1>{FILE} { // first argument; page name
1596 yyextra->current->name = stripQuotes(yytext);
1597 yyextra->current->args = "";
1598 BEGIN( PageDocArg2 );
1599 }
static QCString stripQuotes(const char *s)
1600<PageDocArg1>{LC} { yyextra->lineNr++;
1601 addOutput(yyscanner,'\n');
1602 }
1603<PageDocArg1>{DOCNL} {
1604 warn(yyextra->fileName,yyextra->lineNr,
1605 "missing argument after \\page."
1606 );
1607 unput_string(yytext,yyleng);
1608 //if (*yytext=='\n') yyextra->lineNr++;
1609 //addOutput(yyscanner,'\n');
1610 BEGIN( Comment );
1611 }
1612<PageDocArg1>. { // ignore other stuff
1613 }
1614<PageDocArg2>{DOCNL} { // second argument; page title
1615 unput_string(yytext,yyleng);
1616 //if (*yytext=='\n') yyextra->lineNr++;
1617 //addOutput(yyscanner,'\n');
1618 addOutput(yyscanner," \\ifile \""+ yyextra->fileName);
1619 addOutput(yyscanner,"\" \\iline " + QCString().setNum(yyextra->lineNr) + " \\ilinebr ");
1620 BEGIN( Comment );
1621 }
1622<PageDocArg2>{CMD}[<>] {
1623 // bug 748927
1624 QCString tmp(yytext);
1625 tmp = substitute(substitute(tmp,"@<","&lt;"),"@>","&gt;");
1626 tmp = substitute(substitute(tmp,"\\<","&lt;"),"\\>","&gt;");
1627 yyextra->current->args += tmp;
1628 }
1629<PageDocArg2>. {
1630 yyextra->current->args += yytext;
1631 }
1632 /* --------- handle arguments of the param command ------------ */
1633<ParamArg1>{ID}/{B}*"," {
1634 addOutput(yyscanner,yytext);
1635 }
1636<ParamArg1>"," {
1637 addOutput(yyscanner," , ");
1638 }
1639<ParamArg1>{DOCNL} {
1640 if (*yytext=='\n') yyextra->lineNr++;
1641 addOutput(yyscanner," ");
1642 }
1643<ParamArg1>{ID} {
1644 addOutput(yyscanner,yytext);
1645 BEGIN( Comment );
1646 }
1647<ParamArg1>. {
1648 unput(yytext[0]);
1649 BEGIN( Comment );
1650 }
1651
1652 /* --------- handle arguments of the file/dir/example command ------------ */
1653
1654<FileDocArg1>{DOCNL} { // no file name specified
1655 unput_string(yytext,yyleng);
1656 //if (*yytext=='\n') yyextra->lineNr++;
1657 //addOutput(yyscanner,'\n');
1658 BEGIN( Comment );
1659 }
1660<FileDocArg1>{FILE} { // first argument; name
1661 yyextra->current->name = stripQuotes(yytext);
1662 BEGIN( Comment );
1663 }
1664<FileDocArg1>{LC} { yyextra->lineNr++;
1665 addOutput(yyscanner,'\n');
1666 }
1667<FileDocArg1>. { // ignore other stuff
1668 }
1669
1670 /* --------- handle arguments of the xrefitem command ------------ */
1671
1672<XRefItemParam1>{LABELID} { // first argument
1673 yyextra->newXRefItemKey=yytext;
1674 setOutput(yyscanner,OutputXRef);
1675 BEGIN(XRefItemParam2);
1676 }
1677<XRefItemParam1>{LC} { // line continuation
1678 yyextra->lineNr++;
1679 addOutput(yyscanner,'\n');
1680 }
1681<XRefItemParam1>{DOCNL} { // missing arguments
1682 warn(yyextra->fileName,yyextra->lineNr,
1683 "Missing first argument of \\xrefitem"
1684 );
1685 if (*yytext=='\n') yyextra->lineNr++;
1686 addOutput(yyscanner,'\n');
1687 yyextra->inContext = OutputDoc;
1688 BEGIN( Comment );
1689 }
1690<XRefItemParam1>. { // ignore other stuff
1691 }
1692
1693<XRefItemParam2>"\""[^\n\"]*"\"" { // second argument
1694 yyextra->xrefItemTitle = stripQuotes(yytext);
1695 BEGIN(XRefItemParam3);
1696 }
1697<XRefItemParam2>{LC} { // line continuation
1698 yyextra->lineNr++;
1699 addOutput(yyscanner,'\n');
1700 }
1701<XRefItemParam2>{DOCNL} { // missing argument
1702 warn(yyextra->fileName,yyextra->lineNr,
1703 "Missing second argument of \\xrefitem"
1704 );
1705 if (*yytext=='\n') yyextra->lineNr++;
1706 addOutput(yyscanner,'\n');
1707 yyextra->inContext = OutputDoc;
1708 BEGIN( Comment );
1709 }
1710<XRefItemParam2>. { // ignore other stuff
1711 }
1712
1713<XRefItemParam3>"\""[^\n\"]*"\"" { // third argument
1714 yyextra->xrefListTitle = stripQuotes(yytext);
1715 yyextra->xrefKind = XRef_Item;
1716 BEGIN( Comment );
1717 }
1718<XRefItemParam2,XRefItemParam3>{LC} { // line continuation
1719 yyextra->lineNr++;
1720 addOutput(yyscanner,'\n');
1721 }
1722<XRefItemParam3>{DOCNL} { // missing argument
1723 warn(yyextra->fileName,yyextra->lineNr,
1724 "Missing third argument of \\xrefitem"
1725 );
1726 if (*yytext=='\n') yyextra->lineNr++;
1727 addOutput(yyscanner,'\n');
1728 yyextra->inContext = OutputDoc;
1729 BEGIN( Comment );
1730 }
1731<XRefItemParam3>. { // ignore other stuff
1732 }
1733
1734
1735 /* ----- handle arguments of the relates(also)/memberof command ------- */
1736
1737<RelatesParam1>({ID}("::"|"."))*{ID} { // argument
1738 yyextra->current->relates = yytext;
1739 //if (yyextra->current->mGrpId!=DOX_NOGROUP)
1740 //{
1741 // memberGroupRelates = yytext;
1742 //}
1743 BEGIN( Comment );
1744 }
1745<RelatesParam1>{LC} { // line continuation
1746 yyextra->lineNr++;
1747 addOutput(yyscanner,'\n');
1748 }
1749<RelatesParam1>{DOCNL} { // missing argument
1750 warn(yyextra->fileName,yyextra->lineNr,
1751 "Missing argument of '\\{}' command",yyextra->currentCmd
1752 );
1753 unput_string(yytext,yyleng);
1754 //if (*yytext=='\n') yyextra->lineNr++;
1755 //addOutput(yyscanner,'\n');
1756 BEGIN( Comment );
1757 }
1758<RelatesParam1>. { // ignore other stuff
1759 }
1760
1761
1762 /* ----- handle arguments of the qualifier command ----- */
1763<Qualifier>{LABELID} { // unquoted version, simple label
1764 yyextra->current->qualifiers.emplace_back(yytext);
1765 BEGIN( Comment );
1766 }
1767<Qualifier>"\""[^\"]*"\"" { // quotes version, add without quotes
1768 std::string inp(yytext);
1769 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1770 BEGIN( Comment );
1771 }
1772<Qualifier>{DOCNL} { // missing argument
1773 warn(yyextra->fileName,yyextra->lineNr,
1774 "Missing argument of '\\{}' command",yyextra->currentCmd
1775 );
1776 unput_string(yytext,yyleng);
1777 BEGIN( Comment );
1778 }
1779<Qualifier>. {
1780 warn(yyextra->fileName,yyextra->lineNr,
1781 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1782 );
1783 unput_string(yytext,yyleng);
1784 BEGIN( Comment );
1785 }
1786 /* ----- handle arguments of the iline command ----- */
1787<ILine>{LINENR}/[\\@\n\.] |
1788<ILine>{LINENR}{B} {
1789 bool ok = false;
1790 int nr = QCString(yytext).toInt(&ok);
1791 if (!ok)
1792 {
1793 warn(yyextra->fileName,yyextra->lineNr,"Invalid line number '{}' for iline command",yytext);
1794 }
1795 else
1796 {
1797 yyextra->lineNr = nr;
1798 }
1799 addOutput(yyscanner,yytext);
1800 if (YY_START == ILine)
1801 {
1802 BEGIN(Comment);
1803 }
1804 else
1805 {
1806 yyextra->sectionTitle+=yytext;
1807 BEGIN(SectionTitle);
1808 }
1809 }
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:249
1810<ILine,ILineSection>. {
1811 addOutput(yyscanner,yytext);
1812 if (YY_START == ILine)
1813 {
1814 BEGIN(Comment);
1815 }
1816 else
1817 {
1818 yyextra->sectionTitle+=yytext;
1819 BEGIN(SectionTitle);
1820 }
1821 }
1822
1823 /* ----- handle arguments of the iraise command ----- */
1824<IRaise>{B}*[0-9]+/[\\@\n\.] |
1825<IRaise>{B}*[0-9]+{B} {
1826 bool ok = false;
1827 int nr = QCString(yytext).toInt(&ok);
1828 if (!ok)
1829 {
1830 warn(yyextra->fileName,yyextra->lineNr,"Invalid level '{}' for iraise command",yytext);
1831 }
1832 else
1833 {
1834 yyextra->raiseLevel = nr;
1835 }
1836 BEGIN(Comment);
1837 }
1838<IRaise>. {
1839 unput(yytext[0]);
1840 BEGIN(Comment);
1841 }
1842 /* ----- handle arguments of the iprefix command ----- */
1843
1844<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1845 QCString text(yytext);
1846 yyextra->raisePrefix = text.stripWhiteSpace().mid(1,text.length()-2);
1847 addOutput(yyscanner,yytext);
1848 BEGIN(Comment);
1849 }
1850<IRaisePrefix>. {
1851 unput(yytext[0]);
1852 BEGIN(Comment);
1853 }
1854
1855
1856 /* ----- handle arguments of the ifile command ----- */
1857
1858<IFile,IFileSection>{FILE} {
1859 addOutput(yyscanner,yytext);
1860 QCString text(yytext);
1861 if (yytext[0] == '\"') yyextra->fileName = text.mid(1,text.length()-2);
1862 else yyextra->fileName = yytext;
1863 if (YY_START == IFile)
1864 {
1865 BEGIN(Comment);
1866 }
1867 else
1868 {
1869 yyextra->sectionTitle+=yytext;
1870 BEGIN(SectionTitle);
1871 }
1872 }
1873
1874<LinkSection>[^\\@\n]* {
1875 yyextra->sectionTitle+=yytext;
1876 }
1877<LinkSection>{CMD}{CMD} {
1878 yyextra->sectionTitle+=yytext;
1879 }
1880<LinkSection>{DOCNL} {
1881 addOutput(yyscanner,yytext);
1882 if (*yytext == '\n') yyextra->lineNr++;
1883 yyextra->sectionTitle+=yytext;
1884 }
1885<LinkSection>{CMD}"endlink" {
1886 yyextra->sectionTitle+=yytext;
1887 BEGIN(SectionTitle);
1888 }
1889<LinkSection>. {
1890 yyextra->sectionTitle+=yytext;
1891 }
1892<LinkSection><<EOF>> {
1893 warn(yyextra->fileName,yyextra->lineNr,
1894 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1895 );
1896 yyterminate();
1897 }
1898 /* ----- handle arguments of the relates(also)/addindex commands ----- */
1899
1900<LineParam>{CMD}{CMD} { // escaped command
1901 addOutput(yyscanner,yytext);
1902 }
1903<LineParam>{DOCNL} { // end of argument
1904 //if (*yytext=='\n') yyextra->lineNr++;
1905 //addOutput(yyscanner,'\n');
1906 unput_string(yytext,yyleng);
1907 BEGIN( Comment );
1908 }
1909<LineParam>{LC} { // line continuation
1910 yyextra->lineNr++;
1911 addOutput(yyscanner,'\n');
1912 }
1913<LineParam>({CMD}{CMD}){ID} { // escaped command
1914 addOutput(yyscanner,yytext);
1915 }
1916<LineParam>. { // ignore other stuff
1917 addOutput(yyscanner,*yytext);
1918 }
1919
1920 /* ----- handle arguments of the section/subsection/.. commands ------- */
1921
1922<SectionLabel>{LABELID} { // first argument
1923 yyextra->sectionLabel=yyextra->raisePrefix+yytext;
1924 addOutput(yyscanner,yyextra->sectionLabel.data());
1925 yyextra->sectionTitle.clear();
1926 BEGIN(SectionTitle);
1927 }
1928<SectionLabel>{DOCNL} { // missing argument
1929 warn(yyextra->fileName,yyextra->lineNr,
1930 "\\section command has no label"
1931 );
1932 if (*yytext=='\n') yyextra->lineNr++;
1933 addOutput(yyscanner,'\n');
1934 BEGIN( Comment );
1935 }
1936<SectionLabel>. { // invalid character for section label
1937 warn(yyextra->fileName,yyextra->lineNr,
1938 "Invalid or missing section label"
1939 );
1940 BEGIN(Comment);
1941 }
1942<SectionTitle>{STAopt}/"\n" { // end of section title
1943 addSection(yyscanner);
1944 addOutput(yyscanner,yytext);
1945 BEGIN( Comment );
1946 }
static void addSection(yyscan_t yyscanner, bool addYYtext=true)
1947<SectionTitle>{STopt}"\\\\ilinebr" { // escaped end of section title
1948 yyextra->sectionTitle+=yytext;
1949 }
1950<SectionTitle>{STopt}/"\\ilinebr" { // end of section title
1951 addSection(yyscanner);
1952 addOutput(yyscanner,yytext);
1953 BEGIN( Comment );
1954 }
1955<SectionTitle>{B}*{CMD}"f$" {
1956 yyextra->formulaText="";
1957 yyextra->formulaPreText="$";
1958 yyextra->formulaPostText="";
1959 yyextra->formulaNewLines=0;
1960 BEGIN(ReadFormulaShortSection);
1961 }
1962<SectionTitle>{B}*{CMD}"f(" { // start of a inline formula
1963 yyextra->formulaText="";
1964 yyextra->formulaPreText="";
1965 yyextra->formulaPostText="";
1966 yyextra->formulaNewLines=0;
1967 BEGIN(ReadFormulaRoundSection);
1968 }
1969<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* | // language switch command
1970<SectionTitle>{B}*{CMD}"f"[\[{] { // block formula
1971 setOutput(yyscanner,OutputDoc);
1972 addOutput(yyscanner," \\ilinebr ");
1973 addSection(yyscanner,false);
1974 warn(yyextra->fileName,yyextra->lineNr,
1975 "'\\{}' command is not allowed in section title, ending section title.",
1976 QCString(yytext).stripWhiteSpace()
1977 );
1978 unput_string(yytext,yyleng);
1979 BEGIN(Comment);
1980 }
1981<SectionTitle>{LC} { // line continuation
1982 yyextra->lineNr++;
1983 addOutput(yyscanner,'\n');
1984 }
1985<SectionTitle>[^\n@\\]* { // any character without special meaning
1986 yyextra->sectionTitle+=yytext;
1987 addOutput(yyscanner,yytext);
1988 }
1989<SectionTitle>{B}*{CMD}{CMD} {
1990 yyextra->sectionTitle+=yytext;
1991 addOutput(yyscanner,yytext);
1992 }
1993<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
1994<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* { // handling command in section title
1995 QCString fullMatch = QCString(yytext);
1996 int idx = fullMatch.find('{');
1997 /* handle `f{` command as special case */
1998 if ((idx > 1) && (yytext[idx-1] == 'f') && (yytext[idx-2] == '\\' || yytext[idx-2] =='@')) REJECT;
1999 int idxEnd = fullMatch.find("}",idx+1);
2000 QCString cmdName;
2001 StringVector optList;
2002 if (idx == -1) // no options
2003 {
2004 cmdName = QCString(yytext).stripWhiteSpace().mid(1); // to remove {CMD}
2005 }
2006 else // options present
2007 {
2008 cmdName = fullMatch.left(idx).stripWhiteSpace().mid(1); // to remove {CMD}
2009 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
2010 optList = split(optStr.str(),",");
2011 }
2012 auto it = docCmdMap.find(cmdName.str());
2013 if (it!=docCmdMap.end()) // special action is required
2014 {
2015 switch (it->second.sectionHandling)
2016 {
2018 {
2019 int i=0;
2020 while (yytext[i]==' ' || yytext[i]=='\t') i++;
2021 yyextra->sectionTitle+=fullMatch.left(i);
2022 yyextra->sectionTitle+='@';
2023 yyextra->sectionTitle+=fullMatch.mid(i);
2024 addOutput(yyscanner,qPrint(fullMatch.left(i)));
2025 addOutput(yyscanner,'@');
2026 addOutput(yyscanner,qPrint(fullMatch.mid(i)));
2027 warn(yyextra->fileName,yyextra->lineNr,
2028 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2029 );
2030 }
2031 break;
2033 {
2034 addSection(yyscanner,false);
2035 addOutput(yyscanner," \\ilinebr ");
2036 warn(yyextra->fileName,yyextra->lineNr,
2037 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2038 );
2039 unput_string(yytext,yyleng);
2040 BEGIN(Comment);
2041 }
2042 break;
2044 {
2045 if (cmdName == "fileinfo")
2046 {
2047 int i=0;
2048 while (yytext[i]==' ' || yytext[i]=='\t') i++;
2049 yyextra->sectionTitle+=fullMatch.left(i);
2050 addOutput(yyscanner,fullMatch.left(i));
2051 handleFileInfoSection(yyscanner,cmdName,optList);
2052 if (idxEnd == -1)
2053 {
2054 yyextra->sectionTitle+=fullMatch.mid(i+9);
2055 addOutput(yyscanner,fullMatch.mid(i+9));
2056 }
2057 else
2058 {
2059 yyextra->sectionTitle+=fullMatch.mid(idxEnd+1);
2060 addOutput(yyscanner,fullMatch.mid(idxEnd+1));
2061 }
2062 }
2063 else if (cmdName == "lineinfo")
2064 {
2065 int i=0;
2066 while (yytext[i]==' ' || yytext[i]=='\t') i++;
2067 yyextra->sectionTitle+=fullMatch.left(i);
2068 yyextra->sectionTitle+=QCString().setNum(yyextra->lineNr);
2069 yyextra->sectionTitle+=' ';
2070 yyextra->sectionTitle+=fullMatch.mid(i+9);
2071 addOutput(yyscanner,fullMatch.left(i));
2072 addOutput(yyscanner,QCString().setNum(yyextra->lineNr));
2073 addOutput(yyscanner,' ');
2074 addOutput(yyscanner,fullMatch.mid(i+9));
2075 }
2076 else if (cmdName == "raisewarning")
2077 {
2078 yyextra->raiseWarning = "";
2079 BEGIN(RaiseWarningSection);
2080 }
2081 else if (cmdName == "noop")
2082 {
2083 addSection(yyscanner,false);
2084 BEGIN(Noop);
2085 }
2086 else if (cmdName == "cite")
2087 {
2088 yyextra->sectionTitle+=yytext;
2089 addOutput(yyscanner,yytext);
2090 BEGIN(CiteLabelSection);
2091 }
2092 else if (cmdName == "iline")
2093 {
2094 yyextra->sectionTitle+=yytext;
2095 addOutput(yyscanner,yytext);
2096 BEGIN(ILineSection);
2097 }
2098 else if (cmdName == "ifile")
2099 {
2100 yyextra->sectionTitle+=yytext;
2101 addOutput(yyscanner,yytext);
2102 BEGIN(IFileSection);
2103 }
2104 else if ((cmdName == "anchor") || (cmdName == "ianchor"))
2105 {
2106 addOutput(yyscanner,"@"+cmdName);
2107 if (optList.empty())
2108 {
2109 yyextra -> anchorTitle = "";
2110 }
2111 else
2112 {
2113 addOutput(yyscanner,"{"+join(optList," ")+"}");
2114 yyextra -> anchorTitle = join(optList," ");
2115 }
2116 addOutput(yyscanner," ");
2117 BEGIN(AnchorLabelSection);
2118 }
2119 else if (cmdName == "link")
2120 {
2121 yyextra->sectionTitle+=yytext;
2122 BEGIN(LinkSection);
2123 }
2124 else
2125 {
2126 yyextra->sectionTitle+=yytext;
2127 warn(yyextra->fileName,yyextra->lineNr,
2128 "internal error '\\{}' command is to be replaced in section title.",cmdName
2129 );
2130 }
2131 }
2132 break;
2134 {
2135 yyextra->sectionTitle+=yytext;
2136 addOutput(yyscanner,yytext);
2137 }
2138 break;
2139 }
2140 }
2141 else
2142 {
2143 yyextra->sectionTitle+=yytext;
2144 addOutput(yyscanner,yytext);
2145 }
2146 }
static bool handleFileInfoSection(yyscan_t yyscanner, const QCString &cmdName, const StringVector &optList)
2147<SectionTitle>. { // anything else
2148 yyextra->sectionTitle+=yytext;
2149 addOutput(yyscanner,*yytext);
2150 }
2151
2152 /* ----- handle arguments of the subpage command ------- */
2153
2154<SubpageLabel>{FILE} { // first argument
2155 addOutput(yyscanner,yytext);
2156 // we add subpage labels as a kind of "inheritance" relation to prevent
2157 // needing to add another list to the Entry class.
2158 yyextra->current->extends.emplace_back(QCString(yytext),Protection::Public,Specifier::Normal);
2159 BEGIN(SubpageTitle);
2160 }
2161<SubpageLabel>{DOCNL} { // missing argument
2162 warn(yyextra->fileName,yyextra->lineNr,
2163 "\\subpage command has no label"
2164 );
2165 if (*yytext=='\n') yyextra->lineNr++;
2166 addOutput(yyscanner,'\n');
2167 BEGIN( Comment );
2168 }
2169<SubpageLabel>. {
2170 unput(yytext[0]);
2171 BEGIN( Comment );
2172 }
2173<SubpageTitle>{DOCNL} { // no title, end command
2174 addOutput(yyscanner,yytext);
2175 BEGIN( Comment );
2176 }
2177<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" { // add title, end of command
2178 addOutput(yyscanner,yytext);
2179 BEGIN( Comment );
2180 }
2181<SubpageTitle>. { // no title, end of command
2182 unput(*yytext);
2183 BEGIN( Comment );
2184 }
2185
2186 /* ----- handle arguments of the anchor command ------- */
2187
2188<AnchorLabel,AnchorLabelSection>{LABELID} { // found argument
2189 QCString lbl = yyextra->raisePrefix+yytext;
2190 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2191 addOutput(yyscanner,lbl.data());
2192 if (YY_START == AnchorLabel)
2193 {
2194 BEGIN(Comment);
2195 }
2196 else
2197 {
2198 BEGIN(SectionTitle);
2199 }
2200 }
2201<AnchorLabel,AnchorLabelSection>{DOCNL} { // missing argument
2202 warn(yyextra->fileName,yyextra->lineNr,
2203 "\\anchor command has no label"
2204 );
2205 if (*yytext=='\n') yyextra->lineNr++;
2206 addOutput(yyscanner,'\n');
2207 if (YY_START == AnchorLabel)
2208 {
2209 BEGIN(Comment);
2210 }
2211 else
2212 {
2213 BEGIN(SectionTitle);
2214 }
2215 }
2216<AnchorLabel,AnchorLabelSection>. { // invalid character for anchor label
2217 warn(yyextra->fileName,yyextra->lineNr,
2218 "Invalid or missing anchor label"
2219 );
2220 addOutput(yyscanner,yytext);
2221 if (YY_START == AnchorLabel)
2222 {
2223 BEGIN(Comment);
2224 }
2225 else
2226 {
2227 BEGIN(SectionTitle);
2228 }
2229 }
2230
2231
2232 /* ----- handle arguments of the preformatted block commands ------- */
2233
2234<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} { // possible ends
2235 addOutput(yyscanner,yytext);
2236 if (&yytext[4]==yyextra->blockName) // found end of the block
2237 {
2238 BEGIN(Comment);
2239 }
2240 }
2241<FormatBlock>{CMD}"enduml" {
2242 addOutput(yyscanner,yytext);
2243 if (yyextra->blockName=="startuml") // found end of the block
2244 {
2245 BEGIN(Comment);
2246 }
2247 }
2248<FormatBlock>[^ \@\*\/\\\n]* { // some word
2249 addOutput(yyscanner,yytext);
2250 }
2251<FormatBlock>{DOCNL} { // new line
2252 if (*yytext=='\n') yyextra->lineNr++;
2253 addOutput(yyscanner,'\n');
2254 }
2255<FormatBlock>{CCS} { // start of a C-comment
2256 if (!(yyextra->blockName=="code" || yyextra->blockName=="verbatim" ||
2257 yyextra->blockName=="icode" || yyextra->blockName=="iverbatim"||
2258 yyextra->blockName=="iliteral"
2259 )
2260 ) yyextra->commentCount++;
2261 addOutput(yyscanner,yytext);
2262 }
2263<FormatBlock>{CCE} { // end of a C-comment
2264 addOutput(yyscanner,yytext);
2265 if (!(yyextra->blockName=="code" || yyextra->blockName=="verbatim" ||
2266 yyextra->blockName=="icode" || yyextra->blockName=="iverbatim"||
2267 yyextra->blockName=="iliteral"
2268 )
2269 )
2270 {
2271 yyextra->commentCount--;
2272 if (yyextra->commentCount<0)
2273 {
2274 QCString endTag = "end"+yyextra->blockName;
2275 if (yyextra->blockName=="startuml") endTag="enduml";
2276 warn(yyextra->fileName,yyextra->lineNr,
2277 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2278 yyextra->blockName,endTag);
2279 }
2280 }
2281 }
2282<FormatBlock>. {
2283 addOutput(yyscanner,*yytext);
2284 }
2285<FormatBlock><<EOF>> {
2286 QCString endTag = "end"+yyextra->blockName;
2287 if (yyextra->blockName=="startuml") endTag="enduml";
2288 warn(yyextra->fileName,yyextra->lineNr,
2289 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2290 yyextra->blockName,endTag
2291 );
2292 yyterminate();
2293 }
2294
2295 /* ----- handle arguments of if/ifnot commands ------- */
2296
2297<GuardParam>{B}*"(" {
2298 yyextra->guardExpr=yytext;
2299 yyextra->roundCount=1;
2300 BEGIN(GuardExpr);
2301 }
2302<GuardExpr>[^()]* {
2303 yyextra->guardExpr+=yytext;
2304 lineCount(yyscanner);
2305 }
2306<GuardExpr>"(" {
2307 yyextra->guardExpr+=yytext;
2308 yyextra->roundCount++;
2309 }
2310<GuardExpr>")" {
2311 yyextra->guardExpr+=yytext;
2312 yyextra->roundCount--;
2313 if (yyextra->roundCount==0)
2314 {
2315 handleGuard(yyscanner,yyextra->guardExpr);
2316 }
2317 }
static void handleGuard(yyscan_t yyscanner, const QCString &expr)
2318<GuardExpr>\n {
2319 warn(yyextra->fileName,yyextra->lineNr,
2320 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2321 unput(*yytext);
2322 BEGIN(GuardParam);
2323 }
2324<GuardParam>{B}*[a-z_A-Z0-9.\-]+ { // parameter of if/ifnot yyextra->guards
2325 handleGuard(yyscanner,QCString(yytext));
2326 }
2327<GuardParam>{DOCNL} { // end of argument
2328 //next line is commented out due to bug620924
2329 //addOutput(yyscanner,'\n');
2330 addIlineBreak(yyscanner,yyextra->lineNr);
2331 unput_string(yytext,yyleng);
2332 handleGuard(yyscanner,QCString());
2333 }
static void addIlineBreak(yyscan_t yyscanner, int lineNr)
2334<GuardParam>{LC} { // line continuation
2335 yyextra->lineNr++;
2336 addOutput(yyscanner,'\n');
2337 }
2338<GuardParam>. { // empty condition
2339 unput(*yytext);
2340 handleGuard(yyscanner,QCString());
2341 }
2342<GuardParamEnd>{B}*{DOCNL} {
2343 lineCount(yyscanner);
2344 yyextra->spaceBeforeIf.clear();
2345 addIlineBreak(yyscanner,yyextra->lineNr);
2346 BEGIN(Comment);
2347 }
2348<GuardParamEnd>{B}* {
2349 if (!yyextra->spaceBeforeIf.isEmpty()) // needed for 665313 in combination with bug620924
2350 {
2351 addOutput(yyscanner,yyextra->spaceBeforeIf);
2352 }
2353 yyextra->spaceBeforeIf.clear();
2354 addIlineBreak(yyscanner,yyextra->lineNr);
2355 BEGIN(Comment);
2356 }
2357<GuardParamEnd>. {
2358 unput(*yytext);
2359 addIlineBreak(yyscanner,yyextra->lineNr);
2360 BEGIN(Comment);
2361 }
2362
2363 /* ----- handle skipping of conditional sections ------- */
2364
2365<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2366 yyextra->guardType = Guard_IfNot;
2367 yyextra->guards->emplace(false);
2368 BEGIN( GuardParam );
2369 }
2370<SkipGuardedSection>{CMD}"if"/{NW} {
2371 yyextra->guardType = Guard_If;
2372 yyextra->guards->emplace(false);
2373 BEGIN( GuardParam );
2374 }
2375<SkipGuardedSection>{CMD}"endif"/{NW} {
2376 if (yyextra->guards->empty())
2377 {
2378 warn(yyextra->fileName,yyextra->lineNr,
2379 "found \\endif without matching start command");
2380 BEGIN( Comment );
2381 }
2382 else
2383 {
2384 yyextra->guards->pop();
2385 if (yyextra->guards->empty())
2386 {
2387 BEGIN( GuardParamEnd );
2388 }
2389 else
2390 {
2391 if (yyextra->guards->top().isEnabled())
2392 {
2393 BEGIN( GuardParamEnd );
2394 }
2395 else
2396 {
2397 BEGIN( SkipGuardedSection );
2398 }
2399 }
2400 }
2401 }
2402<SkipGuardedSection>{CMD}"else"/{NW} {
2403 if (yyextra->guards->empty())
2404 {
2405 warn(yyextra->fileName,yyextra->lineNr,
2406 "found \\else without matching start command");
2407 }
2408 else if (yyextra->guards->top().hasElse())
2409 {
2410 warn(yyextra->fileName,yyextra->lineNr,
2411 "found multiple \\else commands in same \\if construct");
2412 yyextra->guards->top().setEnabled(false);
2413 BEGIN( SkipGuardedSection );
2414 }
2415 else if (!yyextra->guards->top().parentVisible())
2416 {
2417 yyextra->guards->top().setEnabled(false);
2418 BEGIN( SkipGuardedSection );
2419 }
2420 else
2421 {
2422 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2423 yyextra->guards->top().setElse();
2424 if (!yyextra->guards->top().parentVisible())
2425 {
2426 yyextra->guards->top().setEnabled(false);
2427 BEGIN( SkipGuardedSection );
2428 }
2429 else if (yyextra->guards->top().isEnabledFound())
2430 {
2431 yyextra->guards->top().setEnabled(false);
2432 BEGIN( SkipGuardedSection );
2433 }
2434 else
2435 {
2436 yyextra->guards->top().setEnabled(true);
2437 BEGIN( GuardParamEnd );
2438 }
2439 }
2440 }
2441<SkipGuardedSection>{CMD}"elseif"/{NW} {
2442 if (yyextra->guards->empty())
2443 {
2444 warn(yyextra->fileName,yyextra->lineNr,
2445 "found \\elseif without matching start command");
2446 }
2447 else if (yyextra->guards->top().hasElse())
2448 {
2449 warn(yyextra->fileName,yyextra->lineNr,
2450 "found \\elseif command after \\else command was given in \\if construct");
2451 yyextra->guardType = Guard_ElseIf;
2452 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2453 yyextra->guards->top().setEnabled(false);
2454 BEGIN( GuardParam );
2455 }
2456 else
2457 {
2458 yyextra->guardType = Guard_ElseIf;
2459 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2460 yyextra->guards->top().setEnabled(false);
2461 BEGIN( GuardParam );
2462 }
2463 }
2464<SkipGuardedSection>{DOCNL} { // skip line
2465 if (*yytext=='\n') yyextra->lineNr++;
2466 //addOutput(yyscanner,'\n');
2467 }
2468<SkipGuardedSection>[^ \\@\n]+ { // skip non-special characters
2469 }
2470<SkipGuardedSection>{CMD}{CMD} |
2471<SkipGuardedSection>. { // any other character
2472 }
2473
2474
2475 /* ----- handle skipping of internal section ------- */
2476
2477<SkipInternal>{DOCNL} { // skip line
2478 if (*yytext=='\n') yyextra->lineNr++;
2479 addOutput(yyscanner,'\n');
2480 }
2481<SkipInternal>[@\\]"if"/[ \t] {
2482 yyextra->condCount++;
2483 }
2484<SkipInternal>[@\\]"ifnot"/[ \t] {
2485 yyextra->condCount++;
2486 }
2487<SkipInternal>[@\\]/"endif" {
2488 yyextra->condCount--;
2489 if (yyextra->condCount<0) // handle conditional section around of \internal, see bug607743
2490 {
2491 unput('\\');
2492 BEGIN(Comment);
2493 }
2494 }
2495<SkipInternal>[@\\]/"section"[ \t] {
2496 if (yyextra->sectionLevel>0)
2497 {
2498 unput('\\');
2499 BEGIN(Comment);
2500 }
2501 }
2502<SkipInternal>[@\\]/"subsection"[ \t] {
2503 if (yyextra->sectionLevel>1)
2504 {
2505 unput('\\');
2506 BEGIN(Comment);
2507 }
2508 }
2509<SkipInternal>[@\\]/"subsubsection"[ \t] {
2510 if (yyextra->sectionLevel>2)
2511 {
2512 unput('\\');
2513 BEGIN(Comment);
2514 }
2515 }
2516<SkipInternal>[@\\]/"paragraph"[ \t] {
2517 if (yyextra->sectionLevel>3)
2518 {
2519 unput('\\');
2520 BEGIN(Comment);
2521 }
2522 }
2523<SkipInternal>[@\\]/"subparagraph"[ \t] {
2524 if (yyextra->sectionLevel>4)
2525 {
2526 unput('\\');
2527 BEGIN(Comment);
2528 }
2529 }
2530<SkipInternal>[@\\]/"subsubparagraph"[ \t] {
2531 if (yyextra->sectionLevel>5)
2532 {
2533 unput('\\');
2534 BEGIN(Comment);
2535 }
2536 }
2537<SkipInternal>[@\\]"endinternal"[ \t]* {
2538 BEGIN(Comment);
2539 }
2540<SkipInternal>[^ \\@\n]+ { // skip non-special characters
2541 }
2542<SkipInternal>. { // any other character
2543 }
2544
2545
2546 /* ----- handle argument of name command ------- */
2547
2548<NameParam>{DOCNL} { // end of argument
2549 //if (*yytext=='\n') yyextra->lineNr++;
2550 //addOutput(yyscanner,'\n');
2551 unput_string(yytext,yyleng);
2552 BEGIN( Comment );
2553 }
2554<NameParam>{LC} { // line continuation
2555 yyextra->lineNr++;
2556 addOutput(yyscanner,'\n');
2557 yyextra->docGroup.appendHeader(' ');
2558 }
2559<NameParam>. { // ignore other stuff
2560 yyextra->docGroup.appendHeader(*yytext);
2561 yyextra->current->name+=*yytext;
2562 }
2563
2564 /* ----- handle argument of noop command ------- */
2565<Noop>{DOCNL} { // end of argument
2566 if (*yytext=='\n')
2567 {
2568 yyextra->lineNr++;
2569 addOutput(yyscanner,'\n');
2570 }
2571 BEGIN( Comment );
2572 }
2573<Noop>. { // ignore other stuff
2574 }
2575 /* ----- handle argument of raisewarning command ------- */
2576<RaiseWarning,RaiseWarningSection>{DOCNL} { // end of argument
2577 warn_doc_error(yyextra->fileName,yyextra->lineNr,
2578 "{}",yyextra->raiseWarning);
2579 yyextra->raiseWarning = "";
2580 if (*yytext=='\n') yyextra->lineNr++;
2581 addOutput(yyscanner,'\n');
2582 if (YY_START == RaiseWarning)
2583 {
2584 BEGIN(Comment);
2585 }
2586 else
2587 {
2588 yyextra->sectionTitle+=yytext;
2589 BEGIN(SectionTitle);
2590 }
2591 }
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
2592<RaiseWarning,RaiseWarningSection>. { // ignore other stuff
2593 yyextra->raiseWarning += yytext;
2594 }
2595 /* ----- handle argument of ingroup command ------- */
2596
2597<InGroupParam>{LABELID} { // group id
2598 yyextra->current->groups.emplace_back(
2600 );
2601 yyextra->inGroupParamFound=TRUE;
2602 }
@ GROUPING_INGROUP
membership in group was defined by @ingroup
Definition types.h:236
2603<InGroupParam>{DOCNL} { // missing argument
2604 if (!yyextra->inGroupParamFound)
2605 {
2606 warn(yyextra->fileName,yyextra->lineNr,
2607 "Missing group name for \\ingroup command"
2608 );
2609 }
2610 //if (*yytext=='\n') yyextra->lineNr++;
2611 //addOutput(yyscanner,'\n');
2612 unput_string(yytext,yyleng);
2613 BEGIN( Comment );
2614 }
2615<InGroupParam>{LC} { // line continuation
2616 yyextra->lineNr++;
2617 addOutput(yyscanner,'\n');
2618 }
2619<InGroupParam>. { // ignore other stuff
2620 addOutput(yyscanner,*yytext);
2621 }
2622
2623 /* ----- handle argument of fn command ------- */
2624
2625<FnParam>{DOCNL} { // end of argument
2626 if (yyextra->braceCount==0)
2627 {
2628 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2629 {
2630 warn(yyextra->fileName,yyextra->lineNr,
2631 "missing argument after '\\{}'.",yyextra->currentCmd
2632 );
2633 }
2634 else
2635 {
2636 makeStructuralIndicator(yyscanner,yyextra->currentMakeEntryType);
2637 yyextra->langParser->parsePrototype(yyextra->functionProto);
2638 }
2639 unput_string(yytext,yyleng);
2640 BEGIN( Comment );
2641 }
2642 }
2643<FnParam>{LC} { // line continuation
2644 yyextra->lineNr++;
2645 yyextra->functionProto+=' ';
2646 }
2647<FnParam>[^@\\\n()]+ { // non-special characters
2648 yyextra->functionProto+=yytext;
2649 }
2650<FnParam>"(" {
2651 yyextra->functionProto+=yytext;
2652 yyextra->braceCount++;
2653 }
2654<FnParam>")" {
2655 yyextra->functionProto+=yytext;
2656 yyextra->braceCount--;
2657 }
2658<FnParam>. { // add other stuff
2659 yyextra->functionProto+=*yytext;
2660 }
2661
2662
2663 /* ----- handle argument of overload command ------- */
2664
2665
2666<OverloadParam>{DOCNL} { // end of argument
2667 if (*yytext=='\n') yyextra->lineNr++;
2668 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2669 { // plain overload command
2670 addOutput(yyscanner,getOverloadDocs());
2671 addOutput(yyscanner,'\n');
2672 }
2673 else // overload declaration
2674 {
2675 makeStructuralIndicator(yyscanner,EntryType::makeOverloadDoc);
2676 yyextra->langParser->parsePrototype(yyextra->functionProto);
2677 }
2678 BEGIN( Comment );
2679 }
QCString getOverloadDocs()
Definition util.cpp:4595
2680<OverloadParam>{LC} { // line continuation
2681 yyextra->lineNr++;
2682 yyextra->functionProto+=' ';
2683 }
2684<OverloadParam>. { // add other stuff
2685 yyextra->functionProto+=*yytext;
2686 }
2687
2688 /* ----- handle argument of inherit command ------- */
2689
2690<InheritParam>({ID}("::"|"."))*{ID} { // found argument
2691 yyextra->current->extends.emplace_back(
2692 removeRedundantWhiteSpace(QCString(yytext)),Protection::Public,Specifier::Normal
2693 );
2694 BEGIN( Comment );
2695 }
2696<InheritParam>{DOCNL} { // missing argument
2697 warn(yyextra->fileName,yyextra->lineNr,
2698 "\\inherit command has no argument"
2699 );
2700 if (*yytext=='\n') yyextra->lineNr++;
2701 addOutput(yyscanner,'\n');
2702 BEGIN( Comment );
2703 }
2704<InheritParam>. { // invalid character for anchor label
2705 warn(yyextra->fileName,yyextra->lineNr,
2706 "Invalid or missing name for \\inherit command"
2707 );
2708 BEGIN(Comment);
2709 }
2710
2711 /* ----- handle argument of extends and implements commands ------- */
2712
2713<ExtendsParam>({ID}("::"|"."))*{ID} { // found argument
2714 yyextra->current->extends.emplace_back(
2715 removeRedundantWhiteSpace(QCString(yytext)),Protection::Public,Specifier::Normal
2716 );
2717 BEGIN( Comment );
2718 }
2719<ExtendsParam>{DOCNL} { // missing argument
2720 warn(yyextra->fileName,yyextra->lineNr,
2721 "'\\{}' command has no argument",yyextra->currentCmd
2722 );
2723 //if (*yytext=='\n') yyextra->lineNr++;
2724 //addOutput(yyscanner,'\n');
2725 unput_string(yytext,yyleng);
2726 BEGIN( Comment );
2727 }
2728<ExtendsParam>. { // ignore other stuff
2729 }
2730
2731 /* ----- handle language specific sections ------- */
2732
2733<SkipLang>[\\@]"~"[a-zA-Z-]* { /* language switch */
2734 QCString langId(&yytext[2]);
2735 if (!langId.isEmpty() && !Config_isAvailableEnum(OUTPUT_LANGUAGE,langId))
2736 {
2737 warn(yyextra->fileName,yyextra->lineNr,
2738 "non supported language '{}' specified in '{}'",langId,QCString(yytext).stripWhiteSpace());
2739 }
2740 else if (langId.isEmpty() ||
2741 qstricmp(Config_getEnumAsString(OUTPUT_LANGUAGE),langId)==0)
2742 { // enable language specific section
2743 BEGIN(Comment);
2744 }
2745 }
2746<SkipLang>[^*@\\\n]* { /* any character not a *, @, backslash or new line */
2747 }
2748<SkipLang>{DOCNL} { /* new line in verbatim block */
2749 if (*yytext=='\n') yyextra->lineNr++;
2750 }
2751<SkipLang>. { /* any other character */
2752 }
2753
2754 /* ----- handle arguments of the cite command ------- */
2755
2756<CiteLabel,CiteLabelSection>{CITEID} { // found argument
2757 addCite(yyscanner);
2758 addOutput(yyscanner,yytext);
2759 if (YY_START == CiteLabel)
2760 {
2761 BEGIN(Comment);
2762 }
2763 else
2764 {
2765 yyextra->sectionTitle+=yytext;
2766 BEGIN(SectionTitle);
2767 }
2768 }
static void addCite(yyscan_t yyscanner)
2769<CiteLabel,CiteLabelSection>{DOCNL} { // missing argument
2770 warn(yyextra->fileName,yyextra->lineNr,
2771 "\\cite command has no label"
2772 );
2773 //if (*yytext=='\n') yyextra->lineNr++;
2774 //addOutput(yyscanner,'\n');
2775 if (YY_START == CiteLabel)
2776 {
2777 unput_string(yytext,yyleng);
2778 BEGIN(Comment);
2779 }
2780 else
2781 {
2782 yyextra->sectionTitle+=yytext;
2783 unput_string(yytext,yyleng);
2784 BEGIN(SectionTitle);
2785 }
2786 }
2787<CiteLabel,CiteLabelSection>. { // invalid character for cite label
2788 warn(yyextra->fileName,yyextra->lineNr,
2789 "Invalid or missing cite label"
2790 );
2791 if (YY_START == CiteLabel)
2792 {
2793 BEGIN(Comment);
2794 }
2795 else
2796 {
2797 yyextra->sectionTitle+=yytext;
2798 BEGIN(SectionTitle);
2799 }
2800 }
2801
2802 /* ----- handle argument of the copydoc command ------- */
2803
2804<CopyDoc><<EOF>> {
2805 setOutput(yyscanner,OutputDoc);
2806 addOutput(yyscanner," \\ilinebr\\ilinebr\\copydetails ");
2807 addOutput(yyscanner,yyextra->copyDocArg);
2808 addOutput(yyscanner,"\n");
2809 BEGIN(Comment);
2810 }
2811<CopyDoc>{DOCNL} {
2812 if (*yytext=='\n') yyextra->lineNr++;
2813 if (yyextra->braceCount==0)
2814 {
2815 setOutput(yyscanner,OutputDoc);
2816 addOutput(yyscanner," \\ilinebr\\ilinebr\\copydetails ");
2817 addOutput(yyscanner,yyextra->copyDocArg);
2818 addOutput(yyscanner,"\n");
2819 BEGIN(Comment);
2820 }
2821 }
2822<CopyDoc>{LC} { // line continuation
2823 yyextra->lineNr++;
2824 }
2825<CopyDoc>[^@\\\n()]+ { // non-special characters
2826 yyextra->copyDocArg+=yytext;
2827 addOutput(yyscanner,yytext);
2828 }
2829<CopyDoc>"(" {
2830 yyextra->copyDocArg+=yytext;
2831 addOutput(yyscanner,yytext);
2832 yyextra->braceCount++;
2833 }
2834<CopyDoc>")" {
2835 yyextra->copyDocArg+=yytext;
2836 addOutput(yyscanner,yytext);
2837 yyextra->braceCount--;
2838 }
2839<CopyDoc>. {
2840 yyextra->copyDocArg+=yytext;
2841 addOutput(yyscanner,yytext);
2842 }
2843
2844 /*
2845<*>. { fprintf(stderr,"Lex scanner %s %sdefault rule for state %s: #%s#\n", __FILE__,!yyextra->fileName.isEmpty() ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START),yytext);}
2846<*>\n { fprintf(stderr,"Lex scanner %s %sdefault rule newline for state %s.\n", __FILE__, !yyextra->fileName.isEmpty() ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START));}
2847 */
2848
2849%%

◆ yyread()

int yyread ( yyscan_t yyscanner,
char * buf,
int max_size )
static

Definition at line 4662 of file commentscan.l.

4663{
4664 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4665 yyextra->prevPosition=yyextra->inputPosition;
4666 int c=0;
4667 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4668 {
4669 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4670 //printf("%d (%c)\n",*buf,*buf);
4671 c++; buf++;
4672 }
4673 return c;
4674}

Variable Documentation

◆ docCmdMap

const std::map< std::string, DocCmdMap > docCmdMap
static

Definition at line 208 of file commentscan.l.

209{
210 // command name handler function command spacing section handling
215 { "arg", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
216 { "attention", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
217 { "author", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
218 { "authors", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
233 { "copyright", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
234 { "showdate", { nullptr, CommandSpacing::Inline, SectionHandling::Allowed }},
235 { "date", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
240 { "diafile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
243 { "docbookinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
246 { "dotfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
253 { "exception", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
272 { "htmlinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
279 { "important", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
280 { "include", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
283 { "includelineno", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
289 { "invariant", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
290 { "latexinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
292 { "li", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
293 { "line", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
295 { "maninclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
300 { "mscfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
305 { "note", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
309 { "par", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
313 { "post", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
314 { "pre", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
331 { "remark", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
332 { "remarks", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
333 { "result", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
334 { "return", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
335 { "returns", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
337 { "rtfinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
339 { "sa", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
341 { "see", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
348 { "since", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
349 { "snippet", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
350 { "snippetlineno", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
361 { "throw", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
362 { "throws", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
364 { "tparam", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
367 { "until", { nullptr, CommandSpacing::Block, SectionHandling::Escape }},
371 { "verbinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
372 { "version", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
373 { "warning", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
375 { "xmlinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
381 { "secreflist", { nullptr, CommandSpacing::Invisible, SectionHandling::Break }},
382 { "endsecreflist", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
383 { "dontinclude", { nullptr, CommandSpacing::Invisible, SectionHandling::Break }},
384 { "line", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
385 { "skip", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
386 { "skipline", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
387 { "until", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
388 { "vhdlflow", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
389 { "enddot", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
390 { "endmsc", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
391 { "enduml", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
392 { "endicode", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
393 { "endcode", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
394 { "endverbatim", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
395 { "enddocbookonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
396 { "endhtmlonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
397 { "endlatexonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
398 { "endmanonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
399 { "endrtfonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
400 { "endxmlonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
402 { "endlink", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
407 { "plantumlfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }}
static bool handlePrivate(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideIncludegraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleDetails(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleName(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleImage(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleStatic(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCopyDetails(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleProtectedSection(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleOverload(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleXRefItem(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleProtocol(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleWeakGroup(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleInternal(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleShowInitializer(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleGroupgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleQualifier(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleLineInfo(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleNoSubGrouping(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleMainpage(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCite(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleTest(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIRaise(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideCallgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCallgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIngroup(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleStruct(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleInterface(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleShowInlineSource(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleAddToGroup(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleDef(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleConcept(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleExtends(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleBrief(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleRefItem(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIncludedBygraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleUnion(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideDirectoryGraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleRelated(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleBug(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleReferencesRelation(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideIncludedBygraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleRaiseWarning(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleElseIf(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleMemberOf(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleToc(yyscan_t yyscanner, const QCString &s, const StringVector &)
static bool handleParBlock(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCategory(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePrivateSection(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleModule(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleInherit(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleEndIf(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleDirectoryGraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleTodo(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIPrefix(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCopyDoc(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleReferencedByRelation(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleEnum(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIfNot(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleFormatBlock(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideInlineSource(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleNoop(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleAnchor(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideInitializer(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCallergraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleParam(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideInheritanceGraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIf(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePage(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePackage(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideEnumValues(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleSection(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCollaborationgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideGroupgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIFile(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleFn(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleDeprecated(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIncludegraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePure(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideCollaborationgraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideReferencedByRelation(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePublic(yyscan_t yyscanner, const QCString &s, const StringVector &)
static bool handleDir(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleRelatedAlso(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleInheritanceGraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleAddIndex(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleFileInfo(yyscan_t yyscanner, const QCString &cmdName, const StringVector &optList)
static bool handleSubpage(yyscan_t yyscanner, const QCString &s, const StringVector &)
static bool handleProtected(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleEndParBlock(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleElse(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleClass(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHeaderFile(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleCopyBrief(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleShowEnumValues(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideReferencesRelation(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleFile(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleRetval(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleIdlException(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleNamespace(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleHideCallergraph(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleDefGroup(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleExample(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleILine(yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handlePublicSection(yyscan_t yyscanner, const QCString &s, const StringVector &)
408};

◆ g_citeMutex

std::mutex g_citeMutex
static

Definition at line 528 of file commentscan.l.

Referenced by addCite().

◆ g_formulaMutex

std::mutex g_formulaMutex
static

Definition at line 527 of file commentscan.l.

Referenced by addFormula().

◆ g_sectionMutex

std::mutex g_sectionMutex
static

Definition at line 526 of file commentscan.l.

Referenced by addAnchor(), addSection(), and addXRefItem().

◆ nonBrief_re

const reg::Ex nonBrief_re(R"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))") ( R"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))" )
static

Referenced by endBrief(), and setOutput().