386 {
388 yyextra->code->codify(yytext);
389 BEGIN( ReadInclude );
390 }
391<Body>("@interface"|"@implementation"|"@protocol")[ \t\n]+ {
392 yyextra->insideObjC=
TRUE;
396 if (!yyextra->insideTemplate)
397 BEGIN( ClassName );
398 }
399<Body>(("public"|"private"){B}+)?("ref"|"value"|"interface"|"enum"){B}+("class"|"struct") {
400 if (yyextra->insideTemplate) REJECT;
404 BEGIN( ClassName );
405 }
406<Body>"property"|"event"/{BN}* {
407 if (yyextra->insideTemplate) REJECT;
411 }
412<Body>("partial"{B}+)?("class"|"struct"|"union"|"namespace"|"interface"){B}+ {
416 if (!yyextra->insideTemplate)
417 BEGIN( ClassName );
418 }
419<Body>("package")[ \t\n]+ {
423 BEGIN( PackageName );
424 }
425<ClassVar>\n {
426 if (!yyextra->insideObjC) REJECT;
428 BEGIN(Body);
429 }
430<Body,ClassVar,Bases>"-"|"+" {
431 if (!yyextra->insideObjC || yyextra->insideBody)
432 {
433 yyextra->code->codify(yytext);
434 }
435 else
436 {
437 DBG_CTX((stderr,
"Start of Objective-C method!\n"));
438 yyextra->code->codify(yytext);
439 BEGIN(ObjCMethod);
440 }
441 }
442<ObjCMethod>":" {
443 yyextra->code->codify(yytext);
444 BEGIN(ObjCParams);
445 }
446<ObjCParams>"(" {
447 yyextra->code->codify(yytext);
448 BEGIN(ObjCParamType);
449 }
450<ObjCParams,ObjCMethod>";"|"{" {
451 yyextra->code->codify(yytext);
452 if (*yytext=='{')
453 {
454 if (yyextra->searchingForBody)
455 {
456 yyextra->searchingForBody=
FALSE;
457 yyextra->insideBody=
TRUE;
458 }
459 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
460 if (!yyextra->curClassName.isEmpty())
461 {
462 pushScope(yyscanner,yyextra->curClassName);
463 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
465 }
466 }
467 yyextra->type.clear();
468 yyextra->name.clear();
469 BEGIN(Body);
470 }
471<ObjCParams>{ID}{B}*":" {
472 yyextra->code->codify(yytext);
473 }
474<ObjCParamType>{TYPEKW} {
476 yyextra->code->codify(yytext);
478 yyextra->parmType=yytext;
479 }
480<ObjCParamType>{ID} {
482 yyextra->parmType=yytext;
483 }
484<ObjCParamType>")" {
485 yyextra->code->codify(yytext);
486 BEGIN(ObjCParams);
487 }
488<ObjCParams>{ID} {
489 yyextra->code->codify(yytext);
490 yyextra->parmName=yytext;
491 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
492 yyextra->parmType.clear();yyextra->parmName.clear();
493 }
494<ObjCMethod,ObjCParams,ObjCParamType>{ID} {
496 }
497<ObjCMethod,ObjCParams,ObjCParamType>. {
498 yyextra->code->codify(yytext);
499 }
500<ObjCMethod,ObjCParams,ObjCParamType>\n {
502 }
503<ReadInclude>[^\n\">]+/(">"|"\"") {
504
505 bool found = false;
506 bool ambig = false;
509
511 {
512 if (ambig)
513 {
514 DBG_CTX((stderr,
"===== yes %s is ambiguous\n",yytext));
516 if (!name.isEmpty() && yyextra->sourceFileDef)
517 {
519 if (fn)
520 {
521
522 auto it = std::find_if(fn->begin(),
523 fn->end(),
524 [&sfd=yyextra->sourceFileDef]
525 (const auto &lfd)
526 { return sfd->isIncluded(lfd->absFilePath()); });
527 found = it!=fn->end();
528 }
529 }
530 }
531 else
532 {
534 }
535 }
537 if (found)
538 {
540 }
541 else
542 {
543 yyextra->code->codify(yytext);
544 }
545 char c=(char)yyinput(yyscanner);
547 text+=c;
548 yyextra->code->codify(text);
550 BEGIN( Body );
551 }
static std::string cleanDirPath(const std::string &path)
static FileNameLinkedMap * inputNameLinkedMap
virtual QCString absFilePath() const =0
Class representing all files with a certain base name.
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
552<Body,Bases>^[ \t]*"#" {
554 yyextra->lastSkipCppContext = YY_START;
555 yyextra->code->codify(yytext);
556 BEGIN( SkipCPP ) ;
557 }
558<SkipCPP>\" {
559 yyextra->code->codify(yytext);
560 yyextra->lastStringContext=YY_START;
561 BEGIN( SkipString ) ;
562 }
563<SkipCPP>. {
564 yyextra->code->codify(yytext);
565 }
566<SkipCPP>[^\n\/\\\"]+ {
567 yyextra->code->codify(yytext);
568 }
569<SkipCPP>\\[\r]?\n {
571 }
572<SkipCPP>{CPPC}/[^/!] {
573 REJECT;
574 }
575<Body,FuncCall,MemberCall,MemberCall2>"}" {
576 yyextra->theVarContext.popScope();
577 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
578 yyextra->type.clear();
579 yyextra->name.clear();
580
581 if (!yyextra->scopeStack.empty())
582 {
583 int scope = yyextra->scopeStack.top();
584 yyextra->scopeStack.pop();
587 {
589 }
590 }
591
592 yyextra->code->codify(yytext);
593
594 DBG_CTX((stderr,
"yyextra->bodyCurlyCount=%d\n",yyextra->bodyCurlyCount));
595 if (--yyextra->bodyCurlyCount<=0)
596 {
597 yyextra->insideBody=
FALSE;
598 yyextra->currentMemberDef=nullptr;
599 if (yyextra->currentDefinition)
600 yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
601 }
602 BEGIN(Body);
603 }
604<Body,ClassVar>"@end" {
605 DBG_CTX((stderr,
"End of objc scope fd=%s\n",
qPrint(yyextra->sourceFileDef->name())));
606 if (yyextra->sourceFileDef)
607 {
608 const FileDef *fd=yyextra->sourceFileDef;
611 DBG_CTX((stderr,
"insideObjC=%d\n",yyextra->insideObjC));
612 }
613 else
614 {
615 yyextra->insideObjC =
FALSE;
616 }
617 if (yyextra->insideBody)
618 {
619 yyextra->theVarContext.popScope();
bool endsWith(const char *s) const
620
621 if (!yyextra->scopeStack.empty())
622 {
623 int scope = yyextra->scopeStack.top();
624 yyextra->scopeStack.pop();
627 {
629 }
630 }
631 yyextra->insideBody=
FALSE;
632 }
633
635 yyextra->code->codify(yytext);
637
638 yyextra->currentMemberDef=nullptr;
639 if (yyextra->currentDefinition)
640 yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
641 BEGIN(Body);
642 }
643<ClassName,ClassVar>";" {
644 if (yyextra->lang==SrcLangExt::CSharp)
645 {
646 yyextra->code->codify(yytext);
647 yyextra->skipCodify = true;
648 unput('{');
649 }
650 else
651 {
652 yyextra->code->codify(yytext);
653 yyextra->searchingForBody=
FALSE;
654 BEGIN( Body );
655 }
656 }
657<ClassName,ClassVar>[*&^%]+ {
658 yyextra->type=yyextra->curClassName;
659 yyextra->name.clear();
660 yyextra->code->codify(yytext);
661 BEGIN( Body );
662 }
663<ClassName>"__declspec"{B}*"("{B}*{ID}{B}*")" {
665 yyextra->code->codify(yytext);
667 }
668<ClassName>{ID}("."{ID})* |
669<ClassName>{ID}("::"{ID})* {
670 if (yyextra->lang==SrcLangExt::CSharp)
671 yyextra->curClassName=
substitute(yytext,
".",
"::");
672 else
673 yyextra->curClassName=yytext;
675 if (yyextra->curClassName=="alignas")
676 {
678 yyextra->code->codify(yytext);
680 BEGIN( AlignAs );
681 }
682 else
683 {
685 BEGIN( ClassVar );
686 }
687 }
static void addType(yyscan_t yyscanner)
688<AlignAs>"(" {
689 yyextra->bracketCount=1;
690 yyextra->code->codify(yytext);
691 BEGIN( AlignAsEnd );
692 }
693<AlignAs>\n { yyextra->yyLineNr++;
695 }
696<AlignAs>. { yyextra->code->codify(yytext); }
697<AlignAsEnd>"(" { yyextra->code->codify(yytext);
698 yyextra->bracketCount++;
699 }
700<AlignAsEnd>")" {
701 yyextra->code->codify(yytext);
702 if (--yyextra->bracketCount<=0)
703 {
704 BEGIN(ClassName);
705 }
706 }
707<AlignAsEnd>\n { yyextra->yyLineNr++;
709 }
710<AlignAsEnd>. { yyextra->code->codify(yytext); }
711<ClassName>{ID}("\\"{ID})* { // PHP namespace
712 yyextra->curClassName=
substitute(yytext,
"\\",
"::");
714 pushScope(yyscanner,yyextra->curClassName);
717 BEGIN( ClassVar );
718 }
719<ClassName>{ID}{B}*"("{ID}")" { // Obj-C category
722 pushScope(yyscanner,yyextra->curClassName);
725 BEGIN( ClassVar );
726 }
727<PackageName>{ID}("."{ID})* {
728 yyextra->curClassName=
substitute(yytext,
".",
"::");
729 DBG_CTX((stderr,
"found package: %s\n",
qPrint(yyextra->curClassName)));
732 }
733<ClassVar>"=" {
734 unput(*yytext);
735 BEGIN( Body );
736 }
737<ClassVar>("extends"|"implements") { // Java, Slice
741 yyextra->curClassBases.clear();
742 BEGIN( Bases );
743 }
744<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
745 DBG_CTX((stderr,
"***** C++/CLI modifier %s on yyextra->curClassName=%s\n",yytext,
qPrint(yyextra->curClassName)));
749 BEGIN( CppCliTypeModifierFollowup );
750 }
751<ClassVar>{ID} {
752 yyextra->type = yyextra->curClassName;
753 yyextra->name = yytext;
754 if (yyextra->insideBody)
755 {
756 addVariable(yyscanner,yyextra->type,yyextra->name);
757 }
759 }
760<ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*":"{B}* {
762 yyextra->curClassBases.clear();
763 BEGIN( Bases );
764 }
765<PackageName>[ \t]*";" |
766<Bases>^{Bopt}/"@"{ID} | // Objective-C interface
767<Bases,ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*"{"{B}* {
768 yyextra->theVarContext.pushScope();
769 if (!yyextra->skipCodify) yyextra->code->codify(yytext);
770 yyextra->skipCodify = false;
771 if (YY_START==ClassVar && yyextra->curClassName.isEmpty())
772 {
773 yyextra->curClassName = yyextra->name;
774 }
775 if (yyextra->searchingForBody)
776 {
777 yyextra->searchingForBody=
FALSE;
778 yyextra->insideBody=
TRUE;
779 }
780 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
781 if (!yyextra->curClassName.isEmpty())
782 {
783 DBG_CTX((stderr,
"** scope stack push CLASSBLOCK\n"));
785 pushScope(yyscanner,yyextra->curClassName);
786 DBG_CTX((stderr,
"***** yyextra->curClassName=%s\n",
qPrint(yyextra->curClassName)));
787 if (yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,yyextra->curClassName,true)==nullptr)
788 {
789 DBG_CTX((stderr,
"Adding new class %s\n",
qPrint(yyextra->curClassName)));
791
792 for (const auto &s : yyextra->curClassBases)
793 {
795 auto it = yyextra->codeClassMap.find(s);
796 if (it!=yyextra->codeClassMap.end())
797 {
799 }
800 if (bcd==
nullptr) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,
QCString(s),
true);
801 if (bcd && bcd->
name()!=yyextra->curClassName)
802 {
803 var.localDef()->insertBaseClass(bcd->
name());
804 }
805 }
806 yyextra->codeClassMap.emplace(yyextra->curClassName.str(),std::move(var));
807 }
808
809 }
810 else
811 {
812 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
814 }
815 yyextra->curClassName.clear();
816 yyextra->curClassBases.clear();
817 BEGIN( Body );
818 }
819<Bases>"virtual"|"public"|"protected"|"private"|"@public"|"@private"|"@protected" {
821 yyextra->code->codify(yytext);
823 }
824<Bases>{SEP}?({ID}{SEP})*{ID} {
825 DBG_CTX((stderr,
"%s:addBase(%s)\n",
qPrint(yyextra->curClassName),yytext));
826 yyextra->curClassBases.emplace_back(yytext);
828 }
829<Bases>"<" {
830 yyextra->code->codify(yytext);
831 if (!yyextra->insideObjC)
832 {
833 yyextra->sharpCount=1;
834 BEGIN ( SkipSharp );
835 }
836 else
837 {
838 yyextra->insideProtocolList=
TRUE;
839 }
840 }
841<Bases>">" {
842 yyextra->code->codify(yytext);
843 yyextra->insideProtocolList=
FALSE;
844 }
845<SkipSharp>"<" {
846 yyextra->code->codify(yytext);
847 ++yyextra->sharpCount;
848 }
849<SkipSharp>">" {
850 yyextra->code->codify(yytext);
851 if (--yyextra->sharpCount<=0)
852 BEGIN ( Bases );
853 }
854<SkipSharp>"\"" {
855 yyextra->code->codify(yytext);
856 yyextra->lastStringContext=YY_START;
857 BEGIN(SkipString);
858 }
859<SkipSharp>"\'" {
860 yyextra->code->codify(yytext);
861 yyextra->lastStringContext=YY_START;
862 BEGIN(SkipStringS);
863 }
864<Bases>"(" {
865 yyextra->code->codify(yytext);
866 yyextra->sharpCount=1;
867 BEGIN ( SkipSharp );
868 }
869<SkipSharp>"(" {
870 yyextra->code->codify(yytext);
871 ++yyextra->sharpCount;
872 }
873<SkipSharp>")" {
874 yyextra->code->codify(yytext);
875 if (--yyextra->sharpCount<=0)
876 BEGIN ( Bases );
877 }
878
879
880<Bases>"," {
881 yyextra->code->codify(yytext);
882 }
883
884
885<Body>{SCOPEPREFIX}?"operator"{B}*"()"{Bopt}/"(" {
888 yyextra->bracketCount=0;
889 yyextra->args.clear();
890 yyextra->name+=yytext;
891 BEGIN( FuncCall );
892 }
893<Body>{SCOPEPREFIX}?"operator"/"(" {
896 yyextra->bracketCount=0;
897 yyextra->args.clear();
898 yyextra->name+=yytext;
899 BEGIN( FuncCall );
900 }
901<Body>{SCOPEPREFIX}?"operator"[^a-z_A-Z0-9\(\n]+/"(" {
904 yyextra->bracketCount=0;
905 yyextra->args.clear();
906 yyextra->name+=yytext;
907 BEGIN( FuncCall );
908 }
909<Body,TemplDecl>("template"|"generic")/([^a-zA-Z0-9]) {
913 yyextra->insideTemplate=
TRUE;
914 yyextra->sharpCount=0;
915 }
916<Body>"concept"{BN}+ {
920 BEGIN(ConceptName);
921 }
922<Body>"using"{BN}+"namespace"{BN}+ {
926 BEGIN(UsingName);
927 }
928<Body>"using"{BN}+ {
932 BEGIN(UsingName);
933 }
934<Body>"module"/{B}*[:;]? { // 'module X' or 'module : private' or 'module;'
935 if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
936 if (!yyextra->type.isEmpty() || !yyextra->name.isEmpty()) REJECT;
940 BEGIN(ModuleName);
941 }
942<Body>"import"/{B}*[<":]? {
943 if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
947 BEGIN(ModuleImport);
948 }
949<ConceptName>{ID}("::"{ID})* {
951 }
952<ConceptName>"=" { codifyLines(yyscanner,yytext); BEGIN(Body); }
953<UsingName>{ID}(("::"|"."){ID})* {
956 BEGIN(Body);
957 }
static void addUsingDirective(yyscan_t yyscanner, const QCString &name)
958<UsingName>\n { codifyLines(yyscanner,yytext); BEGIN(Body); }
959<UsingName>. { codifyLines(yyscanner,yytext); BEGIN(Body); }
960<Body,FuncCall>"$"?"this"("->"|".") { yyextra->code->codify(yytext); // this-> for C++, this. for C#
961 yyextra->isPrefixedWithThis =
TRUE;
962 }
963<Body>{KEYWORD}/([^a-z_A-Z0-9]) {
964 if (yyextra->lang==SrcLangExt::Java &&
qstrcmp(
"internal",yytext) ==0) REJECT;
969 if (text==
"typedef" || text.
find(
"enum ")!=-1)
970 {
972 yyextra->name+=yytext;
973 }
975 }
static bool skipLanguageSpecificKeyword(yyscan_t yyscanner, const char *kw)
int qstrcmp(const char *str1, const char *str2)
976<Body>{KEYWORD}/{B}* {
981 }
982<Body>{KEYWORD}/{BN}*"(" {
987 yyextra->name.clear();yyextra->type.clear();
988 }
989<FuncCall>"in"/{BN}* {
990 if (!yyextra->inForEachExpression) REJECT;
994
995 yyextra->theVarContext.popScope();
996 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
997 yyextra->theVarContext.pushScope();
998 yyextra->name.clear();yyextra->type.clear();
999 }
1000<Body>{FLOWKW}/{BN}*"(" {
1004 yyextra->name.clear();yyextra->type.clear();
1005 yyextra->inForEachExpression = (
qstrcmp(yytext,
"for each")==0 ||
qstrcmp(yytext,
"foreach")==0);
1006 BEGIN(FuncCall);
1007 }
1008<Body>{FLOWCONDITION}/{BN}*"(" {
1013 yyextra->name.clear();yyextra->type.clear();
1014 yyextra->inForEachExpression = (strcmp(yytext,"for each")==0 || strcmp(yytext, "foreach")==0);
1015 BEGIN(FuncCall);
1016 }
static void incrementFlowKeyWordCount(yyscan_t yyscanner)
1017<Body>{FLOWKW}/([^a-z_A-Z0-9]) {
1021 if (yyextra->inFunctionTryBlock && (
qstrcmp(yytext,
"catch")==0 ||
qstrcmp(yytext,
"finally")==0))
1022 {
1023 yyextra->inFunctionTryBlock=
FALSE;
1024 }
1025 }
1026<Body>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
1031 if (yyextra->inFunctionTryBlock && (strcmp(yytext,"catch")==0 || strcmp(yytext,"finally")==0))
1032 {
1033 yyextra->inFunctionTryBlock=
FALSE;
1034 }
1035 }
1036<Body>{FLOWKW}/{B}* {
1040 }
1041<Body>{FLOWCONDITION}/{B}* {
1046 }
1047<Body>"*"{B}*")" { // end of cast?
1048 yyextra->code->codify(yytext);
1049 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1050 yyextra->bracketCount--;
1051 yyextra->parmType = yyextra->name;
1052 BEGIN(FuncCall);
1053 }
1054<Body>"\\)"|"\\(" {
1055 yyextra->code->codify(yytext);
1056 }
1057<Body>[\\|\)\+\-\/\%\~\!] {
1058 yyextra->code->codify(yytext);
1059 yyextra->name.clear();yyextra->type.clear();
1060 if (*yytext==')')
1061 {
1062 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1063 yyextra->bracketCount--;
1064 if (yyextra->bracketCount<=0)
1065 {
1066 BEGIN(FuncCall);
1067 }
1068 }
1069 }
1070<Body,TemplDecl,ObjCMethod>{TYPEKW}/{B}* {
1072 yyextra->code->codify(yytext);
1075 yyextra->name+=yytext;
1076 }
1077<Body,TemplDecl,ObjCMethod>{TYPEKWSL}/{B}* {
1078 if (yyextra->lang!=SrcLangExt::Slice)
1079 {
1080 REJECT;
1081 }
1082 else
1083 {
1085 yyextra->code->codify(yytext);
1088 yyextra->name+=yytext;
1089 }
1090 }
1091<Body>"generic"/{B}*"<"[^\n\/\-\.\{\">]*">"{B}* {
1093 yyextra->code->codify(yytext);
1095 yyextra->sharpCount=0;
1096 BEGIN(TemplDecl);
1097 }
1098<Body>"template"/{B}*"<"[^\n\/\-\.\{\">]*">"{B}* { // template<...>
1100 yyextra->code->codify(yytext);
1102 yyextra->sharpCount=0;
1103 BEGIN(TemplDecl);
1104 }
1105<TemplDecl>"class"|"typename" {
1109 }
1110<TemplDecl>"<" {
1111 yyextra->code->codify(yytext);
1112 yyextra->sharpCount++;
1113 }
1114<TemplDecl>">" {
1115 yyextra->code->codify(yytext);
1116 yyextra->sharpCount--;
1117 if (yyextra->sharpCount<=0)
1118 {
1119 BEGIN(Body);
1120 }
1121 }
1122<TemplCast>">" {
1126 BEGIN( yyextra->lastTemplCastContext );
1127 }
1128<TemplCast>{ID}("::"{ID})* {
1130 }
1131<TemplCast>("const"|"volatile"){B}* {
1135 }
1136<TemplCast>[*^]* {
1138 }
1139<Body,MemberCall2,FuncCall>{CASTKW}{B}*"<" { // static_cast<T>(
1143 yyextra->lastTemplCastContext = YY_START;
1144 BEGIN(TemplCast);
1145 }
1146<Body>"$this->"{SCOPENAME}/{BN}*[;,)\]] { // PHP member variable
1149 yyextra->name+=yytext+7;
1150 }
static void generatePHPVariableLink(yyscan_t yyscanner, OutputCodeList &ol, const char *varName)
1151<Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\">\(']*">"{ENDIDopt}/{B}* { // A<T> *pt;
1153 {
1154 REJECT;
1155 }
1158 yyextra->name+=yytext;
1159 }
static bool isCastKeyword(const char *s)
1160<ModuleName,ModuleImport>{MODULE_ID}({BN}*":"{BN}*{MODULE_ID})? {
1162 int i = name.
find(
':');
1164 if (i!=-1)
1165 {
1168 }
1170 if (mod)
1171 {
1173 }
1174 else
1175 {
1177 }
1178 }
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
1179<ModuleName>":"{BN}+"private" {
1181 int i=text.
find(
'p');
1186 }
1187<ModuleName>";" { yyextra->code->codify(yytext); BEGIN(Body); }
1188<ModuleName>. { yyextra->code->codify(yytext); }
1189<ModuleName>\n { codifyLines(yyscanner,yytext); }
1190<ModuleImport>["<] { yyextra->code->codify(yytext); BEGIN(ReadInclude); }
1191<ModuleImport>";" { yyextra->code->codify(yytext); BEGIN(Body); }
1192<ModuleImport>. { yyextra->code->codify(yytext); }
1193<ModuleImport>\n { codifyLines(yyscanner,yytext); }
1194
1195<Body>{SCOPENAME}/{BN}*[:;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
1197 {
1198 REJECT;
1199 }
1202 yyextra->name+=yytext;
1203 }
static bool startsWithKeyword(const QCString &str, const QCString &kw)
1204<Body>{ID}("."{ID})+/{BN}+ { // CSharp/Java scope
1205 if (yyextra->lang==SrcLangExt::CSharp || yyextra->lang==SrcLangExt::Java)
1206 {
1209 yyextra->name+=yytext;
1210 }
1211 else
1212 {
1213 REJECT;
1214 }
1215 }
1216<Body>"export"/{B}* {
1217 if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
1221 }
1222<Body>{SCOPENAME}/{B}* { // p->func()
1224 {
1225 REJECT;
1226 }
1229 yyextra->name+=yytext;
1230 }
1231<Body>"("{B}*("*"{B}*)+{SCOPENAME}+{B}*")"/{B}* { // (*p)->func() but not "if (p) ..."
1232 yyextra->code->codify(yytext);
1233 uint32_t s=0;
while (s<(uint32_t)yyleng && !
isId(yytext[s])) s++;
1234 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1237 yyextra->name=std::move(varname);
1238 }
1239<Body>{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\">]*">"/{BN}*"(" |
1240<Body>{SCOPETNAME}/{BN}*"(" { // a() or c::a() or t<A,B>::a() or A\B\foo()
1242 {
1243 REJECT;
1244 }
1247 yyextra->bracketCount=0;
1248 yyextra->args.clear();
1249 yyextra->name+=yytext;
1250 BEGIN( FuncCall );
1251 }
1252<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{RAWBEGIN} {
1254 uint32_t i=(uint32_t)text.
find(
'R');
1255 yyextra->code->codify(text.
left(i+1));
1257 yyextra->code->codify(
QCString(yytext+i+1));
1258 yyextra->lastStringContext=YY_START;
1259 yyextra->inForEachExpression =
FALSE;
1261 BEGIN( RawString );
1262 }
QCString extractBeginRawStringDelimiter(const char *rawStart)
1263<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit,ClassVar,OldStyleArgs>\" {
1265 yyextra->code->codify(yytext);
1266 yyextra->lastStringContext=YY_START;
1267 yyextra->inForEachExpression =
FALSE;
1268 BEGIN( SkipString );
1269 }
1270<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{NUMBER} { //Note similar code in commentcnv.l
1271 if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
1272 yyextra->code->codify(yytext);
1273 }
1274<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\' {
1276 yyextra->code->codify(yytext);
1277 yyextra->lastStringContext=YY_START;
1278 yyextra->inForEachExpression =
FALSE;
1279 BEGIN( SkipStringS );
1280 }
1281<SkipString>[^\"\\\r\n]{1,100} {
1282 yyextra->code->codify(yytext);
1283 }
1284<SkipStringS>[^\'\\\r\n]{1,100} {
1285 yyextra->code->codify(yytext);
1286 }
1287<SkipString,SkipStringS>{CPPC}|{CCS} {
1288 yyextra->code->codify(yytext);
1289 }
1290<SkipString>@?\" {
1291 yyextra->code->codify(yytext);
1292 if (yyextra->lastStringContext!=SkipCPP)
1293 {
1295 }
1296 BEGIN( yyextra->lastStringContext );
1297 }
1298<SkipStringS>\' {
1299 yyextra->code->codify(yytext);
1301 BEGIN( yyextra->lastStringContext );
1302 }
1303<SkipString,SkipStringS>\\. {
1304 yyextra->code->codify(yytext);
1305 }
1306<RawString>{RAWEND} {
1307 yyextra->code->codify(yytext);
1309 {
1310 BEGIN( yyextra->lastStringContext );
1311 }
1312 }
QCString extractEndRawStringDelimiter(const char *rawEnd)
1313<RawString>[^)\n]+ { yyextra->code->codify(yytext); }
1314<RawString>. { yyextra->code->codify(yytext); }
1315<RawString>\n { codifyLines(yyscanner,yytext); }
1316<SkipVerbString>[^"\n]+ {
1317 yyextra->code->codify(yytext);
1318 }
1319<SkipVerbString>\"\" { // escaped quote
1320 yyextra->code->codify(yytext);
1321 }
1322<SkipVerbString>\" { // end of string
1323 yyextra->code->codify(yytext);
1325 BEGIN( yyextra->lastVerbStringContext );
1326 }
1327<SkipVerbString>. {
1328 yyextra->code->codify(yytext);
1329 }
1330<SkipVerbString>\n {
1332 }
1333<Body>":" {
1334 yyextra->code->codify(yytext);
1335 yyextra->name.clear();yyextra->type.clear();
1336 }
1337<Body>"<" {
1338 if (yyextra->insideTemplate)
1339 {
1340 yyextra->sharpCount++;
1341 }
1342 yyextra->code->codify(yytext);
1343 }
1344<Body>">" {
1345 if (yyextra->insideTemplate)
1346 {
1347 if (--yyextra->sharpCount<=0)
1348 {
1349 yyextra->insideTemplate=
FALSE;
1350 }
1351 }
1352 yyextra->code->codify(yytext);
1353 }
1354<Body,MemberCall,MemberCall2,FuncCall,OldStyleArgs>"'"((\\0[Xx0-9]+)|(\\.)|(.))"'" {
1356 yyextra->code->codify(yytext);
1358 }
1359<Body>"."|"->" {
1360 if (yytext[0]=='-')
1361 {
1363 }
1364 yyextra->code->codify(yytext);
1365 yyextra->memCallContext = YY_START;
1366 BEGIN( MemberCall );
1367 }
static void updateCallContextForSmartPointer(yyscan_t yyscanner)
1368<MemberCall>{SCOPETNAME}/{BN}*"(" {
1369 if (yyextra->theCallContext.getScope().globalDef())
1370 {
1372 {
1375 }
1376 yyextra->name.clear();
1377 }
1378 else
1379 {
1382 yyextra->name.clear();
1383 }
1384 yyextra->type.clear();
1385 if (yyextra->memCallContext==Body)
1386 {
1387 BEGIN(FuncCall);
1388 }
1389 else
1390 {
1391 BEGIN(yyextra->memCallContext);
1392 }
1393 }
1394<MemberCall>{SCOPENAME}/{B}* {
1395 if (yyextra->theCallContext.getScope().globalDef())
1396 {
1397 DBG_CTX((stderr,
"yyextra->theCallContext.getClass()=%p\n",(
void*)yyextra->theCallContext.getScope().globalDef()));
1399 {
1402 }
1403 yyextra->name.clear();
1404 }
1405 else
1406 {
1407 DBG_CTX((stderr,
"no class context!\n"));
1410 yyextra->name.clear();
1411 }
1412 yyextra->type.clear();
1413 BEGIN(yyextra->memCallContext);
1414 }
1415<Body>[,=;\[{] {
1416 if (yyextra->insideObjC && *yytext=='[')
1417 {
1418 DBG_CTX((stderr,
"Found start of ObjC call!\n"));
1419
1420 yyextra->contextMap.clear();
1421 yyextra->nameMap.clear();
1422 yyextra->objectMap.clear();
1423 yyextra->wordMap.clear();
1424 yyextra->commentMap.clear();
1425 yyextra->currentCtxId = 0;
1426 yyextra->currentNameId = 0;
1427 yyextra->currentObjId = 0;
1428 yyextra->currentCtx = nullptr;
1429 yyextra->braceCount = 0;
1430 unput('[');
1431 BEGIN(ObjCCall);
1432 }
1433 else
1434 {
1435 if (*yytext!='{') yyextra->code->codify(yytext);
1436 yyextra->saveName = yyextra->name;
1437 yyextra->saveType = yyextra->type;
1438 if (*yytext!='[' && !yyextra->type.isEmpty())
1439 {
1440
1441
1442 {
1443
1444
1445 addVariable(yyscanner,yyextra->type,yyextra->name);
1446 }
1447 yyextra->name.clear();
1448 }
1449 if (*yytext==';' || *yytext=='=' || *yytext=='{')
1450 {
1451 yyextra->type.clear();
1452 yyextra->name.clear();
1453 }
1454 else if (*yytext=='[')
1455 {
1456 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1457 }
1458 yyextra->args.clear();
1459 yyextra->parmType.clear();
1460 yyextra->parmName.clear();
1461 if (*yytext=='{')
1462 {
1463 BEGIN( BodyVar );
1464 unput('{');
1465 }
1466 }
1467 }
1468<Body,FuncCall,BodyVar>"{" {
1469 yyextra->theVarContext.pushScope();
1470 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1471 yyextra->bracketCount = 0;
1472
1474 if (yyextra->type.find("enum ")!=-1)
1475 {
1476 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1479 }
1480 else
1481 {
1482 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1484 }
1485
1486 if (yyextra->searchingForBody)
1487 {
1488 yyextra->searchingForBody=
FALSE;
1489 yyextra->insideBody=
TRUE;
1490 }
1491 yyextra->code->codify(yytext);
1492 if (yyextra->insideBody)
1493 {
1494 yyextra->bodyCurlyCount++;
1495 }
1496 yyextra->type.clear();
1497 yyextra->name.clear();
1498 BEGIN( Body );
1499 }
1500<ObjCCall,ObjCMName>"["|"{" {
1502 yyextra->currentCtx->format+=*yytext;
1503 BEGIN(ObjCCall);
1505 }
static void saveObjCContext(yyscan_t yyscanner)
1506<ObjCCall,ObjCMName>"]"|"}" {
1507 yyextra->currentCtx->format+=*yytext;
1509 BEGIN(ObjCMName);
1510 if (yyextra->currentCtx==nullptr)
1511 {
1512
1514 auto it = yyextra->contextMap.find(0);
1515 if (it!=yyextra->contextMap.end())
1516 {
1517 ctx = it->second.get();
1518 }
1520 BEGIN(Body);
1521 }
1523 }
static void restoreObjCContext(yyscan_t yyscanner)
1524<ObjCCall,ObjCMName>{CPPC}.* {
1525 yyextra->currentCtx->format+=
escapeComment(yyscanner,yytext);
1526 }
static QCString escapeComment(yyscan_t yyscanner, const char *s)
1527<ObjCCall,ObjCMName>{CCS} {
1528 yyextra->lastObjCCallContext = YY_START;
1529 yyextra->currentCtx->comment.str(yytext);
1530 BEGIN(ObjCCallComment);
1531 }
1532<ObjCCallComment>{CCE} {
1533 yyextra->currentCtx->comment << yytext;
1534 std::string commentStr = yyextra->currentCtx->comment.str();
1535 yyextra->currentCtx->format+=
escapeComment(yyscanner,commentStr.c_str());
1536 BEGIN(yyextra->lastObjCCallContext);
1537 }
1538<ObjCCallComment>[^*\n]+ { yyextra->currentCtx->comment << yytext; }
1539<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment << yytext; }
1540<ObjCCallComment>\n { yyextra->currentCtx->comment << *yytext; }
1541<ObjCCallComment>. { yyextra->currentCtx->comment << *yytext; }
1542<ObjCCall>{ID}({B}*"."{B}*{ID})* {
1544 if (yyextra->braceCount==0)
1545 {
1546 yyextra->currentCtx->objectTypeOrName=yytext;
1547 DBG_CTX((stderr,
"new type=%s\n",
qPrint(yyextra->currentCtx->objectTypeOrName)));
1548 BEGIN(ObjCMName);
1549 }
1550 }
static QCString escapeObject(yyscan_t yyscanner, const char *s)
1551<ObjCMName>{ID}/{BN}*"]" {
1552 if (yyextra->braceCount==0 &&
1553 yyextra->currentCtx->methodName.isEmpty())
1554 {
1555 yyextra->currentCtx->methodName=yytext;
1556 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1557 }
1558 else
1559 {
1560 yyextra->currentCtx->format+=
escapeWord(yyscanner,yytext);
1561 }
1562 }
static QCString escapeName(yyscan_t yyscanner, const char *s)
static QCString escapeWord(yyscan_t yyscanner, const char *s)
1563<ObjCMName>{ID}/{BN}*":" {
1564 if (yyextra->braceCount==0)
1565 {
1566 yyextra->currentCtx->methodName+=yytext;
1567 yyextra->currentCtx->methodName+=":";
1568 }
1569 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1570 }
1571<ObjCSkipStr>[^\n\"$\\]* { yyextra->currentCtx->format+=yytext; }
1572<ObjCSkipStr>\\. { yyextra->currentCtx->format+=yytext; }
1573<ObjCSkipStr>"\"" { yyextra->currentCtx->format+=yytext;
1574 BEGIN(yyextra->lastStringContext);
1575 }
1576<ObjCCall,ObjCMName>{CHARLIT} { yyextra->currentCtx->format+=yytext; }
1577<ObjCCall,ObjCMName>"@"?"\"" { yyextra->currentCtx->format+=yytext;
1578 yyextra->lastStringContext=YY_START;
1579 BEGIN(ObjCSkipStr);
1580 }
1581<ObjCCall,ObjCMName,ObjCSkipStr>"$" { yyextra->currentCtx->format+="$$"; }
1582<ObjCCall,ObjCMName>"(" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount++; }
1583<ObjCCall,ObjCMName>")" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount--; }
1584<ObjCSkipStr>"@"/"\"" { // needed to prevent matching the global rule (for C#)
1585 yyextra->currentCtx->format+=yytext;
1586 }
1587<ObjCCall,ObjCMName,ObjCSkipStr>{ID} { yyextra->currentCtx->format+=escapeWord(yyscanner,yytext); }
1588<ObjCCall,ObjCMName,ObjCSkipStr>. { yyextra->currentCtx->format+=*yytext; }
1589<ObjCCall,ObjCMName,ObjCSkipStr>\n { yyextra->currentCtx->format+=*yytext; }
1590
1591<Body>"]" {
1592 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1593 yyextra->code->codify(yytext);
1594
1595 yyextra->name = yyextra->saveName;
1596 yyextra->type = yyextra->saveType;
1597 }
1598<Body>[0-9]+ {
1599 yyextra->code->codify(yytext);
1600 }
1601<Body>[0-9]+[xX][0-9A-Fa-f]+ {
1602 yyextra->code->codify(yytext);
1603 }
1604<MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
1605
1606
1609 yyextra->code->codify(yytext);
1611 }
1612<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKW}/([^a-z_A-Z0-9]) {
1614 yyextra->parmName=yytext;
1616 yyextra->code->codify(yytext);
1618 }
static void addParmType(yyscan_t yyscanner)
1619<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKWSL}/([^a-z_A-Z0-9]) {
1620 if (yyextra->lang!=SrcLangExt::Slice)
1621 {
1622 REJECT;
1623 }
1624 else
1625 {
1627 yyextra->parmName=yytext;
1629 yyextra->code->codify(yytext);
1631 }
1632 }
1633<MemberCall2,FuncCall>{FLOWKW}/([^a-z_A-Z0-9]) {
1635 yyextra->parmName=yytext;
1637 yyextra->code->codify(yytext);
1639 }
1640<MemberCall2,FuncCall>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
1643 yyextra->parmName=yytext;
1645 yyextra->code->codify(yytext);
1647 }
1648<MemberCall2,FuncCall>("::")?{ID}(({B}*"<"[^\n\[\](){}<>']*">")?({B}*"::"{B}*{ID})?)* {
1650 {
1651 REJECT;
1652 }
1654 yyextra->parmName=yytext;
1656 }
1657<FuncCall>";" { // probably a cast, not a function call
1658 yyextra->code->codify(yytext);
1659 yyextra->inForEachExpression =
FALSE;
1660 BEGIN( Body );
1661 }
1662<MemberCall2,FuncCall>, {
1663 yyextra->code->codify(yytext);
1664 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1665 yyextra->parmType.clear();yyextra->parmName.clear();
1666 }
1667<MemberCall2,FuncCall>"{" {
1668 if (yyextra->bracketCount>0)
1669 {
1670 yyextra->code->codify(yytext);
1671 yyextra->skipInlineInitContext=YY_START;
1672 yyextra->curlyCount=0;
1673 BEGIN(InlineInit);
1674 }
1675 else
1676 {
1677 REJECT;
1678 }
1679 }
1680<InlineInit>"{" { yyextra->curlyCount++;
1681 yyextra->code->codify(yytext);
1682 }
1683<InlineInit>"}" {
1684 yyextra->code->codify(yytext);
1685 if (--yyextra->curlyCount<=0)
1686 {
1687 BEGIN(yyextra->skipInlineInitContext);
1688 }
1689 }
1690<InlineInit>\n {
1692 }
1693<InlineInit>. {
1694 yyextra->code->codify(yytext);
1695 }
1696<MemberCall2,FuncCall>"(" {
1697 yyextra->parmType.clear();yyextra->parmName.clear();
1698 yyextra->code->codify(yytext);
1699 yyextra->bracketCount++;
1700 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1701 if (YY_START==FuncCall && !yyextra->insideBody)
1702 {
1703 yyextra->theVarContext.pushScope();
1704 }
1705 }
1706<MemberCall2,FuncCall>{OPERATOR} { // operator
1711 {
1712
1713 yyextra->parmType.clear();yyextra->parmName.clear();
1714 }
1715 yyextra->code->codify(yytext);
1716 }
1717<MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" {
1718 if (yytext[0]==')')
1719 {
1720 DBG_CTX((stderr,
"addVariable(%s,%s)\n",
qPrint(yyextra->parmType),
qPrint(yyextra->parmName)));
1721 if (yyextra->parmType.isEmpty())
1722 {
1723 yyextra->parmType=yyextra->parmName;
1724 yyextra->parmName.clear();
1725 }
1726 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1727 }
1728 else
1729 {
1730 yyextra->parmType = yyextra->parmName;
1731 yyextra->parmName.clear();
1732 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1733 }
1734 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1735 yyextra->inForEachExpression =
FALSE;
1736
1737 yyextra->code->codify(yytext);
1738 if (--yyextra->bracketCount<=0)
1739 {
1740 if (yyextra->name.isEmpty())
1741 {
1742 BEGIN( Body );
1743 }
1744 else
1745 {
1746 BEGIN( CallEnd );
1747 }
1748 }
1749 }
1750<MemberCall,MemberCall2,FuncCall>[;:] { // recover from unexpected end of call
1751
1752 if (yyextra->bracketCount<=0)
1753 {
1754 unput(*yytext);
1755 BEGIN(CallEnd);
1756 }
1757 else
1758 {
1759 yyextra->code->codify(yytext);
1760 }
1761 }
1762<CallEnd>[ \t\n]* { codifyLines(yyscanner,yytext); }
1763<CallEnd>[;:] {
1765 yyextra->bracketCount=0;
1766 if (*yytext==
';') yyextra->searchingForBody=
FALSE;
1767 if (!yyextra->type.isEmpty())
1768 {
1769 DBG_CTX((stderr,
"add variable yyextra->type=%s yyextra->name=%s)\n",
qPrint(yyextra->type),
qPrint(yyextra->name)));
1770 addVariable(yyscanner,yyextra->type,yyextra->name);
1771 }
1772 yyextra->parmType.clear();yyextra->parmName.clear();
1774 if (*yytext==';' || yyextra->insideBody)
1775 {
1776 if (!yyextra->insideBody)
1777 {
1778 yyextra->theVarContext.popScope();
1779 }
1780 yyextra->name.clear();yyextra->type.clear();
1781 BEGIN( Body );
1782 }
1783 else
1784 {
1785 yyextra->bracketCount=0;
1786 BEGIN( SkipInits );
1787 }
1788 }
1789<CallEnd>{ENDQopt}/{BN}*(";"|"="|"throw"{BN}*"(") {
1793 }
1794<CallEnd,OldStyleArgs>("const"|"volatile"|"sealed"|"override")*({BN}+("const"|"volatile"|"sealed"|"override"))*{BN}*"{" {
1795 if (yyextra->insideBody)
1796 {
1797 yyextra->theVarContext.pushScope();
1798 }
1799 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1800
1801 yyextra->parmType.clear();yyextra->parmName.clear();
1802 int index = yyextra->name.findRev("::");
1803 DBG_CTX((stderr,
"yyextra->name=%s\n",
qPrint(yyextra->name)));
1804 if (index!=-1)
1805 {
1807 if (!yyextra->scopeName.isEmpty()) scope.
prepend((yyextra->scopeName+
"::"));
1809 if (cd)
1810 {
1813 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1814 }
1815 else
1816 {
1817
1819 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1820 }
1821 }
1822 else
1823 {
1824 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1826 }
1827 yytext[yyleng-1]='\0';
1829 if (!cv.stripWhiteSpace().isEmpty())
1830 {
1834 }
1835 else
1836 {
1838 }
1839 yyextra->code->codify("{");
1840 if (yyextra->searchingForBody)
1841 {
1842 yyextra->searchingForBody=
FALSE;
1843 yyextra->insideBody=
TRUE;
1844 }
1845 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1846 yyextra->type.clear(); yyextra->name.clear();
1847 BEGIN( Body );
1848 }
static void setClassScope(yyscan_t yyscanner, const QCString &name)
1849<CallEnd>"try" { // function-try-block
1851 yyextra->code->codify(yytext);
1853 yyextra->inFunctionTryBlock=
TRUE;
1854 }
1855<CallEnd>"requires" { // function-try-block
1857 yyextra->code->codify(yytext);
1859 }
1860<CallEnd>{ID} {
1861 if (yyextra->insideBody || !yyextra->parmType.isEmpty())
1862 {
1863 REJECT;
1864 }
1865
1867 yyextra->parmName=yytext;
1869 BEGIN(OldStyleArgs);
1870 }
1871<OldStyleArgs>{ID} {
1873 yyextra->parmName=yytext;
1875 }
1876<OldStyleArgs>[,;] {
1877 yyextra->code->codify(yytext);
1878 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1879 if (*yytext==';') yyextra->parmType.clear();
1880 yyextra->parmName.clear();
1881 }
1882<CallEnd,OldStyleArgs>"#" {
1884 yyextra->lastSkipCppContext = Body;
1885 yyextra->code->codify(yytext);
1886 BEGIN( SkipCPP );
1887 }
1888<CallEnd>. {
1889 unput(*yytext);
1890 if (!yyextra->insideBody)
1891 {
1892 yyextra->theVarContext.popScope();
1893 }
1894 yyextra->name.clear();yyextra->args.clear();
1895 yyextra->parmType.clear();yyextra->parmName.clear();
1896 BEGIN( Body );
1897 }
1898<SkipInits>";" {
1899 yyextra->code->codify(yytext);
1900 yyextra->type.clear(); yyextra->name.clear();
1901 BEGIN( Body );
1902 }
1903<SkipInits>"{" {
1904 yyextra->code->codify(yytext);
1905 if (yyextra->searchingForBody)
1906 {
1907 yyextra->searchingForBody=
FALSE;
1908 yyextra->insideBody=
TRUE;
1909 }
1910 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1911 if (yyextra->name.find("::")!=-1)
1912 {
1913 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1916 }
1917 else
1918 {
1919 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1921 }
1922 yyextra->type.clear(); yyextra->name.clear();
1923 BEGIN( Body );
1924 }
1925<SkipInits>{ID}{B}*"{" {
1927 int bracketPos = text.
find(
'{');
1928 int spacePos = text.
find(
' ');
1929 int len = spacePos==-1 ? bracketPos : spacePos;
1931 yyextra->code->codify(
QCString(yytext+len));
1932 }
1933<SkipInits>{ID} {
1935 }
1936<FuncCall>{ID}/"(" {
1938 }
1939<FuncCall>{ID}/("."|"->") {
1940 yyextra->name=yytext;
1942 BEGIN( MemberCall2 );
1943 }
1944<FuncCall,MemberCall2>("("{B}*("*"{B}*)+{ID}+{B}*")"{B}*)/("."|"->") {
1945 yyextra->code->codify(yytext);
1946 uint32_t s=0;
while (!
isId(yytext[s])) s++;
1947 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1948 yyextra->name=((
QCString)yytext).mid(s,e-s+1);
1949 BEGIN( MemberCall2 );
1950 }
1951<MemberCall2>{ID}/([ \t\n]*"(") {
1952 if (!yyextra->args.isEmpty())
1954 else
1956 yyextra->args.clear();
1957 BEGIN( FuncCall );
1958 }
static void generateMemberLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &varName, const QCString &memName)
1959<MemberCall2>{ID}/([ \t\n]*("."|"->")) {
1960
1961 yyextra->name=yytext;
1963 BEGIN( MemberCall2 );
1964 }
1965<MemberCall2>"->"|"." {
1966 if (yytext[0]=='-')
1967 {
1969 }
1970 yyextra->code->codify(yytext);
1971 yyextra->memCallContext = YY_START;
1972 BEGIN( MemberCall );
1973 }
1974<SkipComment>{CCS}("!"?){CCE} {
1975 yyextra->code->codify(yytext);
1977 BEGIN( yyextra->lastCContext ) ;
1978 }
1979<SkipComment>{CPPC}|{CCS} {
1980 yyextra->code->codify(yytext);
1981 }
1982<SkipComment>[^*\/\n]+ {
1983 yyextra->code->codify(yytext);
1984 }
1985<SkipComment>[ \t]*{CCE} {
1986 yyextra->code->codify(yytext);
1988 if (yyextra->lastCContext==SkipCPP)
1989 {
1991 }
1992 BEGIN( yyextra->lastCContext ) ;
1993 }
1994<SkipCxxComment>[^\r\n]*"\\"[\r]?\n { // line continuation
1996 }
1997<SkipCxxComment>[^\r\n]+ {
1998 yyextra->code->codify(yytext);
1999 }
2000<SkipCxxComment>\r
2001<SkipCxxComment>\n {
2002 unput('\n');
2004 BEGIN( yyextra->lastCContext ) ;
2005 }
2006<SkipCxxComment>. {
2007 yyextra->code->codify(yytext);
2008 }
2009<MemberCall>[^a-z_A-Z0-9(\n] {
2010 yyextra->code->codify(yytext);
2011 yyextra->type.clear();
2012 yyextra->name.clear();
2013 BEGIN(yyextra->memCallContext);
2014 }
2015<*>\n({B}*{CPPC}[!/][^\n]*\n)+ { // remove special one-line comment
2016 if (YY_START==SkipCPP) REJECT;
2021 if (YY_START==SkipCxxComment)
2022 {
2023 BEGIN( yyextra->lastCContext ) ;
2024 }
2025 }
2026<SkipCPP>\n/(.|\n) {
2028 BEGIN( yyextra->lastSkipCppContext ) ;
2029 unput('\n');
2030 }
2031<*>\n{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2036 if (YY_START==SkipCxxComment)
2037 {
2038 BEGIN( yyextra->lastCContext ) ;
2039 }
2040 }
2041<*>\n{B}*{CCS}"@"[{}] { // remove one-line group marker
2042
2043 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2044 {
2045 yyextra->lastCContext = YY_START ;
2046 }
2049 BEGIN(SkipComment);
2050 }
2051<*>^{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2056 }
2057<*>^{B}*{CCS}"@"[{}] { // remove multi-line group marker
2058
2059 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2060 {
2061 yyextra->lastCContext = YY_START ;
2062 }
2064 yyextra->code->codify(yytext);
2065 BEGIN(SkipComment);
2066 }
2067<*>^{B}*{CPPC}[!/][^\n]* { // remove special one-line comment
2071 }
2072<*>{CPPC}[!/][^\n]* { // strip special one-line comment
2073 if (YY_START==SkipComment || YY_START==SkipString) REJECT;
2077 }
2078<*>\n{B}*{CCS}[!*]/{NCOMM} {
2079
2080 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2081 {
2082 yyextra->lastCContext = YY_START ;
2083 }
2086 BEGIN(SkipComment);
2087 }
2088<*>^{B}*{CCS}"*"[*]+/[^/] {
2089
2090 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2091 {
2092 yyextra->lastCContext = YY_START ;
2093 }
2094
2096 yyextra->code->codify(yytext);
2097 BEGIN(SkipComment);
2098 }
2099<*>^{B}*{CCS}[!*]/{NCOMM} { // special C comment block at a new line
2100
2101 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2102 {
2103 yyextra->lastCContext = YY_START ;
2104 }
2106 yyextra->code->codify(yytext);
2107 BEGIN(SkipComment);
2108 }
2109<*>{CCS}[!*]/{NCOMM} { // special C comment block half way a line
2110 if (YY_START==SkipString) REJECT;
2111
2112 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2113 {
2114 yyextra->lastCContext = YY_START ;
2115 }
2117 yyextra->code->codify(yytext);
2118 BEGIN(SkipComment);
2119 }
2120<*>{CCS}("!"?){CCE} {
2121 if (YY_START==SkipString) REJECT;
2124 yyextra->code->codify(yytext);
2126 }
2127<SkipComment>[^\*\n]+ {
2128 yyextra->code->codify(yytext);
2129 }
2130<*>{CCS} {
2132 yyextra->code->codify(yytext);
2133
2134 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2135 {
2136 yyextra->lastCContext = YY_START ;
2137 }
2138 BEGIN( SkipComment ) ;
2139 }
2140<*>[$]?@\" { // C# (interpolated) verbatim string
2142 yyextra->code->codify(yytext);
2143 yyextra->lastVerbStringContext=YY_START;
2144 BEGIN(SkipVerbString);
2145 }
2146<*>{CPPC} {
2148 yyextra->code->codify(yytext);
2149 yyextra->lastCContext = YY_START ;
2150 BEGIN( SkipCxxComment ) ;
2151 }
2152<*>"("|"[" {
2153 if (yytext[0]=='(') yyextra->bracketCount++;
2154 yyextra->code->codify(yytext);
2155 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2156 }
2157<*>")"|"]" {
2158 if (yytext[0]==')') yyextra->bracketCount--;
2159 yyextra->code->codify(yytext);
2160 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2161 }
2162<*>\n {
2164 }
2165<*>[\x80-\xFF]* { // keep utf8 characters together...
2166 yyextra->code->codify(yytext);
2167 }
2168<*>. {
2169 yyextra->code->codify(yytext);
2170 }
2171
2172%%