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 handleRequirement (yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleSatisfies (yyscan_t yyscanner, const QCString &, const StringVector &)
static bool handleVerifies (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 fileInfoLookup (const FileInfo &fi, const std::string &name)
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 addRequirementId (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 void escapeLabel (QCString &label)
static const char * getLexerFILE ()
int yylex (yyscan_t yyscanner)

Variables

static const std::unordered_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 570 of file commentscan.l.

◆ 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:3982

Definition at line 575 of file commentscan.l.

◆ YY_NEVER_INTERACTIVE

#define YY_NEVER_INTERACTIVE   1

Definition at line 420 of file commentscan.l.

◆ YY_NO_INPUT

#define YY_NO_INPUT   1

Definition at line 418 of file commentscan.l.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H   1

Definition at line 419 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 185 of file commentscan.l.

◆ HtmlContextStack

using HtmlContextStack = std::vector<HtmlContextInfo>

Definition at line 460 of file commentscan.l.

◆ MakeEntryType

typedef EntryType(* MakeEntryType) ()

Definition at line 186 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 188 of file commentscan.l.

189{
190 Invisible, //!< command sets some property but does not appear in the output.
191 Inline, //!< command appears inline in the output which can be a brief description.
192 Block, //!< command starts a new paragraphs / ends a brief description.
193 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.
194};

◆ GuardType

enum GuardType
Enumerator
Guard_If 
Guard_IfNot 
Guard_ElseIf 

Definition at line 441 of file commentscan.l.

442{
443 Guard_If,
@ Guard_If
@ Guard_ElseIf
@ Guard_IfNot
446};

◆ OutputContext

Enumerator
OutputDoc 
OutputBrief 
OutputXRef 
OutputInbody 

Definition at line 433 of file commentscan.l.

434{
435 OutputDoc,
@ OutputXRef
@ OutputDoc
@ OutputBrief
@ OutputInbody
439};

◆ 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 196 of file commentscan.l.

197{
198 Allowed, //!< command is allowed without restrictions in section title
199 Replace, //!< command will be handled in here / needs special handling here
200 Escape, //!< command is not-allowed in section title, it will be escaped
201 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
202};

◆ XRefKind

enum XRefKind
Enumerator
XRef_Item 
XRef_Todo 
XRef_Test 
XRef_Bug 
XRef_Deprecated 
XRef_None 

Definition at line 423 of file commentscan.l.

424{
425 XRef_Item,
426 XRef_Todo,
427 XRef_Test,
428 XRef_Bug,
@ XRef_Item
@ XRef_Deprecated
@ XRef_Todo
@ XRef_Test
@ XRef_Bug
@ XRef_None
431};

Function Documentation

◆ addAnchor()

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

Definition at line 4809 of file commentscan.l.

4810{
4811 std::unique_lock<std::mutex> lock(g_sectionMutex);
4812 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4814 const SectionInfo *si = sm.find(anchor);
4815 if (si)
4816 {
4817 if (!si->ref().isEmpty()) // we are from a tag file
4818 {
4819 si = sm.replace(anchor,yyextra->fileName,yyextra->lineNr,QCString(),SectionType::Anchor,0);
4820 yyextra->current->anchors.push_back(si);
4821 }
4822 else if (si->lineNr() != -1)
4823 {
4824 warn(yyextra->fileName,yyextra->lineNr,
4825 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4826 anchor,si->fileName(),si->lineNr());
4827 }
4828 else
4829 {
4830 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4831 anchor,si->fileName());
4832 }
4833 }
4834 else
4835 {
4836 si = sm.add(anchor,yyextra->fileName,yyextra->lineNr,title,SectionType::Anchor,0);
4837 yyextra->current->anchors.push_back(si);
4838 }
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:163
class that provide information about a section.
Definition section.h:58
QCString ref() const
Definition section.h:72
QCString fileName() const
Definition section.h:74
int lineNr() const
Definition section.h:73
singleton class that owns the list of all sections
Definition section.h:135
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
Definition section.h:157
SectionInfo * add(const SectionInfo &si)
Definition section.h:139
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
static constexpr int Anchor
Definition section.h:40
static std::mutex g_sectionMutex
#define warn(file, line, fmt,...)
Definition message.h:97
4839}

References SectionType::Anchor, and g_sectionMutex.

Referenced by handleImage().

◆ addCite()

void addCite ( yyscan_t yyscanner)
static

Definition at line 4612 of file commentscan.l.

4613{
4614 std::unique_lock<std::mutex> lock(g_citeMutex);
4615 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4616 QCString name(yytext);
4617 if (yytext[0] =='"')
4618 {
4619 name=yytext+1;
4620 name=name.left((int)yyleng-2);
4621 }
static CitationManager & instance()
Definition cite.cpp:85
void insert(const QCString &label)
Insert a citation identified by label into the database.
Definition cite.cpp:95
static std::mutex g_citeMutex
4623}

References g_citeMutex.

◆ addFormula()

QCString addFormula ( yyscan_t yyscanner)
static

Definition at line 4536 of file commentscan.l.

4537{
4538 std::unique_lock<std::mutex> lock(g_formulaMutex);
4539 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4540 QCString formLabel;
4541 QCString formula = (yyextra->formulaPreText +
4542 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4543 yyextra->formulaPostText).stripWhiteSpace();
4544 //printf("formulaText=\n=1=\n{%s}\n=2=\n{%s}\n=3=\n{%s}\n===",
4545 // qPrint(yyextra->formulaText),
4546 // qPrint(yyextra->formulaText.stripLeadingAndTrailingEmptyLines()),
4547 // qPrint(formula)
4548 // );
4549 int id = FormulaManager::instance().addFormula(formula);
4550 formLabel.sprintf("\\_form#%d",id);
4551 for (int i=0;i<yyextra->formulaNewLines;i++) formLabel+="@_fakenl"; // add fake newlines to
4552 // keep the warnings
4553 // correctly aligned.
4554 return formLabel;
static FormulaManager & instance()
Definition formula.cpp:54
int addFormula(const QCString &formulaText, int width=-1, int height=-1)
Definition formula.cpp:691
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
static std::mutex g_formulaMutex
4555}

References g_formulaMutex.

◆ addIline()

void addIline ( yyscan_t yyscanner,
int lineNr )
static

Definition at line 4864 of file commentscan.l.

4865{
4866 char cmd[30];
4867 qsnprintf(cmd,30," \\iline %d ",lineNr);
4868 addOutput(yyscanner, cmd);
static void addOutput(yyscan_t yyscanner, const char *s)
#define qsnprintf
Definition qcstring.h:49
4869}

Referenced by endBrief().

◆ addIlineBreak()

void addIlineBreak ( yyscan_t yyscanner,
int lineNr )
static

Definition at line 4871 of file commentscan.l.

4872{
4873 char cmd[30];
4874 qsnprintf(cmd,30," \\iline %d \\ilinebr ",lineNr);
4875 addOutput(yyscanner, cmd);
4876}

◆ addOutput() [1/3]

void addOutput ( yyscan_t yyscanner,
char c )
inlinestatic

Definition at line 4858 of file commentscan.l.

4859{
4860 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4861 *yyextra->pOutputString+=c;
4862}

◆ addOutput() [2/3]

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

Definition at line 4842 of file commentscan.l.

4843{
4844 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4845 //printf("addOutput(yyscanner,%s)\n",s);
4846 *yyextra->pOutputString+=s;
4847}

Referenced by endBrief(), handleCite(), handleDetails(), handleFileInfoResult(), handleFormatBlock(), handleLineInfo(), and CommentScanner::parseCommentBlock().

◆ addOutput() [3/3]

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

Definition at line 4850 of file commentscan.l.

4851{
4852 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4853 //printf("addOutput(yyscanner,%s)\n",s);
4854 *yyextra->pOutputString+=s;
4855}

◆ addRequirementId()

void addRequirementId ( yyscan_t yyscanner)
static

Definition at line 4399 of file commentscan.l.

4400{
4401 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4402 std::unique_lock<std::mutex> lock(g_sectionMutex);
4403
4404 QCString reqId = yyextra->current->name;
4405 //printf("### add reqId='%s' reqTitle='%s'\n",qPrint(reqId),qPrint(yyextra->current->type));
4407 const SectionInfo *si = sm.find(reqId);
4408 if (si==nullptr)
4409 {
4410 si = sm.add(reqId,"requirements",yyextra->lineNr,
4411 yyextra->current->type,SectionType::Requirement,1);
4412 }
4413 else // duplicate requirement
4414 {
4415 warn(yyextra->fileName,yyextra->lineNr,"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4416 reqId,
4417 yyextra->fileName,yyextra->lineNr,
4418 si->fileName(),si->lineNr());
4419 }
static constexpr int Requirement
Definition section.h:42
4420}

References g_sectionMutex, and SectionType::Requirement.

◆ addSection()

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

Definition at line 4565 of file commentscan.l.

4566{
4567 std::unique_lock<std::mutex> lock(g_sectionMutex);
4568 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4570 const SectionInfo *si = sm.find(yyextra->sectionLabel);
4571 if (si)
4572 {
4573 if (!si->ref().isEmpty()) // we are from a tag file
4574 {
4575 // create a new section element
4576 if (addYYtext) yyextra->sectionTitle+=yytext;
4577 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4578 si = sm.replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4579 yyextra->sectionTitle,sectionLevelToType(yyextra->sectionLevel),
4580 yyextra->sectionLevel);
static SectionType sectionLevelToType(int level)
4581
4582 // add section to this entry
4583 yyextra->current->anchors.push_back(si);
4584 }
4585 else if (si->lineNr() != -1)
4586 {
4587 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4588 yyextra->sectionLabel,si->fileName(),si->lineNr());
4589 }
4590 else
4591 {
4592 warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '{}' while adding section, (first occurrence: {})",
4593 yyextra->sectionLabel,si->fileName());
4594 }
4595 }
4596 else
4597 {
4598 // create a new section element
4599 if (addYYtext) yyextra->sectionTitle+=yytext;
4600 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4601 si = sm.add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4602 yyextra->sectionTitle,sectionLevelToType(yyextra->sectionLevel),
4603 yyextra->sectionLevel);
4604
4605 // add section to this entry
4606 yyextra->current->anchors.push_back(si);
4607 }
4608}

