385 {
387 yyextra->code->codify(yytext);
388 BEGIN( ReadInclude );
389 }
390<Body>("@interface"|"@implementation"|"@protocol")[ \t\n]+ {
391 yyextra->insideObjC=
TRUE;
395 if (!yyextra->insideTemplate)
396 BEGIN( ClassName );
397 }
398<Body>(("public"|"private"){B}+)?("ref"|"value"|"interface"|"enum"){B}+("class"|"struct") {
399 if (yyextra->insideTemplate) REJECT;
403 BEGIN( ClassName );
404 }
405<Body>"property"|"event"/{BN}* {
406 if (yyextra->insideTemplate) REJECT;
410 }
411<Body>("partial"{B}+)?("class"|"struct"|"union"|"namespace"|"interface"){B}+ {
415 if (!yyextra->insideTemplate)
416 BEGIN( ClassName );
417 }
418<Body>("package")[ \t\n]+ {
422 BEGIN( PackageName );
423 }
424<ClassVar>\n {
425 if (!yyextra->insideObjC) REJECT;
427 BEGIN(Body);
428 }
429<Body,ClassVar,Bases>"-"|"+" {
430 if (!yyextra->insideObjC || yyextra->insideBody)
431 {
432 yyextra->code->codify(yytext);
433 }
434 else
435 {
436 DBG_CTX((stderr,
"Start of Objective-C method!\n"));
437 yyextra->code->codify(yytext);
438 BEGIN(ObjCMethod);
439 }
440 }
441<ObjCMethod>":" {
442 yyextra->code->codify(yytext);
443 BEGIN(ObjCParams);
444 }
445<ObjCParams>"(" {
446 yyextra->code->codify(yytext);
447 BEGIN(ObjCParamType);
448 }
449<ObjCParams,ObjCMethod>";"|"{" {
450 yyextra->code->codify(yytext);
451 if (*yytext=='{')
452 {
453 if (yyextra->searchingForBody)
454 {
455 yyextra->searchingForBody=
FALSE;
456 yyextra->insideBody=
TRUE;
457 }
458 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
459 if (!yyextra->curClassName.isEmpty())
460 {
461 pushScope(yyscanner,yyextra->curClassName);
462 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
464 }
465 }
466 yyextra->type.clear();
467 yyextra->name.clear();
468 BEGIN(Body);
469 }
470<ObjCParams>{ID}{B}*":" {
471 yyextra->code->codify(yytext);
472 }
473<ObjCParamType>{TYPEKW} {
475 yyextra->code->codify(yytext);
477 yyextra->parmType=yytext;
478 }
479<ObjCParamType>{ID} {
481 yyextra->parmType=yytext;
482 }
483<ObjCParamType>")" {
484 yyextra->code->codify(yytext);
485 BEGIN(ObjCParams);
486 }
487<ObjCParams>{ID} {
488 yyextra->code->codify(yytext);
489 yyextra->parmName=yytext;
490 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
491 yyextra->parmType.clear();yyextra->parmName.clear();
492 }
493<ObjCMethod,ObjCParams,ObjCParamType>{ID} {
495 }
496<ObjCMethod,ObjCParams,ObjCParamType>. {
497 yyextra->code->codify(yytext);
498 }
499<ObjCMethod,ObjCParams,ObjCParamType>\n {
501 }
502<ReadInclude>[^\n\">]+/(">"|"\"") {
503
505 bool ambig = false;
508
510 {
511 if (ambig)
512 {
513 DBG_CTX((stderr,
"===== yes %s is ambiguous\n",yytext));
515 if (!name.isEmpty() && yyextra->sourceFileDef)
516 {
518 if (fn)
519 {
520
521 auto it = std::find_if(fn->begin(),
522 fn->end(),
523 [&sfd=yyextra->sourceFileDef]
524 (const auto &lfd)
525 { return sfd->isIncluded(lfd->absFilePath()); });
526 found = it!=fn->end();
527 }
528 }
529 }
530 else
531 {
533 }
534 }
537 {
539 }
540 else
541 {
542 yyextra->code->codify(yytext);
543 }
544 char c=(char)yyinput(yyscanner);
546 text+=c;
547 yyextra->code->codify(text);
549 BEGIN( Body );
550 }
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)
551<Body,Bases>^[ \t]*"#" {
553 yyextra->lastSkipCppContext = YY_START;
554 yyextra->code->codify(yytext);
555 BEGIN( SkipCPP ) ;
556 }
557<SkipCPP>\" {
558 yyextra->code->codify(yytext);
559 yyextra->lastStringContext=YY_START;
560 BEGIN( SkipString ) ;
561 }
562<SkipCPP>. {
563 yyextra->code->codify(yytext);
564 }
565<SkipCPP>[^\n\/\\\"]+ {
566 yyextra->code->codify(yytext);
567 }
568<SkipCPP>\\[\r]?\n {
570 }
571<SkipCPP>{CPPC}/[^/!] {
572 REJECT;
573 }
574<Body,FuncCall>"{" {
575 yyextra->theVarContext.pushScope();
576 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
577 yyextra->bracketCount = 0;
578
580 if (yyextra->type.find("enum ")!=-1)
581 {
582 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
585 }
586 else
587 {
588 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
590 }
591
592 if (yyextra->searchingForBody)
593 {
594 yyextra->searchingForBody=
FALSE;
595 yyextra->insideBody=
TRUE;
596 }
597 yyextra->code->codify(yytext);
598 if (yyextra->insideBody)
599 {
600 yyextra->bodyCurlyCount++;
601 }
602 yyextra->type.clear();
603 yyextra->name.clear();
604 BEGIN( Body );
605 }
606<Body,FuncCall,MemberCall,MemberCall2>"}" {
607 yyextra->theVarContext.popScope();
608 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
609 yyextra->type.clear();
610 yyextra->name.clear();
611
612 if (!yyextra->scopeStack.empty())
613 {
614 int scope = yyextra->scopeStack.top();
615 yyextra->scopeStack.pop();
618 {
620 }
621 }
622
623 yyextra->code->codify(yytext);
624
625 DBG_CTX((stderr,
"yyextra->bodyCurlyCount=%d\n",yyextra->bodyCurlyCount));
626 if (--yyextra->bodyCurlyCount<=0)
627 {
628 yyextra->insideBody=
FALSE;
629 yyextra->currentMemberDef=nullptr;
630 if (yyextra->currentDefinition)
631 yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
632 }
633 BEGIN(Body);
634 }
635<Body,ClassVar>"@end" {
636 DBG_CTX((stderr,
"End of objc scope fd=%s\n",
qPrint(yyextra->sourceFileDef->name())));
637 if (yyextra->sourceFileDef)
638 {
639 const FileDef *fd=yyextra->sourceFileDef;
642 DBG_CTX((stderr,
"insideObjC=%d\n",yyextra->insideObjC));
643 }
644 else
645 {
646 yyextra->insideObjC =
FALSE;
647 }
648 if (yyextra->insideBody)
649 {
650 yyextra->theVarContext.popScope();
bool endsWith(const char *s) const
651
652 if (!yyextra->scopeStack.empty())
653 {
654 int scope = yyextra->scopeStack.top();
655 yyextra->scopeStack.pop();
658 {
660 }
661 }
662 yyextra->insideBody=
FALSE;
663 }
664
666 yyextra->code->codify(yytext);
668
669 yyextra->currentMemberDef=nullptr;
670 if (yyextra->currentDefinition)
671 yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
672 BEGIN(Body);
673 }
674<ClassName,ClassVar>";" {
676 {
677 yyextra->code->codify(yytext);
678 yyextra->skipCodify = true;
679 unput('{');
680 }
681 else
682 {
683 yyextra->code->codify(yytext);
684 yyextra->searchingForBody=
FALSE;
685 BEGIN( Body );
686 }
687 }
688<ClassName,ClassVar>[*&^%]+ {
689 yyextra->type=yyextra->curClassName;
690 yyextra->name.clear();
691 yyextra->code->codify(yytext);
692 BEGIN( Body );
693 }
694<ClassName>"__declspec"{B}*"("{B}*{ID}{B}*")" {
696 yyextra->code->codify(yytext);
698 }
699<ClassName>{ID}("."{ID})* |
700<ClassName>{ID}("::"{ID})* {
702 yyextra->curClassName=
substitute(yytext,
".",
"::");
703 else
704 yyextra->curClassName=yytext;
706 if (yyextra->curClassName=="alignas")
707 {
709 yyextra->code->codify(yytext);
711 BEGIN( AlignAs );
712 }
713 else
714 {
716 BEGIN( ClassVar );
717 }
718 }
static void addType(yyscan_t yyscanner)
719<AlignAs>"(" {
720 yyextra->bracketCount=1;
721 yyextra->code->codify(yytext);
722 BEGIN( AlignAsEnd );
723 }
724<AlignAs>\n { yyextra->yyLineNr++;
726 }
727<AlignAs>. { yyextra->code->codify(yytext); }
728<AlignAsEnd>"(" { yyextra->code->codify(yytext);
729 yyextra->bracketCount++;
730 }
731<AlignAsEnd>")" {
732 yyextra->code->codify(yytext);
733 if (--yyextra->bracketCount<=0)
734 {
735 BEGIN(ClassName);
736 }
737 }
738<AlignAsEnd>\n { yyextra->yyLineNr++;
740 }
741<AlignAsEnd>. { yyextra->code->codify(yytext); }
742<ClassName>{ID}("\\"{ID})* { // PHP namespace
743 yyextra->curClassName=
substitute(yytext,
"\\",
"::");
745 pushScope(yyscanner,yyextra->curClassName);
748 BEGIN( ClassVar );
749 }
750<ClassName>{ID}{B}*"("{ID}")" { // Obj-C category
753 pushScope(yyscanner,yyextra->curClassName);
756 BEGIN( ClassVar );
757 }
758<PackageName>{ID}("."{ID})* {
759 yyextra->curClassName=
substitute(yytext,
".",
"::");
760 DBG_CTX((stderr,
"found package: %s\n",
qPrint(yyextra->curClassName)));
763 }
764<ClassVar>"=" {
765 unput(*yytext);
766 BEGIN( Body );
767 }
768<ClassVar>("extends"|"implements") { // Java, Slice
772 yyextra->curClassBases.clear();
773 BEGIN( Bases );
774 }
775<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
776 DBG_CTX((stderr,
"***** C++/CLI modifier %s on yyextra->curClassName=%s\n",yytext,
qPrint(yyextra->curClassName)));
780 BEGIN( CppCliTypeModifierFollowup );
781 }
782<ClassVar>{ID} {
783 yyextra->type = yyextra->curClassName;
784 yyextra->name = yytext;
785 if (yyextra->insideBody)
786 {
787 addVariable(yyscanner,yyextra->type,yyextra->name);
788 }
790 }
791<ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*":"{B}* {
793 yyextra->curClassBases.clear();
794 BEGIN( Bases );
795 }
796<PackageName>[ \t]*";" |
797<Bases>^{Bopt}/"@"{ID} | // Objective-C interface
798<Bases,ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*"{"{B}* {
799 yyextra->theVarContext.pushScope();
800 if (!yyextra->skipCodify) yyextra->code->codify(yytext);
801 yyextra->skipCodify = false;
802 if (YY_START==ClassVar && yyextra->curClassName.isEmpty())
803 {
804 yyextra->curClassName = yyextra->name;
805 }
806 if (yyextra->searchingForBody)
807 {
808 yyextra->searchingForBody=
FALSE;
809 yyextra->insideBody=
TRUE;
810 }
811 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
812 if (!yyextra->curClassName.isEmpty())
813 {
814 DBG_CTX((stderr,
"** scope stack push CLASSBLOCK\n"));
816 pushScope(yyscanner,yyextra->curClassName);
817 DBG_CTX((stderr,
"***** yyextra->curClassName=%s\n",
qPrint(yyextra->curClassName)));
818 if (yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,yyextra->curClassName,true)==nullptr)
819 {
820 DBG_CTX((stderr,
"Adding new class %s\n",
qPrint(yyextra->curClassName)));
822
823 for (const auto &s : yyextra->curClassBases)
824 {
826 auto it = yyextra->codeClassMap.find(s);
827 if (it!=yyextra->codeClassMap.end())
828 {
830 }
831 if (bcd==
nullptr) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,
QCString(s),
true);
832 if (bcd && bcd->
name()!=yyextra->curClassName)
833 {
834 var.localDef()->insertBaseClass(bcd->
name());
835 }
836 }
837 yyextra->codeClassMap.emplace(yyextra->curClassName.str(),std::move(var));
838 }
839
840 }
841 else
842 {
843 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
845 }
846 yyextra->curClassName.clear();
847 yyextra->curClassBases.clear();
848 BEGIN( Body );
849 }
850<Bases>"virtual"|"public"|"protected"|"private"|"@public"|"@private"|"@protected" {
852 yyextra->code->codify(yytext);
854 }
855<Bases>{SEP}?({ID}{SEP})*{ID} {
856 DBG_CTX((stderr,
"%s:addBase(%s)\n",
qPrint(yyextra->curClassName),yytext));
857 yyextra->curClassBases.emplace_back(yytext);
859 }
860<Bases>"<" {
861 yyextra->code->codify(yytext);
862 if (!yyextra->insideObjC)
863 {
864 yyextra->sharpCount=1;
865 BEGIN ( SkipSharp );
866 }
867 else
868 {
869 yyextra->insideProtocolList=
TRUE;
870 }
871 }
872<Bases>">" {
873 yyextra->code->codify(yytext);
874 yyextra->insideProtocolList=
FALSE;
875 }
876<SkipSharp>"<" {
877 yyextra->code->codify(yytext);
878 ++yyextra->sharpCount;
879 }
880<SkipSharp>">" {
881 yyextra->code->codify(yytext);
882 if (--yyextra->sharpCount<=0)
883 BEGIN ( Bases );
884 }
885<SkipSharp>"\"" {
886 yyextra->code->codify(yytext);
887 yyextra->lastStringContext=YY_START;
888 BEGIN(SkipString);
889 }
890<SkipSharp>"\'" {
891 yyextra->code->codify(yytext);
892 yyextra->lastStringContext=YY_START;
893 BEGIN(SkipStringS);
894 }
895<Bases>"(" {
896 yyextra->code->codify(yytext);
897 yyextra->sharpCount=1;
898 BEGIN ( SkipSharp );
899 }
900<SkipSharp>"(" {
901 yyextra->code->codify(yytext);
902 ++yyextra->sharpCount;
903 }
904<SkipSharp>")" {
905 yyextra->code->codify(yytext);
906 if (--yyextra->sharpCount<=0)
907 BEGIN ( Bases );
908 }
909
910
911<Bases>"," {
912 yyextra->code->codify(yytext);
913 }
914
915
916<Body>{SCOPEPREFIX}?"operator"{B}*"()"{Bopt}/"(" {
919 yyextra->bracketCount=0;
920 yyextra->args.clear();
921 yyextra->name+=yytext;
922 BEGIN( FuncCall );
923 }
924<Body>{SCOPEPREFIX}?"operator"/"(" {
927 yyextra->bracketCount=0;
928 yyextra->args.clear();
929 yyextra->name+=yytext;
930 BEGIN( FuncCall );
931 }
932<Body>{SCOPEPREFIX}?"operator"[^a-z_A-Z0-9\(\n]+/"(" {
935 yyextra->bracketCount=0;
936 yyextra->args.clear();
937 yyextra->name+=yytext;
938 BEGIN( FuncCall );
939 }
940<Body,TemplDecl>("template"|"generic")/([^a-zA-Z0-9]) {
944 yyextra->insideTemplate=
TRUE;
945 yyextra->sharpCount=0;
946 }
947<Body>"concept"{BN}+ {
951 BEGIN(ConceptName);
952 }
953<Body>"using"{BN}+"namespace"{BN}+ {
957 BEGIN(UsingName);
958 }
959<Body>"using"{BN}+ {
963 BEGIN(UsingName);
964 }
965<Body>"module"/{B}*[:;]? { // 'module X' or 'module : private' or 'module;'
967 if (!yyextra->type.isEmpty() || !yyextra->name.isEmpty()) REJECT;
971 BEGIN(ModuleName);
972 }
973<Body>"import"/{B}*[<":]? {
978 BEGIN(ModuleImport);
979 }
980<ConceptName>{ID}("::"{ID})* {
982 }
983<ConceptName>"=" { codifyLines(yyscanner,yytext); BEGIN(Body); }
984<UsingName>{ID}(("::"|"."){ID})* {
987 BEGIN(Body);
988 }
static void addUsingDirective(yyscan_t yyscanner, const QCString &name)
989<UsingName>\n { codifyLines(yyscanner,yytext); BEGIN(Body); }
990<UsingName>. { codifyLines(yyscanner,yytext); BEGIN(Body); }
991<Body,FuncCall>"$"?"this"("->"|".") { yyextra->code->codify(yytext); // this-> for C++, this. for C#
992 yyextra->isPrefixedWithThis =
TRUE;
993 }
994<Body>{KEYWORD}/([^a-z_A-Z0-9]) {
1000 if (text==
"typedef" || text.
find(
"enum ")!=-1)
1001 {
1003 yyextra->name+=yytext;
1004 }
1006 }
static bool skipLanguageSpecificKeyword(yyscan_t yyscanner, const char *kw)
int qstrcmp(const char *str1, const char *str2)
1007<Body>{KEYWORD}/{B}* {
1012 }
1013<Body>{KEYWORD}/{BN}*"(" {
1018 yyextra->name.clear();yyextra->type.clear();
1019 }
1020<FuncCall>"in"/{BN}* {
1021 if (!yyextra->inForEachExpression) REJECT;
1025
1026 yyextra->theVarContext.popScope();
1027 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1028 yyextra->theVarContext.pushScope();
1029 yyextra->name.clear();yyextra->type.clear();
1030 }
1031<Body>{FLOWKW}/{BN}*"(" {
1035 yyextra->name.clear();yyextra->type.clear();
1036 yyextra->inForEachExpression = (
qstrcmp(yytext,
"for each")==0 ||
qstrcmp(yytext,
"foreach")==0);
1037 BEGIN(FuncCall);
1038 }
1039<Body>{FLOWCONDITION}/{BN}*"(" {
1044 yyextra->name.clear();yyextra->type.clear();
1045 yyextra->inForEachExpression = (strcmp(yytext,"for each")==0 || strcmp(yytext, "foreach")==0);
1046 BEGIN(FuncCall);
1047 }
static void incrementFlowKeyWordCount(yyscan_t yyscanner)
1048<Body>{FLOWKW}/([^a-z_A-Z0-9]) {
1052 if (yyextra->inFunctionTryBlock && (
qstrcmp(yytext,
"catch")==0 ||
qstrcmp(yytext,
"finally")==0))
1053 {
1054 yyextra->inFunctionTryBlock=
FALSE;
1055 }
1056 }
1057<Body>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
1062 if (yyextra->inFunctionTryBlock && (strcmp(yytext,"catch")==0 || strcmp(yytext,"finally")==0))
1063 {
1064 yyextra->inFunctionTryBlock=
FALSE;
1065 }
1066 }
1067<Body>{FLOWKW}/{B}* {
1071 }
1072<Body>{FLOWCONDITION}/{B}* {
1077 }
1078<Body>"*"{B}*")" { // end of cast?
1079 yyextra->code->codify(yytext);
1080 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1081 yyextra->bracketCount--;
1082 yyextra->parmType = yyextra->name;
1083 BEGIN(FuncCall);
1084 }
1085<Body>"\\)"|"\\(" {
1086 yyextra->code->codify(yytext);
1087 }
1088<Body>[\\|\)\+\-\/\%\~\!] {
1089 yyextra->code->codify(yytext);
1090 yyextra->name.clear();yyextra->type.clear();
1091 if (*yytext==')')
1092 {
1093 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1094 yyextra->bracketCount--;
1095 if (yyextra->bracketCount<=0)
1096 {
1097 BEGIN(FuncCall);
1098 }
1099 }
1100 }
1101<Body,TemplDecl,ObjCMethod>{TYPEKW}/{B}* {
1103 yyextra->code->codify(yytext);
1106 yyextra->name+=yytext;
1107 }
1108<Body,TemplDecl,ObjCMethod>{TYPEKWSL}/{B}* {
1110 {
1111 REJECT;
1112 }
1113 else
1114 {
1116 yyextra->code->codify(yytext);
1119 yyextra->name+=yytext;
1120 }
1121 }
1122<Body>"generic"/{B}*"<"[^\n\/\-\.\{\">]*">"{B}* {
1124 yyextra->code->codify(yytext);
1126 yyextra->sharpCount=0;
1127 BEGIN(TemplDecl);
1128 }
1129<Body>"template"/{B}*"<"[^\n\/\-\.\{\">]*">"{B}* { // template<...>
1131 yyextra->code->codify(yytext);
1133 yyextra->sharpCount=0;
1134 BEGIN(TemplDecl);
1135 }
1136<TemplDecl>"class"|"typename" {
1140 }
1141<TemplDecl>"<" {
1142 yyextra->code->codify(yytext);
1143 yyextra->sharpCount++;
1144 }
1145<TemplDecl>">" {
1146 yyextra->code->codify(yytext);
1147 yyextra->sharpCount--;
1148 if (yyextra->sharpCount<=0)
1149 {
1150 BEGIN(Body);
1151 }
1152 }
1153<TemplCast>">" {
1157 BEGIN( yyextra->lastTemplCastContext );
1158 }
1159<TemplCast>{ID}("::"{ID})* {
1161 }
1162<TemplCast>("const"|"volatile"){B}* {
1166 }
1167<TemplCast>[*^]* {
1169 }
1170<Body,MemberCall2,FuncCall>{CASTKW}{B}*"<" { // static_cast<T>(
1174 yyextra->lastTemplCastContext = YY_START;
1175 BEGIN(TemplCast);
1176 }
1177<Body>"$this->"{SCOPENAME}/{BN}*[;,)\]] { // PHP member variable
1180 yyextra->name+=yytext+7;
1181 }
static void generatePHPVariableLink(yyscan_t yyscanner, OutputCodeList &ol, const char *varName)
1182<Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\">\(']*">"{ENDIDopt}/{B}* { // A<T> *pt;
1184 {
1185 REJECT;
1186 }
1189 yyextra->name+=yytext;
1190 }
static bool isCastKeyword(const char *s)
1191<ModuleName,ModuleImport>{MODULE_ID}({BN}*":"{BN}*{MODULE_ID})? {
1193 int i = name.
find(
':');
1195 if (i!=-1)
1196 {
1199 }
1201 if (mod)
1202 {
1204 }
1205 else
1206 {
1208 }
1209 }
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
1210<ModuleName>":"{BN}+"private" {
1212 int i=text.
find(
'p');
1217 }
1218<ModuleName>";" { yyextra->code->codify(yytext); BEGIN(Body); }
1219<ModuleName>. { yyextra->code->codify(yytext); }
1220<ModuleName>\n { codifyLines(yyscanner,yytext); }
1221<ModuleImport>["<] { yyextra->code->codify(yytext); BEGIN(ReadInclude); }
1222<ModuleImport>";" { yyextra->code->codify(yytext); BEGIN(Body); }
1223<ModuleImport>. { yyextra->code->codify(yytext); }
1224<ModuleImport>\n { codifyLines(yyscanner,yytext); }
1225
1226<Body>{SCOPENAME}/{BN}*[:;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
1230 yyextra->name+=yytext;
1231 }
static bool startsWithKeyword(const QCString &str, const QCString &kw)
1232<Body>{ID}("."{ID})+/{BN}+ { // CSharp/Java scope
1234 {
1237 yyextra->name+=yytext;
1238 }
1239 else
1240 {
1241 REJECT;
1242 }
1243 }
1244<Body>"export"/{B}* {
1249 }
1250<Body>{SCOPENAME}/{B}* { // p->func()
1254 yyextra->name+=yytext;
1255 }
1256<Body>"("{B}*("*"{B}*)+{SCOPENAME}+{B}*")"/{B}* { // (*p)->func() but not "if (p) ..."
1257 yyextra->code->codify(yytext);
1258 uint32_t s=0;
while (s<(uint32_t)yyleng && !
isId(yytext[s])) s++;
1259 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1262 yyextra->name=std::move(varname);
1263 }
1264<Body>{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\">]*">"/{BN}*"(" |
1265<Body>{SCOPETNAME}/{BN}*"(" { // a() or c::a() or t<A,B>::a() or A\B\foo()
1267 {
1268 REJECT;
1269 }
1272 yyextra->bracketCount=0;
1273 yyextra->args.clear();
1274 yyextra->name+=yytext;
1275 BEGIN( FuncCall );
1276 }
1277<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{RAWBEGIN} {
1279 uint32_t i=(uint32_t)text.
find(
'R');
1280 yyextra->code->codify(text.
left(i+1));
1282 yyextra->code->codify(
QCString(yytext+i+1));
1283 yyextra->lastStringContext=YY_START;
1284 yyextra->inForEachExpression =
FALSE;
1285 yyextra->delimiter = yytext+i+2;
1286 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
1287 BEGIN( RawString );
1288 }
1289<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit,ClassVar,OldStyleArgs>\" {
1291 yyextra->code->codify(yytext);
1292 yyextra->lastStringContext=YY_START;
1293 yyextra->inForEachExpression =
FALSE;
1294 BEGIN( SkipString );
1295 }
1296<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{NUMBER} { //Note similar code in commentcnv.l
1298 yyextra->code->codify(yytext);
1299 }
1300<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\' {
1302 yyextra->code->codify(yytext);
1303 yyextra->lastStringContext=YY_START;
1304 yyextra->inForEachExpression =
FALSE;
1305 BEGIN( SkipStringS );
1306 }
1307<SkipString>[^\"\\\r\n]* {
1308 yyextra->code->codify(yytext);
1309 }
1310<SkipStringS>[^\'\\\r\n]* {
1311 yyextra->code->codify(yytext);
1312 }
1313<SkipString,SkipStringS>{CPPC}|{CCS} {
1314 yyextra->code->codify(yytext);
1315 }
1316<SkipString>@?\" {
1317 yyextra->code->codify(yytext);
1318 if (yyextra->lastStringContext!=SkipCPP)
1319 {
1321 }
1322 BEGIN( yyextra->lastStringContext );
1323 }
1324<SkipStringS>\' {
1325 yyextra->code->codify(yytext);
1327 BEGIN( yyextra->lastStringContext );
1328 }
1329<SkipString,SkipStringS>\\. {
1330 yyextra->code->codify(yytext);
1331 }
1332<RawString>{RAWEND} {
1333 yyextra->code->codify(yytext);
1335 delimiter=delimiter.left(delimiter.length()-1);
1336 if (delimiter==yyextra->delimiter)
1337 {
1338 BEGIN( yyextra->lastStringContext );
1339 }
1340 }
1341<RawString>[^)\n]+ { yyextra->code->codify(yytext); }
1342<RawString>. { yyextra->code->codify(yytext); }
1343<RawString>\n { codifyLines(yyscanner,yytext); }
1344<SkipVerbString>[^"\n]+ {
1345 yyextra->code->codify(yytext);
1346 }
1347<SkipVerbString>\"\" { // escaped quote
1348 yyextra->code->codify(yytext);
1349 }
1350<SkipVerbString>\" { // end of string
1351 yyextra->code->codify(yytext);
1353 BEGIN( yyextra->lastVerbStringContext );
1354 }
1355<SkipVerbString>. {
1356 yyextra->code->codify(yytext);
1357 }
1358<SkipVerbString>\n {
1360 }
1361<Body>":" {
1362 yyextra->code->codify(yytext);
1363 yyextra->name.clear();yyextra->type.clear();
1364 }
1365<Body>"<" {
1366 if (yyextra->insideTemplate)
1367 {
1368 yyextra->sharpCount++;
1369 }
1370 yyextra->code->codify(yytext);
1371 }
1372<Body>">" {
1373 if (yyextra->insideTemplate)
1374 {
1375 if (--yyextra->sharpCount<=0)
1376 {
1377 yyextra->insideTemplate=
FALSE;
1378 }
1379 }
1380 yyextra->code->codify(yytext);
1381 }
1382<Body,MemberCall,MemberCall2,FuncCall,OldStyleArgs>"'"((\\0[Xx0-9]+)|(\\.)|(.))"'" {
1384 yyextra->code->codify(yytext);
1386 }
1387<Body>"."|"->" {
1388 if (yytext[0]=='-')
1389 {
1391 }
1392 yyextra->code->codify(yytext);
1393 yyextra->memCallContext = YY_START;
1394 BEGIN( MemberCall );
1395 }
static void updateCallContextForSmartPointer(yyscan_t yyscanner)
1396<MemberCall>{SCOPETNAME}/{BN}*"(" {
1397 if (yyextra->theCallContext.getScope().globalDef())
1398 {
1400 {
1403 }
1404 yyextra->name.clear();
1405 }
1406 else
1407 {
1410 yyextra->name.clear();
1411 }
1412 yyextra->type.clear();
1413 if (yyextra->memCallContext==Body)
1414 {
1415 BEGIN(FuncCall);
1416 }
1417 else
1418 {
1419 BEGIN(yyextra->memCallContext);
1420 }
1421 }
1422<MemberCall>{SCOPENAME}/{B}* {
1423 if (yyextra->theCallContext.getScope().globalDef())
1424 {
1425 DBG_CTX((stderr,
"yyextra->theCallContext.getClass()=%p\n",(
void*)yyextra->theCallContext.getScope().globalDef()));
1427 {
1430 }
1431 yyextra->name.clear();
1432 }
1433 else
1434 {
1435 DBG_CTX((stderr,
"no class context!\n"));
1438 yyextra->name.clear();
1439 }
1440 yyextra->type.clear();
1441 BEGIN(yyextra->memCallContext);
1442 }
1443<Body>[,=;\[] {
1444 if (yyextra->insideObjC && *yytext=='[')
1445 {
1446 DBG_CTX((stderr,
"Found start of ObjC call!\n"));
1447
1448 yyextra->contextMap.clear();
1449 yyextra->nameMap.clear();
1450 yyextra->objectMap.clear();
1451 yyextra->wordMap.clear();
1452 yyextra->commentMap.clear();
1453 yyextra->currentCtxId = 0;
1454 yyextra->currentNameId = 0;
1455 yyextra->currentObjId = 0;
1456 yyextra->currentCtx = nullptr;
1457 yyextra->braceCount = 0;
1458 unput('[');
1459 BEGIN(ObjCCall);
1460 }
1461 else
1462 {
1463 yyextra->code->codify(yytext);
1464 yyextra->saveName = yyextra->name;
1465 yyextra->saveType = yyextra->type;
1466 if (*yytext!='[' && !yyextra->type.isEmpty())
1467 {
1468
1469
1470 {
1471
1472
1473 addVariable(yyscanner,yyextra->type,yyextra->name);
1474 }
1475 yyextra->name.clear();
1476 }
1477 if (*yytext==';' || *yytext=='=')
1478 {
1479 yyextra->type.clear();
1480 yyextra->name.clear();
1481 }
1482 else if (*yytext=='[')
1483 {
1484 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1485 }
1486 yyextra->args.clear();
1487 yyextra->parmType.clear();
1488 yyextra->parmName.clear();
1489 }
1490 }
1491<ObjCCall,ObjCMName>"["|"{" {
1493 yyextra->currentCtx->format+=*yytext;
1494 BEGIN(ObjCCall);
1496 }
static void saveObjCContext(yyscan_t yyscanner)
1497<ObjCCall,ObjCMName>"]"|"}" {
1498 yyextra->currentCtx->format+=*yytext;
1500 BEGIN(ObjCMName);
1501 if (yyextra->currentCtx==nullptr)
1502 {
1503
1505 auto it = yyextra->contextMap.find(0);
1506 if (it!=yyextra->contextMap.end())
1507 {
1508 ctx = it->second.get();
1509 }
1511 BEGIN(Body);
1512 }
1514 }
static void restoreObjCContext(yyscan_t yyscanner)
1515<ObjCCall,ObjCMName>{CPPC}.* {
1516 yyextra->currentCtx->format+=
escapeComment(yyscanner,yytext);
1517 }
static QCString escapeComment(yyscan_t yyscanner, const char *s)
1518<ObjCCall,ObjCMName>{CCS} {
1519 yyextra->lastObjCCallContext = YY_START;
1520 yyextra->currentCtx->comment.str(yytext);
1521 BEGIN(ObjCCallComment);
1522 }
1523<ObjCCallComment>{CCE} {
1524 yyextra->currentCtx->comment << yytext;
1525 std::string commentStr = yyextra->currentCtx->comment.str();
1526 yyextra->currentCtx->format+=
escapeComment(yyscanner,commentStr.c_str());
1527 BEGIN(yyextra->lastObjCCallContext);
1528 }
1529<ObjCCallComment>[^*\n]+ { yyextra->currentCtx->comment << yytext; }
1530<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment << yytext; }
1531<ObjCCallComment>\n { yyextra->currentCtx->comment << *yytext; }
1532<ObjCCallComment>. { yyextra->currentCtx->comment << *yytext; }
1533<ObjCCall>{ID}({B}*"."{B}*{ID})* {
1535 if (yyextra->braceCount==0)
1536 {
1537 yyextra->currentCtx->objectTypeOrName=yytext;
1538 DBG_CTX((stderr,
"new type=%s\n",
qPrint(yyextra->currentCtx->objectTypeOrName)));
1539 BEGIN(ObjCMName);
1540 }
1541 }
static QCString escapeObject(yyscan_t yyscanner, const char *s)
1542<ObjCMName>{ID}/{BN}*"]" {
1543 if (yyextra->braceCount==0 &&
1544 yyextra->currentCtx->methodName.isEmpty())
1545 {
1546 yyextra->currentCtx->methodName=yytext;
1547 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1548 }
1549 else
1550 {
1551 yyextra->currentCtx->format+=
escapeWord(yyscanner,yytext);
1552 }
1553 }
static QCString escapeName(yyscan_t yyscanner, const char *s)
static QCString escapeWord(yyscan_t yyscanner, const char *s)
1554<ObjCMName>{ID}/{BN}*":" {
1555 if (yyextra->braceCount==0)
1556 {
1557 yyextra->currentCtx->methodName+=yytext;
1558 yyextra->currentCtx->methodName+=":";
1559 }
1560 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1561 }
1562<ObjCSkipStr>[^\n\"$\\]* { yyextra->currentCtx->format+=yytext; }
1563<ObjCSkipStr>\\. { yyextra->currentCtx->format+=yytext; }
1564<ObjCSkipStr>"\"" { yyextra->currentCtx->format+=yytext;
1565 BEGIN(yyextra->lastStringContext);
1566 }
1567<ObjCCall,ObjCMName>{CHARLIT} { yyextra->currentCtx->format+=yytext; }
1568<ObjCCall,ObjCMName>"@"?"\"" { yyextra->currentCtx->format+=yytext;
1569 yyextra->lastStringContext=YY_START;
1570 BEGIN(ObjCSkipStr);
1571 }
1572<ObjCCall,ObjCMName,ObjCSkipStr>"$" { yyextra->currentCtx->format+="$$"; }
1573<ObjCCall,ObjCMName>"(" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount++; }
1574<ObjCCall,ObjCMName>")" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount--; }
1575<ObjCSkipStr>"@"/"\"" { // needed to prevent matching the global rule (for C#)
1576 yyextra->currentCtx->format+=yytext;
1577 }
1578<ObjCCall,ObjCMName,ObjCSkipStr>{ID} { yyextra->currentCtx->format+=escapeWord(yyscanner,yytext); }
1579<ObjCCall,ObjCMName,ObjCSkipStr>. { yyextra->currentCtx->format+=*yytext; }
1580<ObjCCall,ObjCMName,ObjCSkipStr>\n { yyextra->currentCtx->format+=*yytext; }
1581
1582<Body>"]" {
1583 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1584 yyextra->code->codify(yytext);
1585
1586 yyextra->name = yyextra->saveName;
1587 yyextra->type = yyextra->saveType;
1588 }
1589<Body>[0-9]+ {
1590 yyextra->code->codify(yytext);
1591 }
1592<Body>[0-9]+[xX][0-9A-Fa-f]+ {
1593 yyextra->code->codify(yytext);
1594 }
1595<MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
1596
1597
1600 yyextra->code->codify(yytext);
1602 }
1603<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKW}/([^a-z_A-Z0-9]) {
1605 yyextra->parmName=yytext;
1607 yyextra->code->codify(yytext);
1609 }
static void addParmType(yyscan_t yyscanner)
1610<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKWSL}/([^a-z_A-Z0-9]) {
1612 {
1613 REJECT;
1614 }
1615 else
1616 {
1618 yyextra->parmName=yytext;
1620 yyextra->code->codify(yytext);
1622 }
1623 }
1624<MemberCall2,FuncCall>{FLOWKW}/([^a-z_A-Z0-9]) {
1626 yyextra->parmName=yytext;
1628 yyextra->code->codify(yytext);
1630 }
1631<MemberCall2,FuncCall>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
1634 yyextra->parmName=yytext;
1636 yyextra->code->codify(yytext);
1638 }
1639<MemberCall2,FuncCall>("::")?{ID}(({B}*"<"[^\n\[\](){}<>']*">")?({B}*"::"{B}*{ID})?)* {
1641 {
1642 REJECT;
1643 }
1645 yyextra->parmName=yytext;
1647 }
1648<FuncCall>";" { // probably a cast, not a function call
1649 yyextra->code->codify(yytext);
1650 yyextra->inForEachExpression =
FALSE;
1651 BEGIN( Body );
1652 }
1653<MemberCall2,FuncCall>, {
1654 yyextra->code->codify(yytext);
1655 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1656 yyextra->parmType.clear();yyextra->parmName.clear();
1657 }
1658<MemberCall2,FuncCall>"{" {
1659 if (yyextra->bracketCount>0)
1660 {
1661 yyextra->code->codify(yytext);
1662 yyextra->skipInlineInitContext=YY_START;
1663 yyextra->curlyCount=0;
1664 BEGIN(InlineInit);
1665 }
1666 else
1667 {
1668 REJECT;
1669 }
1670 }
1671<InlineInit>"{" { yyextra->curlyCount++;
1672 yyextra->code->codify(yytext);
1673 }
1674<InlineInit>"}" {
1675 yyextra->code->codify(yytext);
1676 if (--yyextra->curlyCount<=0)
1677 {
1678 BEGIN(yyextra->skipInlineInitContext);
1679 }
1680 }
1681<InlineInit>\n {
1683 }
1684<InlineInit>. {
1685 yyextra->code->codify(yytext);
1686 }
1687<MemberCall2,FuncCall>"(" {
1688 yyextra->parmType.clear();yyextra->parmName.clear();
1689 yyextra->code->codify(yytext);
1690 yyextra->bracketCount++;
1691 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1692 if (YY_START==FuncCall && !yyextra->insideBody)
1693 {
1694 yyextra->theVarContext.pushScope();
1695 }
1696 }
1697<MemberCall2,FuncCall>{OPERATOR} { // operator
1702 {
1703
1704 yyextra->parmType.clear();yyextra->parmName.clear();
1705 }
1706 yyextra->code->codify(yytext);
1707 }
1708<MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" {
1709 if (yytext[0]==')')
1710 {
1711 DBG_CTX((stderr,
"addVariable(%s,%s)\n",
qPrint(yyextra->parmType),
qPrint(yyextra->parmName)));
1712 if (yyextra->parmType.isEmpty())
1713 {
1714 yyextra->parmType=yyextra->parmName;
1715 yyextra->parmName.clear();
1716 }
1717 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1718 }
1719 else
1720 {
1721 yyextra->parmType = yyextra->parmName;
1722 yyextra->parmName.clear();
1723 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1724 }
1725 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1726 yyextra->inForEachExpression =
FALSE;
1727
1728 yyextra->code->codify(yytext);
1729 if (--yyextra->bracketCount<=0)
1730 {
1731 if (yyextra->name.isEmpty())
1732 {
1733 BEGIN( Body );
1734 }
1735 else
1736 {
1737 BEGIN( CallEnd );
1738 }
1739 }
1740 }
1741<MemberCall,MemberCall2,FuncCall>[;:] { // recover from unexpected end of call
1742
1743 if (yyextra->bracketCount<=0)
1744 {
1745 unput(*yytext);
1746 BEGIN(CallEnd);
1747 }
1748 else
1749 {
1750 yyextra->code->codify(yytext);
1751 }
1752 }
1753<CallEnd>[ \t\n]* { codifyLines(yyscanner,yytext); }
1754<CallEnd>[;:] {
1756 yyextra->bracketCount=0;
1757 if (*yytext==
';') yyextra->searchingForBody=
FALSE;
1758 if (!yyextra->type.isEmpty())
1759 {
1760 DBG_CTX((stderr,
"add variable yyextra->type=%s yyextra->name=%s)\n",
qPrint(yyextra->type),
qPrint(yyextra->name)));
1761 addVariable(yyscanner,yyextra->type,yyextra->name);
1762 }
1763 yyextra->parmType.clear();yyextra->parmName.clear();
1765 if (*yytext==';' || yyextra->insideBody)
1766 {
1767 if (!yyextra->insideBody)
1768 {
1769 yyextra->theVarContext.popScope();
1770 }
1771 yyextra->name.clear();yyextra->type.clear();
1772 BEGIN( Body );
1773 }
1774 else
1775 {
1776 yyextra->bracketCount=0;
1777 BEGIN( SkipInits );
1778 }
1779 }
1780<CallEnd>{ENDQopt}/{BN}*(";"|"="|"throw"{BN}*"(") {
1784 }
1785<CallEnd,OldStyleArgs>("const"|"volatile"|"sealed"|"override")*({BN}+("const"|"volatile"|"sealed"|"override"))*{BN}*"{" {
1786 if (yyextra->insideBody)
1787 {
1788 yyextra->theVarContext.pushScope();
1789 }
1790 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1791
1792 yyextra->parmType.clear();yyextra->parmName.clear();
1793 int index = yyextra->name.findRev("::");
1794 DBG_CTX((stderr,
"yyextra->name=%s\n",
qPrint(yyextra->name)));
1795 if (index!=-1)
1796 {
1798 if (!yyextra->scopeName.isEmpty()) scope.
prepend((yyextra->scopeName+
"::"));
1800 if (cd)
1801 {
1804 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1805 }
1806 else
1807 {
1808
1810 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1811 }
1812 }
1813 else
1814 {
1815 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1817 }
1818 yytext[yyleng-1]='\0';
1820 if (!cv.stripWhiteSpace().isEmpty())
1821 {
1825 }
1826 else
1827 {
1829 }
1830 yyextra->code->codify("{");
1831 if (yyextra->searchingForBody)
1832 {
1833 yyextra->searchingForBody=
FALSE;
1834 yyextra->insideBody=
TRUE;
1835 }
1836 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1837 yyextra->type.clear(); yyextra->name.clear();
1838 BEGIN( Body );
1839 }
static void setClassScope(yyscan_t yyscanner, const QCString &name)
1840<CallEnd>"try" { // function-try-block
1842 yyextra->code->codify(yytext);
1844 yyextra->inFunctionTryBlock=
TRUE;
1845 }
1846<CallEnd>"requires" { // function-try-block
1848 yyextra->code->codify(yytext);
1850 }
1851<CallEnd>{ID} {
1852 if (yyextra->insideBody || !yyextra->parmType.isEmpty())
1853 {
1854 REJECT;
1855 }
1856
1858 yyextra->parmName=yytext;
1860 BEGIN(OldStyleArgs);
1861 }
1862<OldStyleArgs>{ID} {
1864 yyextra->parmName=yytext;
1866 }
1867<OldStyleArgs>[,;] {
1868 yyextra->code->codify(yytext);
1869 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1870 if (*yytext==';') yyextra->parmType.clear();
1871 yyextra->parmName.clear();
1872 }
1873<CallEnd,OldStyleArgs>"#" {
1875 yyextra->lastSkipCppContext = Body;
1876 yyextra->code->codify(yytext);
1877 BEGIN( SkipCPP );
1878 }
1879<CallEnd>. {
1880 unput(*yytext);
1881 if (!yyextra->insideBody)
1882 {
1883 yyextra->theVarContext.popScope();
1884 }
1885 yyextra->name.clear();yyextra->args.clear();
1886 yyextra->parmType.clear();yyextra->parmName.clear();
1887 BEGIN( Body );
1888 }
1889<SkipInits>";" {
1890 yyextra->code->codify(yytext);
1891 yyextra->type.clear(); yyextra->name.clear();
1892 BEGIN( Body );
1893 }
1894<SkipInits>"{" {
1895 yyextra->code->codify(yytext);
1896 if (yyextra->searchingForBody)
1897 {
1898 yyextra->searchingForBody=
FALSE;
1899 yyextra->insideBody=
TRUE;
1900 }
1901 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1902 if (yyextra->name.find("::")!=-1)
1903 {
1904 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1907 }
1908 else
1909 {
1910 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1912 }
1913 yyextra->type.clear(); yyextra->name.clear();
1914 BEGIN( Body );
1915 }
1916<SkipInits>{ID}{B}*"{" {
1918 int bracketPos = text.
find(
'{');
1919 int spacePos = text.
find(
' ');
1920 int len = spacePos==-1 ? bracketPos : spacePos;
1922 yyextra->code->codify(
QCString(yytext+len));
1923 }
1924<SkipInits>{ID} {
1926 }
1927<FuncCall>{ID}/"(" {
1929 }
1930<FuncCall>{ID}/("."|"->") {
1931 yyextra->name=yytext;
1933 BEGIN( MemberCall2 );
1934 }
1935<FuncCall,MemberCall2>("("{B}*("*"{B}*)+{ID}+{B}*")"{B}*)/("."|"->") {
1936 yyextra->code->codify(yytext);
1937 uint32_t s=0;
while (!
isId(yytext[s])) s++;
1938 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1939 yyextra->name=((
QCString)yytext).mid(s,e-s+1);
1940 BEGIN( MemberCall2 );
1941 }
1942<MemberCall2>{ID}/([ \t\n]*"(") {
1943 if (!yyextra->args.isEmpty())
1945 else
1947 yyextra->args.clear();
1948 BEGIN( FuncCall );
1949 }
static void generateMemberLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &varName, const QCString &memName)
1950<MemberCall2>{ID}/([ \t\n]*("."|"->")) {
1951
1952 yyextra->name=yytext;
1954 BEGIN( MemberCall2 );
1955 }
1956<MemberCall2>"->"|"." {
1957 if (yytext[0]=='-')
1958 {
1960 }
1961 yyextra->code->codify(yytext);
1962 yyextra->memCallContext = YY_START;
1963 BEGIN( MemberCall );
1964 }
1965<SkipComment>{CCS}("!"?){CCE} {
1966 yyextra->code->codify(yytext);
1968 BEGIN( yyextra->lastCContext ) ;
1969 }
1970<SkipComment>{CPPC}|{CCS} {
1971 yyextra->code->codify(yytext);
1972 }
1973<SkipComment>[^*\/\n]+ {
1974 yyextra->code->codify(yytext);
1975 }
1976<SkipComment>[ \t]*{CCE} {
1977 yyextra->code->codify(yytext);
1979 if (yyextra->lastCContext==SkipCPP)
1980 {
1982 }
1983 BEGIN( yyextra->lastCContext ) ;
1984 }
1985<SkipCxxComment>[^\r\n]*"\\"[\r]?\n { // line continuation
1987 }
1988<SkipCxxComment>[^\r\n]+ {
1989 yyextra->code->codify(yytext);
1990 }
1991<SkipCxxComment>\r
1992<SkipCxxComment>\n {
1993 unput('\n');
1995 BEGIN( yyextra->lastCContext ) ;
1996 }
1997<SkipCxxComment>. {
1998 yyextra->code->codify(yytext);
1999 }
2000<MemberCall>[^a-z_A-Z0-9(\n] {
2001 yyextra->code->codify(yytext);
2002 yyextra->type.clear();
2003 yyextra->name.clear();
2004 BEGIN(yyextra->memCallContext);
2005 }
2006<*>\n({B}*{CPPC}[!/][^\n]*\n)+ { // remove special one-line comment
2007 if (YY_START==SkipCPP) REJECT;
2012 if (YY_START==SkipCxxComment)
2013 {
2014 BEGIN( yyextra->lastCContext ) ;
2015 }
2016 }
2017<SkipCPP>\n/(.|\n) {
2019 BEGIN( yyextra->lastSkipCppContext ) ;
2020 unput('\n');
2021 }
2022<*>\n{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2027 if (YY_START==SkipCxxComment)
2028 {
2029 BEGIN( yyextra->lastCContext ) ;
2030 }
2031 }
2032<*>\n{B}*{CCS}"@"[{}] { // remove one-line group marker
2033
2034 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2035 {
2036 yyextra->lastCContext = YY_START ;
2037 }
2040 BEGIN(SkipComment);
2041 }
2042<*>^{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2047 }
2048<*>^{B}*{CCS}"@"[{}] { // remove multi-line group marker
2049
2050 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2051 {
2052 yyextra->lastCContext = YY_START ;
2053 }
2055 yyextra->code->codify(yytext);
2056 BEGIN(SkipComment);
2057 }
2058<*>^{B}*{CPPC}[!/][^\n]* { // remove special one-line comment
2062 }
2063<*>{CPPC}[!/][^\n]* { // strip special one-line comment
2064 if (YY_START==SkipComment || YY_START==SkipString) REJECT;
2068 }
2069<*>\n{B}*{CCS}[!*]/{NCOMM} {
2070
2071 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2072 {
2073 yyextra->lastCContext = YY_START ;
2074 }
2077 BEGIN(SkipComment);
2078 }
2079<*>^{B}*{CCS}"*"[*]+/[^/] {
2080
2081 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2082 {
2083 yyextra->lastCContext = YY_START ;
2084 }
2085
2087 yyextra->code->codify(yytext);
2088 BEGIN(SkipComment);
2089 }
2090<*>^{B}*{CCS}[!*]/{NCOMM} { // special C comment block at a new line
2091
2092 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2093 {
2094 yyextra->lastCContext = YY_START ;
2095 }
2097 yyextra->code->codify(yytext);
2098 BEGIN(SkipComment);
2099 }
2100<*>{CCS}[!*]/{NCOMM} { // special C comment block half way a line
2101 if (YY_START==SkipString) REJECT;
2102
2103 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2104 {
2105 yyextra->lastCContext = YY_START ;
2106 }
2108 yyextra->code->codify(yytext);
2109 BEGIN(SkipComment);
2110 }
2111<*>{CCS}("!"?){CCE} {
2112 if (YY_START==SkipString) REJECT;
2115 yyextra->code->codify(yytext);
2117 }
2118<SkipComment>[^\*\n]+ {
2119 yyextra->code->codify(yytext);
2120 }
2121<*>{CCS} {
2123 yyextra->code->codify(yytext);
2124
2125 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2126 {
2127 yyextra->lastCContext = YY_START ;
2128 }
2129 BEGIN( SkipComment ) ;
2130 }
2131<*>[$]?@\" { // C# (interpolated) verbatim string
2133 yyextra->code->codify(yytext);
2134 yyextra->lastVerbStringContext=YY_START;
2135 BEGIN(SkipVerbString);
2136 }
2137<*>{CPPC} {
2139 yyextra->code->codify(yytext);
2140 yyextra->lastCContext = YY_START ;
2141 BEGIN( SkipCxxComment ) ;
2142 }
2143<*>"("|"[" {
2144 if (yytext[0]=='(') yyextra->bracketCount++;
2145 yyextra->code->codify(yytext);
2146 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2147 }
2148<*>")"|"]" {
2149 if (yytext[0]==')') yyextra->bracketCount--;
2150 yyextra->code->codify(yytext);
2151 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2152 }
2153<*>\n {
2155 }
2156<*>[\x80-\xFF]* { // keep utf8 characters together...
2157 yyextra->code->codify(yytext);
2158 }
2159<*>. {
2160 yyextra->code->codify(yytext);
2161 }
2162
2163%%