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:103
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:245
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:597
#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:176
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:170
QCString right(size_t len) const
Definition qcstring.h:238
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:556
#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:264
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:233
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}"mermaid"/[^a-z_A-Z0-9] {
1519 yyextra->endMarker="endmermaid";
1520 BEGIN(St_SecSkip);
1521 }
1522<St_Sections>{CMD}"startuml"/[^a-z_A-Z0-9] {
1523 yyextra->endMarker="enduml";
1524 BEGIN(St_SecSkip);
1525 }
1526<St_Sections>{CMD}"htmlonly"/[^a-z_A-Z0-9] {
1527 yyextra->endMarker="endhtmlonly";
1528 BEGIN(St_SecSkip);
1529 }
1530<St_Sections>{CMD}"latexonly"/[^a-z_A-Z0-9] {
1531 yyextra->endMarker="endlatexonly";
1532 BEGIN(St_SecSkip);
1533 }
1534<St_Sections>{CMD}"manonly"/[^a-z_A-Z0-9] {
1535 yyextra->endMarker="endmanonly";
1536 BEGIN(St_SecSkip);
1537 }
1538<St_Sections>{CMD}"rtfonly"/[^a-z_A-Z0-9] {
1539 yyextra->endMarker="endrtfonly";
1540 BEGIN(St_SecSkip);
1541 }
1542<St_Sections>{CMD}"xmlonly"/[^a-z_A-Z0-9] {
1543 yyextra->endMarker="endxmlonly";
1544 BEGIN(St_SecSkip);
1545 }
1546<St_Sections>{CMD}"docbookonly"/[^a-z_A-Z0-9] {
1547 yyextra->endMarker="enddocbookonly";
1548 BEGIN(St_SecSkip);
1549 }
1550<St_Sections>{CMD}"code"/[^a-z_A-Z0-9] {
1551 yyextra->endMarker="endcode";
1552 BEGIN(St_SecSkip);
1553 }
1554<St_Sections>{CMD}"icode"/[^a-z_A-Z0-9] {
1555 yyextra->endMarker="endicode";
1556 BEGIN(St_SecSkip);
1557 }
1558<St_Sections>"<!--" {
1559 yyextra->endMarker="-->";
1560 BEGIN(St_SecSkip);
1561 }
1562<St_SecSkip>{CMD}{ID} {
1563 if (yyextra->endMarker==yytext+1)
1564 {
1565 BEGIN(St_Sections);
1566 }
1567 }
1568<St_SecSkip>"-->" {
1569 if (yyextra->endMarker==yytext)
1570 {
1571 BEGIN(St_Sections);
1572 }
1573 }
1574<St_SecSkip>[^a-z_A-Z0-9\-\\\@]+
1575<St_SecSkip>.
1576<St_SecSkip>(\n|"\\ilinebr")
1577<St_Sections>.
1578<St_Sections>(\n|"\\ilinebr")
1579<St_SecLabel1>({REQID}|{LABELID}) {
1580 lineCount(yytext,yyleng);
1581 yyextra->secLabel = yytext;
1582 processSection(yyscanner);
1583 BEGIN(St_Sections);
1584 }
1585<St_SecLabel2>({REQID}|{LABELID}){BLANK}+ |
1586<St_SecLabel2>({REQID}|{LABELID}) {
1587 yyextra->secLabel = yytext;
1588 yyextra->secLabel = yyextra->secLabel.stripWhiteSpace();
1589 BEGIN(St_SecTitle);
1590 }
1591<St_SecTitle>[^\n]+ |
1592<St_SecTitle>[^\n]*\n {
1593 lineCount(yytext,yyleng);
1594 yyextra->secTitle = yytext;
1595 yyextra->secTitle = yyextra->secTitle.stripWhiteSpace();
1596 if (yyextra->secTitle.endsWith("\\ilinebr"))
1597 {
1598 yyextra->secTitle.left(yyextra->secTitle.length()-8);
1599 }
1600 processSection(yyscanner);
1601 BEGIN(St_Sections);
1602 }
1603<St_SecTitle,St_SecLabel1,St_SecLabel2>. {
1604 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}' while looking for section label or title",yytext);
1605 }
1606
1607<St_Snippet>[^\\\n]+ {
1608 yyextra->token.name += yytext;
1609 }
1610<St_Snippet>"\\" {
1611 yyextra->token.name += yytext;
1612 }
1613<St_Snippet>(\n|"\\ilinebr") {
1614 unput_string(yytext,yyleng);
1615 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1616 return Token::make_TK_WORD();
1617 }
1618
1619 /* Generic rules that work for all states */
1620<*>\n {
1621 lineCount(yytext,yyleng);
1622 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected new line character");
1623 }
1624<*>"\\ilinebr" {
1625 }
1626<*>[\\@<>&$#%~"=] { /* unescaped special character */
1627 //warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}', assuming command \\{} was meant.",yytext,yytext);
1628 yyextra->token.name = yytext;
1629 return Token::char_to_command(yytext[0]);
1630 }
1631<*>. {
1632 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}'",yytext);
1633 }
1634%%
1635
1636//--------------------------------------------------------------------------
1637
1638static int yyread(yyscan_t yyscanner,char *buf,int max_size)
1639{
1640 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1641 int c=0;
1642 const char *p = yyextra->inputString + yyextra->inputPos;
1643 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1644 yyextra->inputPos+=c;
1645 return c;
1646}
1647
1648static void processSection(yyscan_t yyscanner)
1649{
1650 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1651 //printf("%s: found section/anchor with name '%s'\n",qPrint(yyextra->fileName),qPrint(yyextra->secLabel));
1652 QCString file;
1653 if (yyextra->definition)
1654 {
1655 file = yyextra->definition->getOutputFileBase();
1656 }
1657 else
1658 {
1659 warn(yyextra->fileName,yyextra->yyLineNr,"Found section/anchor {} without context",yyextra->secLabel);
1660 }
1661 SectionInfo *si = SectionManager::instance().find(yyextra->secLabel);
1662 if (si)
1663 {
1664 si->setFileName(file);
1665 si->setType(yyextra->secType);
1666 }
1667}
1668
1669static void handleHtmlTag(yyscan_t yyscanner,const char *text)
1670{
1671 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1672
1673 QCString tagText(text);
1674 yyextra->token.text = tagText;
1675 yyextra->token.attribs.clear();
1676 yyextra->token.endTag = FALSE;
1677 yyextra->token.emptyTag = FALSE;
1678
1679 // Check for end tag
1680 int startNamePos=1;
1681 if (tagText.at(1)=='/')
1682 {
1683 yyextra->token.endTag = TRUE;
1684 startNamePos++;
1685 }
1686
1687 // Parse the name portion
1688 int i = startNamePos;
1689 for (i=startNamePos; i < (int)yyleng; i++)
1690 {
1691 // Check for valid HTML/XML name chars (including namespaces)
1692 char c = tagText.at(i);
1693 if (!(isalnum(c) || c=='-' || c=='_' || c==':')) break;
1694 }
1695 yyextra->token.name = tagText.mid(startNamePos,i-startNamePos);
1696
1697 // Parse the attributes. Each attribute is a name, value pair
1698 // The result is stored in yyextra->token.attribs.
1699 int startAttribList = i;
1700 while (i<(int)yyleng)
1701 {
1702 char c=tagText.at(i);
1703 // skip spaces
1704 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1705 // check for end of the tag
1706 if (c == '>') break;
1707 // Check for XML style "empty" tag.
1708 if (c == '/')
1709 {
1710 yyextra->token.emptyTag = TRUE;
1711 break;
1712 }
1713 int startName=i;
1714 // search for end of name
1715 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='=' && c!= '>') { c=tagText.at(++i); }
1716 int endName=i;
1717 QCString optName,optValue;
1718 optName = tagText.mid(startName,endName-startName).lower();
1719 // skip spaces
1720 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1721 if (tagText.at(i)=='=') // option has value
1722 {
1723 int startAttrib=0, endAttrib=0;
1724 c=tagText.at(++i);
1725 // skip spaces
1726 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1727 if (tagText.at(i)=='\'') // option '...'
1728 {
1729 c=tagText.at(++i);
1730 startAttrib=i;
1731
1732 // search for matching quote
1733 while (i<(int)yyleng && c!='\'') { c=tagText.at(++i); }
1734 endAttrib=i;
1735 if (i<(int)yyleng) { c=tagText.at(++i);}
1736 }
1737 else if (tagText.at(i)=='"') // option "..."
1738 {
1739 c=tagText.at(++i);
1740 startAttrib=i;
1741 // search for matching quote
1742 while (i<(int)yyleng && c!='"') { c=tagText.at(++i); }
1743 endAttrib=i;
1744 if (i<(int)yyleng) { c=tagText.at(++i);}
1745 }
1746 else // value without any quotes
1747 {
1748 startAttrib=i;
1749 // search for separator or end symbol
1750 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='>') { c=tagText.at(++i); }
1751 endAttrib=i;
1752 if (i<(int)yyleng) { c=tagText.at(++i);}
1753 }
1754 optValue = tagText.mid(startAttrib,endAttrib-startAttrib);
1755 if (optName == "align") optValue = optValue.lower();
1756 else if (optName == "valign")
1757 {
1758 optValue = optValue.lower();
1759 if (optValue == "center") optValue="middle";
1760 }
1761 }
1762 else // start next option
1763 {
1764 }
1765 //printf("=====> Adding option name=<%s> value=<%s>\n",
1766 // qPrint(optName),qPrint(optValue));
1767 yyextra->token.attribs.emplace_back(optName,optValue);
1768 }
1769 yyextra->token.attribsStr = tagText.mid(startAttribList,i-startAttribList);
1770}
1771
1777
1778
1780{
1781 yyscan_t yyscanner = p->yyscanner;
1782 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1783 //printf("DocTokenizer::pushContext() stack=%zu\n",yyextra->lexerStack.size());
1784 yyextra->lexerStack.push(
1785 std::make_unique<DocLexerContext>(
1786 yyextra->token,YY_START,
1787 yyextra->autoListLevel,
1788 yyextra->inputPos,
1789 yyextra->inputString,
1790 YY_CURRENT_BUFFER));
1791 yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner), yyscanner);
1792}
1793
1795{
1796 yyscan_t yyscanner = p->yyscanner;
1797 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1798 //printf("DocTokenizer::popContext() stack=%zu\n",yyextra->lexerStack.size());
1799 if (yyextra->lexerStack.empty()) return FALSE;
1800 const auto &ctx = yyextra->lexerStack.top();
1801 yyextra->autoListLevel = ctx->autoListLevel;
1802 yyextra->inputPos = ctx->inputPos;
1803 yyextra->inputString = ctx->inputString;
1804 yyextra->token = ctx->token;
1805
1806 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
1807 yy_switch_to_buffer(ctx->state, yyscanner);
1808
1809 BEGIN(ctx->rule);
1810 yyextra->lexerStack.pop();
1811 return TRUE;
1812}
1813
1814
1815DocTokenizer::DocTokenizer() : p(std::make_unique<Private>())
1816{
1817 //printf("%p:DocTokenizer::DocTokenizer()\n",(void*)this);
1818 doctokenizerYYlex_init_extra(&p->extra,&p->yyscanner);
1819#ifdef FLEX_DEBUG
1820 doctokenizerYYset_debug(Debug::isFlagSet(Debug::Lex_doctokenizer)?1:0,p->yyscanner);
1821#endif
1822}
1823
1825{
1826 //printf("%p:DocTokenizer::~DocTokenizer()\n",(void*)this);
1827 doctokenizerYYlex_destroy(p->yyscanner);
1828}
1829
1831{
1832 return doctokenizerYYlex(p->yyscanner);
1833}
1834
1836{
1837 yyscan_t yyscanner = p->yyscanner;
1838 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1839 unput_string(tag.data(),tag.length());
1840}
1841
1843 const QCString &fileName)
1844{
1845 yyscan_t yyscanner = p->yyscanner;
1846 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1847
1848 if (input.isEmpty()) return;
1849 DebugLex debugLex(Debug::Lex_doctokenizer, __FILE__, qPrint(fileName));
1850 yyextra->inputString = input.data();
1851 //printf("parsing --->'%s'<---\n",input);
1852 yyextra->inputPos = 0;
1853 yyextra->definition = d;
1854 yyextra->fileName = fileName;
1855 BEGIN(St_Sections);
1856 yyextra->yyLineNr = 1;
1857 doctokenizerYYlex(yyscanner);
1858}
1859
1860void DocTokenizer::init(const char *input,const QCString &fileName,bool markdownSupport, bool insideHtmlLink)
1861{
1862 yyscan_t yyscanner = p->yyscanner;
1863 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1864 yyextra->autoListLevel = 0;
1865 yyextra->inputString = input;
1866 yyextra->inputPos = 0;
1867 yyextra->fileName = fileName;
1868 yyextra->insidePre = FALSE;
1869 yyextra->markdownSupport = markdownSupport;
1870 yyextra->insideHtmlLink = insideHtmlLink;
1871 BEGIN(St_Para);
1872}
1873
1875{
1876 yyscan_t yyscanner = p->yyscanner;
1877 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1878 return &yyextra->token;
1879}
1880
1882{
1883 yyscan_t yyscanner = p->yyscanner;
1884 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1885 yyextra->token = TokenInfo();
1886 return &yyextra->token;
1887}
1888
1890{
1891 yyscan_t yyscanner = p->yyscanner;
1892 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1893 yyextra->insideHtmlLink = false;
1894 BEGIN(St_Para);
1895}
1896
1898{
1899 yyscan_t yyscanner = p->yyscanner;
1900 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1901 BEGIN(St_Title);
1902}
1903
1905{
1906 yyscan_t yyscanner = p->yyscanner;
1907 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1908 BEGIN(St_TitleV);
1909}
1910
1912{
1913 yyscan_t yyscanner = p->yyscanner;
1914 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1915 yyextra->token.verb="";
1916 yyextra->token.name="";
1917 BEGIN(St_CodeOpt);
1918}
1919
1921{
1922 yyscan_t yyscanner = p->yyscanner;
1923 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1924 yyextra->token.verb="";
1925 yyextra->token.name="";
1926 BEGIN(St_iCodeOpt);
1927}
1928
1930{
1931 yyscan_t yyscanner = p->yyscanner;
1932 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1933 yyextra->token.verb="";
1934 yyextra->token.name="";
1935 BEGIN(St_XmlCode);
1936}
1937
1939{
1940 yyscan_t yyscanner = p->yyscanner;
1941 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1942 yyextra->token.verb="";
1943 yyextra->token.name="";
1944 BEGIN(St_HtmlOnlyOption);
1945}
1946
1948{
1949 yyscan_t yyscanner = p->yyscanner;
1950 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1951 yyextra->token.verb="";
1952 BEGIN(St_ManOnly);
1953}
1954
1956{
1957 yyscan_t yyscanner = p->yyscanner;
1958 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1959 yyextra->token.verb="";
1960 BEGIN(St_RtfOnly);
1961}
1962
1964{
1965 yyscan_t yyscanner = p->yyscanner;
1966 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1967 yyextra->token.verb="";
1968 BEGIN(St_XmlOnly);
1969}
1970
1972{
1973 yyscan_t yyscanner = p->yyscanner;
1974 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1975 yyextra->token.verb="";
1976 BEGIN(St_DbOnly);
1977}
1978
1980{
1981 yyscan_t yyscanner = p->yyscanner;
1982 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1983 yyextra->token.verb="";
1984 BEGIN(St_LatexOnly);
1985}
1986
1988{
1989 yyscan_t yyscanner = p->yyscanner;
1990 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1991 yyextra->token.verb="";
1992 BEGIN(St_ILiteral);
1993}
1994
1996{
1997 yyscan_t yyscanner = p->yyscanner;
1998 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1999 yyextra->token.verb="";
2000 BEGIN(St_ILiteralOpt);
2001}
2002
2004{
2005 yyscan_t yyscanner = p->yyscanner;
2006 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2007 yyextra->token.verb="";
2008 BEGIN(St_Verbatim);
2009}
2010
2012{
2013 yyscan_t yyscanner = p->yyscanner;
2014 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2015 yyextra->token.verb="";
2016 BEGIN(St_iVerbatim);
2017}
2018
2020{
2021 yyscan_t yyscanner = p->yyscanner;
2022 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2023 yyextra->token.verb="";
2024 BEGIN(St_Dot);
2025}
2026
2028{
2029 yyscan_t yyscanner = p->yyscanner;
2030 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2031 yyextra->token.verb="";
2032 BEGIN(St_Msc);
2033}
2034
2036{
2037 yyscan_t yyscanner = p->yyscanner;
2038 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2039 yyextra->token.verb="";
2040 yyextra->token.sectionId="";
2041 BEGIN(St_PlantUMLOpt);
2042}
2043
2045{
2046 yyscan_t yyscanner = p->yyscanner;
2047 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2048 yyextra->token.verb="";
2049 BEGIN(St_PlantUML);
2050}
2051
2053{
2054 yyscan_t yyscanner = p->yyscanner;
2055 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2056 yyextra->token.verb="";
2057 yyextra->token.sectionId="";
2058 BEGIN(St_MermaidOpt);
2059}
2060
2062{
2063 yyscan_t yyscanner = p->yyscanner;
2064 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2065 yyextra->token.verb="";
2066 BEGIN(St_Mermaid);
2067}
2068
2070{
2071 yyscan_t yyscanner = p->yyscanner;
2072 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2073 BEGIN(St_Param);
2074}
2075
2077{
2078 yyscan_t yyscanner = p->yyscanner;
2079 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2080 BEGIN(St_XRefItem);
2081}
2082
2084{
2085 yyscan_t yyscanner = p->yyscanner;
2086 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2087 BEGIN(St_File);
2088}
2089
2091{
2092 yyscan_t yyscanner = p->yyscanner;
2093 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2094 BEGIN(St_IFile);
2095}
2096
2098{
2099 yyscan_t yyscanner = p->yyscanner;
2100 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2101 yyextra->token.name = "";
2102 BEGIN(St_Pattern);
2103}
2104
2106{
2107 yyscan_t yyscanner = p->yyscanner;
2108 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2109 BEGIN(St_Link);
2110}
2111
2113{
2114 yyscan_t yyscanner = p->yyscanner;
2115 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2116 BEGIN(St_Cite);
2117}
2118
2120{
2121 yyscan_t yyscanner = p->yyscanner;
2122 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2123 BEGIN(St_DoxyConfig);
2124}
2125
2127{
2128 yyscan_t yyscanner = p->yyscanner;
2129 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2130 yyextra->expectQuote=false;
2131 BEGIN(St_Ref);
2132}
2133
2135{
2136 yyscan_t yyscanner = p->yyscanner;
2137 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2138 BEGIN(St_IntRef);
2139}
2140
2142{
2143 yyscan_t yyscanner = p->yyscanner;
2144 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2145 BEGIN(St_Text);
2146}
2147
2149{
2150 yyscan_t yyscanner = p->yyscanner;
2151 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2152 BEGIN(St_SkipTitle);
2153}
2154
2156{
2157 yyscan_t yyscanner = p->yyscanner;
2158 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2159 BEGIN(St_Anchor);
2160}
2161
2163{
2164 yyscan_t yyscanner = p->yyscanner;
2165 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2166 BEGIN(St_Prefix);
2167}
2168
2170{
2171 yyscan_t yyscanner = p->yyscanner;
2172 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2173 yyextra->token.name="";
2174 BEGIN(St_Snippet);
2175}
2176
2178{
2179 yyscan_t yyscanner = p->yyscanner;
2180 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2181 BEGIN(St_SetScope);
2182}
2183
2185{
2186 yyscan_t yyscanner = p->yyscanner;
2187 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2188 yyextra->token.name="";
2189 BEGIN(St_Options);
2190}
2191
2193{
2194 yyscan_t yyscanner = p->yyscanner;
2195 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2196 yyextra->token.name="";
2197 BEGIN(St_Block);
2198}
2199
2201{
2202 yyscan_t yyscanner = p->yyscanner;
2203 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2204 yyextra->token.name="";
2205 BEGIN(St_Emoji);
2206}
2207
2209{
2210 yyscan_t yyscanner = p->yyscanner;
2211 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2212 BEGIN(St_ILine);
2213}
2214
2216{
2217 yyscan_t yyscanner = p->yyscanner;
2218 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2219 BEGIN(St_QuotedString);
2220}
2221
2223{
2224 yyscan_t yyscanner = p->yyscanner;
2225 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2226 BEGIN(St_ShowDate);
2227}
2228
2230{
2231 yyscan_t yyscanner = p->yyscanner;
2232 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2233 yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner );
2234}
2235
2237{
2238 yyscan_t yyscanner = p->yyscanner;
2239 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2240 yyextra->insidePre = b;
2241}
2242
2244{
2245 yyscan_t yyscanner = p->yyscanner;
2246 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2247 QCString tagName = tag;
2248 int l = static_cast<int>(tagName.length());
2249 unput('>');
2250 for (int i=l-1;i>=0;i--)
2251 {
2252 unput(tag[i]);
2253 }
2254 unput('<');
2255}
2256
2258{
2259 yyscan_t yyscanner = p->yyscanner;
2260 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2261 yyextra->autoListLevel++;
2262}
2263
2265{
2266 yyscan_t yyscanner = p->yyscanner;
2267 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2268 yyextra->autoListLevel--;
2269}
2270
2272{
2273 yyscan_t yyscanner = p->yyscanner;
2274 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2275 yyextra->fileName = fileName;
2276}
2277
2279{
2280 yyscan_t yyscanner = p->yyscanner;
2281 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2282 return yyextra->fileName;
2283}
2284
2286{
2287 yyscan_t yyscanner = p->yyscanner;
2288 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2289 yyextra->yyLineNr = lineno;
2290}
2291
2293{
2294 yyscan_t yyscanner = p->yyscanner;
2295 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2296 return yyextra->yyLineNr;
2297}
2298
2300{
2301 yyscan_t yyscanner = p->yyscanner;
2302 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2303 yyextra->stateStack.push(YYSTATE);
2304}
2305
2307{
2308 yyscan_t yyscanner = p->yyscanner;
2309 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2310 assert(!yyextra->stateStack.empty());
2311 BEGIN(yyextra->stateStack.top());
2312 yyextra->stateStack.pop();
2313}
2314
2315#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:253
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:167
void clear()
Definition qcstring.h:186
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:691
doctokenizerYY_state extra