References g_sectionMutex, and sectionLevelToType().

◆ addXRefItem()

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

Definition at line 4424 of file commentscan.l.

4427{
4428 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4429 if (listName.isEmpty()) return;
4430 //printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append);
4431
4432 std::unique_lock<std::mutex> lock(g_sectionMutex);
4433
4434 RefList *refList = RefListManager::instance().add(listName,listTitle,itemTitle);
4435 RefItem *item = nullptr;
4436 for (auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4437 {
4438 RefItem *i = *it;
4439 if (i && i->list()->listName()==listName)
4440 {
4441 //printf("found %s lii->type=%s\n",listName,qPrint(i->list()->listName()));
4442 item = i;
4443 break;
4444 }
4445 }
4446 if (item && append) // already found item of same type just before this one
4447 {
4448 //printf("listName=%s item id = %d existing\n",listName,item->id());
4449 item->setText(item->text() + " <p>" + yyextra->outputXRef);
4450 //printf("%s: text +=%s\n",listName,qPrint(item->text));
4451 }
4452 else // new item
4453 {
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
4454
4455 // if we have already an item from the same list type (e.g. a second @todo)
4456 // in the same Entry (i.e. lii!=0) then we reuse its link anchor.
4457 item = refList->add();
4458 //printf("listName=%s item id = %d new yyextra->current=%p\n",listName,item->id(),yyextra->current);
4459 QCString anchorLabel;
4460 anchorLabel.sprintf("_%s%06d",listName.data(),item->id());
4461 item->setText(yyextra->outputXRef);
4462 item->setAnchor(anchorLabel);
4463 yyextra->current->sli.push_back(item);
4464 QCString cmdString;
4465 cmdString.sprintf(" \\xrefitem %s %d.",qPrint(listName),item->id());
4466 if (yyextra->inBody)
4467 {
4468 yyextra->current->inbodyDocs += cmdString;
4469 }
4470 else
4471 {
4472 yyextra->current->doc += cmdString;
4473 }
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:172
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:687
4474
4475 {
4477 const SectionInfo *si = sm.find(anchorLabel);
4478 if (si)
4479 {
4480 if (!si->ref().isEmpty()) // we are from a tag file
4481 {
4482 si = sm.replace(anchorLabel,listName,yyextra->lineNr,
4483 yyextra->sectionTitle,SectionType::Anchor,
4484 yyextra->sectionLevel);
4485 yyextra->current->anchors.push_back(si);
4486 }
4487 else if (si->lineNr() != -1)
4488 {
4489 warn(listName,yyextra->lineNr,"multiple use of section label '{}', (first occurrence: {}, line {})",
4490 anchorLabel,si->fileName(),si->lineNr());
4491 }
4492 else
4493 {
4494 warn(listName,yyextra->lineNr,"multiple use of section label '{}', (first occurrence: {})",
4495 anchorLabel,si->fileName());
4496 }
4497 }
4498 else
4499 {
4500 si = sm.add(anchorLabel,listName,yyextra->lineNr,
4501 yyextra->sectionTitle,SectionType::Anchor,
4502 yyextra->sectionLevel);
4503 yyextra->current->anchors.push_back(si);
4504 }
4505 }
4506 }
4507 yyextra->outputXRef.clear();
4508}

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 4924 of file commentscan.l.

4925{
4926 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4927 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4928 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4929 YY_START==ReadFormulaLong)
4930 {
4931 warn(yyextra->fileName,yyextra->lineNr,"End of comment block while inside formula.");
4932 }
4933}

References warn.

Referenced by CommentScanner::parseCommentBlock().

◆ checkStructuralIndicator()

bool checkStructuralIndicator ( yyscan_t yyscanner)
static

Definition at line 4343 of file commentscan.l.

4344{
4345 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4346 //printf("yyextra->current->section=%x\n",yyextra->current->section);
4347 return yyextra->current->section.isDoc();
4348}

◆ endBrief()

void endBrief ( yyscan_t yyscanner)
static

Definition at line 4878 of file commentscan.l.

4879{
4880 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4881 std::string_view str = yyextra->current->brief.view();
4883 if (!stripWhiteSpace(str).empty() && !reg::match(str,match,nonBrief_re))
4884 { // only go to the detailed description if we have
4885 // found some brief description and not just whitespace
4886 yyextra->briefEndsAtDot=FALSE;
4887 setOutput(yyscanner,OutputDoc);
4888 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4889 {
4890 yyextra->current->docLine = yyextra->lineNr;
4891 yyextra->current->doc = "";
4892 }
4893 else
4894 {
4895 addIline(yyscanner,yyextra->lineNr);
4896 }
4897 addOutput(yyscanner,yytext);
4898 }
4899 else
4900 {
4901 int saveLineNr = yyextra->lineNr;
4902 lineCount(yyscanner);
4903 yyextra->current->briefLine = yyextra->lineNr;
4904 yyextra->lineNr = saveLineNr;
4905 }
Object representing the matching results.
Definition regex.h:151
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:855
#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
4906}

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

◆ escapeLabel()

void escapeLabel ( QCString & label)
static

Definition at line 4513 of file commentscan.l.

