254 {NUMBER} {
255 if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
257 }
258<Scan>[^"'!\/\n\\#,\-=; \t@$]* { /* eat anything that is not " / , or \n */
260 }
261<Scan>[,= ;\t] { /* eat , so we have a nice separator in long initialization lines */
263 }
264<Scan>"'''"! |
265<Scan>"\"\"\""! { /* start of python long comment */
266 if (yyextra->lang!=SrcLangExt::Python)
267 {
268 REJECT;
269 }
270 else
271 {
272 yyextra->pythonDocString =
TRUE;
273 yyextra->pythonDocStringChar = yytext[0];
274 yyextra->nestingCount=1;
277 BEGIN(CComment);
278 yyextra->commentStack.push(yyextra->lineNr);
279 }
280 }
281<Scan>"'''" |
282<Scan>"\"\"\"" { /* start of python long comment */
283 if (yyextra->lang!=SrcLangExt::Python)
284 {
285 REJECT;
286 }
288 {
289 REJECT;
290 }
291 else
292 {
293 yyextra->pythonDocString =
TRUE;
294 yyextra->pythonDocStringChar = yytext[0];
295 yyextra->nestingCount=1;
298 BEGIN(CComment);
299 yyextra->commentStack.push(yyextra->lineNr);
300 }
301 }
302<Scan>{B}*![><!]/.*\n {
303 if (yyextra->lang!=SrcLangExt::Fortran)
304 {
305 REJECT;
306 }
307 else
308 {
309 yyextra->nestingCount=0;
311 yyextra->specialComment=true;
313 yyextra->blockHeadCol=yyextra->col-2;
314 BEGIN(CComment);
315 yyextra->commentStack.push(yyextra->lineNr);
316 }
317 }
318<Scan>[Cc\*][><!]/.*\n {
319 if (yyextra->lang!=SrcLangExt::Fortran)
320 {
321 REJECT;
322 }
323 else
324 {
325
326 if (yyextra->isFixedForm && (yyextra->col == 0))
327 {
328 yyextra->nestingCount=0;
330 yyextra->specialComment=true;
332 yyextra->blockHeadCol=yyextra->col-1;
333 BEGIN(CComment);
334 yyextra->commentStack.push(yyextra->lineNr);
335 }
336 else
337 {
338 REJECT;
339 }
340 }
341 }
342<Scan>!.*\n {
343 if (yyextra->lang!=SrcLangExt::Fortran)
344 {
345 REJECT;
346 }
347 else
348 {
350 }
351 }
352<Scan>[Cc\*].*\n {
353 if (yyextra->lang!=SrcLangExt::Fortran)
354 {
355 REJECT;
356 }
357 else
358 {
359 if (yyextra->col == 0)
360 {
362 }
363 else
364 {
365 REJECT;
366 }
367 }
368 }
369<Scan>[$]?"@\"" { /* start of an interpolated verbatim C# string */
370 if (yyextra->lang!=SrcLangExt::CSharp) REJECT
372 yyextra->stringContext = YY_START;
373 BEGIN(SkipVerbString);
374 }
375<Scan>"\"" { /* start of a string */
377 yyextra->stringContext = YY_START;
378 BEGIN(SkipString);
379 }
380<Scan>' {
382 yyextra->charContext = YY_START;
383 if (yyextra->lang!=SrcLangExt::VHDL)
384 {
385 BEGIN(SkipChar);
386 }
387 }
388<Scan>\n { /* new line */
390 }
391<Scan>{CPPC}[!/]/.*\n[ \t]*{CPPC}[!/][ \t]*{CMD}"}" { // see bug #8731, don't treat multiline C++ comment as detailed description
392
393 yyextra->inSpecialComment=true;
394 yyextra->blockHeadCol=yyextra->col+1;
395 yyextra->insertCppCommentMarker=true;
397 yyextra->readLineCtx=YY_START;
398 BEGIN(ReadLine);
399 }
400<Scan>{CPPC}"!"/.*\n[ \t]*{CPPC}[\/!][^\/] | /* start C++ style special comment block */
401<Scan>({CPPC}"/"[/]*)/[^/].*\n[ \t]*{CPPC}[\/!][^\/] { /* start C++ style special comment block */
402 if (yyextra->mlBrief)
403 {
404 REJECT;
405 }
406 else
407 {
408 int i=3;
409 if (yytext[2]=='/')
410 {
411 while (i<(int)yyleng && yytext[i]=='/') i++;
412 }
413 yyextra->blockHeadCol=yyextra->col+1;
414 if (yytext[2] == '!')
415 {
417 }
418 else
419 {
421 }
423 yyextra->inSpecialComment=
TRUE;
424
425 yyextra->readLineCtx=SComment;
426 BEGIN(ReadLine);
427 }
428 }
429<Scan>{CPPC}"##Documentation"{ANYopt}/\n { /* Start of Rational Rose ANSI C++ comment block */
430 if (yyextra->mlBrief) REJECT;
431 int i=17;
432 yyextra->blockHeadCol=yyextra->col+1;
435 yyextra->inRoseComment=
TRUE;
436 BEGIN(SComment);
437 }
438<Scan>{CPPC}[!\/]/.*\n[ \t]*{CPPC}[|\/][ \t]*{CMD}"}" { // next line contains an end marker, see bug 752712
439 yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
440 if (yyextra->inSpecialComment)
441 {
442 yyextra->blockHeadCol=yyextra->col+1;
443 }
445 yyextra->readLineCtx=YY_START;
446 BEGIN(ReadLine);
447 }
448<Scan>{CPPC}[!/]/.*\n { /* one line special C++ comment */
449 yyextra->inSpecialComment=true;
450 yyextra->blockHeadCol=yyextra->col+1;
451 yyextra->insertCppCommentMarker=true;
453 yyextra->readLineCtx=YY_START;
454 BEGIN(ReadLine);
455 }
456<Scan>{CPPC}/.*\n { /* one line normal C++ comment */
457 yyextra->inSpecialComment=false;
459 yyextra->readLineCtx=YY_START;
460 BEGIN(CopyLine);
461 }
462<Scan>{CCS}{CCE} { /* avoid matching next rule for empty C comment, see bug 711723 */
464 }
465<Scan>{CCS}[*!]? { /* start of a C comment */
466 if (yyextra->lang==SrcLangExt::Python)
467 {
468 REJECT;
469 }
470 yyextra->specialComment=(int)yyleng==3;
471 yyextra->nestingCount=1;
474 if (yyextra->specialComment)
475 {
476 yyextra->blockHeadCol=0;
477 BEGIN(CComment);
478 }
479 else
480 {
481 BEGIN(CNComment);
482 }
483 yyextra->commentStack.push(yyextra->lineNr);
484 }
485<Scan>"#"[^\n]*\n {
486 if (yyextra->lang!=SrcLangExt::PHP)
487 {
488 REJECT;
489 }
491 }
492<Scan>"#"("#")? {
493 if (yyextra->lang!=SrcLangExt::Python)
494 {
495 REJECT;
496 }
497 else
498 {
499 yyextra->nestingCount=0;
501 yyextra->specialComment=(int)yyleng==2;
502 if (yyextra->specialComment)
503 {
504 yyextra->blockHeadCol=yyextra->col;
505 }
506 yyextra->commentStack.push(yyextra->lineNr);
508 BEGIN(CComment);
509 }
510 }
511<Scan>"--"[^!][^\n]* {
512 if (yyextra->lang!=SrcLangExt::VHDL)
513 {
514 REJECT;
515 }
516 else
517 {
519 }
520 }
521<Scan>"--!" {
522 if (yyextra->lang!=SrcLangExt::VHDL)
523 {
524 REJECT;
525 }
526 else
527 {
528 yyextra->specialComment=true;
529 yyextra->blockHeadCol=yyextra->col;
530 yyextra->vhdl =
TRUE;
531 yyextra->nestingCount=0;
533 yyextra->commentStack.push(yyextra->lineNr);
535 BEGIN(CComment);
536 }
537 }
538<Scan>{B}*![><!] {
539 if (yyextra->lang!=SrcLangExt::Fortran)
540 {
541 REJECT;
542 }
543 else
544 {
545 yyextra->nestingCount=0;
547 yyextra->specialComment=true;
548 yyextra->blockHeadCol=yyextra->col;
549 yyextra->commentStack.push(yyextra->lineNr);
551 BEGIN(CComment);
552 }
553 }
554<CComment,CNComment,ReadLine,IncludeFile>{MAILADDR} |
555<CComment,CNComment,ReadLine,IncludeFile>"<"{MAILADDR}">" { // Mail address, to prevent seeing e.g x@code-factory.org as start of a code block
557 }
558<CComment,IncludeFile>"{"[ \t]*"@code"/[ \t\n] {
560 yyextra->lastCommentContext = YY_START;
561 yyextra->javaBlock=1;
562 yyextra->blockName=
QCString(
"end")+&yytext[1];
563 yyextra->inVerbatim=true;
564 BEGIN(VerbatimCode);
565 }
566<CComment,IncludeFile>"{"[ \t]*"@literal"/[ \t\n] {
568 yyextra->lastCommentContext = YY_START;
569 yyextra->javaBlock=1;
570 yyextra->blockName=
QCString(
"end")+&yytext[1];
571 yyextra->inVerbatim=true;
572 BEGIN(VerbatimCode);
573 }
574<CComment,ReadLine,IncludeFile>{CMD}"ilinebr"[ \t]+("```"[`]*|"~~~"[~]*) { /* start of markdown code block */
576 {
577 REJECT;
578 }
580 yyextra->lastCommentContext = YY_START;
581 yyextra->javaBlock=0;
583 yyextra->inVerbatim=true;
584 BEGIN(VerbatimCode);
585 }
QCString right(size_t len) const
586<CComment,ReadLine,IncludeFile>^[ \t]*("```"[`]*|"~~~"[~]*) { /* start of markdown code block */
588 {
589 REJECT;
590 }
592 yyextra->lastCommentContext = YY_START;
593 yyextra->javaBlock=0;
595 yyextra->inVerbatim=true;
596 BEGIN(VerbatimCode);
597 }
QCString left(size_t len) const
598<CComment,ReadLine,IncludeFile>{CMD}("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */
600 yyextra->lastCommentContext = YY_START;
601 yyextra->javaBlock=0;
602 if (
qstrcmp(&yytext[1],
"startuml")==0)
603 {
604 yyextra->blockName="enduml";
605 }
606 else
607 {
608 yyextra->blockName=
QCString(
"end")+&yytext[1];
609 }
610 yyextra->inVerbatim=true;
611 BEGIN(VerbatimCode);
612 }
int qstrcmp(const char *str1, const char *str2)
613<CComment,ReadLine,IncludeFile>{CMD}("f$"|"f["|"f{"|"f(") {
615 yyextra->blockName=&yytext[1];
616 if (yyextra->blockName.at(1)=='[')
617 {
618 yyextra->blockName.at(1)=']';
619 }
620 else if (yyextra->blockName.at(1)=='{')
621 {
622 yyextra->blockName.at(1)='}';
623 }
624 else if (yyextra->blockName.at(1)=='(')
625 {
626 yyextra->blockName.at(1)=')';
627 }
628 yyextra->lastCommentContext = YY_START;
629 yyextra->inVerbatim=true;
630 BEGIN(Verbatim);
631 }
632<CComment,ReadLine,IncludeFile>"<!--!" { /* HTML comment doxygen command*/
633 if (yyextra->inVerbatim) REJECT;
634
635 yyextra->inHtmlDoxygenCommand=true;
636 }
637<CComment,ReadLine,IncludeFile>"-->" { /* potential end HTML comment doxygen command*/
638 if (yyextra->inHtmlDoxygenCommand)
639 {
640 yyextra->inHtmlDoxygenCommand=false;
641 }
642 else
643 {
645 }
646 }
647<CComment,ReadLine,IncludeFile>"<!--" { /* HTML comment */
649 yyextra->blockName="-->";
650 yyextra->lastCommentContext = YY_START;
651 yyextra->inVerbatim=true;
652 BEGIN(Verbatim);
653 }
654<CComment,ReadLine,IncludeFile>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly")/[^a-z_A-Z0-9] { /* start of a verbatim block */
656 yyextra->blockName=
QCString(
"end")+&yytext[1];
657 yyextra->lastCommentContext = YY_START;
658 yyextra->inVerbatim=true;
659 BEGIN(Verbatim);
660 }
661<Scan>"\\\"" { /* escaped double quote */
663 }
664<Scan>"\\\\" { /* escaped backslash */
666 }
667<Scan>. { /* any other character */
669 }
670<Verbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
672 if (&yytext[1]==yyextra->blockName)
673 {
674 yyextra->inVerbatim=false;
675 BEGIN(yyextra->lastCommentContext);
676 }
677 }
678<Verbatim>"-->" {
680 if (yytext==yyextra->blockName)
681 {
682 yyextra->inVerbatim=false;
683 BEGIN(yyextra->lastCommentContext);
684 }
685 }
686<VerbatimCode>"{" {
687 if (yyextra->javaBlock==0)
688 {
689 REJECT;
690 }
691 else
692 {
693 yyextra->javaBlock++;
695 }
696 }
697<VerbatimCode>"}" {
698 if (yyextra->javaBlock==0)
699 {
700 REJECT;
701 }
702 else
703 {
704 yyextra->javaBlock--;
705 if (yyextra->javaBlock==0)
706 {
708 yyextra->inVerbatim=false;
709 BEGIN(yyextra->lastCommentContext);
710 }
711 else
712 {
714 }
715 }
716 }
717<VerbatimCode>("```"[`]*|"~~~"[~]*) { /* end of markdown code block */
719 if (yytext[0]==yyextra->blockName[0])
720 {
721 yyextra->inVerbatim=false;
722 BEGIN(yyextra->lastCommentContext);
723 }
724 }
725<VerbatimCode>{CMD}("enddot"|"endcode"|"endmsc"|"enduml")/("{")? { /* end of verbatim block */
727 if (&yytext[1]==yyextra->blockName)
728 {
729 yyextra->inVerbatim=false;
730 BEGIN(yyextra->lastCommentContext);
731 }
732 }
733<VerbatimCode>^[ \t]*{CPPC}[\!\/]? { /* skip leading comments */
734 if (!yyextra->inSpecialComment || yyextra->mlBrief)
735 {
737 }
738 else
739 {
740 int l=0;
741 while (yytext[l]==' ' || yytext[l]=='\t')
742 {
743 l++;
744 }
746 if (yyleng-l==3)
747 {
749 }
750 else
751 {
753 }
754 }
755 }
756<Verbatim,VerbatimCode>[^`~@\/\-\\\n{}]* { /* any character not a backslash or new line or } */
758 }
759<Verbatim,VerbatimCode>\n { /* new line in verbatim block */
761 if (yyextra->lastCommentContext == IncludeFile)
762 {
764 }
765 }
766<Verbatim>^[ \t]*{CPPC}[/!] {
767 if (yyextra->blockName=="enddot" || yyextra->blockName=="endmsc" || yyextra->blockName=="enduml" || yyextra->blockName.at(0)=='f')
768 {
769
770 int l=0;
771 while (yytext[l]==' ' || yytext[l]=='\t')
772 {
773 l++;
774 }
777 }
778 else
779 {
780 REJECT;
781 }
782 }
783<Verbatim,VerbatimCode>. { /* any other character */
785 }
786<SkipString>\\. { /* escaped character in string */
787 if (yyextra->lang==SrcLangExt::Fortran || yyextra->lang==SrcLangExt::VHDL)
788 {
789 unput(yytext[1]);
791 }
792 else
793 {
795 }
796 }
797<SkipString>"\"" { /* end of string */
799 BEGIN(yyextra->stringContext);
800 }
801<SkipString>. { /* any other string character */
803 }
804<SkipString>\n { /* new line inside string (illegal for some compilers) */
806 }
807<SkipVerbString>[^"\n]+ {
809 }
810<SkipVerbString>\"\" { // escaped quote
812 }
813<SkipVerbString>"\"" { /* end of string */
815 BEGIN(yyextra->stringContext);
816 }
817<SkipVerbString>. {
819 }
820<SkipVerbString>\n {
822 }
823<SkipChar>\\. { /* escaped character */
824 if (yyextra->lang==SrcLangExt::Fortran || yyextra->lang==SrcLangExt::VHDL)
825 {
826 unput(yytext[1]);
828 }
829 else
830 {
832 }
833 }
834<SkipChar>' { /* end of character literal */
836 BEGIN(yyextra->charContext);
837 }
838<SkipChar>. { /* any other string character */
840 }
841<SkipChar>\n { /* new line character */
843 }
844
845<CComment,CNComment>[^ `~<\\!@*\n{\"'\/-]* { /* anything that is not a '*' or command */
847 }
848<CComment,CNComment>^{B}*"*"+[^*\/<\\@\n{\"]* { /* stars without slashes */
849 if (yyextra->lang==SrcLangExt::Markdown) REJECT;
851 if (yyextra->col>yyextra->blockHeadCol)
852 {
853
854 yyextra->blockHeadCol=yyextra->col;
855 }
857 }
858<CComment>"'''" |
859<CComment>"\"\"\"" { /* end of Python docstring */
860 if (yyextra->lang!=SrcLangExt::Python)
861 {
862 REJECT;
863 }
864 else if (yyextra->pythonDocStringChar != yytext[0])
865 {
867 }
868 else
869 {
870 yyextra->nestingCount--;
871 yyextra->pythonDocString =
FALSE;
872 yyextra->pythonDocStringChar = '\0';
874 BEGIN(Scan);
875 }
876 }
877<CComment,CNComment>\n { /* new line in comment */
879
880 if (yyextra->lang==SrcLangExt::Fortran)
881 {
882 BEGIN(Scan);
883 }
884 }
885<CComment,CNComment>"/""/"+/"*/" { /* we are already in C-comment so not a start of a nested comment but
886 * just the
end of the
comment (the
end part is handled later). */
888 }
DirIterator end(const DirIterator &) noexcept
889<CComment,CNComment>"/"+"*" { /* nested C comment */
890 if (yyextra->lang==SrcLangExt::Python ||
891 yyextra->lang==SrcLangExt::Markdown)
892 {
893 REJECT;
894 }
895 yyextra->nestingCount++;
896 yyextra->commentStack.push(yyextra->lineNr);
898 }
899<CComment,CNComment>^{B}*"*"+"/" |
900<CComment,CNComment>"*"+"/" { /* end of C comment */
901 if (yyextra->lang==SrcLangExt::Python ||
902 yyextra->lang==SrcLangExt::Markdown)
903 {
904 REJECT;
905 }
906 else
907 {
909 yyextra->nestingCount--;
910 if (yyextra->nestingCount<=0)
911 {
912 BEGIN(Scan);
913 }
914 else
915 {
916
917 yyextra->commentStack.pop();
918 }
919 }
920 }
921
922<CComment,CNComment>"\n"/[ \t]*"#" {
923 if (yyextra->lang!=SrcLangExt::VHDL)
924 {
925 REJECT;
926 }
927 else
928 {
929 if (yyextra->vhdl)
930 {
931 yyextra->vhdl =
FALSE;
933 BEGIN(Scan);
934 }
935 else
936 {
937 REJECT;
938 }
939 }
940 }
941<CComment,CNComment>"\n"/[ \t]*"-" {
942 if (yyextra->lang!=SrcLangExt::Python || yyextra->pythonDocString)
943 {
944 REJECT;
945 }
946 else
947 {
949 BEGIN(Scan);
950 }
951 }
952<CComment,CNComment>"\n"/[ \t]*[^ \t#\-] {
953 if (yyextra->lang==SrcLangExt::Python)
954 {
955 if (yyextra->pythonDocString)
956 {
957 REJECT;
958 }
959 else
960 {
962 BEGIN(Scan);
963 }
964 }
965 else if (yyextra->lang==SrcLangExt::VHDL)
966 {
967 if (yyextra->vhdl)
968 {
969 yyextra->vhdl =
FALSE;
971 BEGIN(Scan);
972 }
973 else
974 {
975 REJECT;
976 }
977 }
978 else
979 {
980 REJECT;
981 }
982 }
983
984<CComment,CNComment>"'" {
985 yyextra->charContext = YY_START;
987 BEGIN(SkipChar);
988 }
989<CComment,CNComment>"\"" {
990 yyextra->stringContext = YY_START;
992 BEGIN(SkipString);
993 }
994 */
995<CComment,CNComment>{CMD}"~"[a-z_A-Z-]* { // language switch command
996 if (yyextra->lang!=SrcLangExt::Markdown) REJECT;
1000 {
1002 {
1003 warn(yyextra->fileName,yyextra->lineNr,
1005 }
1006 BEGIN(SkipLang);
1007 }
1008 }
#define Config_getEnumAsString(name)
#define Config_isAvailableEnum(name, value)
int qstricmp(const char *s1, const char *s2)
1009<CComment,CNComment>{CMD}{CMD} |
1010<CComment,CNComment>. {
1012 }
1013<SkipLang>{CMD}"~"[a-zA-Z-]* { /* language switch */
1016 {
1017 warn(yyextra->fileName,yyextra->lineNr,
1019 }
1022 {
1023 BEGIN(CComment);
1024 }
1025 }
1026<SkipLang>[^*@\\\n]* { /* any character not a *, @, backslash or new line */
1027 }
1028<SkipLang>\n { /* new line in language block, needed for keeping track of line numbers */
1030 }
1031<SkipLang>. { /* any other character */
1032 }
1033<SComment>^[ \t]*{CPPC}"/"{SLASHopt}/\n {
1035 }
1036<SComment>\n[ \t]*{CPPC}"/"{SLASHopt}/\n {
1038 }
1039<SComment>^[ \t]*{CPPC}"/"[^\/\n]/.*\n {
1041 yyextra->readLineCtx=YY_START;
1042 BEGIN(ReadLine);
1043 }
1044<SComment>\n[ \t]*{CPPC}[\/!]("<")?[ \t]*{CMD}"}".*\n {
1045
1048 yyextra->inSpecialComment=false;
1049 yyextra->inRoseComment=false;
1050 BEGIN(Scan);
1051 }
1052<SComment>\n[ \t]*{CPPC}"/"[^\\@\/\n]/.*\n {
1054 yyextra->readLineCtx=YY_START;
1055 BEGIN(ReadLine);
1056 }
1057<SComment>^[ \t]*{CPPC}"!" | // just //!
1058<SComment>^[ \t]*{CPPC}"!<"/.*\n | // or //!< something
1059<SComment>^[ \t]*{CPPC}"!"[^<]/.*\n { // or //!something
1061 yyextra->readLineCtx=YY_START;
1062 BEGIN(ReadLine);
1063 }
1064<SComment>\n[ \t]*{CPPC}"!" |
1065<SComment>\n[ \t]*{CPPC}"!<"/.*\n |
1066<SComment>\n[ \t]*{CPPC}"!"[^<\n]/.*\n {
1068 yyextra->readLineCtx=YY_START;
1069 BEGIN(ReadLine);
1070 }
1071<SComment>^[ \t]*{CPPC}"##"/.*\n {
1072 if (!yyextra->inRoseComment)
1073 {
1074 REJECT;
1075 }
1076 else
1077 {
1079 yyextra->readLineCtx=YY_START;
1080 BEGIN(ReadLine);
1081 }
1082 }
1083<SComment>\n[ \t]*{CPPC}"##"/.*\n {
1084 if (!yyextra->inRoseComment)
1085 {
1086 REJECT;
1087 }
1088 else
1089 {
1091 yyextra->readLineCtx=YY_START;
1092 BEGIN(ReadLine);
1093 }
1094 }
1095<SComment>\n { /* end of special comment */
1098 yyextra->inSpecialComment=
FALSE;
1099 yyextra->inRoseComment=
FALSE;
1100 yyextra->insertCppCommentMarker=false;
1101 yyextra->readLineCtx = Scan;
1102
1103 BEGIN(Scan);
1104 }
1105<ReadLine>{CCS}"*" {
1107 }
1108<ReadLine>{CCE} {
1110 }
1111<ReadLine,CopyLine>"*" {
1113 }
1114<ReadLine,CopyLine>{RL} {
1116 }
1117<ReadLine,CopyLine>{RL}/{B}{CMD}"ilinebr"{B} {
1119 }
1120<ReadLine,CopyLine>{RLopt}/\n {
1122 yyextra->insertCppCommentMarker=false;
1123 BEGIN(yyextra->readLineCtx);
1124 }
1125<CComment,CNComment,ReadLine>"\<" { /* escaped html comment */
1127 }
1128<CComment,CNComment,ReadLine>{CMD}{CMD}[~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command
1130 }
1131
1132<CComment,ReadLine,IncludeFile>{CMD}("include"{OPTS}|"includedoc"{OPTS}*) {
1133 if (!
parseIncludeOptions(yyscanner,std::string_view{yytext,
static_cast<size_t>(yyleng)})) REJECT;
1134 yyextra->includeCtx = YY_START;
1135 yyextra->firstIncludeLine = true;
1136 yyextra->insertCommentCol = yyextra->col;
1137 if (!yyextra->insertCppCommentMarker && (yyextra->includeCtx==ReadLine || yyextra->includeCtx==IncludeFile))
1138 {
1139 yyextra->insertCppCommentMarker = yyextra->mlBrief;
1140 }
1141
1142 BEGIN(IncludeDoc);
1143 }
1144<CComment,ReadLine,IncludeFile>{CMD}("snippet"{OPTS}|"snippetdoc"{OPTS}*) {
1145 if (!
parseIncludeOptions(yyscanner,std::string_view{yytext,
static_cast<size_t>(yyleng)})) REJECT;
1146 yyextra->includeCtx = YY_START;
1147 yyextra->firstIncludeLine = true;
1148 yyextra->insertCommentCol = yyextra->col;
1149 if (!yyextra->insertCppCommentMarker && (yyextra->includeCtx==ReadLine || yyextra->includeCtx==IncludeFile))
1150 {
1151 yyextra->insertCppCommentMarker = yyextra->mlBrief;
1152 }
1153
1154 BEGIN(SnippetDoc);
1155 }
1156<IncludeDoc,SnippetDoc>{B}*
1157<IncludeDoc>{FILEMASK}|"\""[^\n\"]+"\"" {
1159 if (yytext[0]=='"')
1160 {
1161 fileName=fileName.
mid(1,fileName.
length()-2);
1162 }
1164 {
1165 BEGIN(IncludeFile);
1166 }
1167 else
1168 {
1169 BEGIN(yyextra->includeCtx);
1170 }
1171 }
1172<SnippetDoc>({FILEMASK}|"\""[^\n\"]+"\""){B}+ {
1173 yyextra->snippetFileName=yytext;
1174 yyextra->snippetFileName=yyextra->snippetFileName.stripWhiteSpace();
1175 if (yyextra->snippetFileName == "this") yyextra->snippetFileName=yyextra->fileName;
1176 yyextra->snippetName = "";
1177 BEGIN(SnippetDocTag);
1178 }
1179<SnippetDocTag>[^\\@\n]+ {
1180 yyextra->snippetName += yytext;
1181 }
1182<SnippetDocTag>{CMD} {
1183 yyextra->snippetName += yytext;
1184 }
1185<SnippetDocTag>(\n|{CMD}"ilinebr") {
1186 for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]);
1187 yyextra->snippetName = yyextra->snippetName.stripWhiteSpace();
1188 QCString blockId =
"["+yyextra->snippetName+
"]";
1190 {
1191 BEGIN(IncludeFile);
1192 }
1193 else
1194 {
1195 BEGIN(yyextra->includeCtx);
1196 }
1197 }
1198
1199<IncludeDoc,SnippetDoc>\n {
1202
1203
1204 BEGIN(yyextra->includeCtx);
1205 }
1206<IncludeDoc,SnippetDoc>. { // invalid character
1208 BEGIN(yyextra->includeCtx);
1209 }
1210<CComment,ReadLine,IncludeFile>{CMD}"cond"/[^a-z_A-Z0-9] { // conditional section
1211 yyextra->condCtx = YY_START;
1212 BEGIN(CondLine);
1213 }
1214<CComment,ReadLine,IncludeFile>{CMD}"endcond"/[^a-z_A-Z0-9] { // end of conditional section
1215 bool oldSkip=yyextra->skip;
1217 if (YY_START==CComment && oldSkip && !yyextra->skip)
1218 {
1219
1220 if (yyextra->lang!=SrcLangExt::Python &&
1221 yyextra->lang!=SrcLangExt::VHDL &&
1222 yyextra->lang!=SrcLangExt::Markdown &&
1223 yyextra->lang!=SrcLangExt::Fortran)
1224 {
1225 yyextra->outBuf+='/';
1226 yyextra->outBuf+='*';
1227 yyextra->col+=2;
1228 if (yyextra->specialComment)
1229 {
1230 yyextra->outBuf+='*';
1231 yyextra->col++;
1232 }
1233 }
1234 }
1235 }
1236<CondLine>[!()&| \ta-z_A-Z0-9.\-]+ {
1238 }
1239<CComment,ReadLine,IncludeFile>{CMD}"cond"{WSopt}/\n {
1240 yyextra->condCtx=YY_START;
1242 }
1243<CondLine>\n |
1244<CondLine>. { // forgot section id?
1247 }
1248<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{CMD}[a-z_A-Z][a-z_A-Z0-9-]* { // expand alias without arguments
1249 replaceAliases(yyscanner,yytext,YY_START==ReadLine && yyextra->readLineCtx==SComment);
1250 }
1251<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{B}?{CMD}"ilinebr"{B}{CMD}"ialias{" { // expand alias with arguments
1252 yyextra->lastBlockContext=YY_START;
1253 yyextra->blockCount=1;
1254 int extraSpace = (yytext[0]==' '? 1:0);
1255 yyextra->aliasString=yytext+9+extraSpace;
1256 yyextra->aliasCmd=yytext+9+extraSpace;
1257 yyextra->lastEscaped=0;
1258 BEGIN( ReadAliasArgs );
1259 }
1260<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{CMD}[a-z_A-Z][a-z_A-Z0-9-]*"{" { // expand alias with arguments
1261 yyextra->lastBlockContext=YY_START;
1262 yyextra->blockCount=1;
1263 yyextra->aliasString=yytext;
1264 yyextra->aliasCmd=yytext;
1265 yyextra->lastEscaped=0;
1266 BEGIN( ReadAliasArgs );
1267 }
1268<ReadAliasArgs>^[ \t]*"*" { // skip leading *
1269 }
1270<ReadAliasArgs>^[ \t]*{CPPC}[/!]/[^\n]* { // skip leading special comments (see bug 618079)
1271 }
1272<ReadAliasArgs>[^{}\n\\\*]+ {
1273 yyextra->aliasString+=yytext;
1274 yyextra->lastEscaped=
FALSE;
1275 }
1276<ReadAliasArgs>"\\" {
1277 if (yyextra->lastEscaped) yyextra->lastEscaped=
FALSE;
1278 else yyextra->lastEscaped=
TRUE;
1279 yyextra->aliasString+=yytext;
1280 }
1281<ReadAliasArgs>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}"|"f)") { /* end of verbatim block */
1282 yyextra->aliasString+=yytext;
1283 if (yyextra->inVerbatim && &yytext[1]==yyextra->blockName)
1284
1285
1286
1287
1288
1289
1290 {
1292 yyextra->inVerbatim=false;
1293 BEGIN(yyextra->lastCommentContext);
1294 }
1295 }
1296<ReadAliasArgs>\n {
1297 yyextra->aliasString+=yytext;
1298 yyextra->lastEscaped=
FALSE;
1299 if (yyextra->inVerbatim)
1300
1301 {
1303 BEGIN( yyextra->lastBlockContext );
1304 }
1305 }
1306<ReadAliasArgs>"{" {
1307 yyextra->aliasString+=yytext;
1308 if (!yyextra->lastEscaped) yyextra->blockCount++;
1309 yyextra->lastEscaped=
FALSE;
1310 }
1311<ReadAliasArgs>"}" {
1312 yyextra->aliasString+=yytext;
1313 if (!yyextra->lastEscaped) yyextra->blockCount--;
1314 if (yyextra->blockCount==0)
1315 {
1317 yyextra->lastBlockContext==ReadLine && yyextra->readLineCtx==SComment);
1318 BEGIN( yyextra->lastBlockContext );
1319 }
1320 yyextra->lastEscaped=
FALSE;
1321 }
1322<ReadAliasArgs>. {
1323 yyextra->aliasString+=yytext;
1324 yyextra->lastEscaped=
FALSE;
1325 }
1326<CopyLine>. {
1328 }
1329<CopyLine>\n {
1331 yyextra->insertCppCommentMarker=false;
1332 BEGIN(yyextra->readLineCtx);
1333 }
1334<ReadLine>``` {
1336 }
1337<ReadLine>`[^`]+` {
1339 }
1340<ReadLine>{CMD}{CMD} |
1341<ReadLine>. {
1343 }
1344<IncludeFile>. {
1346 }
1347<IncludeFile>\n {
1350 }
1351<*>. {
1353 }
1354<<EOF>> {
1355 if (YY_START == ReadAliasArgs)
1356 {
1357 warn(yyextra->fileName,yyextra->lineNr,
1358 "Reached end of file while still searching closing '}}' of an alias argument (probable start: '{}')",
1359 yyextra->aliasCmd);
1360 }
1361 if (yyextra->includeStack.empty())
1362 {
1363 yyextra->insertCppCommentMarker=false;
1365 }
1366 else
1367 {
1368 std::unique_ptr<commentcnv_FileState> &fs = yyextra->includeStack.back();
1369 YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
1370 yy_switch_to_buffer(fs->bufState, yyscanner);
1371 yy_delete_buffer(oldBuf, yyscanner);
1372 BEGIN(fs->oldState);
1373 yyextra->fileName = fs->oldFileName;
1374 yyextra->lineNr = fs->oldLineNr;
1375 yyextra->inBuf = fs->oldFileBuf;
1376 yyextra->inBufPos = fs->oldFileBufPos;
1377 yyextra->includeCtx = fs->oldIncludeCtx;
1379 if (fs->oldRaiseLvl!=yyextra->raiseLevel)
1380 {
1381 lineStr+="\\iraise " + std::to_string(fs->oldRaiseLvl)+ " ";
1382 }
1383 if (fs->oldRaiseLbl!=yyextra->raiseLabel)
1384 {
1385 lineStr+="\\iprefix \"" + fs->oldRaiseLbl + "\" ";
1386 }
1387 lineStr+="\\ilinebr ";
1388 yyextra->raiseLevel = fs->oldRaiseLvl;
1389 yyextra->raiseLabel = fs->oldRaiseLbl;
1391 yyextra->includeStack.pop_back();
1392
1393
1394 }
1395 }
1396
1397<*>\n { fprintf(stderr,"Lex scanner %s (%s) default rule newline for state %s.\n", __FILE__, qPrint(yyextra->fileName),stateToString(YY_START));}
1398 */
1399%%