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