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// own header
34#include "doctokenizer.h"
35
36// standard includes
37#include <cctype>
38#include <stack>
39#include <string>
40
41// other includes
42#include "cmdmapper.h"
43#include "config.h"
44#include "debug.h"
45#include "definition.h"
46#include "docnode.h"
47#include "message.h"
48#include "portable.h"
49#include "regex.h"
50#include "section.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 size_t nl1 = text.find('\n');
112 size_t nl2 = text.find("\\ilinebr");
113 if (nl1!=DString::npos && nl2!=DString::npos && nl1<nl2)
114 {
115 return text.mid(nl1+1);
116 }
117 if (nl2!=DString::npos)
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
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:686
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
The common base class of all entity definitions found in the sources.
Definition definition.h:77
Data associated with a token used by the comment block parser.
#define Config_getInt(name)
Definition config.h:34
static void processSection(yyscan_t yyscanner)
DString extractPartAfterNewLine(const DString &text)
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:101
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
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 DString text(yytext);
346 size_t dashPos = text.rfind('-');
347 ASSERT(dashPos!=DString::npos);
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 }
#define lineCount(s, len)
#define ASSERT(x)
Definition message.h:142
354<St_Para>^{CLISTITEM} { /* checkbox item */
355 DString text=yytext;
356 size_t dashPos = text.rfind('-');
357 yyextra->token.isEnumList = false;
358 yyextra->token.isCheckedList = true;
359 if (text.find('x') != DString::npos) yyextra->token.id = DocAutoList::Checked_x;
360 else if (text.find('X') != DString::npos) 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 }
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:244
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:154
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:850
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:861
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 = DString(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 dstring.cpp:191
#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);
415 DString text=extractPartAfterNewLine(yytext);
416 size_t dashPos = text.rfind('-');
417 ASSERT(dashPos!=DString::npos);
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 dstring.h:157
424<St_Para>{BLANK}*\n{CLISTITEM} { /* checkbox item on next line */
425 DString text=yytext;
426 text=text.mid(text.find('\n')+1);
427 size_t dashPos = text.rfind('-');
428 yyextra->token.isEnumList = false;
429 yyextra->token.isCheckedList = true;
430 if (text.find('x') != DString::npos) yyextra->token.id = DocAutoList::Checked_x;
431 else if (text.find('X') != DString::npos) 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 }
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 dstring.h:645
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 = DString(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 = DString(yytext).rfind('.');
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);
494 DString text=extractPartAfterNewLine(yytext);
495 size_t dotPos = text.rfind('.');
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 = DString(yytext).right((int)yyleng-7).toInt(&ok);
518 ASSERT(ok);
519 return Token::char_to_command(yytext[0]);
520 }
DString right(size_t len) const
Definition dstring.h:311
static Token char_to_command(char c)
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 DString s(yytext);
543 bool isIn = s.find("in") !=DString::npos;
544 bool isOut = s.find("out")!=DString::npos;
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 }
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 DString tagName(yytext+1);
601 size_t index=tagName.find(':');
602 if (index==DString::npos) index=0; // should never happen
603 yyextra->token.name = tagName.left(index);
604 size_t text_begin = index+2;
605 size_t text_end = 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 DString name(&yytext[2]);
620 name = name.left(static_cast<int>(name.length())-1);
621 DString value = Portable::getenv(name);
622 for (int i=static_cast<int>(value.length())-1;i>=0;i--) unput(value.at(i));
623 }
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
DString getenv(const DString &variable)
Definition portable.cpp:337
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>{LNKWORDN}"<"{HTMLKEYW}">"[^<]*"</"{HTMLKEYW}">" { // a word directly followed by a complete inline
656 // html span, e.g. one<tt>.h</tt> (from a markdown code span) or test<em>.h</em>,
657 // is not a template: return only the word and let the html tag rules handle the span
658 const std::string text(yytext);
659 const size_t closeTagPos = text.rfind('<');
660 const size_t openTagPos = text.rfind('<', closeTagPos - 1);
661 yyless(static_cast<int>(openTagPos));
662 yyextra->token.name = yytext;
663 return Token::make_TK_LNKWORD();
664 }
665<St_Para>{LNKWORD1} |
666<St_Para>{LNKWORD1}{FUNCARG} |
667<St_Para>{LNKWORD2} |
668<St_Para>{LNKWORD3} |
669<St_Para>{LNKWORD4} {
670 yyextra->token.name = yytext;
671 return Token::make_TK_LNKWORD();
672 }
673<St_Para>{LNKWORD1}{FUNCARG}{CVSPEC}[^a-z_A-Z0-9] {
674 yyextra->token.name = yytext;
675 yyextra->token.name = yyextra->token.name.left(yyextra->token.name.length()-1);
676 unput(yytext[(int)yyleng-1]);
677 return Token::make_TK_LNKWORD();
678 }
679 /********* patterns for normal words ******************/
680
681<St_Para,St_Text>[\-+0-9] |
682<St_Para,St_Text>{WORD1} |
683<St_Para,St_Text>{WORD2} { /* function call */
684 if (DString(yytext).find("\\ilinebr")!=DString::npos) REJECT; // see issue #8311
685 lineCount(yytext,yyleng);
686 if (yytext[0]=='%') // strip % if present
687 yyextra->token.name = &yytext[1];
688 else
689 yyextra->token.name = yytext;
690 return Token::make_TK_WORD();
691 }
692<St_Text>({ID}".")+{ID} {
693 yyextra->token.name = yytext;
694 return Token::make_TK_WORD();
695 }
696<St_Para,St_Text>"operator"/{BLANK}*"<"[a-zA-Z_0-9]+">" { // Special case: word "operator" followed by a HTML command
697 // avoid interpretation as "operator <"
698 yyextra->token.name = yytext;
699 return Token::make_TK_WORD();
700 }
701
702 /*******************************************************/
703
704<St_Para,St_Text>{BLANK}+ |
705<St_Para,St_Text>{BLANK}*\n{BLANK}* { /* white space */
706 lineCount(yytext,yyleng);
707 yyextra->token.chars=yytext;
708 return Token::make_TK_WHITESPACE();
709 }
710<St_Text>[\\@<>&$#%~] {
711 yyextra->token.name = yytext;
712 return Token::char_to_command(yytext[0]);
713 }
714<St_Para>({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */
715 if (yyextra->insidePre || yyextra->autoListLevel==0)
716 {
717 REJECT;
718 }
719 lineCount(yytext,yyleng);
720 }
721<St_Para>({BLANK}*\n)+{BLANK}*\n/{CLISTITEM} { /* skip trailing paragraph followed by new checkbox item */
722 if (yyextra->insidePre || yyextra->autoListLevel==0)
723 {
724 REJECT;
725 }
726 }
727<St_Para>({BLANK}*\n)+{BLANK}*\n/{MLISTITEM} { /* skip trailing paragraph followed by new list item */
728 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
729 {
730 REJECT;
731 }
732 lineCount(yytext,yyleng);
733 }
734<St_Para>({BLANK}*\n)+{BLANK}*\n/{OLISTITEM} { /* skip trailing paragraph followed by new list item */
735 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
736 {
737 REJECT;
738 }
739 lineCount(yytext,yyleng);
740 }
741<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}*/" \\ifile" | // we don't want to count the space before \ifile
742<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
743 lineCount(yytext,yyleng);
744 if (yyextra->insidePre)
745 {
746 yyextra->token.chars=yytext;
747 return Token::make_TK_WHITESPACE();
748 }
749 else
750 {
751 yyextra->token.indent=computeIndent(yytext,yyleng);
752 int i;
753 // put back the indentation (needed for list items)
754 //printf("token.indent=%d\n",yyextra->token.indent);
755 for (i=0;i<yyextra->token.indent;i++)
756 {
757 unput(' ');
758 }
759 // tell flex that after putting the last indent
760 // back we are at the beginning of the line
761 YY_CURRENT_BUFFER->yy_at_bol=1;
762 // start of a new paragraph
763 return Token::make_TK_NEWPARA();
764 }
765 }
766<St_CodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
767 yyextra->token.name = yytext;
768 size_t i=yyextra->token.name.find('{'); /* } to keep vi happy */
769 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
770 BEGIN(St_Code);
771 }
772<St_iCodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
773 yyextra->token.name = yytext;
774 size_t i=yyextra->token.name.find('{'); /* } to keep vi happy */
775 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
776 BEGIN(St_iCode);
777 }
778<St_CodeOpt>"\\ilinebr" |
779<St_CodeOpt>\n |
780<St_CodeOpt>. {
781 unput_string(yytext,yyleng);
782 BEGIN(St_Code);
783 }
#define unput_string(yytext, yyleng)
784<St_iCodeOpt>"\\ilinebr" |
785<St_iCodeOpt>\n |
786<St_iCodeOpt>. {
787 unput_string(yytext,yyleng);
788 BEGIN(St_iCode);
789 }
790<St_Code>{WS}*{CMD}"endcode" {
791 lineCount(yytext,yyleng);
792 return Token::make_RetVal_OK();
793 }
794<St_iCode>{WS}*{CMD}"endicode" {
795 lineCount(yytext,yyleng);
796 return Token::make_RetVal_OK();
797 }
798<St_XmlCode>{WS}*"</code>" {
799 lineCount(yytext,yyleng);
800 return Token::make_RetVal_OK();
801 }
802<St_Code,St_iCode,St_XmlCode>[^\\@\n<]+ |
803<St_Code,St_iCode,St_XmlCode>\n |
804<St_Code,St_iCode,St_XmlCode>. {
805 lineCount(yytext,yyleng);
806 yyextra->token.verb+=yytext;
807 }
808<St_HtmlOnlyOption>" [block]" { // the space is added in commentscan.l
809 yyextra->token.name="block";
810 BEGIN(St_HtmlOnly);
811 }
812<St_HtmlOnlyOption>.|\n {
813 unput(*yytext);
814 BEGIN(St_HtmlOnly);
815 }
816<St_HtmlOnlyOption>"\\ilinebr" {
817 unput_string(yytext,yyleng);
818 BEGIN(St_HtmlOnly);
819 }
820<St_HtmlOnly>{CMD}"endhtmlonly" {
821 return Token::make_RetVal_OK();
822 }
823<St_HtmlOnly>[^\\@\n$]+ |
824<St_HtmlOnly>\n |
825<St_HtmlOnly>. {
826 lineCount(yytext,yyleng);
827 yyextra->token.verb+=yytext;
828 }
829<St_ManOnly>{CMD}"endmanonly" {
830 return Token::make_RetVal_OK();
831 }
832<St_ManOnly>[^\\@\n$]+ |
833<St_ManOnly>\n |
834<St_ManOnly>. {
835 lineCount(yytext,yyleng);
836 yyextra->token.verb+=yytext;
837 }
838<St_RtfOnly>{CMD}"endrtfonly" {
839 return Token::make_RetVal_OK();
840 }
841<St_RtfOnly>[^\\@\n$]+ |
842<St_RtfOnly>\n |
843<St_RtfOnly>. {
844 lineCount(yytext,yyleng);
845 yyextra->token.verb+=yytext;
846 }
847<St_LatexOnly>{CMD}"endlatexonly" {
848 return Token::make_RetVal_OK();
849 }
850<St_LatexOnly>[^\\@\n]+ |
851<St_LatexOnly>\n |
852<St_LatexOnly>. {
853 lineCount(yytext,yyleng);
854 yyextra->token.verb+=yytext;
855 }
856<St_XmlOnly>{CMD}"endxmlonly" {
857 return Token::make_RetVal_OK();
858 }
859<St_XmlOnly>[^\\@\n]+ |
860<St_XmlOnly>\n |
861<St_XmlOnly>. {
862 lineCount(yytext,yyleng);
863 yyextra->token.verb+=yytext;
864 }
865<St_DbOnly>{CMD}"enddocbookonly" {
866 return Token::make_RetVal_OK();
867 }
868<St_DbOnly>[^\\@\n]+ |
869<St_DbOnly>\n |
870<St_DbOnly>. {
871 lineCount(yytext,yyleng);
872 yyextra->token.verb+=yytext;
873 }
874<St_Verbatim>{CMD}"endverbatim" {
875 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
876 return Token::make_RetVal_OK();
877 }
878<St_ILiteral>{CMD}"endiliteral " { // note extra space as this is artificially added
879 // remove spaces that have been added
880 yyextra->token.verb = yyextra->token.verb.mid(1,yyextra->token.verb.length()-2);
881 return Token::make_RetVal_OK();
882 }
883<St_iVerbatim>{CMD}"endiverbatim" {
884 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
885 return Token::make_RetVal_OK();
886 }
887<St_Verbatim,St_iVerbatim,St_ILiteral>[^\\@\n]+ |
888<St_Verbatim,St_iVerbatim,St_ILiteral>\n |
889<St_Verbatim,St_iVerbatim,St_ILiteral>. { /* Verbatim text */
890 lineCount(yytext,yyleng);
891 yyextra->token.verb+=yytext;
892 }
893<St_ILiteralOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // option(s) present
894 yyextra->token.verb = DString(yytext).stripWhiteSpace();
895 return Token::make_RetVal_OK();
896 }
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:337
897<St_ILiteralOpt>"\\ilinebr" |
898<St_ILiteralOpt>"\n" |
899<St_ILiteralOpt>. {
900 yyextra->token.sectionId = "";
901 unput_string(yytext,yyleng);
902 return Token::make_RetVal_OK();
903 }
904<St_Dot>{CMD}"enddot" {
905 return Token::make_RetVal_OK();
906 }
907<St_Dot>[^\\@\n]+ |
908<St_Dot>\n |
909<St_Dot>. { /* dot text */
910 lineCount(yytext,yyleng);
911 yyextra->token.verb+=yytext;
912 }
913<St_Msc>{CMD}("endmsc") {
914 return Token::make_RetVal_OK();
915 }
916<St_Msc>[^\\@\n]+ |
917<St_Msc>\n |
918<St_Msc>. { /* msc text */
919 lineCount(yytext,yyleng);
920 yyextra->token.verb+=yytext;
921 }
922<St_PlantUMLOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // case 1: options present
923 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
924 return Token::make_RetVal_OK();
925 }
926<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
927 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
928 return Token::make_RetVal_OK();
929 }
930<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
931 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
932 return Token::make_RetVal_OK();
933 }
934<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
935 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
936 return Token::make_RetVal_OK();
937 }
938<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
939 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
940 return Token::make_RetVal_OK();
941 }
942<St_PlantUMLOpt>"\\ilinebr" |
943<St_PlantUMLOpt>"\n" |
944<St_PlantUMLOpt>. {
945 yyextra->token.sectionId = "";
946 unput_string(yytext,yyleng);
947 return Token::make_RetVal_OK();
948 }
949<St_PlantUML>{CMD}"enduml" {
950 return Token::make_RetVal_OK();
951 }
952<St_PlantUML>[^\\@\n]+ |
953<St_PlantUML>\n |
954<St_PlantUML>. { /* plantuml text */
955 lineCount(yytext,yyleng);
956 yyextra->token.verb+=yytext;
957 }
958<St_MermaidOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // case 1: options present
959 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
960 return Token::make_RetVal_OK();
961 }
962<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
963 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
964 return Token::make_RetVal_OK();
965 }
966<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
967 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
968 return Token::make_RetVal_OK();
969 }
970<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
971 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
972 return Token::make_RetVal_OK();
973 }
974<St_MermaidOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
975 yyextra->token.sectionId = DString(yytext).stripWhiteSpace();
976 return Token::make_RetVal_OK();
977 }
978<St_MermaidOpt>"\\ilinebr" |
979<St_MermaidOpt>"\n" |
980<St_MermaidOpt>. {
981 yyextra->token.sectionId = "";
982 unput_string(yytext,yyleng);
983 return Token::make_RetVal_OK();
984 }
985<St_Mermaid>{CMD}"endmermaid" {
986 return Token::make_RetVal_OK();
987 }
988<St_Mermaid>[^\\@\n]+ |
989<St_Mermaid>\n |
990<St_Mermaid>. { /* mermaid text */
991 lineCount(yytext,yyleng);
992 yyextra->token.verb+=yytext;
993 }
994<St_Title>"\"" { // quoted title
995 BEGIN(St_TitleQ);
996 }
997<St_Title>[ \t]+ {
998 yyextra->token.chars=yytext;
999 return Token::make_TK_WHITESPACE();
1000 }
1001<St_Title>. { // non-quoted title
1002 unput(*yytext);
1003 BEGIN(St_TitleN);
1004 }
1005<St_Title>\n {
1006 unput(*yytext);
1007 return Token::make_TK_NONE();
1008 }
1009<St_Title>"\\ilinebr" {
1010 unput_string(yytext,yyleng);
1011 return Token::make_TK_NONE();
1012 }
1013<St_TitleN>"&"{ID}";" { /* symbol */
1014 yyextra->token.name = yytext;
1015 return Token::make_TK_SYMBOL();
1016 }
1017<St_TitleN>{HTMLTAG} {
1018 yyextra->token.name = yytext;
1019 handleHtmlTag(yyscanner,yytext);
1020 return Token::make_TK_HTMLTAG();
1021 }
1022<St_TitleN>\n { /* new line => end of title */
1023 unput(*yytext);
1024 return Token::make_TK_NONE();
1025 }
1026<St_TitleN>"\\ilinebr" { /* new line => end of title */
1027 unput_string(yytext,yyleng);
1028 return Token::make_TK_NONE();
1029 }
1030<St_TitleN>{SPCMD1} |
1031<St_TitleN>{SPCMD2} { /* special command */
1032 yyextra->token.name = yytext+1;
1033 yyextra->token.paramDir=TokenInfo::Unspecified;
1034 return Token::char_to_command(yytext[0]);
1035 }
1036<St_TitleN>{ID}"=" { /* attribute */
1037 if (yytext[0]=='%') // strip % if present
1038 yyextra->token.name = &yytext[1];
1039 else
1040 yyextra->token.name = yytext;
1041 return Token::make_TK_WORD();
1042 }
1043<St_TitleN>[\-+0-9] |
1044<St_TitleN>{WORD1} |
1045<St_TitleN>{WORD2} { /* word */
1046 if (DString(yytext).find("\\ilinebr")!=DString::npos) REJECT; // see issue #8311
1047 lineCount(yytext,yyleng);
1048 if (yytext[0]=='%') // strip % if present
1049 yyextra->token.name = &yytext[1];
1050 else
1051 yyextra->token.name = yytext;
1052 return Token::make_TK_WORD();
1053 }
1054<St_TitleN>[ \t]+ {
1055 yyextra->token.chars=yytext;
1056 return Token::make_TK_WHITESPACE();
1057 }
1058<St_TitleQ>"&"{ID}";" { /* symbol */
1059 yyextra->token.name = yytext;
1060 return Token::make_TK_SYMBOL();
1061 }
1062<St_TitleQ>(\n|"\\ilinebr") { /* new line => end of title */
1063 unput_string(yytext,yyleng);
1064 return Token::make_TK_NONE();
1065 }
1066<St_TitleQ>{SPCMD1} |
1067<St_TitleQ>{SPCMD2} { /* special command */
1068 yyextra->token.name = yytext+1;
1069 yyextra->token.paramDir=TokenInfo::Unspecified;
1070 return Token::char_to_command(yytext[0]);
1071 }
1072<St_TitleQ>{WORD1NQ} |
1073<St_TitleQ>{WORD2NQ} { /* word */
1074 yyextra->token.name = yytext;
1075 return Token::make_TK_WORD();
1076 }
1077<St_TitleQ>[ \t]+ {
1078 yyextra->token.chars=yytext;
1079 return Token::make_TK_WHITESPACE();
1080 }
1081<St_TitleQ>"\"" { /* closing quote => end of title */
1082 BEGIN(St_TitleA);
1083 return Token::make_TK_NONE();
1084 }
1085<St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute
1086 yyextra->token.name = yytext;
1087 size_t pos = yyextra->token.name.find('=');
1088 if (pos==DString::npos) pos=0; // should never happen
1089 yyextra->token.name = yyextra->token.name.left(pos).stripWhiteSpace();
1090 BEGIN(St_TitleV);
1091 }
1092<St_TitleV>[^ \t\r\n]+ { // attribute value
1093 lineCount(yytext,yyleng);
1094 yyextra->token.chars = yytext;
1095 BEGIN(St_TitleN);
1096 return Token::make_TK_WORD();
1097 }
1098<St_TitleV,St_TitleA>. {
1099 unput(*yytext);
1100 return Token::make_TK_NONE();
1101 }
1102<St_TitleV,St_TitleA>(\n|"\\ilinebr") {
1103 unput_string(yytext,yyleng);
1104 return Token::make_TK_NONE();
1105 }
1106
1107<St_Anchor>({REQID}|{LABELID}){WS}? { // anchor
1108 lineCount(yytext,yyleng);
1109 yyextra->token.name = DString(yytext).stripWhiteSpace();
1110 return Token::make_TK_WORD();
1111 }
1112<St_Anchor>. {
1113 unput(*yytext);
1114 return Token::make_TK_NONE();
1115 }
1116<St_Cite>{CITEID} { // label to cite
1117 if (yytext[0] =='"')
1118 {
1119 yyextra->token.name=yytext+1;
1120 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-2);
1121 }
1122 else
1123 {
1124 yyextra->token.name=yytext;
1125 }
1126 return Token::make_TK_WORD();
1127 }
1128<St_Cite>{BLANK} { // white space
1129 unput(' ');
1130 return Token::make_TK_NONE();
1131 }
1132<St_Cite>(\n|"\\ilinebr") { // new line
1133 unput_string(yytext,yyleng);
1134 return Token::make_TK_NONE();
1135 }
1136<St_Cite>. { // any other character
1137 unput(*yytext);
1138 return Token::make_TK_NONE();
1139 }
1140<St_DoxyConfig>{DOXYCFG} { // config option
1141 yyextra->token.name=yytext;
1142 return Token::make_TK_WORD();
1143 }
1144<St_DoxyConfig>{BLANK} { // white space
1145 unput(' ');
1146 return Token::make_TK_NONE();
1147 }
1148<St_DoxyConfig>(\n|"\\ilinebr") { // new line
1149 unput_string(yytext,yyleng);
1150 return Token::make_TK_NONE();
1151 }
1152<St_DoxyConfig>. { // any other character
1153 unput(*yytext);
1154 return Token::make_TK_NONE();
1155 }
1156<St_Ref>{REFWORD_NOCV}/{BLANK}("const")[a-z_A-Z0-9] { // see bug776988
1157 yyextra->token.name=yytext;
1158 return Token::make_TK_WORD();
1159 }
1160<St_Ref>{REFWORD_NOCV}/{BLANK}("volatile")[a-z_A-Z0-9] { // see bug776988
1161 yyextra->token.name=yytext;
1162 return Token::make_TK_WORD();
1163 }
1164<St_Ref>{REFWORD} { // label to refer to
1165 yyextra->token.name=yytext;
1166 return Token::make_TK_WORD();
1167 }
1168<St_Ref>{BLANK} { // white space
1169 unput(' ');
1170 return Token::make_TK_NONE();
1171 }
1172<St_Ref>{WS}+"\""{WS}* { // white space following by quoted string
1173 yyextra->expectQuote=true;
1174 lineCount(yytext,yyleng);
1175 BEGIN(St_Ref2);
1176 }
1177<St_Ref>(\n|"\\ilinebr") { // new line
1178 unput_string(yytext,yyleng);
1179 return Token::make_TK_NONE();
1180 }
1181<St_Ref>"\""[^"\n]+"\"" { // quoted first argument -> return without quotes
1182 yyextra->token.name=DString(yytext).mid(1,yyleng-2);
1183 return Token::make_TK_WORD();
1184 }
1185<St_Ref>. { // any other character
1186 unput(*yytext);
1187 return Token::make_TK_NONE();
1188 }
1189<St_IntRef>[A-Z_a-z0-9.:/#\-\+\‍(\‍)]+ {
1190 yyextra->token.name = yytext;
1191 return Token::make_TK_WORD();
1192 }
1193<St_IntRef>{BLANK}+"\"" {
1194 BEGIN(St_Ref2);
1195 }
1196<St_SetScope>({SCOPEMASK}|{ANONNS}){BLANK}|{FILEMASK} {
1197 yyextra->token.name = yytext;
1198 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1199 return Token::make_TK_WORD();
1200 }
1201<St_SetScope>{SCOPEMASK}"<" {
1202 yyextra->token.name = yytext;
1203 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1204 yyextra->sharpCount=1;
1205 BEGIN(St_SetScopeEnd);
1206 }
1207<St_SetScope>{BLANK} {
1208 }
1209<St_SetScopeEnd>"<" {
1210 yyextra->token.name += yytext;
1211 yyextra->sharpCount++;
1212 }
1213<St_SetScopeEnd>">" {
1214 yyextra->token.name += yytext;
1215 yyextra->sharpCount--;
1216 if (yyextra->sharpCount<=0)
1217 {
1218 return Token::make_TK_WORD();
1219 }
1220 }
1221<St_SetScopeEnd>. {
1222 yyextra->token.name += yytext;
1223 }
1224<St_Ref2>"&"{ID}";" { /* symbol */
1225 yyextra->token.name = yytext;
1226 return Token::make_TK_SYMBOL();
1227 }
1228<St_Ref2>"\""|\n|"\\ilinebr" { /* " or \n => end of title? */
1229 lineCount(yytext,yyleng);
1230 if (!yyextra->expectQuote || yytext[0]=='"')
1231 {
1232 return Token::make_TK_NONE();
1233 }
1234 else
1235 {
1236 yyextra->token.name += yytext;
1237 }
1238 }
1239<St_Ref2>{HTMLTAG_STRICT} { /* html tag */
1240 lineCount(yytext,yyleng);
1241 handleHtmlTag(yyscanner,yytext);
1242 return Token::make_TK_HTMLTAG();
1243 }
1244<St_Ref2>{SPCMD1} |
1245<St_Ref2>{SPCMD2} { /* special command */
1246 yyextra->token.name = yytext+1;
1247 yyextra->token.paramDir=TokenInfo::Unspecified;
1248 return Token::char_to_command(yytext[0]);
1249 }
1250<St_Ref2>{WORD1NQ} |
1251<St_Ref2>{WORD2NQ} {
1252 /* word */
1253 yyextra->token.name = yytext;
1254 return Token::make_TK_WORD();
1255 }
1256<St_Ref2>[ \t]+ {
1257 yyextra->token.chars=yytext;
1258 return Token::make_TK_WHITESPACE();
1259 }
1260<St_XRefItem>{LABELID} {
1261 yyextra->token.name=yytext;
1262 }
1263<St_XRefItem>" " {
1264 BEGIN(St_XRefItem2);
1265 }
1266<St_XRefItem2>[0-9]+"." {
1267 DString numStr(yytext);
1268 numStr=numStr.left((int)yyleng-1);
1269 yyextra->token.id=numStr.toInt();
1270 return Token::make_RetVal_OK();
1271 }
1272<St_Para,St_Title,St_Ref2>"<!--" { /* html style comment block */
1273 yyextra->commentState = YY_START;
1274 BEGIN(St_Comment);
1275 }
1276<St_Param>"\""[^\n\"]+"\"" {
1277 yyextra->token.name = yytext+1;
1278 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1279 return Token::make_TK_WORD();
1280 }
1281<St_Param>({PHPTYPE}{BLANK}*("["{BLANK}*"]")*{BLANK}*"|"{BLANK}*)*{PHPTYPE}{BLANK}*("["{BLANK}*"]")*{WS}+("&")?"$"{LABELID} {
1282 lineCount(yytext,yyleng);
1283 DString params(yytext);
1284 size_t j = params.find('&');
1285 size_t i = params.find('$');
1286 if (i==DString::npos) i=0; // should never happen
1287 if (j!=DString::npos && j<i) i=j;
1288 DString types = params.left(i).stripWhiteSpace();
1289 yyextra->token.name = types+"#"+params.mid(i);
1290 return Token::make_TK_WORD();
1291 }
DString left(size_t len) const
Definition dstring.h:306
1292<St_Param>[^ \t\n,@\\‍]+ {
1293 yyextra->token.name = yytext;
1294 if (yyextra->token.name.at(static_cast<uint32_t>(yyleng)-1)==':')
1295 {
1296 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-1);
1297 }
1298 return Token::make_TK_WORD();
1299 }
1300<St_Param>{WS}*","{WS}* /* param separator */
1301<St_Param>{WS} {
1302 lineCount(yytext,yyleng);
1303 yyextra->token.chars=yytext;
1304 return Token::make_TK_WHITESPACE();
1305 }
1306<St_Prefix>"\""[^\n\"]*"\"" {
1307 yyextra->token.name = yytext+1;
1308 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1309 return Token::make_TK_WORD();
1310 }
1311<St_Prefix>. {
1312 unput(*yytext);
1313 return Token::make_TK_NONE();
1314 }
1315<St_Options>{ID} {
1316 yyextra->token.name+=yytext;
1317 }
1318<St_Options>{WS}*":"{WS}* {
1319 lineCount(yytext,yyleng);
1320 yyextra->token.name+=":";
1321 }
1322<St_Options>{WS}*","{WS}* |
1323<St_Options>{WS} { /* option separator */
1324 lineCount(yytext,yyleng);
1325 yyextra->token.name+=",";
1326 }
1327<St_Options>"}" {
1328 return Token::make_TK_WORD();
1329 }
1330<St_Block>{ID} {
1331 yyextra->token.name+=yytext;
1332 }
1333<St_Block>"]" {
1334 return Token::make_TK_WORD();
1335 }
1336<St_Emoji>[:0-9_a-z+-]+ {
1337 yyextra->token.name=yytext;
1338 return Token::make_TK_WORD();
1339 }
1340<St_Emoji>. {
1341 unput(*yytext);
1342 return Token::make_TK_NONE();
1343 }
1344<St_QuotedString>"\"" {
1345 yyextra->token.name="";
1346 BEGIN(St_QuotedContent);
1347 }
1348<St_QuotedString>(\n|"\\ilinebr") {
1349 unput_string(yytext,yyleng);
1350 return Token::make_TK_NONE();
1351 }
1352<St_QuotedString>. {
1353 unput(*yytext);
1354 return Token::make_TK_NONE();
1355 }
1356<St_QuotedContent>"\"" {
1357 return Token::make_TK_WORD();
1358 }
1359<St_QuotedContent>. {
1360 yyextra->token.name+=yytext;
1361 }
1362<St_ShowDate>{WS}+{SHOWDATE} {
1363 lineCount(yytext,yyleng);
1364 yyextra->token.name=yytext;
1365 return Token::make_TK_WORD();
1366 }
1367<St_ShowDate>(\n|"\\ilinebr") {
1368 unput_string(yytext,yyleng);
1369 return Token::make_TK_NONE();
1370 }
1371<St_ShowDate>. {
1372 unput(*yytext);
1373 return Token::make_TK_NONE();
1374 }
1375<St_ILine>{LINENR}/[\\@\n\.] |
1376<St_ILine>{LINENR}{BLANK} {
1377 bool ok = false;
1378 int nr = DString(yytext).toInt(&ok);
1379 if (!ok)
1380 {
1381 warn(yyextra->fileName,yyextra->yyLineNr,"Invalid line number '{}' for iline command",yytext);
1382 }
1383 else
1384 {
1385 yyextra->yyLineNr = nr;
1386 }
1387 return Token::make_TK_WORD();
1388 }
1389<St_ILine>. {
1390 return Token::make_TK_NONE();
1391 }
1392<St_IFile>{BLANK}*{FILEMASK} {
1393 DString text(yytext);
1394 text = text.stripWhiteSpace();
1395 yyextra->fileName = text;
1396 yyextra->token.name = text;
1397 return Token::make_TK_WORD();
1398 }
1399<St_IFile>{BLANK}*"\""[^\n\"]+"\"" {
1400 DString text(yytext);
1401 text = text.stripWhiteSpace();
1402 yyextra->fileName = text.mid(1,text.length()-2);
1403 yyextra->token.name = text.mid(1,text.length()-2);
1404 return Token::make_TK_WORD();
1405 }
1406<St_File>{FILEMASK} {
1407 yyextra->token.name = yytext;
1408 if (yyextra->token.name.endsWith("\\ilinebr") ||yyextra->token.name.endsWith("@ilinebr"))
1409 {
1410 unput_string("\\ilinebr",8);
1411 yyextra->token.name = yyextra->token.name.left(yyleng-8);
1412 }
1413 return Token::make_TK_WORD();
1414 }
1415<St_File>"\""[^\n\"]+"\"" {
1416 DString text(yytext);
1417 yyextra->token.name = text.mid(1,text.length()-2);
1418 return Token::make_TK_WORD();
1419 }
1420<St_Pattern>[^\\\r\n]+ {
1421 yyextra->token.name += yytext;
1422 }
1423<St_Pattern>"\\ilinebr" {
1424 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1425 return Token::make_TK_WORD();
1426 }
1427<St_Pattern>\n {
1428 lineCount(yytext,yyleng);
1429 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1430 return Token::make_TK_WORD();
1431 }
1432<St_Pattern>. {
1433 yyextra->token.name += yytext;
1434 }
1435<St_Link>{LINKMASK}|{REFWORD} {
1436 yyextra->token.name = yytext;
1437 return Token::make_TK_WORD();
1438 }
1439<St_Comment>"-->" { /* end of html comment */
1440 BEGIN(yyextra->commentState);
1441 }
1442<St_Comment>[^-]+ /* inside html comment */
1443<St_Comment>. /* inside html comment */
1444
1445 /* State for skipping title (all chars until the end of the line) */
1446
1447<St_SkipTitle>.
1448<St_SkipTitle>(\n|"\\ilinebr") {
1449 if (*yytext == '\n') unput('\n');
1450 return Token::make_TK_NONE();
1451 }
1452
1453 /* State for the pass used to find the anchors and sections */
1454
1455<St_Sections>[^\n@\<]+
1456<St_Sections>{CMD}("<"|{CMD})
1457<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" {
1458 lineCount(yytext,yyleng);
1459 DString tag(yytext);
1460 size_t s=tag.find("id=");
1461 if (s!=DString::npos) // command has id attribute
1462 {
1463 char c=tag[s+3];
1464 if (c=='\'' || c=='"') // valid start
1465 {
1466 size_t e=tag.find(c,s+4);
1467 if (e!=DString::npos) // found matching end
1468 {
1469 yyextra->secType = SectionType::Table;
1470 yyextra->secLabel=tag.mid(s+4,e-s-4); // extract id
1471 processSection(yyscanner);
1472 }
1473 }
1474 }
1475 }
static constexpr int Table
Definition section.h:41
1476<St_Sections>{CMD}"anchor"{BLANK}+ {
1477 yyextra->secType = SectionType::Anchor;
1478 BEGIN(St_SecLabel1);
1479 }
static constexpr int Anchor
Definition section.h:40
1480<St_Sections>{CMD}"ianchor"{BLANK}+ {
1481 yyextra->secType = SectionType::Anchor;
1482 BEGIN(St_SecLabel1);
1483 }
1484<St_Sections>{CMD}"section"{BLANK}+ {
1485 yyextra->secType = SectionType::Section;
1486 BEGIN(St_SecLabel2);
1487 }
static constexpr int Section
Definition section.h:33
1488<St_Sections>{CMD}"subsection"{BLANK}+ {
1489 yyextra->secType = SectionType::Subsection;
1490 BEGIN(St_SecLabel2);
1491 }
static constexpr int Subsection
Definition section.h:34
1492<St_Sections>{CMD}"subsubsection"{BLANK}+ {
1493 yyextra->secType = SectionType::Subsubsection;
1494 BEGIN(St_SecLabel2);
1495 }
static constexpr int Subsubsection
Definition section.h:35
1496<St_Sections>{CMD}"paragraph"{BLANK}+ {
1497 yyextra->secType = SectionType::Paragraph;
1498 BEGIN(St_SecLabel2);
1499 }
static constexpr int Paragraph
Definition section.h:36
1500<St_Sections>{CMD}"subparagraph"{BLANK}+ {
1501 yyextra->secType = SectionType::Subparagraph;
1502 BEGIN(St_SecLabel2);
1503 }
static constexpr int Subparagraph
Definition section.h:37
1504<St_Sections>{CMD}"subsubparagraph"{BLANK}+ {
1505 yyextra->secType = SectionType::Subsubparagraph;
1506 BEGIN(St_SecLabel2);
1507 }
static constexpr int Subsubparagraph
Definition section.h:38
1508<St_Sections>{CMD}"verbatim"/[^a-z_A-Z0-9] {
1509 yyextra->endMarker="endverbatim";
1510 BEGIN(St_SecSkip);
1511 }
1512<St_Sections>{CMD}"iverbatim"/[^a-z_A-Z0-9] {
1513 yyextra->endMarker="endiverbatim";
1514 BEGIN(St_SecSkip);
1515 }
1516<St_Sections>{CMD}"iliteral"/[^a-z_A-Z0-9] {
1517 yyextra->endMarker="endiliteral";
1518 BEGIN(St_SecSkip);
1519 }
1520<St_Sections>{CMD}"dot"/[^a-z_A-Z0-9] {
1521 yyextra->endMarker="enddot";
1522 BEGIN(St_SecSkip);
1523 }
1524<St_Sections>{CMD}"msc"/[^a-z_A-Z0-9] {
1525 yyextra->endMarker="endmsc";
1526 BEGIN(St_SecSkip);
1527 }
1528<St_Sections>{CMD}"mermaid"/[^a-z_A-Z0-9] {
1529 yyextra->endMarker="endmermaid";
1530 BEGIN(St_SecSkip);
1531 }
1532<St_Sections>{CMD}"startuml"/[^a-z_A-Z0-9] {
1533 yyextra->endMarker="enduml";
1534 BEGIN(St_SecSkip);
1535 }
1536<St_Sections>{CMD}"htmlonly"/[^a-z_A-Z0-9] {
1537 yyextra->endMarker="endhtmlonly";
1538 BEGIN(St_SecSkip);
1539 }
1540<St_Sections>{CMD}"latexonly"/[^a-z_A-Z0-9] {
1541 yyextra->endMarker="endlatexonly";
1542 BEGIN(St_SecSkip);
1543 }
1544<St_Sections>{CMD}"manonly"/[^a-z_A-Z0-9] {
1545 yyextra->endMarker="endmanonly";
1546 BEGIN(St_SecSkip);
1547 }
1548<St_Sections>{CMD}"rtfonly"/[^a-z_A-Z0-9] {
1549 yyextra->endMarker="endrtfonly";
1550 BEGIN(St_SecSkip);
1551 }
1552<St_Sections>{CMD}"xmlonly"/[^a-z_A-Z0-9] {
1553 yyextra->endMarker="endxmlonly";
1554 BEGIN(St_SecSkip);
1555 }
1556<St_Sections>{CMD}"docbookonly"/[^a-z_A-Z0-9] {
1557 yyextra->endMarker="enddocbookonly";
1558 BEGIN(St_SecSkip);
1559 }
1560<St_Sections>{CMD}"code"/[^a-z_A-Z0-9] {
1561 yyextra->endMarker="endcode";
1562 BEGIN(St_SecSkip);
1563 }
1564<St_Sections>{CMD}"icode"/[^a-z_A-Z0-9] {
1565 yyextra->endMarker="endicode";
1566 BEGIN(St_SecSkip);
1567 }
1568<St_Sections>"<!--" {
1569 yyextra->endMarker="-->";
1570 BEGIN(St_SecSkip);
1571 }
1572<St_SecSkip>{CMD}{ID} {
1573 if (yyextra->endMarker==yytext+1)
1574 {
1575 BEGIN(St_Sections);
1576 }
1577 }
1578<St_SecSkip>"-->" {
1579 if (yyextra->endMarker==yytext)
1580 {
1581 BEGIN(St_Sections);
1582 }
1583 }
1584<St_SecSkip>[^a-z_A-Z0-9\-\\\@]+
1585<St_SecSkip>.
1586<St_SecSkip>(\n|"\\ilinebr")
1587<St_Sections>.
1588<St_Sections>(\n|"\\ilinebr")
1589<St_SecLabel1>({REQID}|{LABELID}) {
1590 lineCount(yytext,yyleng);
1591 yyextra->secLabel = yytext;
1592 processSection(yyscanner);
1593 BEGIN(St_Sections);
1594 }
1595<St_SecLabel2>({REQID}|{LABELID}){BLANK}+ |
1596<St_SecLabel2>({REQID}|{LABELID}) {
1597 yyextra->secLabel = yytext;
1598 yyextra->secLabel = yyextra->secLabel.stripWhiteSpace();
1599 BEGIN(St_SecTitle);
1600 }
1601<St_SecTitle>[^\n]+ |
1602<St_SecTitle>[^\n]*\n {
1603 lineCount(yytext,yyleng);
1604 yyextra->secTitle = yytext;
1605 yyextra->secTitle = yyextra->secTitle.stripWhiteSpace();
1606 if (yyextra->secTitle.endsWith("\\ilinebr"))
1607 {
1608 yyextra->secTitle.left(yyextra->secTitle.length()-8);
1609 }
1610 processSection(yyscanner);
1611 BEGIN(St_Sections);
1612 }
1613<St_SecTitle,St_SecLabel1,St_SecLabel2>. {
1614 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}' while looking for section label or title",yytext);
1615 }
1616
1617<St_Snippet>[^\\\n]+ {
1618 yyextra->token.name += yytext;
1619 }
1620<St_Snippet>"\\" {
1621 yyextra->token.name += yytext;
1622 }
1623<St_Snippet>(\n|"\\ilinebr") {
1624 unput_string(yytext,yyleng);
1625 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1626 return Token::make_TK_WORD();
1627 }
1628
1629 /* Generic rules that work for all states */
1630<*>\n {
1631 lineCount(yytext,yyleng);
1632 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected new line character");
1633 }
1634<*>"\\ilinebr" {
1635 }
1636<*>[\\@<>&$#%~"=] { /* unescaped special character */
1637 //warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}', assuming command \\{} was meant.",yytext,yytext);
1638 yyextra->token.name = yytext;
1639 return Token::char_to_command(yytext[0]);
1640 }
1641<*>. {
1642 warn(yyextra->fileName,yyextra->yyLineNr,"Unexpected character '{}'",yytext);
1643 }
1644%%
1645
1646//--------------------------------------------------------------------------
1647
1648static int yyread(yyscan_t yyscanner,char *buf,int max_size)
1649{
1650 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1651 int c=0;
1652 const char *p = yyextra->inputString + yyextra->inputPos;
1653 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1654 yyextra->inputPos+=c;
1655 return c;
1656}
1657
1658static void processSection(yyscan_t yyscanner)
1659{
1660 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1661 //printf("%s: found section/anchor with name '%s'\n",qPrint(yyextra->fileName),qPrint(yyextra->secLabel));
1662 DString file;
1663 if (yyextra->definition)
1664 {
1665 file = yyextra->definition->getOutputFileBase();
1666 }
1667 else
1668 {
1669 warn(yyextra->fileName,yyextra->yyLineNr,"Found section/anchor {} without context",yyextra->secLabel);
1670 }
1671 SectionInfo *si = SectionManager::instance().find(yyextra->secLabel);
1672 if (si)
1673 {
1674 si->setFileName(file);
1675 si->setType(yyextra->secType);
1676 }
1677}
1678
1679static void handleHtmlTag(yyscan_t yyscanner,const char *text)
1680{
1681 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1682
1683 DString tagText(text);
1684 yyextra->token.text = tagText;
1685 yyextra->token.attribs.clear();
1686 yyextra->token.endTag = false;
1687 yyextra->token.emptyTag = false;
1688
1689 // Check for end tag
1690 int startNamePos=1;
1691 if (tagText.at(1)=='/')
1692 {
1693 yyextra->token.endTag = true;
1694 startNamePos++;
1695 }
1696
1697 // Parse the name portion
1698 int i = startNamePos;
1699 for (i=startNamePos; i < (int)yyleng; i++)
1700 {
1701 // Check for valid HTML/XML name chars (including namespaces)
1702 char c = tagText.at(i);
1703 if (!(isalnum(c) || c=='-' || c=='_' || c==':')) break;
1704 }
1705 yyextra->token.name = tagText.mid(startNamePos,i-startNamePos);
1706
1707 // Parse the attributes. Each attribute is a name, value pair
1708 // The result is stored in yyextra->token.attribs.
1709 int startAttribList = i;
1710 while (i<(int)yyleng)
1711 {
1712 char c=tagText.at(i);
1713 // skip spaces
1714 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1715 // check for end of the tag
1716 if (c == '>') break;
1717 // Check for XML style "empty" tag.
1718 if (c == '/')
1719 {
1720 yyextra->token.emptyTag = true;
1721 break;
1722 }
1723 int startName=i;
1724 // search for end of name
1725 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='=' && c!= '>') { c=tagText.at(++i); }
1726 int endName=i;
1727 DString optName,optValue;
1728 optName = tagText.mid(startName,endName-startName).lower();
1729 // skip spaces
1730 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1731 if (tagText.at(i)=='=') // option has value
1732 {
1733 int startAttrib=0, endAttrib=0;
1734 c=tagText.at(++i);
1735 // skip spaces
1736 while (i<(int)yyleng && isspace((uint8_t)c)) { c=tagText.at(++i); }
1737 if (tagText.at(i)=='\'') // option '...'
1738 {
1739 c=tagText.at(++i);
1740 startAttrib=i;
1741
1742 // search for matching quote
1743 while (i<(int)yyleng && c!='\'') { c=tagText.at(++i); }
1744 endAttrib=i;
1745 if (i<(int)yyleng) { c=tagText.at(++i);}
1746 }
1747 else if (tagText.at(i)=='"') // option "..."
1748 {
1749 c=tagText.at(++i);
1750 startAttrib=i;
1751 // search for matching quote
1752 while (i<(int)yyleng && c!='"') { c=tagText.at(++i); }
1753 endAttrib=i;
1754 if (i<(int)yyleng) { c=tagText.at(++i);}
1755 }
1756 else // value without any quotes
1757 {
1758 startAttrib=i;
1759 // search for separator or end symbol
1760 while (i<(int)yyleng && !isspace((uint8_t)c) && c!='>') { c=tagText.at(++i); }
1761 endAttrib=i;
1762 if (i<(int)yyleng) { c=tagText.at(++i);}
1763 }
1764 optValue = tagText.mid(startAttrib,endAttrib-startAttrib);
1765 if (optName == "align") optValue = optValue.lower();
1766 else if (optName == "valign")
1767 {
1768 optValue = optValue.lower();
1769 if (optValue == "center") optValue="middle";
1770 }
1771 }
1772 else // start next option
1773 {
1774 }
1775 //printf("=====> Adding option name=<%s> value=<%s>\n",
1776 // qPrint(optName),qPrint(optValue));
1777 yyextra->token.attribs.emplace_back(optName,optValue);
1778 }
1779 yyextra->token.attribsStr = tagText.mid(startAttribList,i-startAttribList);
1780}
1781
1787
1788
1790{
1791 yyscan_t yyscanner = p->yyscanner;
1792 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1793 //printf("DocTokenizer::pushContext() stack=%zu\n",yyextra->lexerStack.size());
1794 yyextra->lexerStack.push(
1795 std::make_unique<DocLexerContext>(
1796 yyextra->token,YY_START,
1797 yyextra->autoListLevel,
1798 yyextra->inputPos,
1799 yyextra->inputString,
1800 YY_CURRENT_BUFFER));
1801 yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner), yyscanner);
1802}
1803
1805{
1806 yyscan_t yyscanner = p->yyscanner;
1807 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1808 //printf("DocTokenizer::popContext() stack=%zu\n",yyextra->lexerStack.size());
1809 if (yyextra->lexerStack.empty()) return false;
1810 const auto &ctx = yyextra->lexerStack.top();
1811 yyextra->autoListLevel = ctx->autoListLevel;
1812 yyextra->inputPos = ctx->inputPos;
1813 yyextra->inputString = ctx->inputString;
1814 yyextra->token = ctx->token;
1815
1816 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
1817 yy_switch_to_buffer(ctx->state, yyscanner);
1818
1819 BEGIN(ctx->rule);
1820 yyextra->lexerStack.pop();
1821 return true;
1822}
1823
1824
1826{
1827 //printf("%p:DocTokenizer::DocTokenizer()\n",(void*)this);
1828 doctokenizerYYlex_init_extra(&p->extra,&p->yyscanner);
1829#ifdef FLEX_DEBUG
1830 doctokenizerYYset_debug(Debug::isFlagSet(Debug::Lex_doctokenizer)?1:0,p->yyscanner);
1831#endif
1832}
1833
1835{
1836 //printf("%p:DocTokenizer::~DocTokenizer()\n",(void*)this);
1837 doctokenizerYYlex_destroy(p->yyscanner);
1838}
1839
1841{
1842 return doctokenizerYYlex(p->yyscanner);
1843}
1844
1846{
1847 yyscan_t yyscanner = p->yyscanner;
1848 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1849 unput_string(tag.data(),tag.length());
1850}
1851
1853 const DString &fileName)
1854{
1855 yyscan_t yyscanner = p->yyscanner;
1856 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1857
1858 if (input.empty()) return;
1859 DebugLex debugLex(Debug::Lex_doctokenizer, __FILE__, qPrint(fileName));
1860 yyextra->inputString = input.data();
1861 //printf("parsing --->'%s'<---\n",input);
1862 yyextra->inputPos = 0;
1863 yyextra->definition = d;
1864 yyextra->fileName = fileName;
1865 BEGIN(St_Sections);
1866 yyextra->yyLineNr = 1;
1867 doctokenizerYYlex(yyscanner);
1868}
1869
1870void DocTokenizer::init(const char *input,const DString &fileName,bool markdownSupport, bool insideHtmlLink)
1871{
1872 yyscan_t yyscanner = p->yyscanner;
1873 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1874 yyextra->autoListLevel = 0;
1875 yyextra->inputString = input;
1876 yyextra->inputPos = 0;
1877 yyextra->fileName = fileName;
1878 yyextra->insidePre = false;
1879 yyextra->markdownSupport = markdownSupport;
1880 yyextra->insideHtmlLink = insideHtmlLink;
1881 BEGIN(St_Para);
1882}
1883
1885{
1886 yyscan_t yyscanner = p->yyscanner;
1887 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1888 return &yyextra->token;
1889}
1890
1892{
1893 yyscan_t yyscanner = p->yyscanner;
1894 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1895 yyextra->token = TokenInfo();
1896 return &yyextra->token;
1897}
1898
1900{
1901 yyscan_t yyscanner = p->yyscanner;
1902 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1903 yyextra->insideHtmlLink = false;
1904 BEGIN(St_Para);
1905}
1906
1908{
1909 yyscan_t yyscanner = p->yyscanner;
1910 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1911 BEGIN(St_Title);
1912}
1913
1915{
1916 yyscan_t yyscanner = p->yyscanner;
1917 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1918 BEGIN(St_TitleV);
1919}
1920
1922{
1923 yyscan_t yyscanner = p->yyscanner;
1924 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1925 yyextra->token.verb="";
1926 yyextra->token.name="";
1927 BEGIN(St_CodeOpt);
1928}
1929
1931{
1932 yyscan_t yyscanner = p->yyscanner;
1933 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1934 yyextra->token.verb="";
1935 yyextra->token.name="";
1936 BEGIN(St_iCodeOpt);
1937}
1938
1940{
1941 yyscan_t yyscanner = p->yyscanner;
1942 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1943 yyextra->token.verb="";
1944 yyextra->token.name="";
1945 BEGIN(St_XmlCode);
1946}
1947
1949{
1950 yyscan_t yyscanner = p->yyscanner;
1951 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1952 yyextra->token.verb="";
1953 yyextra->token.name="";
1954 BEGIN(St_HtmlOnlyOption);
1955}
1956
1958{
1959 yyscan_t yyscanner = p->yyscanner;
1960 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1961 yyextra->token.verb="";
1962 BEGIN(St_ManOnly);
1963}
1964
1966{
1967 yyscan_t yyscanner = p->yyscanner;
1968 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1969 yyextra->token.verb="";
1970 BEGIN(St_RtfOnly);
1971}
1972
1974{
1975 yyscan_t yyscanner = p->yyscanner;
1976 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1977 yyextra->token.verb="";
1978 BEGIN(St_XmlOnly);
1979}
1980
1982{
1983 yyscan_t yyscanner = p->yyscanner;
1984 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1985 yyextra->token.verb="";
1986 BEGIN(St_DbOnly);
1987}
1988
1990{
1991 yyscan_t yyscanner = p->yyscanner;
1992 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1993 yyextra->token.verb="";
1994 BEGIN(St_LatexOnly);
1995}
1996
1998{
1999 yyscan_t yyscanner = p->yyscanner;
2000 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2001 yyextra->token.verb="";
2002 BEGIN(St_ILiteral);
2003}
2004
2006{
2007 yyscan_t yyscanner = p->yyscanner;
2008 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2009 yyextra->token.verb="";
2010 BEGIN(St_ILiteralOpt);
2011}
2012
2014{
2015 yyscan_t yyscanner = p->yyscanner;
2016 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2017 yyextra->token.verb="";
2018 BEGIN(St_Verbatim);
2019}
2020
2022{
2023 yyscan_t yyscanner = p->yyscanner;
2024 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2025 yyextra->token.verb="";
2026 BEGIN(St_iVerbatim);
2027}
2028
2030{
2031 yyscan_t yyscanner = p->yyscanner;
2032 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2033 yyextra->token.verb="";
2034 BEGIN(St_Dot);
2035}
2036
2038{
2039 yyscan_t yyscanner = p->yyscanner;
2040 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2041 yyextra->token.verb="";
2042 BEGIN(St_Msc);
2043}
2044
2046{
2047 yyscan_t yyscanner = p->yyscanner;
2048 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2049 yyextra->token.verb="";
2050 yyextra->token.sectionId="";
2051 BEGIN(St_PlantUMLOpt);
2052}
2053
2055{
2056 yyscan_t yyscanner = p->yyscanner;
2057 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2058 yyextra->token.verb="";
2059 BEGIN(St_PlantUML);
2060}
2061
2063{
2064 yyscan_t yyscanner = p->yyscanner;
2065 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2066 yyextra->token.verb="";
2067 yyextra->token.sectionId="";
2068 BEGIN(St_MermaidOpt);
2069}
2070
2072{
2073 yyscan_t yyscanner = p->yyscanner;
2074 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2075 yyextra->token.verb="";
2076 BEGIN(St_Mermaid);
2077}
2078
2080{
2081 yyscan_t yyscanner = p->yyscanner;
2082 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2083 BEGIN(St_Param);
2084}
2085
2087{
2088 yyscan_t yyscanner = p->yyscanner;
2089 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2090 BEGIN(St_XRefItem);
2091}
2092
2094{
2095 yyscan_t yyscanner = p->yyscanner;
2096 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2097 BEGIN(St_File);
2098}
2099
2101{
2102 yyscan_t yyscanner = p->yyscanner;
2103 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2104 BEGIN(St_IFile);
2105}
2106
2108{
2109 yyscan_t yyscanner = p->yyscanner;
2110 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2111 yyextra->token.name = "";
2112 BEGIN(St_Pattern);
2113}
2114
2116{
2117 yyscan_t yyscanner = p->yyscanner;
2118 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2119 BEGIN(St_Link);
2120}
2121
2123{
2124 yyscan_t yyscanner = p->yyscanner;
2125 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2126 BEGIN(St_Cite);
2127}
2128
2130{
2131 yyscan_t yyscanner = p->yyscanner;
2132 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2133 BEGIN(St_DoxyConfig);
2134}
2135
2137{
2138 yyscan_t yyscanner = p->yyscanner;
2139 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2140 yyextra->expectQuote=false;
2141 BEGIN(St_Ref);
2142}
2143
2145{
2146 yyscan_t yyscanner = p->yyscanner;
2147 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2148 BEGIN(St_IntRef);
2149}
2150
2152{
2153 yyscan_t yyscanner = p->yyscanner;
2154 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2155 BEGIN(St_Text);
2156}
2157
2159{
2160 yyscan_t yyscanner = p->yyscanner;
2161 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2162 BEGIN(St_SkipTitle);
2163}
2164
2166{
2167 yyscan_t yyscanner = p->yyscanner;
2168 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2169 BEGIN(St_Anchor);
2170}
2171
2173{
2174 yyscan_t yyscanner = p->yyscanner;
2175 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2176 BEGIN(St_Prefix);
2177}
2178
2180{
2181 yyscan_t yyscanner = p->yyscanner;
2182 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2183 yyextra->token.name="";
2184 BEGIN(St_Snippet);
2185}
2186
2188{
2189 yyscan_t yyscanner = p->yyscanner;
2190 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2191 BEGIN(St_SetScope);
2192}
2193
2195{
2196 yyscan_t yyscanner = p->yyscanner;
2197 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2198 yyextra->token.name="";
2199 BEGIN(St_Options);
2200}
2201
2203{
2204 yyscan_t yyscanner = p->yyscanner;
2205 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2206 yyextra->token.name="";
2207 BEGIN(St_Block);
2208}
2209
2211{
2212 yyscan_t yyscanner = p->yyscanner;
2213 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2214 yyextra->token.name="";
2215 BEGIN(St_Emoji);
2216}
2217
2219{
2220 yyscan_t yyscanner = p->yyscanner;
2221 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2222 BEGIN(St_ILine);
2223}
2224
2226{
2227 yyscan_t yyscanner = p->yyscanner;
2228 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2229 BEGIN(St_QuotedString);
2230}
2231
2233{
2234 yyscan_t yyscanner = p->yyscanner;
2235 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2236 BEGIN(St_ShowDate);
2237}
2238
2240{
2241 yyscan_t yyscanner = p->yyscanner;
2242 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2243 yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner );
2244}
2245
2247{
2248 yyscan_t yyscanner = p->yyscanner;
2249 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2250 yyextra->insidePre = b;
2251}
2252
2254{
2255 yyscan_t yyscanner = p->yyscanner;
2256 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2257 DString tagName = tag;
2258 int l = static_cast<int>(tagName.length());
2259 unput('>');
2260 for (int i=l-1;i>=0;i--)
2261 {
2262 unput(tag[i]);
2263 }
2264 unput('<');
2265}
2266
2268{
2269 yyscan_t yyscanner = p->yyscanner;
2270 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2271 yyextra->autoListLevel++;
2272}
2273
2275{
2276 yyscan_t yyscanner = p->yyscanner;
2277 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2278 yyextra->autoListLevel--;
2279}
2280
2282{
2283 yyscan_t yyscanner = p->yyscanner;
2284 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2285 yyextra->fileName = fileName;
2286}
2287
2289{
2290 yyscan_t yyscanner = p->yyscanner;
2291 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2292 return yyextra->fileName;
2293}
2294
2296{
2297 yyscan_t yyscanner = p->yyscanner;
2298 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2299 yyextra->yyLineNr = lineno;
2300}
2301
2303{
2304 yyscan_t yyscanner = p->yyscanner;
2305 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2306 return yyextra->yyLineNr;
2307}
2308
2310{
2311 yyscan_t yyscanner = p->yyscanner;
2312 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2313 yyextra->stateStack.push(YYSTATE);
2314}
2315
2317{
2318 yyscan_t yyscanner = p->yyscanner;
2319 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2320 ASSERT(!yyextra->stateStack.empty());
2321 BEGIN(yyextra->stateStack.top());
2322 yyextra->stateStack.pop();
2323}
2324
2325#include "doctokenizer.l.h"
void clear()
Definition dstring.h:214
DString lower() const
Definition dstring.h:326
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
@ Lex_doctokenizer
Definition debug.h:61
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
TokenInfo * token()
DString getFileName() const
void setStateTitleAttrValue()
void setStateILiteralOpt()
void setStateILiteral()
void unputString(const DString &tag)
void setStateCite()
void setStateSnippet()
void setStatePrefix()
void setStateEmoji()
void setStateMermaidOpt()
void setLineNr(int lineno)
void setStateCode()
void setStatePattern()
void startAutoList()
void setStateIFile()
void setStateSkipTitle()
void setStateParam()
void setStateBlock()
void setStatePlantUMLOpt()
void setStateAnchor()
void setStateRtfOnly()
void setStateVerbatim()
void setStateLink()
void setStateTitle()
void setStateFile()
void setStateLatexOnly()
void setStateManOnly()
void setStateShowDate()
void setInsidePre(bool b)
void findSections(const DString &input, const Definition *d, const DString &fileName)
void setStateXRefItem()
int getLineNr() const
void setStateText()
void setStateXmlCode()
void setStateDbOnly()
void setStateHtmlOnly()
void setStateInternalRef()
void pushBackHtmlTag(const DString &tag)
void init(const char *input, const DString &fileName, bool markdownSupport, bool insideHtmlLink)
void setStateILine()
void setFileName(const DString &fileName)
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()
const T * find(const std::string &key) const
Definition linkedmap.h:47
class that provide information about a section.
Definition section.h:58
void setType(SectionType t)
Definition section.h:81
void setFileName(const DString &fn)
Definition section.h:80
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
#define YY_BUF_SIZE
Definition commentcnv.l:19
const char * qPrint(const char *s)
Definition dstring.h:783
Definition dstring.h:913
doctokenizerYY_state extra