4514{
4515 if (label.isEmpty()) return;
4516 char c = label[0];
4517 if (!((c>='a' && c<='z') || (c>='A' && c<='Z') || c=='_' || c<0))
4518 {
4519 label[0]='_'; // replace invalid starting char by _
4520 }
4521 for (size_t i=1; i<label.size(); i++)
4522 {
4523 c = label[i];
4524 if (!((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_' || c<0))
4525 {
4526 label[i]='_'; // replace invalid char by _
4527 }
4528 }
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:169
4529}

◆ fileInfoLookup()

QCString fileInfoLookup ( const FileInfo & fi,
const std::string & name )
static

Definition at line 3642 of file commentscan.l.

3643{
3644 using OptionFunc = std::function<QCString(const FileInfo &)>;
3645 static std::unordered_map<std::string,OptionFunc> options =
3646 {
3647 // name, function producing the value
3648 { "name", [](const FileInfo &fi_) -> QCString { return fi_.baseName(); } },
3649 { "extension", [](const FileInfo &fi_) -> QCString { return fi_.extension(true); } },
3650 { "filename", [](const FileInfo &fi_) -> QCString { return fi_.fileName(); } },
3651 { "directory", [](const FileInfo &fi_) -> QCString { return fi_.dirPath(); } },
3652 { "full", [](const FileInfo &fi_) -> QCString { return fi_.absFilePath(); } }
3653 };
3654 auto it = options.find(optionName);
3655 return (it!=options.end()) ? it->second(fi) : QCString();
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
3656}

◆ getLexerFILE()

const char * getLexerFILE ( )
inlinestatic

Definition at line 578 of file commentscan.l.

578{return __FILE__;}

◆ handleAddIndex()

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

Definition at line 3625 of file commentscan.l.

3626{
3627 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3628 addOutput(yyscanner,yytext);
3629 BEGIN(LineParam);
3630 return FALSE;
3631}

References FALSE.

◆ handleAddToGroup()

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

Definition at line 3095 of file commentscan.l.

3096{
3097 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3098 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
3099 yyextra->current->groupDocType = Entry::GROUPDOC_ADD;
3100 BEGIN( GroupDocArg1 );
3101 return stop;
@ GROUPDOC_ADD
addtogroup
Definition entry.h:123
static bool makeStructuralIndicator(yyscan_t yyscanner, MakeEntryType maker)
3102}

References Entry::GROUPDOC_ADD.

◆ handleAnchor()

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

Definition at line 3541 of file commentscan.l.

3542{
3543 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3544 addOutput(yyscanner,"@"+s+" ");
3545 if (optList.empty())
3546 {
3547 yyextra -> anchorTitle = "";
3548 }
3549 else
3550 {
3551 yyextra -> anchorTitle = join(optList," ");
3552 }
3553 BEGIN(AnchorLabel);
3554 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:6669
3555}

◆ handleBrief()

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

Definition at line 3041 of file commentscan.l.

3042{
3043 //printf("handleBrief\n");
3044 setOutput(yyscanner,OutputBrief);
3045 return FALSE;
3046}

References FALSE, and OutputBrief.

◆ handleBug()

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

Definition at line 3360 of file commentscan.l.

3361{
3362 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3363 yyextra->newXRefKind = XRef_Bug;
3364 setOutput(yyscanner,OutputXRef);
3365 yyextra->xrefKind = XRef_Bug;
3366 return FALSE;
3367}

References FALSE, OutputXRef, and XRef_Bug.

◆ handleCallergraph()

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

Definition at line 3929 of file commentscan.l.

3930{
3931 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3932 yyextra->current->commandOverrides.override_callerGraph(true); // ON
3933 return FALSE;
3934}

References FALSE.

◆ handleCallgraph()

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

Definition at line 3915 of file commentscan.l.

3916{
3917 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3918 yyextra->current->commandOverrides.override_callGraph(true); // ON
3919 return FALSE;
3920}

References FALSE.

◆ handleCategory()

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

Definition at line 3172 of file commentscan.l.

3173{ // Obj-C category
3174 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3175 yyextra->currentCmd = cmd;
3176 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3177 BEGIN( CategoryDocArg1 );
3178 return checkStructuralIndicator(yyscanner);
static bool checkStructuralIndicator(yyscan_t yyscanner)
3179}

◆ handleCite()

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

Definition at line 3582 of file commentscan.l.

3583{
3584 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3585 if (!yyextra->spaceBeforeCmd.isEmpty())
3586 {
3587 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3588 yyextra->spaceBeforeCmd.clear();
3589 }
3590 if (optList.empty())
3591 {
3592 addOutput(yyscanner,"@"+s+" ");
3593 }
3594 else
3595 {
3596 addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
3597 }
3598 BEGIN(CiteLabel);
3599 return FALSE;
3600}

References addOutput().

◆ handleClass()

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

Definition at line 3129 of file commentscan.l.

3130{
3131 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3132 yyextra->currentCmd = cmd;
3133 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3134 BEGIN( ClassDocArg1 );
3135 return checkStructuralIndicator(yyscanner);
3136}

◆ handleCollaborationgraph()

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

Definition at line 4013 of file commentscan.l.

4014{
4015 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4016 yyextra->current->commandOverrides.override_collaborationGraph(true); // ON
4017 return FALSE;
4018}

References FALSE.

◆ handleConcept()

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

Definition at line 3138 of file commentscan.l.

3139{
3140 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3141 yyextra->currentCmd = cmd;
3142 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3143 BEGIN( ConceptDocArg1 );
3144 return checkStructuralIndicator(yyscanner);
3145}

◆ handleCopyBrief()

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

Definition at line 4278 of file commentscan.l.

4279{
4280 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4281 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4282 { // if we don't have a brief or detailed description yet,
4283 // then the @copybrief should end up in the brief description.
4284 // otherwise it will be copied inline (see bug691315 & bug700788)
4285 setOutput(yyscanner,OutputBrief);
4286 }
4287 if (!yyextra->spaceBeforeCmd.isEmpty())
4288 {
4289 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4290 yyextra->spaceBeforeCmd.clear();
4291 }
4292 addOutput(yyscanner,"\\copybrief ");
4293 return FALSE;
4294}

References OutputBrief, and setOutput().

◆ handleCopyDetails()

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

Definition at line 4296 of file commentscan.l.

4297{
4298 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4299 setOutput(yyscanner,OutputDoc);
4300 if (!yyextra->spaceBeforeCmd.isEmpty())
4301 {
4302 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4303 yyextra->spaceBeforeCmd.clear();
4304 }
4305 addOutput(yyscanner,"\\copydetails ");
4306 return FALSE;
4307}

References OutputDoc.

◆ handleCopyDoc()

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

Definition at line 4309 of file commentscan.l.

4310{
4311 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4312 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4313 { // if we don't have a brief or detailed description yet,
4314 // then the @copybrief should end up in the brief description.
4315 // otherwise it will be copied inline (see bug691315 & bug700788)
4316 setOutput(yyscanner,OutputBrief);
4317 }
4318 if (!yyextra->spaceBeforeCmd.isEmpty())
4319 {
4320 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4321 yyextra->spaceBeforeCmd.clear();
4322 }
4323 addOutput(yyscanner,"\\copybrief ");
4324 yyextra->copyDocArg.clear();
4325 yyextra->braceCount = 0;
4326 BEGIN(CopyDoc);
4327 return FALSE;
4328}

References OutputBrief, and setOutput().

◆ handleDef()

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

Definition at line 3059 of file commentscan.l.

3060{
3061 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3062 yyextra->functionProto.clear();
3063 yyextra->braceCount=0;
3064 yyextra->currentCmd = cmd;
3065 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3066 BEGIN( FnParam );
3067 return checkStructuralIndicator(yyscanner);
3068}

◆ handleDefGroup()

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

Definition at line 3086 of file commentscan.l.

3087{
3088 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3089 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
3090 yyextra->current->groupDocType = Entry::GROUPDOC_NORMAL;
3091 BEGIN( GroupDocArg1 );
3092 return stop;
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:122
3093}

References Entry::GROUPDOC_NORMAL.

◆ handleDeprecated()

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

Definition at line 3369 of file commentscan.l.

3370{
3371 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3372 yyextra->newXRefKind = XRef_Deprecated;
3373 setOutput(yyscanner,OutputXRef);
3374 yyextra->xrefKind = XRef_Deprecated;
3375 return FALSE;
3376}

References FALSE, OutputXRef, and XRef_Deprecated.

◆ handleDetails()

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

Definition at line 3299 of file commentscan.l.

3300{
3301 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3302 if (yyextra->inContext!=OutputBrief)
3303 {
3304 addOutput(yyscanner," \\ilinebr\\ilinebr "); // treat @details outside brief description
3305 // as a new paragraph
3306 }
3307 setOutput(yyscanner,OutputDoc);
3308 return FALSE;
3309}

References addOutput(), and OutputBrief.

◆ handleDir()

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

Definition at line 3268 of file commentscan.l.

3269{
3270 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3271 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeDirDoc);
3272 if (!stop) yyextra->current->name = yyextra->fileName;
3273 BEGIN( FileDocArg1 );
3274 return stop;
3275}

◆ handleDirectoryGraph()

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

Definition at line 3999 of file commentscan.l.

4000{
4001 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4002 yyextra->current->commandOverrides.override_directoryGraph(true); // ON
4003 return FALSE;
4004}

References FALSE.

◆ handleElse()

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

Definition at line 3817 of file commentscan.l.

3818{
3819 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3820 if (yyextra->guards->empty())
3821 {
3822 warn(yyextra->fileName,yyextra->lineNr,
3823 "found \\else without matching start command");
3824 }
3825 else if (yyextra->guards->top().hasElse())
3826 {
3827 warn(yyextra->fileName,yyextra->lineNr,
3828 "found multiple \\else commands in same \\if construct");
3829 yyextra->guards->top().setEnabled(false);
3830 yyextra->guards->top().setElse();
3831 BEGIN( SkipGuardedSection );
3832 }
3833 else
3834 {
3835 yyextra->guards->top().setElse();
3836 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3837 if (yyextra->guards->top().isEnabledFound())
3838 {
3839 yyextra->guards->top().setEnabled(false);
3840 BEGIN( SkipGuardedSection );
3841 }
3842 else
3843 {
3844 yyextra->guards->top().setEnabled(true);
3845 BEGIN( GuardParamEnd );
3846 }
3847 }
3848 return FALSE;
3849}

References warn.

◆ handleElseIf()

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

Definition at line 3790 of file commentscan.l.

3791{
3792 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3793 if (yyextra->guards->empty())
3794 {
3795 warn(yyextra->fileName,yyextra->lineNr,
3796 "found \\elseif without matching start command");
3797 }
3798 else if (yyextra->guards->top().hasElse())
3799 {
3800 warn(yyextra->fileName,yyextra->lineNr,
3801 "found \\elseif command after \\else command was given in \\if construct");
3802 yyextra->guardType = Guard_ElseIf;
3803 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3804 yyextra->guards->top().setEnabled(false);
3805 BEGIN(GuardParam);
3806 }
3807 else
3808 {
3809 yyextra->guardType = Guard_ElseIf;
3810 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3811 yyextra->guards->top().setEnabled(false);
3812 BEGIN(GuardParam);
3813 }
3814 return FALSE;
3815}

References warn.

◆ handleEndIf()

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

Definition at line 3851 of file commentscan.l.

3852{
3853 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3854 if (yyextra->guards->empty())
3855 {
3856 warn(yyextra->fileName,yyextra->lineNr,
3857 "found \\endif without matching start command");
3858 }
3859 else
3860 {
3861 yyextra->guards->pop();
3862 }
3863 if (!yyextra->spaceBeforeCmd.isEmpty())
3864 {
3865 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3866 yyextra->spaceBeforeCmd.clear();
3867 }
3868 if (yyextra->guards->empty())
3869 {
3870 BEGIN( GuardParamEnd );
3871 }
3872 else
3873 {
3874 if (yyextra->guards->top().isEnabled())
3875 {
3876 BEGIN( GuardParamEnd );
3877 }
3878 else
3879 {
3880 BEGIN( SkipGuardedSection );
3881 }
3882 }
3883 return FALSE;
3884}

References warn.

◆ handleEndParBlock()

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

Definition at line 3404 of file commentscan.l.

3405{
3406 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3407 if (!yyextra->insideParBlock)
3408 {
3409 warn(yyextra->fileName,yyextra->lineNr,
3410 "found \\endparblock command without matching \\parblock!");
3411 }
3412 addOutput(yyscanner,"@endparblock");
3413 setOutput(yyscanner,OutputDoc); // to end a parblock inside a xrefitem like context
3414 yyextra->insideParBlock = FALSE;
3415 return FALSE;
3416}

References warn.

◆ handleEnum()

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

Definition at line 3078 of file commentscan.l.

3079{
3080 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3081 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3082 BEGIN( EnumDocArg1 );
3083 return checkStructuralIndicator(yyscanner);
3084}

◆ handleExample()

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

Definition at line 3277 of file commentscan.l.

3278{
3279 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3280 MakeEntryType sectionMaker = EntryType::makeExample;
3281 for (const auto &opt : optList)
3282 {
3283 if (opt=="lineno")
3284 {
3285 sectionMaker=EntryType::makeExampleLineno;
3286 }
3287 else
3288 {
3289 warn(yyextra->fileName,yyextra->lineNr,
3290 "unsupported option '{}' for command '\\{}'",opt,cmd);
3291 }
3292 }
3293 bool stop=makeStructuralIndicator(yyscanner,sectionMaker);
3294 if (!stop) yyextra->current->name = yyextra->fileName;
3295 BEGIN( FileDocArg1 );
3296 return stop;
EntryType(* MakeEntryType)()
3297}

References warn.

◆ handleExtends()

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

Definition at line 4270 of file commentscan.l.

4271{
4272 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4273 yyextra->currentCmd = cmd;
4274 BEGIN(ExtendsParam);
4275 return FALSE;
4276}

References FALSE.

◆ handleFile()

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

Definition at line 3238 of file commentscan.l.

3239{
3240 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3241 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeFileDoc);
3242 if (!stop)
3243 {
3244 yyextra->current->name = yyextra->fileName;
3245 }
3246 BEGIN( FileDocArg1 );
3247 return stop;
3248}

◆ handleFileInfo()

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

Definition at line 3633 of file commentscan.l.

3634{
3635 return handleFileInfoResult(yyscanner,cmdName, optList, false);
static bool handleFileInfoResult(yyscan_t yyscanner, const QCString &, const StringVector &optList, bool isSection)
3636}

◆ handleFileInfoResult()

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

Definition at line 3658 of file commentscan.l.

3659{
3660 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3661 if (!yyextra->spaceBeforeCmd.isEmpty())
3662 {
3663 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3664 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3665 yyextra->spaceBeforeCmd.clear();
3666 }
3667 bool first = true;
3668 FileInfo fi(yyextra->fileName.str());
3669 for (const auto &opt_ : optList)
3670 {
3671 QCString optStripped = QCString(opt_).stripWhiteSpace();
3672 std::string opt = optStripped.lower().str();
3673 QCString result = fileInfoLookup(fi,opt);
3674 if (!result.isEmpty())
3675 {
3676 if (!first)
3677 {
3678 warn(yyextra->fileName,yyextra->lineNr,"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3679 }
3680 else
3681 {
3682 addOutput(yyscanner,result);
3683 if (isSection)
3684 {
3685 yyextra->sectionTitle+=result;
3686 }
3687 }
3688 first = false;
3689 }
3690 else
3691 {
3692 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\fileinfo: '{}'", optStripped);
3693 }
3694 }
3695 if (first) // no options specified
3696 {
3697 if (Config_getBool(FULL_PATH_NAMES))
3698 {
3699 if (isSection) yyextra->sectionTitle+=stripFromPath(yyextra->fileName);
3700 addOutput(yyscanner,stripFromPath(yyextra->fileName));
3701 }
3702 else
3703 {
3704 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3705 addOutput(yyscanner,yyextra->fileName);
3706 }
3707 }
3708 return false;
QCString lower() const
Definition qcstring.h:249
const std::string & str() const
Definition qcstring.h:552
static QCString fileInfoLookup(const FileInfo &fi, const std::string &name)
#define Config_getBool(name)
Definition config.h:33
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:299
3709}

References addOutput().

◆ handleFileInfoSection()

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

Definition at line 3637 of file commentscan.l.

3638{
3639 return handleFileInfoResult(yyscanner,cmdName, optList, true);
3640}

◆ handleFn()

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

Definition at line 3048 of file commentscan.l.

3049{
3050 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3051 yyextra->braceCount=0;
3052 yyextra->functionProto.clear();
3053 yyextra->currentCmd = cmd;
3054 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3055 BEGIN( FnParam );
3056 return checkStructuralIndicator(yyscanner);
3057}

◆ handleFormatBlock()

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

Definition at line 3602 of file commentscan.l.

3603{
3604 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3605 if (!yyextra->spaceBeforeCmd.isEmpty())
3606 {
3607 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3608 yyextra->spaceBeforeCmd.clear();
3609 }
3610 if (optList.empty())
3611 {
3612 addOutput(yyscanner,"@"+s+" ");
3613 }
3614 else
3615 {
3616 addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
3617 }
3618 //printf("handleFormatBlock(%s) with option(%s)\n",qPrint(s),qPrint(opt));
3619 yyextra->blockName=s;
3620 yyextra->commentCount=0;
3621 BEGIN(FormatBlock);
3622 return FALSE;
3623}

References addOutput().

◆ handleGroupgraph()

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

Definition at line 4027 of file commentscan.l.

4028{
4029 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4030 yyextra->current->commandOverrides.override_groupGraph(true); // ON
4031 return FALSE;
4032}

References FALSE.

◆ handleGuard()

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

Definition at line 5086 of file commentscan.l.

5087{
5088 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
5089 CondParser prs;
5090 bool sectionEnabled = false;
5091 if (!expr.isEmpty())
5092 {
5093 sectionEnabled=prs.parse(yyextra->fileName,yyextra->lineNr,expr.stripWhiteSpace());
5094 }
5095 bool parentEnabled = yyextra->guards->top().parentVisible();
5096 if (parentEnabled)
5097 {
5098 if (
5099 (sectionEnabled && yyextra->guardType==Guard_If) ||
5100 (!sectionEnabled && yyextra->guardType==Guard_IfNot)
5101 ) // section is visible
5102 {
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.
5103
5104 yyextra->guards->top().setEnabled(true);
5105 yyextra->guards->top().setEnabledFound();
5106 BEGIN( GuardParamEnd );
5107 }
5108 else if (yyextra->guardType==Guard_ElseIf)
5109 {
5110 if (yyextra->guards->top().isEnabledFound())
5111 {
5112 yyextra->guards->top().setEnabled(false);
5113 BEGIN( SkipGuardedSection );
5114 }
5115 else if (sectionEnabled)
5116 {
5117 yyextra->guards->top().setEnabled(true);
5118 yyextra->guards->top().setEnabledFound();
5119 BEGIN( GuardParamEnd );
5120 }
5121 else
5122 {
5123 yyextra->guards->top().setEnabled(false);
5124 BEGIN( SkipGuardedSection );
5125 }
5126 }
5127 else // section is invisible
5128 {
5129 BEGIN( SkipGuardedSection );
5130 }
5131 }
5132 else // invisible because of parent
5133 {
5134 BEGIN( SkipGuardedSection );
5135 }
5136}

References CondParser::parse(), and QCString::stripWhiteSpace().

◆ handleHeaderFile()

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

Definition at line 3156 of file commentscan.l.

3157{
3158 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3159 BEGIN( ClassDocArg2 );
3160 return FALSE;
3161}

References FALSE.

◆ handleHideCallergraph()

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

Definition at line 3936 of file commentscan.l.

3937{
3938 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3939 yyextra->current->commandOverrides.override_callerGraph(false); // OFF
3940 return FALSE;
3941}

References FALSE.

◆ handleHideCallgraph()

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

Definition at line 3922 of file commentscan.l.

3923{
3924 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3925 yyextra->current->commandOverrides.override_callGraph(false); // OFF
3926 return FALSE;
3927}

References FALSE.

◆ handleHideCollaborationgraph()

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

Definition at line 4020 of file commentscan.l.

4021{
4022 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4023 yyextra->current->commandOverrides.override_collaborationGraph(false); // OFF
4024 return FALSE;
4025}

References FALSE.

◆ handleHideDirectoryGraph()

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

Definition at line 4006 of file commentscan.l.

4007{
4008 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4009 yyextra->current->commandOverrides.override_directoryGraph(false); // OFF
4010 return FALSE;
4011}

References FALSE.

◆ handleHideEnumValues()

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

Definition at line 3950 of file commentscan.l.

3951{
3952 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3953 yyextra->current->commandOverrides.override_enumValues(false); // OFF
3954 return FALSE;
3955}

References FALSE.

◆ handleHideGroupgraph()

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

Definition at line 4034 of file commentscan.l.

4035{
4036 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4037 yyextra->current->commandOverrides.override_groupGraph(false); // OFF
4038 return FALSE;
4039}

References FALSE.

◆ handleHideIncludedBygraph()

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

Definition at line 3992 of file commentscan.l.

3993{
3994 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3995 yyextra->current->commandOverrides.override_includedByGraph(false); // OFF
3996 return FALSE;
3997}

References FALSE.

◆ handleHideIncludegraph()

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

Definition at line 3985 of file commentscan.l.

3986{
3987 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3988 yyextra->current->commandOverrides.override_includeGraph(false); // OFF
3989 return FALSE;
3990}

References FALSE.

◆ handleHideInheritanceGraph()

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

Definition at line 4080 of file commentscan.l.

4081{
4082 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4083 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO); // OFF
4084 return FALSE;
4085}

References FALSE.

◆ handleHideInitializer()

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

Definition at line 3908 of file commentscan.l.

3909{
3910 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3911 yyextra->current->initLines = 0; // OFF
3912 return FALSE;
3913}

References FALSE.

◆ handleHideInlineSource()

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

Definition at line 3964 of file commentscan.l.

3965{
3966 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3967 yyextra->current->commandOverrides.override_inlineSource(false); // OFF
3968 return FALSE;
3969}

References FALSE.

◆ handleHideReferencedByRelation()

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

Definition at line 4094 of file commentscan.l.

4095{
4096 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4097 yyextra->current->commandOverrides.override_referencedByRelation(false); // OFF
4098 return FALSE;
4099}

References FALSE.

◆ handleHideReferencesRelation()

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

Definition at line 4108 of file commentscan.l.

4109{
4110 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4111 yyextra->current->commandOverrides.override_referencesRelation(false); // OFF
4112 return FALSE;
4113}

References FALSE.

◆ handleIdlException()

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

Definition at line 3208 of file commentscan.l.

3209{
3210 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3211 yyextra->currentCmd = cmd;
3212 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3213 BEGIN( ClassDocArg1 );
3214 return checkStructuralIndicator(yyscanner);
3215}

◆ handleIf()

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

Definition at line 3754 of file commentscan.l.

3755{
3756 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3757 yyextra->guardType = Guard_If;
3758 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3759 if (yyextra->guards->empty())
3760 {
3761 yyextra->guards->emplace(true);
3762 }
3763 else
3764 {
3765 bool enabled = yyextra->guards->top().isEnabled();
3766 yyextra->guards->emplace(enabled);
3767 }
3768 BEGIN(GuardParam);
3769 return FALSE;
3770}

References Guard_If.

◆ handleIFile()

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

Definition at line 3731 of file commentscan.l.

3732{
3733 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3734 addOutput(yyscanner,yytext);
3735 BEGIN(IFile);
3736 return FALSE;
3737}

References FALSE.

◆ handleIfNot()

bool handleIfNot ( 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->guardType = Guard_IfNot;
3776 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3777 if (yyextra->guards->empty())
3778 {
3779 yyextra->guards->emplace(true);
3780 }
3781 else
3782 {
3783 bool enabled = yyextra->guards->top().isEnabled();
3784 yyextra->guards->emplace(enabled);
3785 }
3786 BEGIN(GuardParam);
3787 return FALSE;
3788}

References Guard_IfNot.

◆ handleILine()

bool handleILine ( 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 addOutput(yyscanner,yytext);
3727 BEGIN(ILine);
3728 return FALSE;
3729}

References FALSE.

◆ handleImage()

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

Definition at line 3557 of file commentscan.l.

3558{
3559 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3560 for (const auto &opt : optList)
3561 {
3562 QCString locOpt(opt);
3563 locOpt = locOpt.stripWhiteSpace();
3564 if (locOpt.lower().startsWith("anchor:"))
3565 {
3566 addAnchor(yyscanner,locOpt.mid(7));
3567 break; // real option handling will be done later on
3568 }
3569 }
3570 if (optList.empty())
3571 {
3572 addOutput(yyscanner,"@"+s+" ");
3573 }
3574 else
3575 {
3576 addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
3577 }
3578 BEGIN(Comment);
3579 return FALSE;
static void addAnchor(yyscan_t yyscanner, const QCString &anchor, const QCString &title="")
3580}

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

◆ handleIncludedBygraph()

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

Definition at line 3978 of file commentscan.l.

3979{
3980 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3981 yyextra->current->commandOverrides.override_includedByGraph(true); // ON
3982 return FALSE;
3983}

References FALSE.

◆ handleIncludegraph()

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

Definition at line 3971 of file commentscan.l.

3972{
3973 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3974 yyextra->current->commandOverrides.override_includeGraph(true); // ON
3975 return FALSE;
3976}

References FALSE.

◆ handleIngroup()

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

Definition at line 3886 of file commentscan.l.

3887{
3888 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3889 yyextra->inGroupParamFound=FALSE;
3890 BEGIN( InGroupParam );
3891 return FALSE;
3892}

References FALSE.

◆ handleInherit()

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

Definition at line 4263 of file commentscan.l.

4264{
4265 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4266 BEGIN(InheritParam);
4267 return FALSE;
4268}

References FALSE.

◆ handleInheritanceGraph()

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

Definition at line 4041 of file commentscan.l.

4042{
4043 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4044 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4045 for (const auto &opt_ : optList)
4046 {
4047 QCString opt = QCString(opt_).stripWhiteSpace().lower();
4048 if (!opt.isEmpty())
4049 {
4050 if (opt == "yes")
4051 {
4052 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4053 }
4054 else if (opt == "graph")
4055 {
4056 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4057 }
4058 else if (opt == "builtin")
4059 {
4060 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4061 }
4062 else if (opt == "text")
4063 {
4064 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4065 }
4066 else if (opt == "no")
4067 {
4068 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4069 }
4070 else
4071 {
4072 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\inheritancegraph: '{}'",
4073 QCString(opt_).stripWhiteSpace());
4074 }
4075 }
4076 }
4077 return FALSE;
4078}

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

◆ handleInterface()

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

Definition at line 3199 of file commentscan.l.

3200{
3201 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3202 yyextra->currentCmd = cmd;
3203 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3204 BEGIN( ClassDocArg1 );
3205 return checkStructuralIndicator(yyscanner);
3206}

◆ handleInternal()

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

Definition at line 4123 of file commentscan.l.

4124{
4125 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4126 if (!Config_getBool(INTERNAL_DOCS))
4127 {
4128 // make sure some whitespace before a \internal command
4129 // is not treated as "documentation"
4130 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4131 {
4132 yyextra->current->doc.clear();
4133 }
4134 yyextra->condCount=0;
4135 BEGIN( SkipInternal );
4136 }
4137 else
4138 {
4139 // re-enabled for bug640828
4140 addOutput(yyscanner," \\internal ");
4141 yyextra->inInternalDocs = TRUE;
4142 }
4143 return FALSE;
#define TRUE
Definition qcstring.h:37
4144}

◆ handleIPrefix()

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

Definition at line 3746 of file commentscan.l.

3747{
3748 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3749 addOutput(yyscanner,"@iprefix ");
3750 BEGIN(IRaisePrefix);
3751 return FALSE;
3752}

References FALSE.

◆ handleIRaise()

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

Definition at line 3739 of file commentscan.l.

3740{
3741 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3742 BEGIN(IRaise);
3743 return FALSE;
3744}

References FALSE.

◆ handleLineInfo()

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

Definition at line 3711 of file commentscan.l.

3712{
3713 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3714 if (!yyextra->spaceBeforeCmd.isEmpty())
3715 {
3716 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3717 yyextra->spaceBeforeCmd.clear();
3718 }
3719 addOutput(yyscanner,QCString().setNum(yyextra->lineNr));
3720 return FALSE;
3721}

References addOutput().

◆ handleMainpage()

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

Definition at line 3225 of file commentscan.l.

3226{
3227 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3228 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeMainpageDoc);
3229 if (!stop)
3230 {
3231 yyextra->current->name = "mainpage";
3232 }
3233 setOutput(yyscanner,OutputDoc);
3234 BEGIN( PageDocArg2 );
3235 return stop;
3236}

