Doxygen
Loading...
Searching...
No Matches
doctokenizer.l
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * $Id: $
4 *
5 *
6 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 * Documents produced by Doxygen are derivative works derived from the
15 * input used in their production; they are not affected by this license.
16 *
17 */
18
19%option never-interactive
20%option prefix="doctokenizerYY"
21%option reentrant
22%option extra-type="struct doctokenizerYY_state *"
23%top{
24#include <stdint.h>
25// forward declare yyscan_t to improve type safety
26#define YY_TYPEDEF_YY_SCANNER_T
27struct yyguts_t;
28typedef yyguts_t *yyscan_t;
yyguts_t * yyscan_t
Definition code.l:24
29}
30
31%{
32
33#include <ctype.h>
34#include <stack>
35#include <string>
36#include <cassert>
37
38#include "doctokenizer.h"
39#include "cmdmapper.h"
40#include "config.h"
41#include "message.h"
42#include "section.h"
43#include "membergroup.h"
44#include "definition.h"
45#include "doxygen.h"
46#include "portable.h"
47#include "cite.h"
48#include "regex.h"
49#include "debug.h"
50#include "docnode.h"
51#include "stringutil.h"
52
53#define YY_NO_INPUT 1
54#define YY_NO_UNISTD_H 1
55
56//--------------------------------------------------------------------------
57
59{
60 DocLexerContext(const TokenInfo &tk,int r,int lvl,yy_size_t pos,const char *s,YY_BUFFER_STATE bs)
61 : token(tk), rule(r), autoListLevel(lvl), inputPos(pos), inputString(s), state(bs) {}
63 int rule;
65 yy_size_t inputPos;
66 const char *inputString;
67 YY_BUFFER_STATE state;
68};
69
71{
72
73 // context for tokenizer phase
76 yy_size_t inputPos = 0;
77 const char *inputString = nullptr;
79 bool insidePre = false;
81 bool markdownSupport=true;
82 bool insideHtmlLink=false;
83 bool expectQuote=false;
84
85 // context for section finding phase
86 const Definition *definition = nullptr;
92 std::stack< std::unique_ptr<DocLexerContext> > lexerStack;
93 std::stack<int> stateStack;
94
95 int yyLineNr = 0;
96};
97
98#define lineCount(s,len) do { for(int i=0;i<(int)len;i++) if (s[i]=='\n') yyextra->yyLineNr++; } while(0)
99
100
101[[maybe_unused]] static const char *stateToString(int state);
102
103static int yyread(yyscan_t yyscanner,char *buf,int max_size);
104static void handleHtmlTag(yyscan_t yyscanner,const char *text);
105static void processSection(yyscan_t yyscanner);
106
107//--------------------------------------------------------------------------
108
110{
111 int nl1 = text.find('\n');
112 int nl2 = text.find("\\ilinebr");
113 if (nl1!=-1 && nl1<nl2)
114 {
115 return text.mid(nl1+1);
116 }
117 if (nl2!=-1)
118 {
119 if (text.at(nl2+8)==' ') nl2++; // skip space after \\ilinebr
120 return text.mid(nl2+8);
121 }
122 return text;
123}
124
125//--------------------------------------------------------------------------
126
127static int computeIndent(const char *str,size_t length)
128{
129 if (str==0 || length==std::string::npos) return 0;
130 size_t i;
131 int indent=0;
132 int tabSize=Config_getInt(TAB_SIZE);
133 for (i=0;i<length;i++)
134 {
135 if (str[i]=='\t')
136 {
137 indent+=tabSize - (indent%tabSize);
138 }
139 else if (str[i]=='\n')
140 {
141 indent=0;
142 }
143 else if (literal_at(&str[i],"\\ilinebr"))
144 {
145 indent=0;
146 i+=7;
147 if (str[i+1]==' ') i++; // also eat space after \\ilinebr if present
148 }
149 else
150 {
151 indent++;
152 }
153 }
154 //printf("input('%s')=%d\n",str,indent);
155 return indent;
156}
157
158//--------------------------------------------------------------------------
159
160#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
161//--------------------------------------------------------------------------
162
163#undef YY_INPUT
164#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
165
166// otherwise the filename would be the name of the converted file (*.cpp instead of *.l)
167static inline const char *getLexerFILE() {return __FILE__;}
168#include "doxygen_lex.h"
169
170//--------------------------------------------------------------------------
171#define YY_DECL static Token doctokenizerYYlex(yyscan_t yyscanner)
172//#define LOCAL_YY_DECL local_doctokenizer(yyscan_t yyscanner)
173#ifndef yyterminate
174#define yyterminate() return Token::make_TK_EOF()
175#endif
176
The common base class of all entity definitions found in the sources.
Definition definition.h:77
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
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
#define Config_getInt(name)
Definition config.h:34
QCString extractPartAfterNewLine(const QCString &text)
static void processSection(yyscan_t yyscanner)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static const char * stateToString(int state)
static void handleHtmlTag(yyscan_t yyscanner, const char *text)
static const char * getLexerFILE()
static int computeIndent(const char *str, size_t length)
Portable versions of functions that are platform dependent.
Some helper functions for std::string.
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
TokenInfo token
const char * inputString
yy_size_t inputPos
DocLexerContext(const TokenInfo &tk, int r, int lvl, yy_size_t pos, const char *s, YY_BUFFER_STATE bs)
YY_BUFFER_STATE state
Data associated with a token used by the comment block parser.
const Definition * definition
std::stack< int > stateStack
const char * inputString
std::stack< std::unique_ptr< DocLexerContext > > lexerStack
177%}
178
179CMD ("\\"|"@")
180WS [ \t\r\n]
181BLANK [ \t\r]
182BLANKopt {BLANK}*
183ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
184LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
185REQID [a-z_A-Z0-9\x80-\xFF\-]+
186CODEID [a-zA-Z][a-zA-Z0-9+]*
187PHPTYPE [?]?[\\:a-z_A-Z0-9\x80-\xFF\-]+
188CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
189CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]
190CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
191DOXYCFG [A-Z][A-Z_0-9]*
192MAILADDR ("mailto:")?[a-z_A-Z0-9\x80-\xFF.+-]+"@"[a-z_A-Z0-9\x80-\xFf-]+("."[a-z_A-Z0-9\x80-\xFf\-]+)+[a-z_A-Z0-9\x80-\xFf\-]+
193MAILWS [\t a-z_A-Z0-9\x80-\xFF+-]
194MAILADDR2 {MAILWS}+{BLANK}+("at"|"AT"|"_at_"|"_AT_"){BLANK}+{MAILWS}+("dot"|"DOT"|"_dot_"|"_DOT_"|"point"|"POINT"|"_point_"|"_POINT_"){BLANK}+{MAILWS}+
195LISTITEM {BLANK}*[-]("#")?{WS}
196MLISTITEM {BLANK}*[+*]{WS}
197OLISTITEM {BLANK}*("0"|[1-9][0-9]*)"."{BLANK}
198CLISTITEM {BLANK}*[-]{BLANK}*"\‍["[ xX]"\‍]"
199ENDLIST {BLANK}*"."{BLANK}*(\n|"\\ilinebr")
200ATTRNAME [a-z_A-Z\x80-\xFF][:a-z_A-Z0-9\x80-\xFF\-]*
201ATTRIB {ATTRNAME}{WS}*("="{WS}*(("\""[^\"]*"\"")|("'"[^\']*"'")|[^ \t\r\n'"><]+))?
202URLCHAR [a-z_A-Z0-9\!\~\,\:\;\'\$\?\@\&\%\#\.\-\+\/\=\x80-\xFF]
203URLMASK ({URLCHAR}+([({]{URLCHAR}*[)}])?)+
204URLPROTOCOL ("http:"|"https:"|"ftp:"|"ftps:"|"sftp:"|"file:"|"news:"|"irc:"|"ircs:")
205FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
206FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
207FILECHARS {FILEICHAR}*{FILEECHAR}+
208HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
209VFILEMASK {FILECHARS}("."{FILECHARS})*
210FILEMASK {VFILEMASK}|{HFILEMASK}
211LINKMASK [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"){BLANK}+)?
212VERBATIM "verbatim"{BLANK}*
213SPCMD1 {CMD}([a-z_A-Z][a-z_A-Z0-9]*|{VERBATIM}|"--"|"---")
214SPCMD2 {CMD}[\\@<>&$#%~".+=|!?-]
215SPCMD3 {CMD}_form#[0-9]+
216SPCMD4 {CMD}"::"
217SPCMD5 {CMD}":"
218INOUT "in"|"out"|("in"{BLANK}*","?{BLANK}*"out")|("out"{BLANK}*","?{BLANK}*"in")
219PARAMIO {CMD}param{BLANK}*"["{BLANK}*{INOUT}{BLANK}*"]"
220VARARGS "..."
221TEMPCHAR [a-z_A-Z0-9.,: \t\*\&\‍(\‍)\‍[\‍]]
222FUNCCHAR [a-z_A-Z0-9,:<> \t\n\^\*\&\‍[\‍]]|{VARARGS}|"\\ilinebr"
223FUNCPART {FUNCCHAR}*("("{FUNCCHAR}*")"{FUNCCHAR}*)?
224SCOPESEP "::"|"#"|"."
225TEMPLPART "<"{TEMPCHAR}*("<"{TEMPCHAR}*("<"{TEMPCHAR}*">")?">")?">"
226ANONNS "anonymous_namespace{"[^}]*"}"
227SCOPEPRE (({ID}{TEMPLPART}?)|{ANONNS}){SCOPESEP}
228SCOPEKEYS ":"({ID}":")*
229SCOPECPP {SCOPEPRE}*(~)?{ID}{TEMPLPART}?
230SCOPECPPN {SCOPEPRE}*(~)?{ID}
231SCOPEOBJC {SCOPEPRE}?{ID}{SCOPEKEYS}?
232SCOPEMASK {SCOPECPP}|{SCOPEOBJC}
233SCOPEMSKN {SCOPECPPN}|{SCOPEOBJC}
234FUNCARG "("{FUNCPART}")"({BLANK}*("volatile"|"const"){BLANK})?
235FUNCARG2 "("{FUNCPART}")"({BLANK}*("volatile"|"const"))?
236OPNEW {BLANK}+"new"({BLANK}*"[]")?
237OPDEL {BLANK}+"delete"({BLANK}*"[]")?
238OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()"|"<=>"
239OPCAST {BLANK}+[^<(\r\n.,][^(\r\n.,]*
240OPMASK ({BLANK}*{OPNORM}{FUNCARG})
241OPMASKOPT ({BLANK}*{OPNORM}{FUNCARG}?)|({OPCAST}{FUNCARG})
242OPMASKOP2 ({BLANK}*{OPNORM}{FUNCARG2}?)|({OPCAST}{FUNCARG2})
243LNKWORD1 ("::"|"#")?{SCOPEMASK}
244LNKWORDN ("::"|"#")?{SCOPEMSKN}
245CVSPEC {BLANK}*("const"|"volatile")
246LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT})){CVSPEC}?
247LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+
248LNKWORD4 "#"{LABELID}
249CHARWORDQ [^ \t\n\r\\@<>()\‍[\‍]:;\?{}&%$#,."=']
250ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'")
251CHARWORDQ1 [^ \-+0-9\t\n\r\\@<>()\‍[\‍]:;\?{}&%$#,."=']
252WORD1 {ESCWORD}|{CHARWORDQ1}{CHARWORDQ}*|"{"|"}"|"'\"'"|("\""([^"\n]*(\\\"|\n)?)*[^"\n]*"\"")
253WORD2 "."|","|"("|")"|"["|"]"|"::"|":"|";"|"\?"|"="|"'"
254WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}"
255WORD2NQ "."|","|"("|")"|"["|"]"|"::"|":"|";"|"\?"|"="|"'"
256CAPTION [cC][aA][pP][tT][iI][oO][nN]
257HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*{WS}*(("/")?)">"
258HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"|"strike"|"u"|"del"|"ins"|"s"
259HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"|"STRIKE"|"U"|"DEL"|"INS"|"S"
260HTMLKEYW {HTMLKEYL}|{HTMLKEYU}
261HTMLTAG_STRICT "<"(("/")?){HTMLKEYW}({WS}+{ATTRIB})*{WS}*(("/")?)">"
262REFWORD2_PRE ("#"|"::")?((({ID}{TEMPLPART}?)|{ANONNS})("."|"#"|"::"|"-"|"/"))*({ID}{TEMPLPART}?(":")?)
263REFWORD2 {REFWORD2_PRE}{FUNCARG2}?
264REFWORD2_NOCV {REFWORD2_PRE}("("{FUNCPART}")")?
265REFWORD3 ({ID}":")*{ID}":"?
266REFWORD4_NOCV (({SCOPEPRE}*"operator"{OPMASKOP2})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOP2}))
267REFWORD4 {REFWORD4_NOCV}{CVSPEC}?
268REFWORD {FILEMASK}|{REQID}|{LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
269REFWORD_NOCV {FILEMASK}|{REQID}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
270RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revision"|"Source"|"State")":"[^:\n$][^\n$]*"$"
271LINENR {BLANK}*([1-9][0-9]*|"0"|"-1")
272
273SHOWDATE ([0-9]{4}"-"[0-9]{1,2}"-"[0-9]{1,2})?({WS}*[0-9]{1,2}":"[0-9]{1,2}(":"[0-9]{1,2})?)?
274
275%option noyywrap
276
277%x St_Para
278%x St_Comment
279%x St_Title
280%x St_TitleN
281%x St_TitleQ
282%x St_TitleA
283%x St_TitleV
284%x St_Code
285%x St_iCode
286%x St_CodeOpt
287%x St_iCodeOpt
288%x St_XmlCode
289%x St_HtmlOnly
290%x St_HtmlOnlyOption
291%x St_ManOnly
292%x St_LatexOnly
293%x St_RtfOnly
294%x St_XmlOnly
295%x St_DbOnly
296%x St_Verbatim
297%x St_iVerbatim
298%x St_ILiteral
299%x St_ILiteralOpt
300%x St_Dot
301%x St_Msc
302%x St_PlantUMLOpt
303%x St_PlantUML
304%x St_MermaidOpt
305%x St_Mermaid
306%x St_Param
307%x St_XRefItem
308%x St_XRefItem2
309%x St_File
310%x St_IFile
311%x St_Pattern
312%x St_Link
313%x St_Cite
314%x St_DoxyConfig
315%x St_Ref
316%x St_Ref2
317%x St_IntRef
318%x St_Text
319%x St_SkipTitle
320%x St_Anchor
321%x St_Prefix
322%x St_Snippet
323%x St_SetScope
324%x St_SetScopeEnd
325%x St_Options
326%x St_Block
327%x St_Emoji
328%x St_ILine
329%x St_ShowDate
330
331%x St_Sections
332%s St_SecLabel1
333%s St_SecLabel2
334%s St_SecTitle
335%x St_SecSkip
336
337%x St_QuotedString
338%x St_QuotedContent
339
341<St_Para>\r /* skip carriage return */
342<St_Para>^{LISTITEM} { /* list item */
343 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
344 lineCount(yytext,yyleng);
345 QCString text(yytext);
346 uint32_t dashPos = static_cast<uint32_t>(text.findRev('-'));
347 assert(dashPos!=static_cast<uint32_t>(-1));
348 yyextra->token.isEnumList = text.at(dashPos+1)=='#';
349 yyextra->token.isCheckedList = false;
350 yyextra->token.id = -1;
351 yyextra->token.indent = computeIndent(yytext,dashPos);
352 return Token::make_TK_LISTITEM();
353 }
static int computeIndent(const char *s)
#define lineCount(s, len)
354<St_Para>^{CLISTITEM} { /* checkbox item */
355 QCString text=yytext;
356 int dashPos = text.findRev('-');
357 yyextra->token.isEnumList = false;
358 yyextra->token.isCheckedList = true;
359 if (text.find('x') != -1) yyextra->token.id = DocAutoList::Checked_x;
360 else if (text.find('X') != -1) yyextra->token.id = DocAutoList::Checked_X;
361 else yyextra->token.id = DocAutoList::Unchecked;
362 yyextra->token.indent = computeIndent(yytext,dashPos);
363 return Token::make_TK_LISTITEM();
364 }
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
365<St_Para>^{MLISTITEM} { /* list item */
366 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
367 {
368 REJECT;
369 }
370 else
371 {
372 lineCount(yytext,yyleng);
373 std::string text(yytext);
374 static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
376 reg::search(text,match,re);
377 size_t listPos = match.position();
378 assert(listPos!=std::string::npos);
379 yyextra->token.isEnumList = false;
380 yyextra->token.isCheckedList = false;
381 yyextra->token.id = -1;
382 yyextra->token.indent = computeIndent(yytext,listPos);
383 return Token::make_TK_LISTITEM();
384 }
385 }
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:151
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:844
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
386<St_Para>^{OLISTITEM} { /* numbered list item */
387 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
388 {
389 REJECT;
390 }
391 else
392 {
393 std::string text(yytext);
394 static const reg::Ex re(R"(\d+)");
396 reg::search(text,match,re);
397 size_t markPos = match.position();
398 assert(markPos!=std::string::npos);
399 yyextra->token.isEnumList = true;
400 yyextra->token.isCheckedList = false;
401 bool ok = false;
402 int id = QCString(match.str()).toInt(&ok);
403 yyextra->token.id = ok ? id : -1;
404 if (!ok)
405 {
406 warn(yyextra->fileName,yyextra->yyLineNr,"Invalid number for list item '{}' ",match.str());
407 }
408 yyextra->token.indent = computeIndent(yytext,markPos);
409 return Token::make_TK_LISTITEM();
410 }
411 }
int toInt(bool *ok=nullptr, int base=10) const
Definition qcstring.cpp:254
#define warn(file, line, fmt,...)
Definition message.h:97
412<St_Para>{BLANK}*(\n|"\\ilinebr"){LISTITEM} { /* list item on next line */
413 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
414 lineCount(yytext,yyleng);
416 uint32_t dashPos = static_cast<uint32_t>(text.findRev('-'));
417 assert(dashPos!=static_cast<uint32_t>(-1));
418 yyextra->token.isEnumList = text.at(dashPos+1)=='#';
419 yyextra->token.isCheckedList = false;
420 yyextra->token.id = -1;
421 yyextra->token.indent = computeIndent(text.data(),dashPos);
422 return Token::make_TK_LISTITEM();
423 }
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
424<St_Para>{BLANK}*\n{CLISTITEM} { /* checkbox item on next line */
425 QCString text=yytext;
426 text=text.right(text.length()-text.find('\n')-1);
427 int dashPos = text.findRev('-');
428 yyextra->token.isEnumList = false;
429 yyextra->token.isCheckedList = true;
430 if (text.find('x') != -1) yyextra->token.id = DocAutoList::Checked_x;
431 else if (text.find('X') != -1) yyextra->token.id = DocAutoList::Checked_X;
432 else yyextra->token.id = DocAutoList::Unchecked;
433 yyextra->token.indent = computeIndent(text.data(),dashPos);
434 return Token::make_TK_LISTITEM();
435 }
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
436<St_Para>{BLANK}*(\n|"\\ilinebr"){MLISTITEM} { /* list item on next line */
437 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
438 {
439 REJECT;
440 }
441 else
442 {
443 lineCount(yytext,yyleng);
444 std::string text=extractPartAfterNewLine(yytext).str();
445 static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
447 reg::search(text,match,re);
448 size_t markPos = match.position();
449 assert(markPos!=std::string::npos);
450 yyextra->token.isEnumList = FALSE;
451 yyextra->token.isCheckedList = false;
452 yyextra->token.id = -1;
453 yyextra->token.indent = computeIndent(text.c_str(),markPos);
454 return Token::make_TK_LISTITEM();
455 }
456 }
const std::string & str() const
Definition qcstring.h:552
#define FALSE
Definition qcstring.h:34
457<St_Para>{BLANK}*(\n|"\\ilinebr"){OLISTITEM} { /* list item on next line */
458 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
459 {
460 REJECT;
461 }
462 else
463 {
464 lineCount(yytext,yyleng);
465 std::string text=extractPartAfterNewLine(yytext).str();
466 static const reg::Ex re(R"(\d+)");
468 reg::search(text,match,re);
469 size_t markPos = match.position();
470 assert(markPos!=std::string::npos);
471 yyextra->token.isEnumList = true;
472 yyextra->token.isCheckedList = false;
473 bool ok = false;
474 int id = QCString(match.str()).toInt(&ok);
475 yyextra->token.id = ok ? id : -1;
476 if (!ok)
477 {
478 warn(yyextra->fileName,yyextra->yyLineNr,"Invalid number for list item '{}' ",match.str());
479 }
480 yyextra->token.indent = computeIndent(text.c_str(),markPos);
481 return Token::make_TK_LISTITEM();
482 }
483 }
484<St_Para>^{ENDLIST} { /* end list */
485 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
486 lineCount(yytext,yyleng);
487 size_t dotPos = static_cast<size_t>(QCString(yytext).findRev('.'));
488 yyextra->token.indent = computeIndent(yytext,dotPos);
489 return Token::make_TK_ENDLIST();
490 }
491<St_Para>{BLANK}*(\n|"\\ilinebr"){ENDLIST} { /* end list on next line */
492 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
493 lineCount(yytext,yyleng);
495 size_t dotPos = static_cast<size_t>(text.findRev('.'));
496 yyextra->token.indent = computeIndent(text.data(),dotPos);
497 return Token::make_TK_ENDLIST();
498 }
499<St_Para>"{"{BLANK}*"@linkplain"/{WS}+ {
500 yyextra->token.name = "javalinkplain";
501 return Token::make_TK_COMMAND_AT();
502 }
503<St_Para>"{"{BLANK}*"@link"/{WS}+ {
504 yyextra->token.name = "javalink";
505 return Token::make_TK_COMMAND_AT();
506 }
507<St_Para>"{"{BLANK}*"@inheritDoc"{BLANK}*"}" {
508 yyextra->token.name = "inheritdoc";
509 return Token::make_TK_COMMAND_AT();
510 }
511<St_Para>"@_fakenl" { // artificial new line
512 //yyextra->yyLineNr++;
513 }
514<St_Para>{SPCMD3} {
515 yyextra->token.name = "_form";
516 bool ok;
517 yyextra->token.id = QCString(yytext).right((int)yyleng-7).toInt(&ok);
518 ASSERT(ok);
519 return Token::char_to_command(yytext[0]);
520 }
static Token char_to_command(char c)
#define ASSERT(x)
Definition qcstring.h:39
521<St_Para>{CMD}"n"\n { /* \n followed by real newline */
522 lineCount(yytext,yyleng);
523 //yyextra->yyLineNr++;
524 yyextra->token.name = yytext+1;
525 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
526 yyextra->token.paramDir=TokenInfo::Unspecified;
527 return Token::char_to_command(yytext[0]);
528 }
529<St_Para>"\\ilinebr" {
530 }
531<St_Para>{SPCMD1} |
532<St_Para>{SPCMD2} |
533<St_Para>{SPCMD5} |
534<St_Para>{SPCMD4} { /* special command */
535 yyextra->token.name = yytext+1;
536 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
537 yyextra->token.paramDir=TokenInfo::Unspecified;
538 return Token::char_to_command(yytext[0]);
539 }
540<St_Para>{PARAMIO} { /* param [in,out] command */
541 yyextra->token.name = "param";
542 QCString s(yytext);
543 bool isIn = s.find("in")!=-1;
544 bool isOut = s.find("out")!=-1;
545 if (isIn)
546 {
547 if (isOut)
548 {
549 yyextra->token.paramDir=TokenInfo::InOut;
550 }
551 else
552 {
553 yyextra->token.paramDir=TokenInfo::In;
554 }
555 }
556 else if (isOut)
557 {
558 yyextra->token.paramDir=TokenInfo::Out;
559 }
560 else
561 {
562 yyextra->token.paramDir=TokenInfo::Unspecified;
563 }
564 return Token::char_to_command(yytext[0]);
565 }
566<St_Para>{URLPROTOCOL}{URLMASK}/[,\.] { // URL, or URL.
567 yyextra->token.name=yytext;
568 yyextra->token.isEMailAddr=FALSE;
569 return Token::make_TK_URL();
570 }
571<St_Para>{URLPROTOCOL}{URLMASK} { // URL
572 yyextra->token.name=yytext;
573 yyextra->token.isEMailAddr=FALSE;
574 return Token::make_TK_URL();
575 }
576<St_Para>"<"{URLPROTOCOL}{URLMASK}">" { // URL
577 yyextra->token.name=yytext;
578 yyextra->token.name = yyextra->token.name.mid(1,yyextra->token.name.length()-2);
579 yyextra->token.isEMailAddr=FALSE;
580 return Token::make_TK_URL();
581 }
582<St_Para>{MAILADDR} { // Mail address
583 yyextra->token.name=yytext;
584 yyextra->token.name.stripPrefix("mailto:");
585 yyextra->token.isEMailAddr=TRUE;
586 return Token::make_TK_URL();
587 }
#define TRUE
Definition qcstring.h:37
588<St_Para>"<"{MAILADDR}">" { // Mail address
589 yyextra->token.name=yytext;
590 yyextra->token.name = yyextra->token.name.mid(1,yyextra->token.name.length()-2);
591 yyextra->token.name.stripPrefix("mailto:");
592 yyextra->token.isEMailAddr=TRUE;
593 return Token::make_TK_URL();
594 }
595<St_Para>"<"{MAILADDR2}">" { // anti spam mail address
596 yyextra->token.name=yytext;
597 return Token::make_TK_WORD();
598 }
599<St_Para>{RCSID} { /* RCS tag */
600 QCString tagName(yytext+1);
601 int index=tagName.find(':');
602 if (index<0) index=0; // should never happen
603 yyextra->token.name = tagName.left(index);
604 int text_begin = index+2;
605 int text_end = static_cast<int>(tagName.length())-1;
606 if (tagName[text_begin-1]==':') /* check for Subversion fixed-length keyword */
607 {
608 ++text_begin;
609 if (tagName[text_end-1]=='#')
610 {
611 --text_end;
612 }
613 }
614 yyextra->token.text = tagName.mid(text_begin,text_end-text_begin);
615 return Token::make_TK_RCSTAG();
616 }
617<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}")" | /* environment variable */
618<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}"("{ID}"))" { /* environment variable */
619 QCString name(&yytext[2]);
620 name = name.left(static_cast<int>(name.length())-1);
621 QCString value = Portable::getenv(name);
622 for (int i=static_cast<int>(value.length())-1;i>=0;i--) unput(value.at(i));
623 }
QCString getenv(const QCString &variable)
Definition portable.cpp:321
624<St_Para>"<blockquote>&zwj;" {
625 // for a markdown inserted block quote,
626 // tell flex that after putting the last indent
627 // back we are at the beginning of the line, see issue #11309
628 YY_CURRENT_BUFFER->yy_at_bol=1;
629 lineCount(yytext,yyleng);
630 handleHtmlTag(yyscanner,yytext);
631 return Token::make_TK_HTMLTAG();
632 }
633<St_Para>{HTMLTAG} { /* html tag */
634 lineCount(yytext,yyleng);
635 handleHtmlTag(yyscanner,yytext);
636 return Token::make_TK_HTMLTAG();
637 }
638<St_Para,St_Text>"&"{ID}";" { /* special symbol */
639 yyextra->token.name = yytext;
640 return Token::make_TK_SYMBOL();
641 }
642
643 /********* patterns for linkable words ******************/
644
645<St_Para>{ID}/"<"{HTMLKEYW}">"+ { /* this rule is to prevent opening html
646 * tag to be recognized as a templated classes
647 */
648 yyextra->token.name = yytext;
649 return Token::make_TK_LNKWORD();
650 }
651<St_Para>{LNKWORDN}/("<"{HTMLKEYW}">")+ { // prevent <br> html tag to be parsed as template arguments
652 yyextra->token.name = yytext;
653 return Token::make_TK_LNKWORD();
654 }
655<St_Para>{LNKWORD1} |
656<St_Para>{LNKWORD1}{FUNCARG} |
657<St_Para>{LNKWORD2} |
658<St_Para>{LNKWORD3} |
659<St_Para>{LNKWORD4} {
660 yyextra->token.name = yytext;
661 return Token::make_TK_LNKWORD();
662 }
663<St_Para>{LNKWORD1}{FUNCARG}{CVSPEC}[^a-z_A-Z0-9] {
664 yyextra->token.name = yytext;
665 yyextra->token.name = yyextra->token.name.left(yyextra->token.name.length()-1);
666 unput(yytext[(int)yyleng-1]);
667 return Token::make_TK_LNKWORD();
668 }
669 /********* patterns for normal words ******************/
670
671<St_Para,St_Text>[\-+0-9] |
672<St_Para,St_Text>{WORD1} |
673<St_Para,St_Text>{WORD2} { /* function call */
674 if (QCString(yytext).find("\\ilinebr")!=-1) REJECT; // see issue #8311
675 lineCount(yytext,yyleng);
676 if (yytext[0]=='%') // strip % if present
677 yyextra->token.name = &yytext[1];
678 else
679 yyextra->token.name = yytext;
680 return Token::make_TK_WORD();
681 }
682<St_Text>({ID}".")+{ID} {
683 yyextra->token.name = yytext;
684 return Token::make_TK_WORD();
685 }
686<St_Para,St_Text>"operator"/{BLANK}*"<"[a-zA-Z_0-9]+">" { // Special case: word "operator" followed by a HTML command
687 // avoid interpretation as "operator <"
688 yyextra->token.name = yytext;
689 return Token::make_TK_WORD();
690 }
691
692 /*******************************************************/
693
694<St_Para,St_Text>{BLANK}+ |
695<St_Para,St_Text>{BLANK}*\n{BLANK}* { /* white space */
696 lineCount(yytext,yyleng);
697 yyextra->token.chars=yytext;
698 return Token::make_TK_WHITESPACE();
699 }
700<St_Text>[\\@<>&$#%~] {
701 yyextra->token.name = yytext;
702 return Token::char_to_command(yytext[0]);
703 }
704<St_Para>({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */
705 if (yyextra->insidePre || yyextra->autoListLevel==0)
706 {
707 REJECT;
708 }
709 lineCount(yytext,yyleng);
710 }
711<St_Para>({BLANK}*\n)+{BLANK}*\n/{CLISTITEM} { /* skip trailing paragraph followed by new checkbox item */
712 if (yyextra->insidePre || yyextra->autoListLevel==0)
713 {
714 REJECT;
715 }
716 }
717<St_Para>({BLANK}*\n)+{BLANK}*\n/{MLISTITEM} { /* skip trailing paragraph followed by new list item */
718 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
719 {
720 REJECT;
721 }
722 lineCount(yytext,yyleng);
723 }
724<St_Para>({BLANK}*\n)+{BLANK}*\n/{OLISTITEM} { /* skip trailing paragraph followed by new list item */
725 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
726 {
727 REJECT;
728 }
729 lineCount(yytext,yyleng);
730 }
731<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}*/" \\ifile" | // we don't want to count the space before \ifile
732<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
733 lineCount(yytext,yyleng);
734 if (yyextra->insidePre)
735 {
736 yyextra->token.chars=yytext;
737 return Token::make_TK_WHITESPACE();
738 }
739 else
740 {
741 yyextra->token.indent=computeIndent(yytext,yyleng);
742 int i;
743 // put back the indentation (needed for list items)
744 //printf("token.indent=%d\n",yyextra->token.indent);
745 for (i=0;i<yyextra->token.indent;i++)
746 {
747 unput(' ');
748 }
749 // tell flex that after putting the last indent
750 // back we are at the beginning of the line
751 YY_CURRENT_BUFFER->yy_at_bol=1;
752 // start of a new paragraph
753 return Token::make_TK_NEWPARA();
754 }
755 }
756<St_CodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
757 yyextra->token.name = yytext;
758 int i=yyextra->token.name.find('{'); /* } to keep vi happy */
759 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
760 BEGIN(St_Code);
761 }
762<St_iCodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
763 yyextra->token.name = yytext;
764 int i=yyextra->token.name.find('{'); /* } to keep vi happy */
765 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
766 BEGIN(St_iCode);
767 }
768<St_CodeOpt>"\\ilinebr" |
769<St_CodeOpt>\n |
770<St_CodeOpt>. {
771 unput_string(yytext,yyleng);
772 BEGIN(St_Code);
773 }
#define unput_string(yytext, yyleng)
774<St_iCodeOpt>"\\ilinebr" |
775<St_iCodeOpt>\n |
776<St_iCodeOpt>. {
777 unput_string(yytext,yyleng);
778 BEGIN(St_iCode);
779 }
780<St_Code>{WS}*{CMD}"endcode" {
781 lineCount(yytext,yyleng);
782 return Token::make_RetVal_OK();
783 }
784<St_iCode>{WS}*{CMD}"endicode" {
785 lineCount(yytext,yyleng);
786 return Token::make_RetVal_OK();
787 }
788<St_XmlCode>{WS}*"</code>" {
789 lineCount(yytext,yyleng);
790 return Token::make_RetVal_OK();
791 }
792<St_Code,St_iCode,St_XmlCode>[^\\@\n<]+ |
793<St_Code,St_iCode,St_XmlCode>\n |
794<St_Code,St_iCode,St_XmlCode>. {
795 lineCount(yytext,yyleng);
796 yyextra->token.verb+=yytext;
797 }
798<St_HtmlOnlyOption>" [block]" { // the space is added in commentscan.l
799 yyextra->token.name="block";
800 BEGIN(St_HtmlOnly);
801 }
802<St_HtmlOnlyOption>.|\n {
803 unput(*yytext);
804 BEGIN(St_HtmlOnly);
805 }
806<St_HtmlOnlyOption>"\\ilinebr" {
807 unput_string(yytext,yyleng);
808 BEGIN(St_HtmlOnly);
809 }
810<St_HtmlOnly>{CMD}"endhtmlonly" {
811 return Token::make_RetVal_OK();
812 }
813<St_HtmlOnly>[^\\@\n$]+ |
814<St_HtmlOnly>\n |
815<St_HtmlOnly>. {
816 lineCount(yytext,yyleng);
817 yyextra->token.verb+=yytext;
818 }
819<St_ManOnly>{CMD}"endmanonly" {
820 return Token::make_RetVal_OK();
821 }
822<St_ManOnly>[^\\@\n$]+ |
823<St_ManOnly>\n |
824<St_ManOnly>. {
825 lineCount(yytext,yyleng);
826 yyextra->token.verb+=yytext;
827 }
828<St_RtfOnly>{CMD}"endrtfonly" {
829 return Token::make_RetVal_OK();
830 }
831<St_RtfOnly>[^\\@\n$]+ |
832<St_RtfOnly>\n |
833<St_RtfOnly>. {
834 lineCount(yytext,yyleng);
835 yyextra->token.verb+=yytext;
836 }
837<St_LatexOnly>{CMD}"endlatexonly" {
838 return Token::make_RetVal_OK();
839 }
840<St_LatexOnly>[^\\@\n]+ |
841<St_LatexOnly>\n |
842<St_LatexOnly>. {
843 lineCount(yytext,yyleng);
844 yyextra->token.verb+=yytext;
845 }
846<St_XmlOnly>{CMD}"endxmlonly" {
847 return Token::make_RetVal_OK();
848 }
849<St_XmlOnly>[^\\@\n]+ |
850<St_XmlOnly>\n |
851<St_XmlOnly>. {
852 lineCount(yytext,yyleng);
853 yyextra->token.verb+=yytext;
854 }
855<St_DbOnly>{CMD}"enddocbookonly" {
856 return Token::make_RetVal_OK();
857 }
858<St_DbOnly>[^\\@\n]+ |
859<St_DbOnly>\n |
860<St_DbOnly>. {
861 lineCount(yytext,yyleng);
862 yyextra->token.verb+=yytext;
863 }
864<St_Verbatim>{CMD}"endverbatim" {
865 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
866 return Token::make_RetVal_OK();
867 }
868<St_ILiteral>{CMD}"endiliteral " { // note extra space as this is artificially added
869 // remove spaces that have been added
870 yyextra->token.verb = yyextra->token.verb.mid(1,yyextra->token.verb.length()-2);
871 return Token::make_RetVal_OK();
872 }
873<St_iVerbatim>{CMD}"endiverbatim" {
874 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
875 return Token::make_RetVal_OK();
876 }
877<St_Verbatim,St_iVerbatim,St_ILiteral>[^\\@\n]+ |
878<St_Verbatim,St_iVerbatim,St_ILiteral>\n |
879<St_Verbatim,St_iVerbatim,St_ILiteral>. { /* Verbatim text */
880 lineCount(yytext,yyleng);
881 yyextra->token.verb+=yytext;
882 }
883<St_ILiteralOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // option(s) present
884 yyextra->token.verb = QCString(yytext).stripWhiteSpace();
885 return Token::make_RetVal_OK();
886 }
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
887<St_ILiteralOpt>"\\ilinebr" |
888<St_ILiteralOpt>"\n" |
889<St_ILiteralOpt>. {
890 yyextra->token.sectionId = "";
891 unput_string(yytext,yyleng);
892 return Token::make_RetVal_OK();
893 }
894<St_Dot>{CMD}"enddot" {
895 return Token::make_RetVal_OK();
896 }
897<St_Dot>[^\\@\n]+ |
898<St_Dot>\n |
899<St_Dot>. { /* dot text */
900 lineCount(yytext,yyleng);
901 yyextra->token.verb+=yytext;
902 }
903<St_Msc>{CMD}("endmsc") {
904 return Token::make_RetVal_OK();
905 }
906<St_Msc>[^\\@\n]+ |
907<St_Msc>\n |
908<St_Msc>. { /* msc text */
909 lineCount(yytext,yyleng);
910 yyextra->token.verb+=yytext;
911 }
912<St_PlantUMLOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // case 1: options present
913 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
914 return Token::make_RetVal_OK();
915 }
916<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
917 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
918 return Token::make_RetVal_OK();
919 }
920<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
921 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
922 return Token::make_RetVal_OK();
923 }
924<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
925 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
926 return Token::make_RetVal_OK();
927 }
928<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
929 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
930 return Token::make_RetVal_OK();
931 }
932<St_PlantUMLOpt>"\\ilinebr" |
933<St_PlantUMLOpt>"\n" |
934<St_PlantUMLOpt>. {
935 yyextra->token.sectionId = "";
936 unput_string(yytext,yyleng);
937 return Token::make_RetVal_OK();
938 }
939<St_PlantUML>{CMD}"enduml" {
940 return Token::make_RetVal_OK();
941 }
942<St_PlantUML>[^\\@\n]+ |
943<St_PlantUML>\n |
944<St_PlantUML>. { /* plantuml text */
945 lineCount(yytext,yyleng);
946 yyextra->token.verb+=yytext;
947 }
948<St_MermaidOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // case 1: options present
949 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
950 return Token::make_RetVal_OK();
951 }
952<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
953 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
954 return Token::make_RetVal_OK();
955 }
956<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
957 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
958 return Token::make_RetVal_OK();
959 }
960<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
961 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
962 return Token::make_RetVal_OK();
963 }
964<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
965 yyextra->token.sectionId = QCString(yytext).stripWhiteSpace();
966 return Token::make_RetVal_OK();
967 }
968<St_MermaidOpt>"\\ilinebr" |
969<St_MermaidOpt>"\n" |
970<St_MermaidOpt>. {
971 yyextra->token.sectionId = "";
972 unput_string(yytext,yyleng);
973 return Token::make_RetVal_OK();
974 }
975<St_Mermaid>{CMD}"endmermaid" {
976 return Token::make_RetVal_OK();
977 }
978<St_Mermaid>[^\\@\n]+ |
979<St_Mermaid>\n |
980<St_Mermaid>. { /* mermaid text */
981 lineCount(yytext,yyleng);
982 yyextra->token.verb+=yytext;
983 }
984<St_Title>"\"" { // quoted title
985 BEGIN(St_TitleQ);
986 }
987<St_Title>[ \t]+ {
988 yyextra->token.chars=yytext;
989 return Token::make_TK_WHITESPACE();
990 }
991<St_Title>. { // non-quoted title
992 unput(*yytext);
993 BEGIN(St_TitleN);
994 }
995<St_Title>\n {
996 unput(*yytext);
997 return Token::make_TK_NONE();
998 }
999<St_Title>"\\ilinebr" {
1000 unput_string(yytext,yyleng);
1001 return Token::make_TK_NONE();
1002 }
1003<St_TitleN>"&"{ID}";" { /* symbol */
1004 yyextra->token.name = yytext;
1005 return Token::make_TK_SYMBOL();
1006 }
1007<St_TitleN>{HTMLTAG} {
1008 yyextra->token.name = yytext;
1009 handleHtmlTag(yyscanner,yytext);
1010 return Token::make_TK_HTMLTAG();
1011 }
1012<St_TitleN>\n { /* new line => end of title */
1013 unput(*yytext);
1014 return Token::make_TK_NONE();
1015 }
1016<St_TitleN>"\\ilinebr" { /* new line => end of title */
1017 unput_string(yytext,yyleng);
1018 return Token::make_TK_NONE();
1019 }
1020<St_TitleN>{SPCMD1} |
1021<St_TitleN>{SPCMD2} { /* special command */
1022 yyextra->token.name = yytext+1;
1023 yyextra->token.paramDir=TokenInfo::Unspecified;
1024 return Token::char_to_command(yytext[0]);
1025 }
1026<St_TitleN>{ID}"=" { /* attribute */
1027 if (yytext[0]=='%') // strip % if present
1028 yyextra->token.name = &yytext[1];
1029 else
1030 yyextra->token.name = yytext;
1031 return Token::make_TK_WORD();
1032 }
1033<St_TitleN>[\-+0-9] |
1034<St_TitleN>{WORD1} |
1035<St_TitleN>{WORD2} { /* word */
1036 if (QCString(yytext).find("\\ilinebr")!=-1) REJECT; // see issue #8311
1037 lineCount(yytext,yyleng);
1038 if (yytext[0]=='%') // strip % if present
1039 yyextra->token.name = &yytext[1];
1040 else
1041 yyextra->token.name = yytext;
1042 return Token::make_TK_WORD();
1043 }
1044<St_TitleN>[ \t]+ {
1045 yyextra->token.chars=yytext;
1046 return Token::make_TK_WHITESPACE();
1047 }
1048<St_TitleQ>"&"{ID}";" { /* symbol */
1049 yyextra->token.name = yytext;
1050 return Token::make_TK_SYMBOL();
1051 }
1052<St_TitleQ>(\n|"\\ilinebr") { /* new line => end of title */
1053 unput_string(yytext,yyleng);
1054 return Token::make_TK_NONE();
1055 }
1056<St_TitleQ>{SPCMD1} |
1057<St_TitleQ>{SPCMD2} { /* special command */
1058 yyextra->token.name = yytext+1;
1059 yyextra->token.paramDir=TokenInfo::Unspecified;
1060 return Token::char_to_command(yytext[0]);
1061 }
1062<St_TitleQ>{WORD1NQ} |
1063<St_TitleQ>{WORD2NQ} { /* word */
1064 yyextra->token.name = yytext;
1065 return Token::make_TK_WORD();
1066 }
1067<St_TitleQ>[ \t]+ {
1068 yyextra->token.chars=yytext;
1069 return Token::make_TK_WHITESPACE();
1070 }
1071<St_TitleQ>"\"" { /* closing quote => end of title */
1072 BEGIN(St_TitleA);
1073 return Token::make_TK_NONE();
1074 }
1075<St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute
1076 yyextra->token.name = yytext;
1077 int pos = yyextra->token.name.find('=');
1078 if (pos<0) pos=0; // should never happen
1079 yyextra->token.name = yyextra->token.name.left(pos).stripWhiteSpace();
1080 BEGIN(St_TitleV);
1081 }
1082<St_TitleV>[^ \t\r\n]+ { // attribute value
1083 lineCount(yytext,yyleng);
1084 yyextra->token.chars = yytext;
1085 BEGIN(St_TitleN);
1086 return Token::make_TK_WORD();
1087 }
1088<St_TitleV,St_TitleA>. {
1089 unput(*yytext);
1090 return Token::make_TK_NONE();
1091 }
1092<St_TitleV,St_TitleA>(\n|"\\ilinebr") {
1093 unput_string(yytext,yyleng);
1094 return Token::make_TK_NONE();
1095 }
1096
1097<St_Anchor>({REQID}|{LABELID}){WS}? { // anchor
1098 lineCount(yytext,yyleng);
1099 yyextra->token.name = QCString(yytext).stripWhiteSpace();
1100 return Token::make_TK_WORD();
1101 }
1102<St_Anchor>. {
1103 unput(*yytext);
1104 return Token::make_TK_NONE();
1105 }
1106<St_Cite>{CITEID} { // label to cite
1107 if (yytext[0] =='"')
1108 {
1109 yyextra->token.name=yytext+1;
1110 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-2);
1111 }
1112 else
1113 {
1114 yyextra->token.name=yytext;
1115 }
1116 return Token::make_TK_WORD();
1117 }
1118<St_Cite>{BLANK} { // white space
1119 unput(' ');
1120 return Token::make_TK_NONE();
1121 }
1122<St_Cite>(\n|"\\ilinebr") { // new line
1123 unput_string(yytext,yyleng);
1124 return Token::make_TK_NONE();
1125 }
1126<St_Cite>. { // any other character
1127 unput(*yytext);
1128 return Token::make_TK_NONE();
1129 }
1130<St_DoxyConfig>{DOXYCFG} { // config option
1131 yyextra->token.name=yytext;
1132 return Token::make_TK_WORD();
1133 }
1134<St_DoxyConfig>{BLANK} { // white space
1135 unput(' ');
1136 return Token::make_TK_NONE();
1137 }
1138<St_DoxyConfig>(\n|"\\ilinebr") { // new line
1139 unput_string(yytext,yyleng);
1140 return Token::make_TK_NONE();
1141 }
1142<St_DoxyConfig>. { // any other character
1143 unput(*yytext);
1144 return Token::make_TK_NONE();
1145 }
1146<St_Ref>{REFWORD_NOCV}/{BLANK}("const")[a-z_A-Z0-9] { // see bug776988
1147 yyextra->token.name=yytext;
1148 return Token::make_TK_WORD();
1149 }
1150<St_Ref>{REFWORD_NOCV}/{BLANK}("volatile")[a-z_A-Z0-9] { // see bug776988
1151 yyextra->token.name=yytext;
1152 return Token::make_TK_WORD();
1153 }
1154<St_Ref>{REFWORD} { // label to refer to
1155 yyextra->token.name=yytext;
1156 return Token::make_TK_WORD();
1157 }
1158<St_Ref>{BLANK} { // white space
1159 unput(' ');
1160 return Token::make_TK_NONE();
1161 }
1162<St_Ref>{WS}+"\""{WS}* { // white space following by quoted string
1163 yyextra->expectQuote=true;
1164 lineCount(yytext,yyleng);
1165 BEGIN(St_Ref2);
1166 }
1167<St_Ref>(\n|"\\ilinebr") { // new line
1168 unput_string(yytext,yyleng);
1169 return Token::make_TK_NONE();
1170 }
1171<St_Ref>"\""[^"\n]+"\"" { // quoted first argument -> return without quotes
1172 yyextra->token.name=QCString(yytext).mid(1,yyleng-2);
1173 return Token::make_TK_WORD();
1174 }
1175<St_Ref>. { // any other character
1176 unput(*yytext);
1177 return Token::make_TK_NONE();
1178 }
1179<St_IntRef>[A-Z_a-z0-9.:/#\-\+\‍(\‍)]+ {
1180 yyextra->token.name = yytext;
1181 return Token::make_TK_WORD();
1182 }
1183<St_IntRef>{BLANK}+"\"" {
1184 BEGIN(St_Ref2);
1185 }
1186<St_SetScope>({SCOPEMASK}|{ANONNS}){BLANK}|{FILEMASK} {
1187 yyextra->token.name = yytext;
1188 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1189 return Token::make_TK_WORD();
1190 }
1191<St_SetScope>{SCOPEMASK}"<" {
1192 yyextra->token.name = yytext;
1193 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1194 yyextra->sharpCount=1;
1195 BEGIN(St_SetScopeEnd);
1196 }
1197<St_SetScope>{BLANK} {
1198 }
1199<St_SetScopeEnd>"<" {
1200 yyextra->token.name += yytext;
1201 yyextra->sharpCount++;
1202 }
1203<St_SetScopeEnd>">" {
1204 yyextra->token.name += yytext;
1205 yyextra->sharpCount--;
1206 if (yyextra->sharpCount<=0)
1207 {
1208 return Token::make_TK_WORD();
1209 }
1210 }
1211<St_SetScopeEnd>. {
1212 yyextra->token.name += yytext;
1213 }
1214<St_Ref2>"&"{ID}";" { /* symbol */
1215 yyextra->token.name = yytext;
1216 return Token::make_TK_SYMBOL();
1217 }
1218<St_Ref2>"\""|\n|"\\ilinebr" { /* " or \n => end of title? */
1219 lineCount(yytext,yyleng);
1220 if (!yyextra->expectQuote || yytext[0]=='"')
1221 {
1222 return Token::make_TK_NONE();
1223 }
1224 else
1225 {
1226 yyextra->token.name += yytext;
1227 }
1228 }
1229<St_Ref2>{HTMLTAG_STRICT} { /* html tag */
1230 lineCount(yytext,yyleng);
1231 handleHtmlTag(yyscanner,yytext);
1232 return Token::make_TK_HTMLTAG();
1233 }
1234<St_Ref2>{SPCMD1} |
1235<St_Ref2>{SPCMD2} { /* special command */
1236 yyextra->token.name = yytext+1;
1237 yyextra->token.paramDir=TokenInfo::Unspecified;
1238 return Token::char_to_command(yytext[0]);
1239 }
1240<St_Ref2>{WORD1NQ} |
1241<St_Ref2>{WORD2NQ} {
1242 /* word */
1243 yyextra->token.name = yytext;
1244 return Token::make_TK_WORD();
1245 }
1246<St_Ref2>[ \t]+ {
1247 yyextra->token.chars=yytext;
1248 return Token::make_TK_WHITESPACE();
1249 }
1250<St_XRefItem>{LABELID} {
1251 yyextra->token.name=yytext;
1252 }
1253<St_XRefItem>" " {
1254 BEGIN(St_XRefItem2);
1255 }
1256<St_XRefItem2>[0-9]+"." {
1257 QCString numStr(yytext);
1258 numStr=numStr.left((int)yyleng-1);
1259 yyextra->token.id=numStr.toInt();
1260 return Token::make_RetVal_OK();
1261 }
1262<St_Para,St_Title,St_Ref2>"<!--" { /* html style comment block */
1263 yyextra->commentState = YY_START;
1264 BEGIN(St_Comment);
1265 }
1266<St_Param>"\""[^\n\"]+"\"" {
1267 yyextra->token.name = yytext+1;
1268 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1269 return Token::make_TK_WORD();
1270 }
1271<St_Param>({PHPTYPE}{BLANK}*("["{BLANK}*"]")*{BLANK}*"|"{BLANK}*)*{PHPTYPE}{BLANK}*("["{BLANK}*"]")*{WS}+("&")?"$"{LABELID} {
1272 lineCount(yytext,yyleng);
1273 QCString params(yytext);
1274 int j = params.find('&');
1275 int i = params.find('$');
1276 if (i<0) i=0; // should never happen
1277 if (j<i && j>=0) i=j;
1278 QCString types = params.left(i).stripWhiteSpace();
1279 yyextra->token.name = types+"#"+params.mid(i);
1280 return Token::make_TK_WORD();
1281 }
QCString left(size_t len) const
Definition qcstring.h:229
1282<St_Param>[^ \t\n,@\\‍]+ {
1283 yyextra->token.name = yytext;
1284 if (yyextra->token.name.at(static_cast<uint32_t>(yyleng)-1)==':')
1285 {
1286 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-1);
1287 }
1288 return Token::make_TK_WORD();
1289 }
1290<St_Param>{WS}*","{WS}* /* param separator */
1291<St_Param>{WS} {
1292 lineCount(yytext,yyleng);
1293 yyextra->token.chars=yytext;
1294 return Token::make_TK_WHITESPACE();
1295 }
1296<St_Prefix>"\""[^\n\"]*"\"" {
1297 yyextra->token.name = yytext+1;
1298 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1299 return Token::make_TK_WORD();
1300 }
1301<St_Prefix>. {
1302 unput(*yytext);
1303 return Token::make_TK_NONE();
1304 }
1305<St_Options>{ID} {
1306 yyextra->token.name+=yytext;
1307 }
1308<St_Options>{WS}*":"{WS}* {
1309 lineCount(yytext,yyleng);
1310 yyextra->token.name+=":";
1311 }
1312<St_Options>{WS}*","{WS}* |
1313<St_Options>{WS} { /* option separator */
1314 lineCount(yytext,yyleng);
1315 yyextra->token.name+=",";
1316 }
1317<St_Options>"}" {
1318 return Token::make_TK_WORD();
1319 }
1320<St_Block>{ID} {
1321 yyextra->token.name+=yytext;
1322 }
1323<St_Block>"]" {
1324 return Token::make_TK_WORD();
1325 }
1326<St_Emoji>[:0-9_a-z+-]+ {
1327 yyextra->token.name=yytext;
1328 return Token::make_TK_WORD();
1329 }
1330<St_Emoji>. {
1331 unput(*yytext);
1332 return Token::make_TK_NONE();
1333 }
1334<St_QuotedString>"\"" {
1335 yyextra->token.name="";
1336 BEGIN(St_QuotedContent);
1337 }
1338<St_QuotedString>(\n|"\\ilinebr") {
1339 unput_string(yytext,yyleng);
1340 return Token::make_TK_NONE();
1341 }
1342<St_QuotedString>. {
1343 unput(*yytext);
1344 return Token::make_TK_NONE();
1345 }
1346<St_QuotedContent>"\"" {
1347 return Token::make_TK_WORD();
1348 }
1349<St_QuotedContent>. {
1350 yyextra->token.name+=yytext;
1351 }
1352<St_ShowDate>{WS}+{SHOWDATE} {
1353 lineCount(yytext,yyleng);
1354 yyextra->token.name=yytext;
1355 return Token::make_TK_WORD();
1356 }
1357<St_ShowDate>(\n|"\\ilinebr") {
1358 unput_string(yytext,yyleng);
1359 return Token::make_TK_NONE();
1360 }
1361<St_ShowDate>. {
1362 unput(*yytext);
1363 return Token::make_TK_NONE();
1364 }
1365<St_ILine>{LINENR}/[\\@\n\.] |
1366<St_ILine>{LINENR}{BLANK} {
1367 bool ok = false;
1368 int nr = QCString(yytext).toInt(&ok);
1369 if (!ok)
1370 {
1371 warn(yyextra->fileName,yyextra->yyLineNr,"Invalid line number '{}' for iline command",yytext);
1372 }
1373 else
1374 {
1375 yyextra->yyLineNr = nr;
1376 }
1377 return Token::make_TK_WORD();
1378 }
1379<St_ILine>. {
1380 return Token::make_TK_NONE();
1381 }
1382<St_IFile>{BLANK}*{FILEMASK} {
1383 QCString text(yytext);
1384 text = text.stripWhiteSpace();
1385 yyextra->fileName = text;
1386 yyextra->token.name = text;
1387 return Token::make_TK_WORD();
1388 }
1389<St_IFile>{BLANK}*"\""[^\n\"]+"\"" {
1390 QCString text(yytext);
1391 text = text.stripWhiteSpace();
1392 yyextra->fileName = text.mid(1,text.length()-2);
1393 yyextra->token.name = text.mid(1,text.length()-2);
1394 return Token::make_TK_WORD();
1395 }
1396<St_File>{FILEMASK} {
1397 yyextra->token.name = yytext;
1398 if (yyextra->token.name.endsWith("\\ilinebr") ||yyextra->token.name.endsWith("@ilinebr"))
1399 {
1400 unput_string("\\ilinebr",8);
1401 yyextra->token.name = yyextra->token.name.left(yyleng-8);
1402 }
1403 return Token::make_TK_WORD();
1404 }
1405<St_File>"\""[^\n\"]+"\"" {
1406 QCString text(yytext);
1407 yyextra->token.name = text.mid(1,text.length()-2);
1408 return Token::make_TK_WORD();
1409 }
1410<St_Pattern>[^\\\r\n]+ {
1411 yyextra->token.name += yytext;
1412 }
1413<St_Pattern>"\\ilinebr" {
1414 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1415 return Token::make_TK_WORD();
1416 }
1417<St_Pattern>\n {
1418 lineCount(yytext,yyleng);
1419 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1420 return Token::make_TK_WORD();
1421 }
1422<St_Pattern>. {
1423 yyextra->token.name += yytext;
1424 }
1425<St_Link>{LINKMASK}|{REFWORD} {
1426 yyextra->token.name = yytext;
1427 return Token::make_TK_WORD();
1428 }
1429<St_Comment>"-->" { /* end of html comment */
1430 BEGIN(yyextra->commentState);
1431 }
1432<St_Comment>[^-]+ /* inside html comment */
1433<St_Comment>. /* inside html comment */
1434
1435 /* State for skipping title (all chars until the end of the line) */
1436
1437<St_SkipTitle>.
1438<St_SkipTitle>(\n|"\\ilinebr") {
1439 if (*yytext == '\n') unput('\n');
1440 return Token::make_TK_NONE();
1441 }
1442
1443 /* State for the pass used to find the anchors and sections */
1444
1445<St_Sections>[^\n@\<]+
1446<St_Sections>{CMD}("<"|{CMD})
1447<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" {
1448 lineCount(yytext,yyleng);
1449 QCString tag(yytext);
1450 int s=tag.find("id=");
1451 if (s!=-1) // command has id attribute
1452 {
1453 char c=tag[s+3];
1454 if (c=='\'' || c=='"') // valid start
1455 {
1456 int e=tag.find(c,s+4);
1457 if (e!=-1) // found matching end
1458 {
1459 yyextra->secType = SectionType::Table;
1460 yyextra->secLabel=tag.mid(s+4,e-s-4); // extract id
1461 processSection(yyscanner);
1462 }
1463 }
1464 }
1465 }
static constexpr int Table
Definition section.h:41
1466<St_Sections>{CMD}"anchor"{BLANK}+ {
1467 yyextra->secType = SectionType::Anchor;
1468 BEGIN(St_SecLabel1);
1469 }
static constexpr int Anchor
Definition section.h:40
1470<St_Sections>{CMD}"ianchor"{BLANK}+ {
1471 yyextra->secType = SectionType::Anchor;
1472 BEGIN(St_SecLabel1);
1473 }
1474<St_Sections>{CMD}"section"{BLANK}+ {
1475 yyextra->secType = SectionType::Section;
1476 BEGIN(St_SecLabel2);
1477 }
static constexpr int Section
Definition section.h:33
1478<St_Sections>{CMD}"subsection"{BLANK}+ {
1479 yyextra->secType = SectionType::Subsection;
1480 BEGIN(St_SecLabel2);
1481 }
static constexpr int Subsection
Definition section.h:34
1482<St_Sections>{CMD}"subsubsection"{BLANK}+ {
1483 yyextra->secType = SectionType::Subsubsection;
1484 BEGIN(St_SecLabel2);
1485 }
static constexpr int Subsubsection
Definition section.h:35
1486<St_Sections>{CMD}"paragraph"{BLANK}+ {
1487 yyextra->secType = SectionType::Paragraph;
1488 BEGIN(St_SecLabel2);
1489 }
static constexpr int Paragraph
Definition section.h:36
1490<St_Sections>{CMD}"subparagraph"{BLANK}+ {
1491 yyextra->secType = SectionType::Subparagraph;
1492 BEGIN(St_SecLabel2);
1493 }
static constexpr int Subparagraph
Definition section.h:37
1494<St_Sections>{CMD}"subsubparagraph"{BLANK}+ {
1495 yyextra->secType = SectionType::Subsubparagraph;
1496 BEGIN(St_SecLabel2);
1497 }
static constexpr int Subsubparagraph
Definition section.h:38
1498<St_Sections>{CMD}"verbatim"/[^a-z_A-Z0-9] {
1499 yyextra->endMarker="endverbatim";
1500 BEGIN(St_SecSkip);
1501 }
1502<St_Sections>{CMD}"iverbatim"/[^a-z_A-Z0-9] {
1503 yyextra->endMarker="endiverbatim";
1504 BEGIN(St_SecSkip);
1505 }
1506<St_Sections>{CMD}"iliteral"/[^a-z_A-Z0-9] {
1507 yyextra->endMarker="endiliteral";
1508 BEGIN(St_SecSkip);
1509 }
1510<St_Sections>{CMD}"dot"/[^a-z_A-Z0-9] {
1511 yyextra->endMarker="enddot";
1512 BEGIN(St_SecSkip);
1513 }
1514<St_Sections>{CMD}"msc"/[^a-z_A-Z0-9] {
1515 yyextra->endMarker="endmsc";
1516 BEGIN(St_SecSkip);
1517 }
1518<St_Sections>{CMD}"startuml"/[^a-z_A-Z0-9] {
1519 yyextra->endMarker="enduml";
1520 BEGIN(St_SecSkip);
1521 }
1522<St_Sections>{CMD}"htmlonly"/[^a-z_A-Z0-9] {
1523 yyextra->endMarker="endhtmlonly";
1524 BEGIN(St_SecSkip);
1525 }
1526<St_Sections>{CMD}"latexonly"/[^a-z_A-Z0-9] {
1527 yyextra->endMarker="endlatexonly";
1528 BEGIN(St_SecSkip);
1529 }
1530<St_Sections>{CMD}"manonly"/[^a-z_A-Z0-9] {
1531 yyextra->endMarker="endmanonly";
1532 BEGIN(St_SecSkip);
1533 }
1534<St_Sections>{CMD}"rtfonly"/[^a-z_A-Z0-9] {
1535 yyextra->endMarker="endrtfonly";
1536 BEGIN(St_SecSkip);
1537 }
1538<St_Sections>{CMD}"xmlonly"/[^a-z_A-Z0-9] {
1539 yyextra->endMarker="endxmlonly";
1540 BEGIN(St_SecSkip);
1541 }
1542<St_Sections>{CMD}"docbookonly"/[^a-z_A-Z0-9] {
1543 yyextra->endMarker="enddocbookonly";
1544 BEGIN(St_SecSkip);
1545 }
1546<St_Sections>{CMD}"code"/[^a-z_A-Z0-9] {
1547 yyextra->endMarker="endcode";
1548 BEGIN(St_SecSkip);
1549 }
1550<St_Sections>{CMD}"icode"/[^a-z_A-Z0-9] {
1551 yyextra->endMarker="endicode";
1552 BEGIN(St_SecSkip);
1553 }
1554<St_Sections>"<!--" {
1555 yyextra->endMarker="-->";
1556 BEGIN(St_SecSkip);
1557 }
1558<St_SecSkip>{CMD}{ID} {
1559 if (yyextra->endMarker==yytext+1)
1560 {
1561 BEGIN(St_Sections);
1562 }
1563 }
1564<St_SecSkip>"-->" {
1565 if (yyextra->endMarker==yytext)
1566 {
1567 BEGIN(St_Sections);
1568 }
1569 }
1570<St_SecSkip>[^a-z_A-Z0-9\-\\\@]+
1571<St_SecSkip>.
1572<St_SecSkip>(\n|"\\ilinebr")
1573<St_Sections>.
1574<St_Sections>(\n|"\\ilinebr")
1575<St_SecLabel1>({REQID}|{LABELID}) {
1576 lineCount(yytext,yyleng);
1577 yyextra->secLabel = yytext;
1578 processSection(yyscanner);
1579 BEGIN(St_Sections);
1580 }
1581<St_SecLabel2>({REQID}|{LABELID}){BLANK}+ |
1582<St_SecLabel2>({REQID}|{LABELID}) {
1583 yyextra->secLabel = yytext;
1584 yyextra->secLabel = yyextra->secLabel.stripWhiteSpace();
1585 BEGIN(St_SecTitle);
1586 }
1587<St_SecTitle>[^\n]+ |
1588<St_SecTitle>[^\n]*\n {
1589 lineCount(yytext,yyleng);
1590 yyextra->secTitle = yytext;
1591 yyextra->secTitle = yyextra->secTitle.stripWhiteSpace();
1592 if (yyextra->secTitle.endsWith("\\ilinebr"))
1593 {
1594 yyextra->secTitle.left(yyextra->secTitle.length()-8);
1595 }
1596 processSection(yyscanner);
1597 BEGIN(St_Sections);
1598 }
1599<St_SecTitle,St_SecLabel1,St_SecLabel2>. {
1600 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}' while looking for section label or title",yytext);
1601 }
1602
1603<St_Snippet>[^\\\n]+ {
1604 yyextra->token.name += yytext;
1605 }
1606<St_Snippet>"\\" {
1607 yyextra->token.name += yytext;
1608 }
1609<St_Snippet>(\n|"\\ilinebr") {
1610 unput_string(yytext,yyleng);
1611 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1612 return Token::make_TK_WORD();
1613 }
1614
1615 /* Generic rules that work for all states */
1616<*>\n {
1617 lineCount(yytext,yyleng);
1618 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected new line character");
1619 }
1620<*>"\\ilinebr" {
1621 }
1622<*>[\\@<>&$#%~"=] { /* unescaped special character */
1623 //warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}', assuming command \\{} was meant.",yytext,yytext);
1624 yyextra->token.name = yytext;
1625 return Token::char_to_command(yytext[0]);
1626 }
1627<*>. {
1628 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}'",yytext);
1629 }
1630%%
1631
1632//--------------------------------------------------------------------------
1633
1634static int yyread(yyscan_t yyscanner,char *buf,int max_size)
1635{
1636 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1637 int c=0;
1638 const char *p = yyextra->inputString + yyextra->inputPos;
1639 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1640 yyextra->inputPos+=c;
1641 return c;
1642}
1643
1644static void processSection(yyscan_t yyscanner)
1645{
1646 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1647 //printf("%s: found section/anchor with name '%s'\n",qPrint(yyextra->fileName),qPrint(yyextra->secLabel));
1648 QCString file;
1649 if (yyextra->definition)
1650 {
1651 file = yyextra->definition->getOutputFileBase();
1652 }
1653 else
1654 {
1655 warn(yyextra->fileName,yyextra->yyLineNr,"Found section/anchor {} without context",yyextra->secLabel);
1656 }
1657 SectionInfo *si = SectionManager::instance().find(yyextra->secLabel);
1658 if (si)
1659 {
1660 si->setFileName(file);
1661 si->setType(yyextra->secType);
1662 }
1663}
1664
1665static void handleHtmlTag(yyscan_t yyscanner,const char *text)
1666{
1667 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1668
1669 QCString tagText(text);
1670 yyextra->token.text = tagText;
1671 yyextra->token.attribs.clear();
1672 yyextra->token.endTag = FALSE;
1673 yyextra->token.emptyTag = FALSE;
1674
1675 // Check for end tag
1676 int startNamePos=1;
1677 if (tagText.at(1)=='/')
1678 {
1679 yyextra->token.endTag = TRUE;
1680 startNamePos++;
1681 }
1682
1683 // Parse the name portion
1684 int i = startNamePos;
1685 for (i=startNamePos; i < (int)yyleng; i++)
1686 {
1687 // Check for valid HTML/XML name chars (including namespaces)
1688 char c = tagText.at(i);
1689 if (!(isalnum(c) || c=='-' || c=='_' || c==':')) break;
1690 }
1691 yyextra->token.name = tagText.mid(startNamePos,i-startNamePos);
1692
1693 // Parse the attributes. Each attribute is a name, value pair
1694 // The result is stored in yyextra->token.attribs.
1695 int startAttribList = i;
1696 while (i<(int)yyleng)
1697 {
1698 char c=tagText.at(i);
1699 // skip spaces
1700 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1701 // check for end of the tag
1702 if (c == '>') break;
1703 // Check for XML style "empty" tag.
1704 if (c == '/')
1705 {
1706 yyextra->token.emptyTag = TRUE;
1707 break;
1708 }
1709 int startName=i;
1710 // search for end of name
1711 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='=' && c!= '>') { c=tagText.at(++i); }
1712 int endName=i;
1713 QCString optName,optValue;
1714 optName = tagText.mid(startName,endName-startName).lower();
1715 // skip spaces
1716 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1717 if (tagText.at(i)=='=') // option has value
1718 {
1719 int startAttrib=0, endAttrib=0;
1720 c=tagText.at(++i);
1721 // skip spaces
1722 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1723 if (tagText.at(i)=='\'') // option '...'
1724 {
1725 c=tagText.at(++i);
1726 startAttrib=i;
1727
1728 // search for matching quote
1729 while (i<(int)yyleng && c!='\'') { c=tagText.at(++i); }
1730 endAttrib=i;
1731 if (i<(int)yyleng) { c=tagText.at(++i);}
1732 }
1733 else if (tagText.at(i)=='"') // option "..."
1734 {
1735 c=tagText.at(++i);
1736 startAttrib=i;
1737 // search for matching quote
1738 while (i<(int)yyleng && c!='"') { c=tagText.at(++i); }
1739 endAttrib=i;
1740 if (i<(int)yyleng) { c=tagText.at(++i);}
1741 }
1742 else // value without any quotes
1743 {
1744 startAttrib=i;
1745 // search for separator or end symbol
1746 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='>') { c=tagText.at(++i); }
1747 endAttrib=i;
1748 if (i<(int)yyleng) { c=tagText.at(++i);}
1749 }
1750 optValue = tagText.mid(startAttrib,endAttrib-startAttrib);
1751 if (optName == "align") optValue = optValue.lower();
1752 else if (optName == "valign")
1753 {
1754 optValue = optValue.lower();
1755 if (optValue == "center") optValue="middle";
1756 }
1757 }
1758 else // start next option
1759 {
1760 }
1761 //printf("=====> Adding option name=<%s> value=<%s>\n",
1762 // qPrint(optName),qPrint(optValue));
1763 yyextra->token.attribs.emplace_back(optName,optValue);
1764 }
1765 yyextra->token.attribsStr = tagText.mid(startAttribList,i-startAttribList);
1766}
1767
1773
1774
1776{
1777 yyscan_t yyscanner = p->yyscanner;
1778 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1779 //printf("DocTokenizer::pushContext() stack=%zu\n",yyextra->lexerStack.size());
1780 yyextra->lexerStack.push(
1781 std::make_unique<DocLexerContext>(
1782 yyextra->token,YY_START,
1783 yyextra->autoListLevel,
1784 yyextra->inputPos,
1785 yyextra->inputString,
1786 YY_CURRENT_BUFFER));
1787 yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner), yyscanner);
1788}
1789
1791{
1792 yyscan_t yyscanner = p->yyscanner;
1793 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1794 //printf("DocTokenizer::popContext() stack=%zu\n",yyextra->lexerStack.size());
1795 if (yyextra->lexerStack.empty()) return FALSE;
1796 const auto &ctx = yyextra->lexerStack.top();
1797 yyextra->autoListLevel = ctx->autoListLevel;
1798 yyextra->inputPos = ctx->inputPos;
1799 yyextra->inputString = ctx->inputString;
1800 yyextra->token = ctx->token;
1801
1802 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
1803 yy_switch_to_buffer(ctx->state, yyscanner);
1804
1805 BEGIN(ctx->rule);
1806 yyextra->lexerStack.pop();
1807 return TRUE;
1808}
1809
1810
1811DocTokenizer::DocTokenizer() : p(std::make_unique<Private>())
1812{
1813 //printf("%p:DocTokenizer::DocTokenizer()\n",(void*)this);
1814 doctokenizerYYlex_init_extra(&p->extra,&p->yyscanner);
1815#ifdef FLEX_DEBUG
1816 doctokenizerYYset_debug(Debug::isFlagSet(Debug::Lex_doctokenizer)?1:0,p->yyscanner);
1817#endif
1818}
1819
1821{
1822 //printf("%p:DocTokenizer::~DocTokenizer()\n",(void*)this);
1823 doctokenizerYYlex_destroy(p->yyscanner);
1824}
1825
1827{
1828 return doctokenizerYYlex(p->yyscanner);
1829}
1830
1832{
1833 yyscan_t yyscanner = p->yyscanner;
1834 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1835 unput_string(tag.data(),tag.length());
1836}
1837
1839 const QCString &fileName)
1840{
1841 yyscan_t yyscanner = p->yyscanner;
1842 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1843
1844 if (input.isEmpty()) return;
1845 DebugLex debugLex(Debug::Lex_doctokenizer, __FILE__, qPrint(fileName));
1846 yyextra->inputString = input.data();
1847 //printf("parsing --->'%s'<---\n",input);
1848 yyextra->inputPos = 0;
1849 yyextra->definition = d;
1850 yyextra->fileName = fileName;
1851 BEGIN(St_Sections);
1852 yyextra->yyLineNr = 1;
1853 doctokenizerYYlex(yyscanner);
1854}
1855
1856void DocTokenizer::init(const char *input,const QCString &fileName,bool markdownSupport, bool insideHtmlLink)
1857{
1858 yyscan_t yyscanner = p->yyscanner;
1859 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1860 yyextra->autoListLevel = 0;
1861 yyextra->inputString = input;
1862 yyextra->inputPos = 0;
1863 yyextra->fileName = fileName;
1864 yyextra->insidePre = FALSE;
1865 yyextra->markdownSupport = markdownSupport;
1866 yyextra->insideHtmlLink = insideHtmlLink;
1867 BEGIN(St_Para);
1868}
1869
1871{
1872 yyscan_t yyscanner = p->yyscanner;
1873 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1874 return &yyextra->token;
1875}
1876
1878{
1879 yyscan_t yyscanner = p->yyscanner;
1880 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1881 yyextra->token = TokenInfo();
1882 return &yyextra->token;
1883}
1884
1886{
1887 yyscan_t yyscanner = p->yyscanner;
1888 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1889 yyextra->insideHtmlLink = false;
1890 BEGIN(St_Para);
1891}
1892
1894{
1895 yyscan_t yyscanner = p->yyscanner;
1896 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1897 BEGIN(St_Title);
1898}
1899
1901{
1902 yyscan_t yyscanner = p->yyscanner;
1903 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1904 BEGIN(St_TitleV);
1905}
1906
1908{
1909 yyscan_t yyscanner = p->yyscanner;
1910 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1911 yyextra->token.verb="";
1912 yyextra->token.name="";
1913 BEGIN(St_CodeOpt);
1914}
1915
1917{
1918 yyscan_t yyscanner = p->yyscanner;
1919 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1920 yyextra->token.verb="";
1921 yyextra->token.name="";
1922 BEGIN(St_iCodeOpt);
1923}
1924
1926{
1927 yyscan_t yyscanner = p->yyscanner;
1928 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1929 yyextra->token.verb="";
1930 yyextra->token.name="";
1931 BEGIN(St_XmlCode);
1932}
1933
1935{
1936 yyscan_t yyscanner = p->yyscanner;
1937 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1938 yyextra->token.verb="";
1939 yyextra->token.name="";
1940 BEGIN(St_HtmlOnlyOption);
1941}
1942
1944{
1945 yyscan_t yyscanner = p->yyscanner;
1946 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1947 yyextra->token.verb="";
1948 BEGIN(St_ManOnly);
1949}
1950
1952{
1953 yyscan_t yyscanner = p->yyscanner;
1954 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1955 yyextra->token.verb="";
1956 BEGIN(St_RtfOnly);
1957}
1958
1960{
1961 yyscan_t yyscanner = p->yyscanner;
1962 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1963 yyextra->token.verb="";
1964 BEGIN(St_XmlOnly);
1965}
1966
1968{
1969 yyscan_t yyscanner = p->yyscanner;
1970 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1971 yyextra->token.verb="";
1972 BEGIN(St_DbOnly);
1973}
1974
1976{
1977 yyscan_t yyscanner = p->yyscanner;
1978 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1979 yyextra->token.verb="";
1980 BEGIN(St_LatexOnly);
1981}
1982
1984{
1985 yyscan_t yyscanner = p->yyscanner;
1986 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1987 yyextra->token.verb="";
1988 BEGIN(St_ILiteral);
1989}
1990
1992{
1993 yyscan_t yyscanner = p->yyscanner;
1994 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1995 yyextra->token.verb="";
1996 BEGIN(St_ILiteralOpt);
1997}
1998
2000{
2001 yyscan_t yyscanner = p->yyscanner;
2002 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2003 yyextra->token.verb="";
2004 BEGIN(St_Verbatim);
2005}
2006
2008{
2009 yyscan_t yyscanner = p->yyscanner;
2010 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2011 yyextra->token.verb="";
2012 BEGIN(St_iVerbatim);
2013}
2014
2016{
2017 yyscan_t yyscanner = p->yyscanner;
2018 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2019 yyextra->token.verb="";
2020 BEGIN(St_Dot);
2021}
2022
2024{
2025 yyscan_t yyscanner = p->yyscanner;
2026 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2027 yyextra->token.verb="";
2028 BEGIN(St_Msc);
2029}
2030
2032{
2033 yyscan_t yyscanner = p->yyscanner;
2034 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2035 yyextra->token.verb="";
2036 yyextra->token.sectionId="";
2037 BEGIN(St_PlantUMLOpt);
2038}
2039
2041{
2042 yyscan_t yyscanner = p->yyscanner;
2043 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2044 yyextra->token.verb="";
2045 BEGIN(St_PlantUML);
2046}
2047
2049{
2050 yyscan_t yyscanner = p->yyscanner;
2051 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2052 yyextra->token.verb="";
2053 yyextra->token.sectionId="";
2054 BEGIN(St_MermaidOpt);
2055}
2056
2058{
2059 yyscan_t yyscanner = p->yyscanner;
2060 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2061 yyextra->token.verb="";
2062 BEGIN(St_Mermaid);
2063}
2064
2066{
2067 yyscan_t yyscanner = p->yyscanner;
2068 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2069 BEGIN(St_Param);
2070}
2071
2073{
2074 yyscan_t yyscanner = p->yyscanner;
2075 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2076 BEGIN(St_XRefItem);
2077}
2078
2080{
2081 yyscan_t yyscanner = p->yyscanner;
2082 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2083 BEGIN(St_File);
2084}
2085
2087{
2088 yyscan_t yyscanner = p->yyscanner;
2089 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2090 BEGIN(St_IFile);
2091}
2092
2094{
2095 yyscan_t yyscanner = p->yyscanner;
2096 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2097 yyextra->token.name = "";
2098 BEGIN(St_Pattern);
2099}
2100
2102{
2103 yyscan_t yyscanner = p->yyscanner;
2104 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2105 BEGIN(St_Link);
2106}
2107
2109{
2110 yyscan_t yyscanner = p->yyscanner;
2111 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2112 BEGIN(St_Cite);
2113}
2114
2116{
2117 yyscan_t yyscanner = p->yyscanner;
2118 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2119 BEGIN(St_DoxyConfig);
2120}
2121
2123{
2124 yyscan_t yyscanner = p->yyscanner;
2125 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2126 yyextra->expectQuote=false;
2127 BEGIN(St_Ref);
2128}
2129
2131{
2132 yyscan_t yyscanner = p->yyscanner;
2133 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2134 BEGIN(St_IntRef);
2135}
2136
2138{
2139 yyscan_t yyscanner = p->yyscanner;
2140 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2141 BEGIN(St_Text);
2142}
2143
2145{
2146 yyscan_t yyscanner = p->yyscanner;
2147 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2148 BEGIN(St_SkipTitle);
2149}
2150
2152{
2153 yyscan_t yyscanner = p->yyscanner;
2154 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2155 BEGIN(St_Anchor);
2156}
2157
2159{
2160 yyscan_t yyscanner = p->yyscanner;
2161 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2162 BEGIN(St_Prefix);
2163}
2164
2166{
2167 yyscan_t yyscanner = p->yyscanner;
2168 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2169 yyextra->token.name="";
2170 BEGIN(St_Snippet);
2171}
2172
2174{
2175 yyscan_t yyscanner = p->yyscanner;
2176 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2177 BEGIN(St_SetScope);
2178}
2179
2181{
2182 yyscan_t yyscanner = p->yyscanner;
2183 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2184 yyextra->token.name="";
2185 BEGIN(St_Options);
2186}
2187
2189{
2190 yyscan_t yyscanner = p->yyscanner;
2191 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2192 yyextra->token.name="";
2193 BEGIN(St_Block);
2194}
2195
2197{
2198 yyscan_t yyscanner = p->yyscanner;
2199 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2200 yyextra->token.name="";
2201 BEGIN(St_Emoji);
2202}
2203
2205{
2206 yyscan_t yyscanner = p->yyscanner;
2207 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2208 BEGIN(St_ILine);
2209}
2210
2212{
2213 yyscan_t yyscanner = p->yyscanner;
2214 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2215 BEGIN(St_QuotedString);
2216}
2217
2219{
2220 yyscan_t yyscanner = p->yyscanner;
2221 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2222 BEGIN(St_ShowDate);
2223}
2224
2226{
2227 yyscan_t yyscanner = p->yyscanner;
2228 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2229 yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner );
2230}
2231
2233{
2234 yyscan_t yyscanner = p->yyscanner;
2235 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2236 yyextra->insidePre = b;
2237}
2238
2240{
2241 yyscan_t yyscanner = p->yyscanner;
2242 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2243 QCString tagName = tag;
2244 int l = static_cast<int>(tagName.length());
2245 unput('>');
2246 for (int i=l-1;i>=0;i--)
2247 {
2248 unput(tag[i]);
2249 }
2250 unput('<');
2251}
2252
2254{
2255 yyscan_t yyscanner = p->yyscanner;
2256 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2257 yyextra->autoListLevel++;
2258}
2259
2261{
2262 yyscan_t yyscanner = p->yyscanner;
2263 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2264 yyextra->autoListLevel--;
2265}
2266
2268{
2269 yyscan_t yyscanner = p->yyscanner;
2270 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2271 yyextra->fileName = fileName;
2272}
2273
2275{
2276 yyscan_t yyscanner = p->yyscanner;
2277 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2278 return yyextra->fileName;
2279}
2280
2282{
2283 yyscan_t yyscanner = p->yyscanner;
2284 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2285 yyextra->yyLineNr = lineno;
2286}
2287
2289{
2290 yyscan_t yyscanner = p->yyscanner;
2291 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2292 return yyextra->yyLineNr;
2293}
2294
2296{
2297 yyscan_t yyscanner = p->yyscanner;
2298 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2299 yyextra->stateStack.push(YYSTATE);
2300}
2301
2303{
2304 yyscan_t yyscanner = p->yyscanner;
2305 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2306 assert(!yyextra->stateStack.empty());
2307 BEGIN(yyextra->stateStack.top());
2308 yyextra->stateStack.pop();
2309}
2310
2311#include "doctokenizer.l.h"
@ Lex_doctokenizer
Definition debug.h:60
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:133
TokenInfo * token()
void setStateTitleAttrValue()
void setStateILiteralOpt()
void setStateILiteral()
void setStateCite()
void setStateSnippet()
void setStatePrefix()
void setStateEmoji()
void setStateMermaidOpt()
void init(const char *input, const QCString &fileName, bool markdownSupport, bool insideHtmlLink)
void setLineNr(int lineno)
void setStateCode()
void setStatePattern()
void startAutoList()
void setStateIFile()
QCString getFileName() const
void setFileName(const QCString &fileName)
void setStateSkipTitle()
void setStateParam()
void setStateBlock()
void setStatePlantUMLOpt()
void setStateAnchor()
void findSections(const QCString &input, const Definition *d, const QCString &fileName)
void setStateRtfOnly()
void setStateVerbatim()
void setStateLink()
void setStateTitle()
void setStateFile()
void setStateLatexOnly()
void setStateManOnly()
void setStateShowDate()
void setInsidePre(bool b)
void setStateXRefItem()
int getLineNr() const
void setStateText()
void setStateXmlCode()
void unputString(const QCString &tag)
void setStateDbOnly()
void setStateHtmlOnly()
void setStateInternalRef()
void setStateILine()
void setStateICode()
void setStateOptions()
void setStateDoxyConfig()
void setStateQuotedString()
void setStatePara()
void setStatePlantUML()
TokenInfo * resetToken()
void setStateIVerbatim()
void setStateXmlOnly()
std::unique_ptr< Private > p
void setStateMermaid()
void setStateSetScope()
void pushBackHtmlTag(const QCString &tag)
const T * find(const std::string &key) const
Definition linkedmap.h:47
QCString lower() const
Definition qcstring.h:249
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
void clear()
Definition qcstring.h:182
class that provide information about a section.
Definition section.h:58
void setType(SectionType t)
Definition section.h:81
void setFileName(const QCString &fn)
Definition section.h:80
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
Definition code.l:3982
#define YY_BUF_SIZE
Definition commentcnv.l:19
const char * qPrint(const char *s)
Definition qcstring.h:687
doctokenizerYY_state extra