336 {LISTITEM} {
337 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
340 uint32_t dashPos = static_cast<uint32_t>(text.findRev('-'));
341 assert(dashPos!=static_cast<uint32_t>(-1));
342 yyextra->token.isEnumList = text.at(dashPos+1)=='#';
343 yyextra->token.isCheckedList = false;
344 yyextra->token.id = -1;
346 return Token::make_TK_LISTITEM();
347 }
#define lineCount(s, len)
static int computeIndent(const char *str, size_t length)
348<St_Para>^{CLISTITEM} { /* checkbox item */
350 int dashPos = text.
findRev(
'-');
351 yyextra->token.isEnumList = false;
352 yyextra->token.isCheckedList = true;
357 return Token::make_TK_LISTITEM();
358 }
int findRev(char c, int index=-1, bool cs=TRUE) const
359<St_Para>^{MLISTITEM} { /* list item */
360 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
361 {
362 REJECT;
363 }
364 else
365 {
367 std::string text(yytext);
368 static const reg::Ex re(R
"([*+][^*+]*$)");
371 size_t listPos =
match.position();
372 assert(listPos!=std::string::npos);
373 yyextra->token.isEnumList = false;
374 yyextra->token.isCheckedList = false;
375 yyextra->token.id = -1;
377 return Token::make_TK_LISTITEM();
378 }
379 }
Class representing a regular expression.
Object representing the matching results.
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.
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
380<St_Para>^{OLISTITEM} { /* numbered list item */
381 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
382 {
383 REJECT;
384 }
385 else
386 {
387 std::string text(yytext);
388 static const reg::Ex re(R
"(\d+)");
391 size_t markPos =
match.position();
392 assert(markPos!=std::string::npos);
393 yyextra->token.isEnumList = true;
394 yyextra->token.isCheckedList = false;
395 bool ok = false;
397 yyextra->token.id = ok ? id : -1;
398 if (!ok)
399 {
400 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid number for list item '{}' ",
match.str());
401 }
403 return Token::make_TK_LISTITEM();
404 }
405 }
int toInt(bool *ok=nullptr, int base=10) const
406<St_Para>{BLANK}*(\n|"\\ilinebr"){LISTITEM} { /* list item on next line */
407 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
410 uint32_t dashPos =
static_cast<uint32_t
>(text.
findRev(
'-'));
411 assert(dashPos!=static_cast<uint32_t>(-1));
412 yyextra->token.isEnumList = text.
at(dashPos+1)==
'#';
413 yyextra->token.isCheckedList = false;
414 yyextra->token.id = -1;
416 return Token::make_TK_LISTITEM();
417 }
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString extractPartAfterNewLine(const QCString &text)
418<St_Para>{BLANK}*\n{CLISTITEM} { /* checkbox item on next line */
421 int dashPos = text.
findRev(
'-');
422 yyextra->token.isEnumList = false;
423 yyextra->token.isCheckedList = true;
428 return Token::make_TK_LISTITEM();
429 }
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString right(size_t len) const
430<St_Para>{BLANK}*(\n|"\\ilinebr"){MLISTITEM} { /* list item on next line */
431 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
432 {
433 REJECT;
434 }
435 else
436 {
439 static const reg::Ex re(R
"([*+][^*+]*$)");
442 size_t markPos =
match.position();
443 assert(markPos!=std::string::npos);
444 yyextra->token.isEnumList =
FALSE;
445 yyextra->token.isCheckedList = false;
446 yyextra->token.id = -1;
448 return Token::make_TK_LISTITEM();
449 }
450 }
const std::string & str() const
451<St_Para>{BLANK}*(\n|"\\ilinebr"){OLISTITEM} { /* list item on next line */
452 if (yyextra->insideHtmlLink || !yyextra->markdownSupport || yyextra->insidePre)
453 {
454 REJECT;
455 }
456 else
457 {
460 static const reg::Ex re(R
"(\d+)");
463 size_t markPos =
match.position();
464 assert(markPos!=std::string::npos);
465 yyextra->token.isEnumList = true;
466 yyextra->token.isCheckedList = false;
467 bool ok = false;
469 yyextra->token.id = ok ? id : -1;
470 if (!ok)
471 {
472 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid number for list item '{}' ",
match.str());
473 }
475 return Token::make_TK_LISTITEM();
476 }
477 }
478<St_Para>^{ENDLIST} { /* end list */
479 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
483 return Token::make_TK_ENDLIST();
484 }
485<St_Para>{BLANK}*(\n|"\\ilinebr"){ENDLIST} { /* end list on next line */
486 if (yyextra->insideHtmlLink || yyextra->insidePre) REJECT;
489 size_t dotPos =
static_cast<size_t>(text.
findRev(
'.'));
491 return Token::make_TK_ENDLIST();
492 }
493<St_Para>"{"{BLANK}*"@linkplain"/{WS}+ {
494 yyextra->token.name = "javalinkplain";
495 return Token::make_TK_COMMAND_AT();
496 }
497<St_Para>"{"{BLANK}*"@link"/{WS}+ {
498 yyextra->token.name = "javalink";
499 return Token::make_TK_COMMAND_AT();
500 }
501<St_Para>"{"{BLANK}*"@inheritDoc"{BLANK}*"}" {
502 yyextra->token.name = "inheritdoc";
503 return Token::make_TK_COMMAND_AT();
504 }
505<St_Para>"@_fakenl" { // artificial new line
506
507 }
508<St_Para>{SPCMD3} {
509 yyextra->token.name = "_form";
510 bool ok;
514 }
static Token char_to_command(char c)
515<St_Para>{CMD}"n"\n { /* \n followed by real newline */
517
518 yyextra->token.name = yytext+1;
519 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
522 }
523<St_Para>"\\ilinebr" {
524 }
525<St_Para>{SPCMD1} |
526<St_Para>{SPCMD2} |
527<St_Para>{SPCMD5} |
528<St_Para>{SPCMD4} { /* special command */
529 yyextra->token.name = yytext+1;
530 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
533 }
534<St_Para>{PARAMIO} { /* param [in,out] command */
535 yyextra->token.name = "param";
537 bool isIn = s.find("in")!=-1;
538 bool isOut = s.find("out")!=-1;
539 if (isIn)
540 {
541 if (isOut)
542 {
544 }
545 else
546 {
548 }
549 }
550 else if (isOut)
551 {
553 }
554 else
555 {
557 }
559 }
560<St_Para>{URLPROTOCOL}{URLMASK}/[,\.] { // URL, or URL.
561 yyextra->token.name=yytext;
562 yyextra->token.isEMailAddr=
FALSE;
563 return Token::make_TK_URL();
564 }
565<St_Para>{URLPROTOCOL}{URLMASK} { // URL
566 yyextra->token.name=yytext;
567 yyextra->token.isEMailAddr=
FALSE;
568 return Token::make_TK_URL();
569 }
570<St_Para>"<"{URLPROTOCOL}{URLMASK}">" { // URL
571 yyextra->token.name=yytext;
572 yyextra->token.name = yyextra->token.name.mid(1,yyextra->token.name.length()-2);
573 yyextra->token.isEMailAddr=
FALSE;
574 return Token::make_TK_URL();
575 }
576<St_Para>{MAILADDR} { // Mail address
577 yyextra->token.name=yytext;
578 yyextra->token.name.stripPrefix("mailto:");
579 yyextra->token.isEMailAddr=
TRUE;
580 return Token::make_TK_URL();
581 }
582<St_Para>"<"{MAILADDR}">" { // Mail address
583 yyextra->token.name=yytext;
584 yyextra->token.name = yyextra->token.name.mid(1,yyextra->token.name.length()-2);
585 yyextra->token.name.stripPrefix("mailto:");
586 yyextra->token.isEMailAddr=
TRUE;
587 return Token::make_TK_URL();
588 }
589<St_Para>"<"{MAILADDR2}">" { // anti spam mail address
590 yyextra->token.name=yytext;
591 return Token::make_TK_WORD();
592 }
593<St_Para>{RCSID} { /* RCS tag */
595 int index=tagName.find(':');
596 if (index<0) index=0;
597 yyextra->token.name = tagName.left(index);
598 int text_begin = index+2;
599 int text_end = static_cast<int>(tagName.length())-1;
600 if (tagName[text_begin-1]==':')
601 {
602 ++text_begin;
603 if (tagName[text_end-1]=='#')
604 {
605 --text_end;
606 }
607 }
608 yyextra->token.text = tagName.mid(text_begin,text_end-text_begin);
609 return Token::make_TK_RCSTAG();
610 }
611<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}")" | /* environment variable */
612<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}"("{ID}"))" { /* environment variable */
614 name = name.left(static_cast<int>(name.length())-1);
616 for (
int i=
static_cast<int>(value.
length())-1;i>=0;i--) unput(value.
at(i));
617 }
QCString getenv(const QCString &variable)
618<St_Para>"<blockquote>‍" {
619
620
621
622 YY_CURRENT_BUFFER->yy_at_bol=1;
625 return Token::make_TK_HTMLTAG();
626 }
static void handleHtmlTag(yyscan_t yyscanner, const char *text)
627<St_Para>{HTMLTAG} { /* html tag */
630 return Token::make_TK_HTMLTAG();
631 }
632<St_Para,St_Text>"&"{ID}";" { /* special symbol */
633 yyextra->token.name = yytext;
634 return Token::make_TK_SYMBOL();
635 }
636
637
638
639<St_Para>{ID}/"<"{HTMLKEYW}">"+ { /* this rule is to prevent opening html
640 * tag to be recognized as a templated classes
641 */
642 yyextra->token.name = yytext;
643 return Token::make_TK_LNKWORD();
644 }
645<St_Para>{LNKWORDN}/("<"{HTMLKEYW}">")+ { // prevent <br> html tag to be parsed as template arguments
646 yyextra->token.name = yytext;
647 return Token::make_TK_LNKWORD();
648 }
649<St_Para>{LNKWORD1} |
650<St_Para>{LNKWORD1}{FUNCARG} |
651<St_Para>{LNKWORD2} |
652<St_Para>{LNKWORD3} {
653 yyextra->token.name = yytext;
654 return Token::make_TK_LNKWORD();
655 }
656<St_Para>{LNKWORD1}{FUNCARG}{CVSPEC}[^a-z_A-Z0-9] {
657 yyextra->token.name = yytext;
658 yyextra->token.name = yyextra->token.name.left(yyextra->token.name.length()-1);
659 unput(yytext[(int)yyleng-1]);
660 return Token::make_TK_LNKWORD();
661 }
662
663
664<St_Para,St_Text>[\-+0-9] |
665<St_Para,St_Text>{WORD1} |
666<St_Para,St_Text>{WORD2} { /* function call */
667 if (
QCString(yytext).find(
"\\ilinebr")!=-1) REJECT;
669 if (yytext[0]=='%')
670 yyextra->token.name = &yytext[1];
671 else
672 yyextra->token.name = yytext;
673 return Token::make_TK_WORD();
674 }
675<St_Text>({ID}".")+{ID} {
676 yyextra->token.name = yytext;
677 return Token::make_TK_WORD();
678 }
679<St_Para,St_Text>"operator"/{BLANK}*"<"[a-zA-Z_0-9]+">" { // Special case: word "operator" followed by a HTML command
680
681 yyextra->token.name = yytext;
682 return Token::make_TK_WORD();
683 }
684
685
686
687<St_Para,St_Text>{BLANK}+ |
688<St_Para,St_Text>{BLANK}*\n{BLANK}* { /* white space */
690 yyextra->token.chars=yytext;
691 return Token::make_TK_WHITESPACE();
692 }
693<St_Text>[\\@<>&$#%~] {
694 yyextra->token.name = yytext;
696 }
697<St_Para>({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */
698 if (yyextra->insidePre || yyextra->autoListLevel==0)
699 {
700 REJECT;
701 }
703 }
704<St_Para>({BLANK}*\n)+{BLANK}*\n/{CLISTITEM} { /* skip trailing paragraph followed by new checkbox item */
705 if (yyextra->insidePre || yyextra->autoListLevel==0)
706 {
707 REJECT;
708 }
709 }
710<St_Para>({BLANK}*\n)+{BLANK}*\n/{MLISTITEM} { /* skip trailing paragraph followed by new list item */
711 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
712 {
713 REJECT;
714 }
716 }
717<St_Para>({BLANK}*\n)+{BLANK}*\n/{OLISTITEM} { /* skip trailing paragraph followed by new list item */
718 if (!yyextra->markdownSupport || yyextra->insidePre || yyextra->autoListLevel==0)
719 {
720 REJECT;
721 }
723 }
724<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}*/" \\ifile" | // we don't want to count the space before \ifile
725<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
727 if (yyextra->insidePre)
728 {
729 yyextra->token.chars=yytext;
730 return Token::make_TK_WHITESPACE();
731 }
732 else
733 {
735 int i;
736
737
738 for (i=0;i<yyextra->token.indent;i++)
739 {
740 unput(' ');
741 }
742
743
744 YY_CURRENT_BUFFER->yy_at_bol=1;
745
746 return Token::make_TK_NEWPARA();
747 }
748 }
749<St_CodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
750 yyextra->token.name = yytext;
751 int i=yyextra->token.name.find('{');
752 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
753 BEGIN(St_Code);
754 }
755<St_iCodeOpt>{BLANK}*"{"(".")?{CODEID}"}" {
756 yyextra->token.name = yytext;
757 int i=yyextra->token.name.find('{');
758 yyextra->token.name = yyextra->token.name.mid(i+1,yyextra->token.name.length()-i-2);
759 BEGIN(St_iCode);
760 }
761<St_CodeOpt>"\\ilinebr" |
762<St_CodeOpt>\n |
763<St_CodeOpt>. {
765 BEGIN(St_Code);
766 }
#define unput_string(yytext, yyleng)
767<St_iCodeOpt>"\\ilinebr" |
768<St_iCodeOpt>\n |
769<St_iCodeOpt>. {
771 BEGIN(St_iCode);
772 }
773<St_Code>{WS}*{CMD}"endcode" {
775 return Token::make_RetVal_OK();
776 }
777<St_iCode>{WS}*{CMD}"endicode" {
779 return Token::make_RetVal_OK();
780 }
781<St_XmlCode>{WS}*"</code>" {
783 return Token::make_RetVal_OK();
784 }
785<St_Code,St_iCode,St_XmlCode>[^\\@\n<]+ |
786<St_Code,St_iCode,St_XmlCode>\n |
787<St_Code,St_iCode,St_XmlCode>. {
789 yyextra->token.verb+=yytext;
790 }
791<St_HtmlOnlyOption>" [block]" { // the space is added in commentscan.l
792 yyextra->token.name="block";
793 BEGIN(St_HtmlOnly);
794 }
795<St_HtmlOnlyOption>.|\n {
796 unput(*yytext);
797 BEGIN(St_HtmlOnly);
798 }
799<St_HtmlOnlyOption>"\\ilinebr" {
801 BEGIN(St_HtmlOnly);
802 }
803<St_HtmlOnly>{CMD}"endhtmlonly" {
804 return Token::make_RetVal_OK();
805 }
806<St_HtmlOnly>[^\\@\n$]+ |
807<St_HtmlOnly>\n |
808<St_HtmlOnly>. {
810 yyextra->token.verb+=yytext;
811 }
812<St_ManOnly>{CMD}"endmanonly" {
813 return Token::make_RetVal_OK();
814 }
815<St_ManOnly>[^\\@\n$]+ |
816<St_ManOnly>\n |
817<St_ManOnly>. {
819 yyextra->token.verb+=yytext;
820 }
821<St_RtfOnly>{CMD}"endrtfonly" {
822 return Token::make_RetVal_OK();
823 }
824<St_RtfOnly>[^\\@\n$]+ |
825<St_RtfOnly>\n |
826<St_RtfOnly>. {
828 yyextra->token.verb+=yytext;
829 }
830<St_LatexOnly>{CMD}"endlatexonly" {
831 return Token::make_RetVal_OK();
832 }
833<St_LatexOnly>[^\\@\n]+ |
834<St_LatexOnly>\n |
835<St_LatexOnly>. {
837 yyextra->token.verb+=yytext;
838 }
839<St_XmlOnly>{CMD}"endxmlonly" {
840 return Token::make_RetVal_OK();
841 }
842<St_XmlOnly>[^\\@\n]+ |
843<St_XmlOnly>\n |
844<St_XmlOnly>. {
846 yyextra->token.verb+=yytext;
847 }
848<St_DbOnly>{CMD}"enddocbookonly" {
849 return Token::make_RetVal_OK();
850 }
851<St_DbOnly>[^\\@\n]+ |
852<St_DbOnly>\n |
853<St_DbOnly>. {
855 yyextra->token.verb+=yytext;
856 }
857<St_Verbatim>{CMD}"endverbatim" {
858 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
859 return Token::make_RetVal_OK();
860 }
861<St_ILiteral>{CMD}"endiliteral " { // note extra space as this is artificially added
862
863 yyextra->token.verb = yyextra->token.verb.mid(1,yyextra->token.verb.length()-2);
864 return Token::make_RetVal_OK();
865 }
866<St_iVerbatim>{CMD}"endiverbatim" {
867 yyextra->token.verb = yyextra->token.verb.stripLeadingAndTrailingEmptyLines();
868 return Token::make_RetVal_OK();
869 }
870<St_Verbatim,St_iVerbatim,St_ILiteral>[^\\@\n]+ |
871<St_Verbatim,St_iVerbatim,St_ILiteral>\n |
872<St_Verbatim,St_iVerbatim,St_ILiteral>. { /* Verbatim text */
874 yyextra->token.verb+=yytext;
875 }
876<St_ILiteralOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // option(s) present
878 return Token::make_RetVal_OK();
879 }
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
880<St_ILiteralOpt>"\\ilinebr" |
881<St_ILiteralOpt>"\n" |
882<St_ILiteralOpt>. {
883 yyextra->token.sectionId = "";
885 return Token::make_RetVal_OK();
886 }
887<St_Dot>{CMD}"enddot" {
888 return Token::make_RetVal_OK();
889 }
890<St_Dot>[^\\@\n]+ |
891<St_Dot>\n |
892<St_Dot>. { /* dot text */
894 yyextra->token.verb+=yytext;
895 }
896<St_Msc>{CMD}("endmsc") {
897 return Token::make_RetVal_OK();
898 }
899<St_Msc>[^\\@\n]+ |
900<St_Msc>\n |
901<St_Msc>. { /* msc text */
903 yyextra->token.verb+=yytext;
904 }
905<St_PlantUMLOpt>{BLANK}*"{"[a-zA-Z_,:0-9\. ]*"}" { // case 1: options present
907 return Token::make_RetVal_OK();
908 }
909<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute
911 return Token::make_RetVal_OK();
912 }
913<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title
915 return Token::make_RetVal_OK();
916 }
917<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
919 return Token::make_RetVal_OK();
920 }
921<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
923 return Token::make_RetVal_OK();
924 }
925<St_PlantUMLOpt>"\\ilinebr" |
926<St_PlantUMLOpt>"\n" |
927<St_PlantUMLOpt>. {
928 yyextra->token.sectionId = "";
930 return Token::make_RetVal_OK();
931 }
932<St_PlantUML>{CMD}"enduml" {
933 return Token::make_RetVal_OK();
934 }
935<St_PlantUML>[^\\@\n]+ |
936<St_PlantUML>\n |
937<St_PlantUML>. { /* plantuml text */
939 yyextra->token.verb+=yytext;
940 }
941<St_Title>"\"" { // quoted title
942 BEGIN(St_TitleQ);
943 }
944<St_Title>[ \t]+ {
945 yyextra->token.chars=yytext;
946 return Token::make_TK_WHITESPACE();
947 }
948<St_Title>. { // non-quoted title
949 unput(*yytext);
950 BEGIN(St_TitleN);
951 }
952<St_Title>\n {
953 unput(*yytext);
954 return Token::make_TK_NONE();
955 }
956<St_Title>"\\ilinebr" {
958 return Token::make_TK_NONE();
959 }
960<St_TitleN>"&"{ID}";" { /* symbol */
961 yyextra->token.name = yytext;
962 return Token::make_TK_SYMBOL();
963 }
964<St_TitleN>{HTMLTAG} {
965 yyextra->token.name = yytext;
967 return Token::make_TK_HTMLTAG();
968 }
969<St_TitleN>\n { /* new line => end of title */
970 unput(*yytext);
971 return Token::make_TK_NONE();
972 }
973<St_TitleN>"\\ilinebr" { /* new line => end of title */
975 return Token::make_TK_NONE();
976 }
977<St_TitleN>{SPCMD1} |
978<St_TitleN>{SPCMD2} { /* special command */
979 yyextra->token.name = yytext+1;
982 }
983<St_TitleN>{ID}"=" { /* attribute */
984 if (yytext[0]=='%')
985 yyextra->token.name = &yytext[1];
986 else
987 yyextra->token.name = yytext;
988 return Token::make_TK_WORD();
989 }
990<St_TitleN>[\-+0-9] |
991<St_TitleN>{WORD1} |
992<St_TitleN>{WORD2} { /* word */
993 if (
QCString(yytext).find(
"\\ilinebr")!=-1) REJECT;
995 if (yytext[0]=='%')
996 yyextra->token.name = &yytext[1];
997 else
998 yyextra->token.name = yytext;
999 return Token::make_TK_WORD();
1000 }
1001<St_TitleN>[ \t]+ {
1002 yyextra->token.chars=yytext;
1003 return Token::make_TK_WHITESPACE();
1004 }
1005<St_TitleQ>"&"{ID}";" { /* symbol */
1006 yyextra->token.name = yytext;
1007 return Token::make_TK_SYMBOL();
1008 }
1009<St_TitleQ>(\n|"\\ilinebr") { /* new line => end of title */
1011 return Token::make_TK_NONE();
1012 }
1013<St_TitleQ>{SPCMD1} |
1014<St_TitleQ>{SPCMD2} { /* special command */
1015 yyextra->token.name = yytext+1;
1018 }
1019<St_TitleQ>{WORD1NQ} |
1020<St_TitleQ>{WORD2NQ} { /* word */
1021 yyextra->token.name = yytext;
1022 return Token::make_TK_WORD();
1023 }
1024<St_TitleQ>[ \t]+ {
1025 yyextra->token.chars=yytext;
1026 return Token::make_TK_WHITESPACE();
1027 }
1028<St_TitleQ>"\"" { /* closing quote => end of title */
1029 BEGIN(St_TitleA);
1030 return Token::make_TK_NONE();
1031 }
1032<St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute
1033 yyextra->token.name = yytext;
1034 int pos = yyextra->token.name.find('=');
1035 if (pos<0) pos=0;
1036 yyextra->token.name = yyextra->token.name.left(pos).stripWhiteSpace();
1037 BEGIN(St_TitleV);
1038 }
1039<St_TitleV>[^ \t\r\n]+ { // attribute value
1041 yyextra->token.chars = yytext;
1042 BEGIN(St_TitleN);
1043 return Token::make_TK_WORD();
1044 }
1045<St_TitleV,St_TitleA>. {
1046 unput(*yytext);
1047 return Token::make_TK_NONE();
1048 }
1049<St_TitleV,St_TitleA>(\n|"\\ilinebr") {
1051 return Token::make_TK_NONE();
1052 }
1053
1054<St_Anchor>{LABELID}{WS}? { // anchor
1057 return Token::make_TK_WORD();
1058 }
1059<St_Anchor>. {
1060 unput(*yytext);
1061 return Token::make_TK_NONE();
1062 }
1063<St_Cite>{CITEID} { // label to cite
1064 if (yytext[0] =='"')
1065 {
1066 yyextra->token.name=yytext+1;
1067 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-2);
1068 }
1069 else
1070 {
1071 yyextra->token.name=yytext;
1072 }
1073 return Token::make_TK_WORD();
1074 }
1075<St_Cite>{BLANK} { // white space
1076 unput(' ');
1077 return Token::make_TK_NONE();
1078 }
1079<St_Cite>(\n|"\\ilinebr") { // new line
1081 return Token::make_TK_NONE();
1082 }
1083<St_Cite>. { // any other character
1084 unput(*yytext);
1085 return Token::make_TK_NONE();
1086 }
1087<St_DoxyConfig>{DOXYCFG} { // config option
1088 yyextra->token.name=yytext;
1089 return Token::make_TK_WORD();
1090 }
1091<St_DoxyConfig>{BLANK} { // white space
1092 unput(' ');
1093 return Token::make_TK_NONE();
1094 }
1095<St_DoxyConfig>(\n|"\\ilinebr") { // new line
1097 return Token::make_TK_NONE();
1098 }
1099<St_DoxyConfig>. { // any other character
1100 unput(*yytext);
1101 return Token::make_TK_NONE();
1102 }
1103<St_Ref>{REFWORD_NOCV}/{BLANK}("const")[a-z_A-Z0-9] { // see bug776988
1104 yyextra->token.name=yytext;
1105 return Token::make_TK_WORD();
1106 }
1107<St_Ref>{REFWORD_NOCV}/{BLANK}("volatile")[a-z_A-Z0-9] { // see bug776988
1108 yyextra->token.name=yytext;
1109 return Token::make_TK_WORD();
1110 }
1111<St_Ref>{REFWORD} { // label to refer to
1112 yyextra->token.name=yytext;
1113 return Token::make_TK_WORD();
1114 }
1115<St_Ref>{BLANK} { // white space
1116 unput(' ');
1117 return Token::make_TK_NONE();
1118 }
1119<St_Ref>{WS}+"\""{WS}* { // white space following by quoted string
1121 BEGIN(St_Ref2);
1122 }
1123<St_Ref>(\n|"\\ilinebr") { // new line
1125 return Token::make_TK_NONE();
1126 }
1127<St_Ref>"\""[^"\n]+"\"" { // quoted first argument -> return without quotes
1128 yyextra->token.name=
QCString(yytext).
mid(1,yyleng-2);
1129 return Token::make_TK_WORD();
1130 }
1131<St_Ref>. { // any other character
1132 unput(*yytext);
1133 return Token::make_TK_NONE();
1134 }
1135<St_IntRef>[A-Z_a-z0-9.:/#\-\+\(\)]+ {
1136 yyextra->token.name = yytext;
1137 return Token::make_TK_WORD();
1138 }
1139<St_IntRef>{BLANK}+"\"" {
1140 BEGIN(St_Ref2);
1141 }
1142<St_SetScope>({SCOPEMASK}|{ANONNS}){BLANK}|{FILEMASK} {
1143 yyextra->token.name = yytext;
1144 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1145 return Token::make_TK_WORD();
1146 }
1147<St_SetScope>{SCOPEMASK}"<" {
1148 yyextra->token.name = yytext;
1149 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1150 yyextra->sharpCount=1;
1151 BEGIN(St_SetScopeEnd);
1152 }
1153<St_SetScope>{BLANK} {
1154 }
1155<St_SetScopeEnd>"<" {
1156 yyextra->token.name += yytext;
1157 yyextra->sharpCount++;
1158 }
1159<St_SetScopeEnd>">" {
1160 yyextra->token.name += yytext;
1161 yyextra->sharpCount--;
1162 if (yyextra->sharpCount<=0)
1163 {
1164 return Token::make_TK_WORD();
1165 }
1166 }
1167<St_SetScopeEnd>. {
1168 yyextra->token.name += yytext;
1169 }
1170<St_Ref2>"&"{ID}";" { /* symbol */
1171 yyextra->token.name = yytext;
1172 return Token::make_TK_SYMBOL();
1173 }
1174<St_Ref2>"\""|\n|"\\ilinebr" { /* " or \n => end of title */
1176 return Token::make_TK_NONE();
1177 }
1178<St_Ref2>{HTMLTAG_STRICT} { /* html tag */
1181 return Token::make_TK_HTMLTAG();
1182 }
1183<St_Ref2>{SPCMD1} |
1184<St_Ref2>{SPCMD2} { /* special command */
1185 yyextra->token.name = yytext+1;
1188 }
1189<St_Ref2>{WORD1NQ} |
1190<St_Ref2>{WORD2NQ} {
1191
1192 yyextra->token.name = yytext;
1193 return Token::make_TK_WORD();
1194 }
1195<St_Ref2>[ \t]+ {
1196 yyextra->token.chars=yytext;
1197 return Token::make_TK_WHITESPACE();
1198 }
1199<St_XRefItem>{LABELID} {
1200 yyextra->token.name=yytext;
1201 }
1202<St_XRefItem>" " {
1203 BEGIN(St_XRefItem2);
1204 }
1205<St_XRefItem2>[0-9]+"." {
1207 numStr=numStr.left((int)yyleng-1);
1208 yyextra->token.id=numStr.toInt();
1209 return Token::make_RetVal_OK();
1210 }
1211<St_Para,St_Title,St_Ref2>"<!--" { /* html style comment block */
1212 yyextra->commentState = YY_START;
1213 BEGIN(St_Comment);
1214 }
1215<St_Param>"\""[^\n\"]+"\"" {
1216 yyextra->token.name = yytext+1;
1217 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1218 return Token::make_TK_WORD();
1219 }
1220<St_Param>({PHPTYPE}{BLANK}*("["{BLANK}*"]")*{BLANK}*"|"{BLANK}*)*{PHPTYPE}{BLANK}*("["{BLANK}*"]")*{WS}+("&")?"$"{LABELID} {
1223 int j = params.find('&');
1224 int i = params.find('$');
1225 if (i<0) i=0;
1226 if (j<i && j>=0) i=j;
1228 yyextra->token.name = types+
"#"+params.
mid(i);
1229 return Token::make_TK_WORD();
1230 }
QCString left(size_t len) const
1231<St_Param>[^ \t\n,@\\]+ {
1232 yyextra->token.name = yytext;
1233 if (yyextra->token.name.at(static_cast<uint32_t>(yyleng)-1)==':')
1234 {
1235 yyextra->token.name=yyextra->token.name.left(static_cast<uint32_t>(yyleng)-1);
1236 }
1237 return Token::make_TK_WORD();
1238 }
1239<St_Param>{WS}*","{WS}* /* param separator */
1240<St_Param>{WS} {
1242 yyextra->token.chars=yytext;
1243 return Token::make_TK_WHITESPACE();
1244 }
1245<St_Prefix>"\""[^\n\"]*"\"" {
1246 yyextra->token.name = yytext+1;
1247 yyextra->token.name = yyextra->token.name.left((int)yyleng-2);
1248 return Token::make_TK_WORD();
1249 }
1250<St_Prefix>. {
1251 unput(*yytext);
1252 return Token::make_TK_NONE();
1253 }
1254<St_Options>{ID} {
1255 yyextra->token.name+=yytext;
1256 }
1257<St_Options>{WS}*":"{WS}* {
1259 yyextra->token.name+=":";
1260 }
1261<St_Options>{WS}*","{WS}* |
1262<St_Options>{WS} { /* option separator */
1264 yyextra->token.name+=",";
1265 }
1266<St_Options>"}" {
1267 return Token::make_TK_WORD();
1268 }
1269<St_Block>{ID} {
1270 yyextra->token.name+=yytext;
1271 }
1272<St_Block>"]" {
1273 return Token::make_TK_WORD();
1274 }
1275<St_Emoji>[:0-9_a-z+-]+ {
1276 yyextra->token.name=yytext;
1277 return Token::make_TK_WORD();
1278 }
1279<St_Emoji>. {
1280 unput(*yytext);
1281 return Token::make_TK_NONE();
1282 }
1283<St_QuotedString>"\"" {
1284 yyextra->token.name="";
1285 BEGIN(St_QuotedContent);
1286 }
1287<St_QuotedString>(\n|"\\ilinebr") {
1289 return Token::make_TK_NONE();
1290 }
1291<St_QuotedString>. {
1292 unput(*yytext);
1293 return Token::make_TK_NONE();
1294 }
1295<St_QuotedContent>"\"" {
1296 return Token::make_TK_WORD();
1297 }
1298<St_QuotedContent>. {
1299 yyextra->token.name+=yytext;
1300 }
1301<St_ShowDate>{WS}+{SHOWDATE} {
1303 yyextra->token.name=yytext;
1304 return Token::make_TK_WORD();
1305 }
1306<St_ShowDate>(\n|"\\ilinebr") {
1308 return Token::make_TK_NONE();
1309 }
1310<St_ShowDate>. {
1311 unput(*yytext);
1312 return Token::make_TK_NONE();
1313 }
1314<St_ILine>{LINENR}/[\\@\n\.] |
1315<St_ILine>{LINENR}{BLANK} {
1316 bool ok = false;
1318 if (!ok)
1319 {
1320 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1321 }
1322 else
1323 {
1324 yyextra->yyLineNr = nr;
1325 }
1326 return Token::make_TK_WORD();
1327 }
1328<St_ILine>. {
1329 return Token::make_TK_NONE();
1330 }
1331<St_IFile>{BLANK}*{FILEMASK} {
1333 return Token::make_TK_WORD();
1334 }
1335<St_IFile>{BLANK}*"\""[^\n\"]+"\"" {
1337 text = text.stripWhiteSpace();
1338 yyextra->fileName = text.mid(1,text.length()-2);
1339 return Token::make_TK_WORD();
1340 }
1341<St_File>{FILEMASK} {
1342 yyextra->token.name = yytext;
1343 return Token::make_TK_WORD();
1344 }
1345<St_File>"\""[^\n\"]+"\"" {
1347 yyextra->token.name = text.mid(1,text.length()-2);
1348 return Token::make_TK_WORD();
1349 }
1350<St_Pattern>[^\\\r\n]+ {
1351 yyextra->token.name += yytext;
1352 }
1353<St_Pattern>"\\ilinebr" {
1354 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1355 return Token::make_TK_WORD();
1356 }
1357<St_Pattern>\n {
1359 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1360 return Token::make_TK_WORD();
1361 }
1362<St_Pattern>. {
1363 yyextra->token.name += yytext;
1364 }
1365<St_Link>{LINKMASK}|{REFWORD} {
1366 yyextra->token.name = yytext;
1367 return Token::make_TK_WORD();
1368 }
1369<St_Comment>"-->" { /* end of html comment */
1370 BEGIN(yyextra->commentState);
1371 }
1372<St_Comment>[^-]+ /* inside html comment */
1373<St_Comment>. /* inside html comment */
1374
1375
1376
1377<St_SkipTitle>.
1378<St_SkipTitle>(\n|"\\ilinebr") {
1379 if (*yytext == '\n') unput('\n');
1380 return Token::make_TK_NONE();
1381 }
1382
1383
1384
1385<St_Sections>[^\n@\<]+
1386<St_Sections>{CMD}("<"|{CMD})
1387<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" {
1390 int s=tag.find("id=");
1391 if (s!=-1)
1392 {
1393 char c=tag[s+3];
1394 if (c=='\'' || c=='"')
1395 {
1396 int e=tag.find(c,s+4);
1397 if (e!=-1)
1398 {
1400 yyextra->secLabel=tag.mid(s+4,e-s-4);
1402 }
1403 }
1404 }
1405 }
static constexpr int Table
static void processSection(yyscan_t yyscanner)
1406<St_Sections>{CMD}"anchor"{BLANK}+ {
1408 BEGIN(St_SecLabel1);
1409 }
static constexpr int Anchor
1410<St_Sections>{CMD}"ianchor"{BLANK}+ {
1412 BEGIN(St_SecLabel1);
1413 }
1414<St_Sections>{CMD}"section"{BLANK}+ {
1416 BEGIN(St_SecLabel2);
1417 }
static constexpr int Section
1418<St_Sections>{CMD}"subsection"{BLANK}+ {
1420 BEGIN(St_SecLabel2);
1421 }
static constexpr int Subsection
1422<St_Sections>{CMD}"subsubsection"{BLANK}+ {
1424 BEGIN(St_SecLabel2);
1425 }
static constexpr int Subsubsection
1426<St_Sections>{CMD}"paragraph"{BLANK}+ {
1428 BEGIN(St_SecLabel2);
1429 }
static constexpr int Paragraph
1430<St_Sections>{CMD}"subparagraph"{BLANK}+ {
1432 BEGIN(St_SecLabel2);
1433 }
static constexpr int Subparagraph
1434<St_Sections>{CMD}"subsubparagraph"{BLANK}+ {
1436 BEGIN(St_SecLabel2);
1437 }
static constexpr int Subsubparagraph
1438<St_Sections>{CMD}"verbatim"/[^a-z_A-Z0-9] {
1439 yyextra->endMarker="endverbatim";
1440 BEGIN(St_SecSkip);
1441 }
1442<St_Sections>{CMD}"iverbatim"/[^a-z_A-Z0-9] {
1443 yyextra->endMarker="endiverbatim";
1444 BEGIN(St_SecSkip);
1445 }
1446<St_Sections>{CMD}"iliteral"/[^a-z_A-Z0-9] {
1447 yyextra->endMarker="endiliteral";
1448 BEGIN(St_SecSkip);
1449 }
1450<St_Sections>{CMD}"dot"/[^a-z_A-Z0-9] {
1451 yyextra->endMarker="enddot";
1452 BEGIN(St_SecSkip);
1453 }
1454<St_Sections>{CMD}"msc"/[^a-z_A-Z0-9] {
1455 yyextra->endMarker="endmsc";
1456 BEGIN(St_SecSkip);
1457 }
1458<St_Sections>{CMD}"startuml"/[^a-z_A-Z0-9] {
1459 yyextra->endMarker="enduml";
1460 BEGIN(St_SecSkip);
1461 }
1462<St_Sections>{CMD}"htmlonly"/[^a-z_A-Z0-9] {
1463 yyextra->endMarker="endhtmlonly";
1464 BEGIN(St_SecSkip);
1465 }
1466<St_Sections>{CMD}"latexonly"/[^a-z_A-Z0-9] {
1467 yyextra->endMarker="endlatexonly";
1468 BEGIN(St_SecSkip);
1469 }
1470<St_Sections>{CMD}"manonly"/[^a-z_A-Z0-9] {
1471 yyextra->endMarker="endmanonly";
1472 BEGIN(St_SecSkip);
1473 }
1474<St_Sections>{CMD}"rtfonly"/[^a-z_A-Z0-9] {
1475 yyextra->endMarker="endrtfonly";
1476 BEGIN(St_SecSkip);
1477 }
1478<St_Sections>{CMD}"xmlonly"/[^a-z_A-Z0-9] {
1479 yyextra->endMarker="endxmlonly";
1480 BEGIN(St_SecSkip);
1481 }
1482<St_Sections>{CMD}"docbookonly"/[^a-z_A-Z0-9] {
1483 yyextra->endMarker="enddocbookonly";
1484 BEGIN(St_SecSkip);
1485 }
1486<St_Sections>{CMD}"code"/[^a-z_A-Z0-9] {
1487 yyextra->endMarker="endcode";
1488 BEGIN(St_SecSkip);
1489 }
1490<St_Sections>{CMD}"icode"/[^a-z_A-Z0-9] {
1491 yyextra->endMarker="endicode";
1492 BEGIN(St_SecSkip);
1493 }
1494<St_Sections>"<!--" {
1495 yyextra->endMarker="-->";
1496 BEGIN(St_SecSkip);
1497 }
1498<St_SecSkip>{CMD}{ID} {
1499 if (yyextra->endMarker==yytext+1)
1500 {
1501 BEGIN(St_Sections);
1502 }
1503 }
1504<St_SecSkip>"-->" {
1505 if (yyextra->endMarker==yytext)
1506 {
1507 BEGIN(St_Sections);
1508 }
1509 }
1510<St_SecSkip>[^a-z_A-Z0-9\-\\\@]+
1511<St_SecSkip>.
1512<St_SecSkip>(\n|"\\ilinebr")
1513<St_Sections>.
1514<St_Sections>(\n|"\\ilinebr")
1515<St_SecLabel1>{LABELID} {
1517 yyextra->secLabel = yytext;
1519 BEGIN(St_Sections);
1520 }
1521<St_SecLabel2>{LABELID}{BLANK}+ |
1522<St_SecLabel2>{LABELID} {
1523 yyextra->secLabel = yytext;
1524 yyextra->secLabel = yyextra->secLabel.stripWhiteSpace();
1525 BEGIN(St_SecTitle);
1526 }
1527<St_SecTitle>[^\n]+ |
1528<St_SecTitle>[^\n]*\n {
1530 yyextra->secTitle = yytext;
1531 yyextra->secTitle = yyextra->secTitle.stripWhiteSpace();
1532 if (yyextra->secTitle.endsWith("\\ilinebr"))
1533 {
1534 yyextra->secTitle.left(yyextra->secTitle.length()-8);
1535 }
1537 BEGIN(St_Sections);
1538 }
1539<St_SecTitle,St_SecLabel1,St_SecLabel2>. {
1540 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected character '{}' while looking for section label or title",yytext);
1541 }
1542
1543<St_Snippet>[^\\\n]+ {
1544 yyextra->token.name += yytext;
1545 }
1546<St_Snippet>"\\" {
1547 yyextra->token.name += yytext;
1548 }
1549<St_Snippet>(\n|"\\ilinebr") {
1551 yyextra->token.name = yyextra->token.name.stripWhiteSpace();
1552 return Token::make_TK_WORD();
1553 }
1554
1555
1556<*>\n {
1558 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected new line character");
1559 }
1560<*>"\\ilinebr" {
1561 }
1562<*>[\\@<>&$#%~"=] { /* unescaped special character */
1563
1564 yyextra->token.name = yytext;
1566 }
1567<*>. {
1568 warn(yyextra->fileName,yyextra->yyLineNr,
"Unexpected character '{}'",yytext);
1569 }
1570%%