◆ handleMemberOf()

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

Definition at line 3446 of file commentscan.l.

3447{
3448 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3449 if (!yyextra->current->relates.isEmpty())
3450 {
3451 warn(yyextra->fileName,yyextra->lineNr,
3452 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3453 }
3454 yyextra->current->relatesType = RelatesType::MemberOf;
3455 yyextra->currentCmd = cmd;
3456 BEGIN(RelatesParam1);
3457 return FALSE;
3458}

References warn.

◆ handleModule()

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

Definition at line 3147 of file commentscan.l.

3148{
3149 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3150 yyextra->currentCmd = cmd;
3151 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3152 BEGIN( ModuleDocArg1 );
3153 return checkStructuralIndicator(yyscanner);
3154}

◆ handleName()

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

Definition at line 3326 of file commentscan.l.

3327{
3328 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3329 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeMemberGrp);
3330 if (!stop)
3331 {
3332 yyextra->docGroup.clearHeader();
3333 BEGIN( NameParam );
3334 if (!yyextra->docGroup.isEmpty()) // end of previous member group
3335 {
3336 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,TRUE,true);
3337 }
3338 }
3339 return stop;
3340}

References TRUE.

◆ handleNamespace()

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

Definition at line 3113 of file commentscan.l.

3114{
3115 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3116 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3117 BEGIN( NameSpaceDocArg1 );
3118 return checkStructuralIndicator(yyscanner);
3119}

◆ handleNoop()

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

Definition at line 3319 of file commentscan.l.

3320{
3321 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3322 BEGIN( Noop );
3323 return FALSE;
3324}

References FALSE.

◆ handleNoSubGrouping()

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

Definition at line 3894 of file commentscan.l.

3895{
3896 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3897 yyextra->current->subGrouping = FALSE;
3898 return FALSE;
3899}

References FALSE.

◆ handleOverload()

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

Definition at line 3070 of file commentscan.l.

3071{
3072 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3073 yyextra->functionProto.clear();
3074 BEGIN(OverloadParam);
3075 return FALSE;
3076}

References FALSE.

◆ handlePackage()

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

Definition at line 3121 of file commentscan.l.

3122{
3123 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3124 bool stop=makeStructuralIndicator(yyscanner,EntryType::makePackageDoc);
3125 BEGIN( PackageDocArg1 );
3126 return stop;
3127}

◆ handlePage()

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

Definition at line 3217 of file commentscan.l.

3218{
3219 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3220 bool stop=makeStructuralIndicator(yyscanner,EntryType::makePageDoc);
3221 BEGIN( PageDocArg1 );
3222 return stop;
3223}

◆ handleParam()

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

Definition at line 3250 of file commentscan.l.

3251{
3252 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3253 // we need process param and retval arguments to escape leading underscores in case of
3254 // markdown processing, see bug775493
3255 addOutput(yyscanner,"@param ");
3256 BEGIN( ParamArg1 );
3257 return FALSE;
3258}

References FALSE.

◆ handleParBlock()

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

Definition at line 3386 of file commentscan.l.

3387{
3388 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3389 if (yyextra->insideParBlock)
3390 {
3391 warn(yyextra->fileName,yyextra->lineNr,
3392 "found \\parblock command while already in a parblock!");
3393 }
3394 if (!yyextra->spaceBeforeCmd.isEmpty())
3395 {
3396 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3397 yyextra->spaceBeforeCmd.clear();
3398 }
3399 addOutput(yyscanner,"@parblock ");
3400 yyextra->insideParBlock = TRUE;
3401 return FALSE;
3402}

References warn.

◆ handlePrivate()

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

Definition at line 4160 of file commentscan.l.

4161{
4162 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4163 yyextra->current->protection = Protection::Private;
4164 return FALSE;
4165}

References FALSE.

◆ handlePrivateSection()

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

Definition at line 4167 of file commentscan.l.

4168{
4169 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4170 yyextra->current->protection = yyextra->protection = Protection::Private;
4171 return FALSE;
4172}

References FALSE.

◆ handleProtected()

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

Definition at line 4174 of file commentscan.l.

4175{
4176 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4177 yyextra->current->protection = Protection::Protected;
4178 return FALSE;
4179}

References FALSE.

◆ handleProtectedSection()

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

Definition at line 4181 of file commentscan.l.

4182{
4183 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4184 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4185 return FALSE;
4186}

References FALSE.

◆ handleProtocol()

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

Definition at line 3163 of file commentscan.l.

3164{ // Obj-C protocol
3165 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3166 yyextra->currentCmd = cmd;
3167 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3168 BEGIN( ClassDocArg1 );
3169 return checkStructuralIndicator(yyscanner);
3170}

◆ handlePublic()

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

Definition at line 4188 of file commentscan.l.

4189{
4190 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4191 yyextra->current->protection = Protection::Public;
4192 return FALSE;
4193}

References FALSE.

◆ handlePublicSection()

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

Definition at line 4195 of file commentscan.l.

4196{
4197 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4198 yyextra->current->protection = yyextra->protection = Protection::Public;
4199 return FALSE;
4200}

References FALSE.

◆ handlePure()

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

Definition at line 4153 of file commentscan.l.

4154{
4155 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4156 yyextra->current->virt = Specifier::Pure;
4157 return FALSE;
4158}

References FALSE.

◆ handleQualifier()

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

Definition at line 4115 of file commentscan.l.

4116{
4117 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4118 yyextra->currentCmd = cmd;
4119 BEGIN(Qualifier);
4120 return FALSE;
4121}

References FALSE.

◆ handleRaiseWarning()

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

Definition at line 3311 of file commentscan.l.

3312{
3313 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3314 yyextra->raiseWarning = "";
3315 BEGIN( RaiseWarning );
3316 return FALSE;
3317}

References FALSE.

◆ handleReferencedByRelation()

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

Definition at line 4087 of file commentscan.l.

4088{
4089 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4090 yyextra->current->commandOverrides.override_referencedByRelation(true); // ON
4091 return FALSE;
4092}

References FALSE.

◆ handleReferencesRelation()

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

Definition at line 4101 of file commentscan.l.

4102{
4103 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4104 yyextra->current->commandOverrides.override_referencesRelation(true); // ON
4105 return FALSE;
4106}

References FALSE.

◆ handleRefItem()

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

Definition at line 3460 of file commentscan.l.

3461{
3462 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3463 addOutput(yyscanner,"@refitem ");
3464 BEGIN(LineParam);
3465 return FALSE;
3466}

References FALSE.

◆ handleRelated()

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

Definition at line 3418 of file commentscan.l.

3419{
3420 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3421 if (!yyextra->current->relates.isEmpty())
3422 {
3423 warn(yyextra->fileName,yyextra->lineNr,
3424 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3425 }
3426 yyextra->current->relatesType = RelatesType::Simple;
3427 yyextra->currentCmd = cmd;
3428 BEGIN(RelatesParam1);
3429 return FALSE;
3430}

References warn.

◆ handleRelatedAlso()

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

Definition at line 3432 of file commentscan.l.

3433{
3434 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3435 if (!yyextra->current->relates.isEmpty())
3436 {
3437 warn(yyextra->fileName,yyextra->lineNr,
3438 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3439 }
3440 yyextra->current->relatesType = RelatesType::Duplicate;
3441 yyextra->currentCmd = cmd;
3442 BEGIN(RelatesParam1);
3443 return FALSE;
3444}

References warn.

◆ handleRequirement()

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

Definition at line 3498 of file commentscan.l.

3499{
3500 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3501 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeRequirementDoc);
3502 BEGIN( RequirementLabel );
3503 return stop;
3504}

◆ handleRetval()

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

Definition at line 3260 of file commentscan.l.

3261{
3262 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3263 addOutput(yyscanner,"@retval ");
3264 BEGIN( ParamArg1 );
3265 return FALSE;
3266}

References FALSE.

◆ handleSatisfies()

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

Definition at line 3506 of file commentscan.l.

3507{
3508 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3509 BEGIN( SatisfiesLabel );
3510 return false;
3511}

◆ handleSection()

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

Definition at line 3468 of file commentscan.l.

3469{
3470 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3471 setOutput(yyscanner,OutputDoc);
3472 //printf("handleSection(%s) raiseLevel=%d\n",qPrint(s),yyextra->raiseLevel);
3473 BEGIN(SectionLabel);
3474 yyextra->sectionLabel.clear();
3475 // determine natural section level
3476 if (s=="section") yyextra->sectionLevel=SectionType::Section;
3477 else if (s=="subsection") yyextra->sectionLevel=SectionType::Subsection;
3478 else if (s=="subsubsection") yyextra->sectionLevel=SectionType::Subsubsection;
3479 else if (s=="paragraph") yyextra->sectionLevel=SectionType::Paragraph;
3480 else if (s=="subparagraph") yyextra->sectionLevel=SectionType::Subparagraph;
3481 else if (s=="subsubparagraph") yyextra->sectionLevel=SectionType::Subsubparagraph;
3482 // raise it if requested
3483 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,SectionType::MaxLevel);
3484 // rewrite the update section level to the output
3485 switch (yyextra->sectionLevel)
3486 {
3487 case SectionType::Section: addOutput(yyscanner,"@section "); break;
3488 case SectionType::Subsection: addOutput(yyscanner,"@subsection "); break;
3489 case SectionType::Subsubsection: addOutput(yyscanner,"@subsubsection "); break;
3490 case SectionType::Paragraph: addOutput(yyscanner,"@paragraph "); break;
3491 case SectionType::Subparagraph: addOutput(yyscanner,"@subparagraph "); break;
3492 case SectionType::Subsubparagraph: addOutput(yyscanner,"@subsubparagraph "); break;
3493 default: addOutput(yyscanner,"@"+s+" "); break;
3494 }
3495 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
3496}

References SectionType::MaxLevel, OutputDoc, SectionType::Paragraph, SectionType::Section, SectionType::Subparagraph, SectionType::Subsection, SectionType::Subsubparagraph, and SectionType::Subsubsection.

◆ handleShowEnumValues()

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

Definition at line 3943 of file commentscan.l.

3944{
3945 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3946 yyextra->current->commandOverrides.override_enumValues(true); // ON
3947 return FALSE;
3948}

References FALSE.

◆ handleShowInitializer()

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

Definition at line 3901 of file commentscan.l.

3902{
3903 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3904 yyextra->current->initLines = 100000; // ON
3905 return FALSE;
3906}

References FALSE.

◆ handleShowInlineSource()

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

Definition at line 3957 of file commentscan.l.

3958{
3959 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3960 yyextra->current->commandOverrides.override_inlineSource(true); // ON
3961 return FALSE;
3962}

References FALSE.

◆ handleStatic()

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

Definition at line 4146 of file commentscan.l.

4147{
4148 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4149 yyextra->current->isStatic = TRUE;
4150 return FALSE;
4151}

References FALSE, and TRUE.

◆ handleStruct()

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

Definition at line 3190 of file commentscan.l.

3191{
3192 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3193 yyextra->currentCmd = cmd;
3194 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3195 BEGIN( ClassDocArg1 );
3196 return checkStructuralIndicator(yyscanner);
3197}

◆ handleSubpage()

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

Definition at line 3520 of file commentscan.l.

3521{
3522 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3523 if (!yyextra->current->section.isEmpty() &&
3524 !yyextra->current->section.isPageDoc() &&
3525 !yyextra->current->section.isMainpageDoc()
3526 )
3527 {
3528 warn(yyextra->fileName,yyextra->lineNr,
3529 "found \\subpage command in a comment block that is not marked as a page!");
3530 }
3531 if (!yyextra->spaceBeforeCmd.isEmpty())
3532 {
3533 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3534 yyextra->spaceBeforeCmd.clear();
3535 }
3536 addOutput(yyscanner,"@"+s+" ");
3537 BEGIN(SubpageLabel);
3538 return FALSE;
3539}

References warn.

◆ handleTest()

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

Definition at line 3351 of file commentscan.l.

3352{
3353 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3354 yyextra->newXRefKind = XRef_Test;
3355 setOutput(yyscanner,OutputXRef);
3356 yyextra->xrefKind = XRef_Test;
3357 return FALSE;
3358}

References FALSE, OutputXRef, and XRef_Test.

◆ handleToc()

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

Definition at line 4202 of file commentscan.l.

4203{
4204 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4205 if (yyextra->current->section.isPageDoc() ||
4206 yyextra->current->section.isMainpageDoc())
4207 {
4208 for (const auto &opt_ : optList)
4209 {
4210 QCString opt = QCString(opt_).stripWhiteSpace().lower();
4211 int level = SectionType::MaxLevel;
4212 int i = opt.find(':');
4213 if (i>0) // found ':' but not on position 0 what would mean just a level
4214 {
4215 char dum=0;
4216 if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1)
4217 {
4218 warn(yyextra->fileName,yyextra->lineNr,"Unknown option:level specified with \\tableofcontents: '{}'",
4220 opt = "";
4221 }
4222 else
4223 {
4224 level = level<=0 ? SectionType::MaxLevel : std::min(level,SectionType::MaxLevel);
4225 opt = opt.left(i).stripWhiteSpace();
4226 }
4227 }
4228 if (!opt.isEmpty())
4229 {
4230 if (opt == "html")
4231 {
4232 yyextra->current->localToc.enableHtml(level);
4233 }
4234 else if (opt == "latex")
4235 {
4236 yyextra->current->localToc.enableLatex(level);
4237 }
4238 else if (opt == "xml")
4239 {
4240 yyextra->current->localToc.enableXml(level);
4241 }
4242 else if (opt == "docbook")
4243 {
4244 yyextra->current->localToc.enableDocbook(level);
4245 }
4246 else
4247 {
4248 warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\tableofcontents: '{}'",
4249 QCString(opt_).stripWhiteSpace());
4250 }
4251 }
4252 }
4253 if (yyextra->current->localToc.nothingEnabled())
4254 {
4255 // for backward compatibility
4256 yyextra->current->localToc.enableHtml(SectionType::MaxLevel);
4257 yyextra->current->localToc.enableXml(SectionType::MaxLevel);
4258 }
4259 }
4260 return FALSE;
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString right(size_t len) const
Definition qcstring.h:234
QCString left(size_t len) const
Definition qcstring.h:229
4261}

References QCString::data(), 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 3342 of file commentscan.l.

3343{
3344 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3345 yyextra->newXRefKind = XRef_Todo;
3346 setOutput(yyscanner,OutputXRef);
3347 yyextra->xrefKind = XRef_Todo;
3348 return FALSE;
3349}

References FALSE, OutputXRef, and XRef_Todo.

◆ handleUnion()

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

Definition at line 3181 of file commentscan.l.

3182{
3183 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3184 yyextra->currentCmd = cmd;
3185 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3186 BEGIN( ClassDocArg1 );
3187 return checkStructuralIndicator(yyscanner);
3188}

◆ handleVerifies()

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

Definition at line 3513 of file commentscan.l.

3514{
3515 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3516 BEGIN( VerifiesLabel );
3517 return false;
3518}

◆ handleWeakGroup()

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

Definition at line 3104 of file commentscan.l.

3105{
3106 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3107 bool stop=makeStructuralIndicator(yyscanner,EntryType::makeGroupDoc);
3108 yyextra->current->groupDocType = Entry::GROUPDOC_WEAK;
3109 BEGIN( GroupDocArg1 );
3110 return stop;
@ GROUPDOC_WEAK
weakgroup
Definition entry.h:124
3111}

References Entry::GROUPDOC_WEAK.

◆ handleXRefItem()

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

Definition at line 3378 of file commentscan.l.

3379{
3380 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
3381 yyextra->newXRefKind = XRef_Item;
3382 BEGIN(XRefItemParam1);
3383 return FALSE;
3384}

References FALSE, and XRef_Item.

◆ initParser()

void initParser ( yyscan_t yyscanner)
static

Definition at line 4332 of file commentscan.l.

4333{
4334 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4335 yyextra->sectionLabel.clear();
4336 yyextra->sectionTitle.clear();
4337 yyextra->docGroup.clearHeader();
4338 yyextra->insideParBlock = FALSE;
4339}

References FALSE.

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

◆ lineCount()

void lineCount ( yyscan_t yyscanner)
static

Definition at line 4376 of file commentscan.l.

4377{
4378 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4379 for( const char* c = yytext ; *c ; ++c )
4380 yyextra->lineNr += (*c == '\n') ;
4381}

◆ makeStructuralIndicator()

bool makeStructuralIndicator ( yyscan_t yyscanner,
MakeEntryType maker )
static

Definition at line 4350 of file commentscan.l.

4351{
4352 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4353 assert(maker!=nullptr); // detect programming error
4354 //printf("yyextra->current->section=%x\n",yyextra->current->section);
4355 if (yyextra->current->section.isDoc())
4356 {
4357 return true;
4358 }
4359 else if (maker)
4360 {
4361 yyextra->needNewEntry = true;
4362 yyextra->current->section = maker();
4363 yyextra->current->fileName = yyextra->fileName;
4364 yyextra->current->startLine = yyextra->lineNr;
4365 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4366 return false;
4367 }
4368 else
4369 {
4370 return false;
4371 }
4372}

◆ sectionLevelToType()

SectionType sectionLevelToType ( int level)
static

Definition at line 4559 of file commentscan.l.

4560{
4561 if (level>=0 && level<SectionType::MaxLevel) return SectionType(level);
4562 return SectionType::Anchor;
4563}

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

Referenced by addSection().

◆ setOutput()

void setOutput ( yyscan_t yyscanner,
OutputContext ctx )
inlinestatic

Definition at line 4657 of file commentscan.l.

4658{
4659 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4660 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4661 // determine append flag for the next item (i.e. the end of this item)
4662 yyextra->xrefAppendFlag = !yyextra->inBody &&
4663 yyextra->inContext==OutputXRef && ctx==OutputXRef && // two consecutive xref items
4664 yyextra->newXRefKind==yyextra->xrefKind && // of the same kind
4665 (yyextra->xrefKind!=XRef_Item ||
4666 yyextra->newXRefItemKey==yyextra->xrefItemKey); // with the same key if \xrefitem
4667 //printf("%d && %d && %d && (%d || %d)\n",
4668 // yyextra->inContext==OutputXRef,
4669 // ctx==OutputXRef,
4670 // yyextra->newXRefKind==yyextra->xrefKind,
4671 // yyextra->xrefKind!=XRef_Item,
4672 // yyextra->newXRefItemKey==yyextra->xrefItemKey);
4673 //printf("refKind=%d yyextra->newXRefKind=%d xrefAppendToPrev=%d yyextra->xrefAppendFlag=%d\n",
4674 // yyextra->xrefKind,yyextra->newXRefKind,xrefAppendToPrev,yyextra->xrefAppendFlag);
4675
4676 //printf("setOutput(yyscanner,yyextra->inContext=%d ctx=%d)\n",yyextra->inContext,ctx);
4677 if (yyextra->inContext==OutputXRef) // end of XRef section => add the item
4678 {
4679 // See if we can append this new xref item to the previous one.
4680 // We know this at the start of the next item of the same
4681 // type and need to remember this until the end of that item.
4682 switch(yyextra->xrefKind)
4683 {
4684 case XRef_Todo:
4685 addXRefItem(yyscanner,QCString("todo"),
4686 theTranslator->trTodo(),
4687 theTranslator->trTodoList(),
4688 xrefAppendToPrev
4689 );
4690 break;
4691 case XRef_Test:
4692 addXRefItem(yyscanner,QCString("test"),
4693 theTranslator->trTest(),
4694 theTranslator->trTestList(),
4695 xrefAppendToPrev
4696 );
4697 break;
4698 case XRef_Bug:
4699 addXRefItem(yyscanner,QCString("bug"),
4700 theTranslator->trBug(),
4701 theTranslator->trBugList(),
4702 xrefAppendToPrev
4703 );
4704 break;
4705 case XRef_Deprecated:
4706 addXRefItem(yyscanner,QCString("deprecated"),
4707 theTranslator->trDeprecated(),
4708 theTranslator->trDeprecatedList(),
4709 xrefAppendToPrev
4710 );
4711 break;
4712 case XRef_Item: // user defined list
4713 addXRefItem(yyscanner,yyextra->xrefItemKey,
4714 yyextra->xrefItemTitle,
4715 yyextra->xrefListTitle,
4716 xrefAppendToPrev
4717 );
4718 break;
4719 case XRef_None:
4720 ASSERT(0);
4721 break;
4722 }
4723 }
4724 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
4725
4726 int oldContext = yyextra->inContext;
4727 yyextra->inContext = ctx;
4728 if (yyextra->inContext!=OutputXRef && yyextra->inBody) yyextra->inContext=OutputInbody;
4729 switch(yyextra->inContext)
4730 {
4731 case OutputDoc:
4732 if (oldContext!=yyextra->inContext)
4733 {
4734 stripTrailingWhiteSpace(yyextra->current->doc);
4735 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4736 if (yyextra->current->docFile.isEmpty())
4737 {
4738 yyextra->current->docFile = yyextra->fileName;
4739 yyextra->current->docLine = yyextra->lineNr;
4740 }
4741 }
4742 yyextra->pOutputString = &yyextra->current->doc;
4743 break;
4744 case OutputBrief:
4745 {
4746 if (oldContext!=yyextra->inContext)
4747 {
4748 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4749 if (yyextra->current->briefFile.isEmpty())
4750 {
4751 yyextra->current->briefFile = yyextra->fileName;
4752 yyextra->current->briefLine = yyextra->lineNr;
4753 }
4754 }
4755 bool foundMatch = false;
4756 if (yyextra->current->brief.stripWhiteSpace().isEmpty()) // we only want one brief
4757 // description even if multiple
4758 // are given...
4759 {
4760 foundMatch = true;
4761 }
4762 else
4763 {
4764 std::string str = yyextra->current->brief.str();
4766 if (reg::match(str,match,nonBrief_re)) // match found
4767 {
4768 size_t cnt = 0;
4769 for (size_t i = 0; i < match[2].str().size(); i++)
4770 {
4771 if (match[2].str()[i] == '\n') cnt++;
4772 }
4773 if (cnt>0)
4774 {
4775 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4776 // set warning line correct
4777 yyextra->current->brief += " \\iline " + QCString().setNum(cnt + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
4778 }
4779 foundMatch = true;
4780 }
4781 }
4782 if (foundMatch)
4783 {
4784 yyextra->pOutputString = &yyextra->current->brief;
4785 }
4786 else
4787 {
4788 if (!yyextra->current->doc.isEmpty()) // when appending parts add a new line
4789 {
4790 yyextra->current->doc += "\n";
4791 }
4792 yyextra->pOutputString = &yyextra->current->doc;
4793 yyextra->inContext = OutputDoc; // need to switch to detailed docs, see bug 631380
4794 }
4795 }
4796 break;
4797 case OutputXRef:
4798 yyextra->pOutputString = &yyextra->outputXRef;
4799 // first item found, so can't append to previous
4800 //yyextra->xrefAppendFlag = FALSE;
4801 break;
4802 case OutputInbody:
4803 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4804 break;
4805 }
QCString & setNum(short n)
Definition qcstring.h:459
static void stripTrailingWhiteSpace(QCString &s)
4806}

References addXRefItem(), ASSERT, OutputXRef, theTranslator, XRef_Bug, XRef_Deprecated, XRef_Item, XRef_None, XRef_Test, and XRef_Todo.

Referenced by endBrief(), handleCopyBrief(), handleCopyDoc(), and CommentScanner::parseCommentBlock().

◆ stateToString()

const char * stateToString ( int state)
static

◆ stripQuotes()

QCString stripQuotes ( const char * s)
static

Definition at line 4385 of file commentscan.l.

4386{
4387 QCString name;
4388 if (s==nullptr || *s==0) return name;
4389 name=s;
4390 if (name.at(0)=='"' && name.at(name.length()-1)=='"')
4391 {
4392 name=name.mid(1,name.length()-2);
4393 }
4394 return name;
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
4395}

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

◆ stripTrailingWhiteSpace()

void stripTrailingWhiteSpace ( QCString & s)
static

Definition at line 4629 of file commentscan.l.

4630{
4631 size_t len = s.length();
4632 int i = (int)len-1;
4633 while (i>=0)
4634 {
4635 char c = s.at(i);
4636 if (c==' ' || c=='\t' || c=='\r') // normal whitespace
4637 {
4638 i--;
4639 }
4640 else if (c=='r' && i>=7 && literal_at(s.data()+i-7,"\\ilinebr")) // special line break marker
4641 {
4642 i-=8;
4643 }
4644 else // non-whitespace
4645 {
4646 break;
4647 }
4648 }
4649 //printf("stripTrailingWhitespace(%s) i=%d len=%d\n",qPrint(s),i,len);
4650 if (i!=(int)len-1)
4651 {
4652 s.resize(i+1); // string up to and including char at pos i
4653 }
void resize(size_t newlen)
Definition qcstring.h:180
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
4654}

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

◆ yylex()

int yylex ( yyscan_t yyscanner)

Definition at line 716 of file commentscan.l.

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

◆ yyread()

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

Definition at line 4908 of file commentscan.l.

4909{
4910 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
4911 yyextra->prevPosition=yyextra->inputPosition;
4912 int c=0;
4913 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4914 {
4915 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4916 //printf("%d (%c)\n",*buf,*buf);
4917 c++; buf++;
4918 }
4919 return c;
4920}

Variable Documentation

◆ docCmdMap

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

Definition at line 213 of file commentscan.l.

213 {
214 // command name handler function command spacing section handling
218 { "arg", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
219 { "attention", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
220 { "author", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
221 { "authors", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
235 { "copyright", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
236 { "date", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
241 { "diafile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
244 { "docbookinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
246 { "dontinclude", { nullptr, CommandSpacing::Invisible, SectionHandling::Break }},
248 { "dotfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
251 { "endcode", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
252 { "enddocbookonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
253 { "enddot", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
254 { "endhtmlonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
255 { "endicode", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
257 { "endlatexonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
258 { "endlink", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
259 { "endmanonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
260 { "endmsc", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
262 { "endrtfonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
263 { "endsecreflist", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
264 { "enduml", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
265 { "endverbatim", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
266 { "endxmlonly", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
269 { "exception", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
289 { "htmlinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
301 { "important", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
302 { "include", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
305 { "includelineno", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
311 { "invariant", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
315 { "latexinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
317 { "li", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
318 { "line", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
319 { "line", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
323 { "maninclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
328 { "mscfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
333 { "note", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
337 { "par", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
341 { "plantumlfile", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
342 { "post", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
343 { "pre", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
360 { "remark", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
361 { "remarks", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
363 { "result", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
364 { "return", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
365 { "returns", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
367 { "rtfinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
369 { "sa", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
371 { "secreflist", { nullptr, CommandSpacing::Invisible, SectionHandling::Break }},
373 { "see", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
375 { "showdate", { nullptr, CommandSpacing::Inline, SectionHandling::Allowed }},
381 { "since", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
382 { "skip", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
383 { "skipline", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
384 { "snippet", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
385 { "snippetlineno", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
396 { "throw", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
397 { "throws", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
399 { "tparam", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
402 { "until", { nullptr, CommandSpacing::Block, SectionHandling::Escape }},
403 { "until", { nullptr, CommandSpacing::Invisible, SectionHandling::Escape }},
406 { "verbinclude", { nullptr, CommandSpacing::Inline, SectionHandling::Break }},
408 { "version", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
409 { "vhdlflow", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
410 { "warning", { nullptr, CommandSpacing::Block, SectionHandling::Break }},
412 { "xmlinclude", { nullptr, CommandSpacing::Inline, 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 handleRequirement(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 handleVerifies(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 handleSatisfies(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 &)
415};

◆ g_citeMutex

std::mutex g_citeMutex
static

Definition at line 538 of file commentscan.l.

Referenced by addCite().

◆ g_formulaMutex

std::mutex g_formulaMutex
static

Definition at line 537 of file commentscan.l.

Referenced by addFormula().

◆ g_sectionMutex

std::mutex g_sectionMutex
static

Definition at line 536 of file commentscan.l.

Referenced by addAnchor(), addRequirementId(), 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().