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;
1228 {
1229 REJECT;
1230 }
1233 yyextra->name+=yytext;
1234 }
static bool startsWithKeyword(const QCString &str, const QCString &kw)
1235<Body>{ID}("."{ID})+/{BN}+ { // CSharp/Java scope
1237 {
1240 yyextra->name+=yytext;
1241 }
1242 else
1243 {
1244 REJECT;
1245 }
1246 }
1247<Body>"export"/{B}* {
1252 }
1253<Body>{SCOPENAME}/{B}* { // p->func()
1255 {
1256 REJECT;
1257 }
1260 yyextra->name+=yytext;
1261 }
1262<Body>"("{B}*("*"{B}*)+{SCOPENAME}+{B}*")"/{B}* { // (*p)->func() but not "if (p) ..."
1263 yyextra->code->codify(yytext);
1264 uint32_t s=0;
while (s<(uint32_t)yyleng && !
isId(yytext[s])) s++;
1265 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1268 yyextra->name=std::move(varname);
1269 }
1270<Body>{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\">]*">"/{BN}*"(" |
1271<Body>{SCOPETNAME}/{BN}*"(" { // a() or c::a() or t<A,B>::a() or A\B\foo()
1273 {
1274 REJECT;
1275 }
1278 yyextra->bracketCount=0;
1279 yyextra->args.clear();
1280 yyextra->name+=yytext;
1281 BEGIN( FuncCall );
1282 }
1283<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{RAWBEGIN} {
1285 uint32_t i=(uint32_t)text.
find(
'R');
1286 yyextra->code->codify(text.
left(i+1));
1288 yyextra->code->codify(
QCString(yytext+i+1));
1289 yyextra->lastStringContext=YY_START;
1290 yyextra->inForEachExpression =
FALSE;
1291 yyextra->delimiter = yytext+i+2;
1292 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
1293 BEGIN( RawString );
1294 }
1295<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit,ClassVar,OldStyleArgs>\" {
1297 yyextra->code->codify(yytext);
1298 yyextra->lastStringContext=YY_START;
1299 yyextra->inForEachExpression =
FALSE;
1300 BEGIN( SkipString );
1301 }
1302<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{NUMBER} { //Note similar code in commentcnv.l
1304 yyextra->code->codify(yytext);
1305 }
1306<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\' {
1308 yyextra->code->codify(yytext);
1309 yyextra->lastStringContext=YY_START;
1310 yyextra->inForEachExpression =
FALSE;
1311 BEGIN( SkipStringS );
1312 }
1313<SkipString>[^\"\\\r\n]* {
1314 yyextra->code->codify(yytext);
1315 }
1316<SkipStringS>[^\'\\\r\n]* {
1317 yyextra->code->codify(yytext);
1318 }
1319<SkipString,SkipStringS>{CPPC}|{CCS} {
1320 yyextra->code->codify(yytext);
1321 }
1322<SkipString>@?\" {
1323 yyextra->code->codify(yytext);
1324 if (yyextra->lastStringContext!=SkipCPP)
1325 {
1327 }
1328 BEGIN( yyextra->lastStringContext );
1329 }
1330<SkipStringS>\' {
1331 yyextra->code->codify(yytext);
1333 BEGIN( yyextra->lastStringContext );
1334 }
1335<SkipString,SkipStringS>\\. {
1336 yyextra->code->codify(yytext);
1337 }
1338<RawString>{RAWEND} {
1339 yyextra->code->codify(yytext);
1341 delimiter=delimiter.left(delimiter.length()-1);
1342 if (delimiter==yyextra->delimiter)
1343 {
1344 BEGIN( yyextra->lastStringContext );
1345 }
1346 }
1347<RawString>[^)\n]+ { yyextra->code->codify(yytext); }
1348<RawString>. { yyextra->code->codify(yytext); }
1349<RawString>\n { codifyLines(yyscanner,yytext); }
1350<SkipVerbString>[^"\n]+ {
1351 yyextra->code->codify(yytext);
1352 }
1353<SkipVerbString>\"\" { // escaped quote
1354 yyextra->code->codify(yytext);
1355 }
1356<SkipVerbString>\" { // end of string
1357 yyextra->code->codify(yytext);
1359 BEGIN( yyextra->lastVerbStringContext );
1360 }
1361<SkipVerbString>. {
1362 yyextra->code->codify(yytext);
1363 }
1364<SkipVerbString>\n {
1366 }
1367<Body>":" {
1368 yyextra->code->codify(yytext);
1369 yyextra->name.clear();yyextra->type.clear();
1370 }
1371<Body>"<" {
1372 if (yyextra->insideTemplate)
1373 {
1374 yyextra->sharpCount++;
1375 }
1376 yyextra->code->codify(yytext);
1377 }
1378<Body>">" {
1379 if (yyextra->insideTemplate)
1380 {
1381 if (--yyextra->sharpCount<=0)
1382 {
1383 yyextra->insideTemplate=
FALSE;
1384 }
1385 }
1386 yyextra->code->codify(yytext);
1387 }
1388<Body,MemberCall,MemberCall2,FuncCall,OldStyleArgs>"'"((\\0[Xx0-9]+)|(\\.)|(.))"'" {
1390 yyextra->code->codify(yytext);
1392 }
1393<Body>"."|"->" {
1394 if (yytext[0]=='-')
1395 {
1397 }
1398 yyextra->code->codify(yytext);
1399 yyextra->memCallContext = YY_START;
1400 BEGIN( MemberCall );
1401 }
static void updateCallContextForSmartPointer(yyscan_t yyscanner)
1402<MemberCall>{SCOPETNAME}/{BN}*"(" {
1403 if (yyextra->theCallContext.getScope().globalDef())
1404 {
1406 {
1409 }
1410 yyextra->name.clear();
1411 }
1412 else
1413 {
1416 yyextra->name.clear();
1417 }
1418 yyextra->type.clear();
1419 if (yyextra->memCallContext==Body)
1420 {
1421 BEGIN(FuncCall);
1422 }
1423 else
1424 {
1425 BEGIN(yyextra->memCallContext);
1426 }
1427 }
1428<MemberCall>{SCOPENAME}/{B}* {
1429 if (yyextra->theCallContext.getScope().globalDef())
1430 {
1431 DBG_CTX((stderr,
"yyextra->theCallContext.getClass()=%p\n",(
void*)yyextra->theCallContext.getScope().globalDef()));
1433 {
1436 }
1437 yyextra->name.clear();
1438 }
1439 else
1440 {
1441 DBG_CTX((stderr,
"no class context!\n"));
1444 yyextra->name.clear();
1445 }
1446 yyextra->type.clear();
1447 BEGIN(yyextra->memCallContext);
1448 }
1449<Body>[,=;\[] {
1450 if (yyextra->insideObjC && *yytext=='[')
1451 {
1452 DBG_CTX((stderr,
"Found start of ObjC call!\n"));
1453
1454 yyextra->contextMap.clear();
1455 yyextra->nameMap.clear();
1456 yyextra->objectMap.clear();
1457 yyextra->wordMap.clear();
1458 yyextra->commentMap.clear();
1459 yyextra->currentCtxId = 0;
1460 yyextra->currentNameId = 0;
1461 yyextra->currentObjId = 0;
1462 yyextra->currentCtx = nullptr;
1463 yyextra->braceCount = 0;
1464 unput('[');
1465 BEGIN(ObjCCall);
1466 }
1467 else
1468 {
1469 yyextra->code->codify(yytext);
1470 yyextra->saveName = yyextra->name;
1471 yyextra->saveType = yyextra->type;
1472 if (*yytext!='[' && !yyextra->type.isEmpty())
1473 {
1474
1475
1476 {
1477
1478
1479 addVariable(yyscanner,yyextra->type,yyextra->name);
1480 }
1481 yyextra->name.clear();
1482 }
1483 if (*yytext==';' || *yytext=='=')
1484 {
1485 yyextra->type.clear();
1486 yyextra->name.clear();
1487 }
1488 else if (*yytext=='[')
1489 {
1490 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1491 }
1492 yyextra->args.clear();
1493 yyextra->parmType.clear();
1494 yyextra->parmName.clear();
1495 }
1496 }
1497<ObjCCall,ObjCMName>"["|"{" {
1499 yyextra->currentCtx->format+=*yytext;
1500 BEGIN(ObjCCall);
1502 }
static void saveObjCContext(yyscan_t yyscanner)
1503<ObjCCall,ObjCMName>"]"|"}" {
1504 yyextra->currentCtx->format+=*yytext;
1506 BEGIN(ObjCMName);
1507 if (yyextra->currentCtx==nullptr)
1508 {
1509
1511 auto it = yyextra->contextMap.find(0);
1512 if (it!=yyextra->contextMap.end())
1513 {
1514 ctx = it->second.get();
1515 }
1517 BEGIN(Body);
1518 }
1520 }
static void restoreObjCContext(yyscan_t yyscanner)
1521<ObjCCall,ObjCMName>{CPPC}.* {
1522 yyextra->currentCtx->format+=
escapeComment(yyscanner,yytext);
1523 }
static QCString escapeComment(yyscan_t yyscanner, const char *s)
1524<ObjCCall,ObjCMName>{CCS} {
1525 yyextra->lastObjCCallContext = YY_START;
1526 yyextra->currentCtx->comment.str(yytext);
1527 BEGIN(ObjCCallComment);
1528 }
1529<ObjCCallComment>{CCE} {
1530 yyextra->currentCtx->comment << yytext;
1531 std::string commentStr = yyextra->currentCtx->comment.str();
1532 yyextra->currentCtx->format+=
escapeComment(yyscanner,commentStr.c_str());
1533 BEGIN(yyextra->lastObjCCallContext);
1534 }
1535<ObjCCallComment>[^*\n]+ { yyextra->currentCtx->comment << yytext; }
1536<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment << yytext; }
1537<ObjCCallComment>\n { yyextra->currentCtx->comment << *yytext; }
1538<ObjCCallComment>. { yyextra->currentCtx->comment << *yytext; }
1539<ObjCCall>{ID}({B}*"."{B}*{ID})* {
1541 if (yyextra->braceCount==0)
1542 {
1543 yyextra->currentCtx->objectTypeOrName=yytext;
1544 DBG_CTX((stderr,
"new type=%s\n",
qPrint(yyextra->currentCtx->objectTypeOrName)));
1545 BEGIN(ObjCMName);
1546 }
1547 }
static QCString escapeObject(yyscan_t yyscanner, const char *s)
1548<ObjCMName>{ID}/{BN}*"]" {
1549 if (yyextra->braceCount==0 &&
1550 yyextra->currentCtx->methodName.isEmpty())
1551 {
1552 yyextra->currentCtx->methodName=yytext;
1553 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1554 }
1555 else
1556 {
1557 yyextra->currentCtx->format+=
escapeWord(yyscanner,yytext);
1558 }
1559 }
static QCString escapeName(yyscan_t yyscanner, const char *s)
static QCString escapeWord(yyscan_t yyscanner, const char *s)
1560<ObjCMName>{ID}/{BN}*":" {
1561 if (yyextra->braceCount==0)
1562 {
1563 yyextra->currentCtx->methodName+=yytext;
1564 yyextra->currentCtx->methodName+=":";
1565 }
1566 yyextra->currentCtx->format+=
escapeName(yyscanner,yytext);
1567 }
1568<ObjCSkipStr>[^\n\"$\\]* { yyextra->currentCtx->format+=yytext; }
1569<ObjCSkipStr>\\. { yyextra->currentCtx->format+=yytext; }
1570<ObjCSkipStr>"\"" { yyextra->currentCtx->format+=yytext;
1571 BEGIN(yyextra->lastStringContext);
1572 }
1573<ObjCCall,ObjCMName>{CHARLIT} { yyextra->currentCtx->format+=yytext; }
1574<ObjCCall,ObjCMName>"@"?"\"" { yyextra->currentCtx->format+=yytext;
1575 yyextra->lastStringContext=YY_START;
1576 BEGIN(ObjCSkipStr);
1577 }
1578<ObjCCall,ObjCMName,ObjCSkipStr>"$" { yyextra->currentCtx->format+="$$"; }
1579<ObjCCall,ObjCMName>"(" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount++; }
1580<ObjCCall,ObjCMName>")" { yyextra->currentCtx->format+=*yytext; yyextra->braceCount--; }
1581<ObjCSkipStr>"@"/"\"" { // needed to prevent matching the global rule (for C#)
1582 yyextra->currentCtx->format+=yytext;
1583 }
1584<ObjCCall,ObjCMName,ObjCSkipStr>{ID} { yyextra->currentCtx->format+=escapeWord(yyscanner,yytext); }
1585<ObjCCall,ObjCMName,ObjCSkipStr>. { yyextra->currentCtx->format+=*yytext; }
1586<ObjCCall,ObjCMName,ObjCSkipStr>\n { yyextra->currentCtx->format+=*yytext; }
1587
1588<Body>"]" {
1589 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1590 yyextra->code->codify(yytext);
1591
1592 yyextra->name = yyextra->saveName;
1593 yyextra->type = yyextra->saveType;
1594 }
1595<Body>[0-9]+ {
1596 yyextra->code->codify(yytext);
1597 }
1598<Body>[0-9]+[xX][0-9A-Fa-f]+ {
1599 yyextra->code->codify(yytext);
1600 }
1601<MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
1602
1603
1606 yyextra->code->codify(yytext);
1608 }
1609<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKW}/([^a-z_A-Z0-9]) {
1611 yyextra->parmName=yytext;
1613 yyextra->code->codify(yytext);
1615 }
static void addParmType(yyscan_t yyscanner)
1616<MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKWSL}/([^a-z_A-Z0-9]) {
1618 {
1619 REJECT;
1620 }
1621 else
1622 {
1624 yyextra->parmName=yytext;
1626 yyextra->code->codify(yytext);
1628 }
1629 }
1630<MemberCall2,FuncCall>{FLOWKW}/([^a-z_A-Z0-9]) {
1632 yyextra->parmName=yytext;
1634 yyextra->code->codify(yytext);
1636 }
1637<MemberCall2,FuncCall>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
1640 yyextra->parmName=yytext;
1642 yyextra->code->codify(yytext);
1644 }
1645<MemberCall2,FuncCall>("::")?{ID}(({B}*"<"[^\n\[\](){}<>']*">")?({B}*"::"{B}*{ID})?)* {
1647 {
1648 REJECT;
1649 }
1651 yyextra->parmName=yytext;
1653 }
1654<FuncCall>";" { // probably a cast, not a function call
1655 yyextra->code->codify(yytext);
1656 yyextra->inForEachExpression =
FALSE;
1657 BEGIN( Body );
1658 }
1659<MemberCall2,FuncCall>, {
1660 yyextra->code->codify(yytext);
1661 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1662 yyextra->parmType.clear();yyextra->parmName.clear();
1663 }
1664<MemberCall2,FuncCall>"{" {
1665 if (yyextra->bracketCount>0)
1666 {
1667 yyextra->code->codify(yytext);
1668 yyextra->skipInlineInitContext=YY_START;
1669 yyextra->curlyCount=0;
1670 BEGIN(InlineInit);
1671 }
1672 else
1673 {
1674 REJECT;
1675 }
1676 }
1677<InlineInit>"{" { yyextra->curlyCount++;
1678 yyextra->code->codify(yytext);
1679 }
1680<InlineInit>"}" {
1681 yyextra->code->codify(yytext);
1682 if (--yyextra->curlyCount<=0)
1683 {
1684 BEGIN(yyextra->skipInlineInitContext);
1685 }
1686 }
1687<InlineInit>\n {
1689 }
1690<InlineInit>. {
1691 yyextra->code->codify(yytext);
1692 }
1693<MemberCall2,FuncCall>"(" {
1694 yyextra->parmType.clear();yyextra->parmName.clear();
1695 yyextra->code->codify(yytext);
1696 yyextra->bracketCount++;
1697 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1698 if (YY_START==FuncCall && !yyextra->insideBody)
1699 {
1700 yyextra->theVarContext.pushScope();
1701 }
1702 }
1703<MemberCall2,FuncCall>{OPERATOR} { // operator
1708 {
1709
1710 yyextra->parmType.clear();yyextra->parmName.clear();
1711 }
1712 yyextra->code->codify(yytext);
1713 }
1714<MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" {
1715 if (yytext[0]==')')
1716 {
1717 DBG_CTX((stderr,
"addVariable(%s,%s)\n",
qPrint(yyextra->parmType),
qPrint(yyextra->parmName)));
1718 if (yyextra->parmType.isEmpty())
1719 {
1720 yyextra->parmType=yyextra->parmName;
1721 yyextra->parmName.clear();
1722 }
1723 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1724 }
1725 else
1726 {
1727 yyextra->parmType = yyextra->parmName;
1728 yyextra->parmName.clear();
1729 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1730 }
1731 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
1732 yyextra->inForEachExpression =
FALSE;
1733
1734 yyextra->code->codify(yytext);
1735 if (--yyextra->bracketCount<=0)
1736 {
1737 if (yyextra->name.isEmpty())
1738 {
1739 BEGIN( Body );
1740 }
1741 else
1742 {
1743 BEGIN( CallEnd );
1744 }
1745 }
1746 }
1747<MemberCall,MemberCall2,FuncCall>[;:] { // recover from unexpected end of call
1748
1749 if (yyextra->bracketCount<=0)
1750 {
1751 unput(*yytext);
1752 BEGIN(CallEnd);
1753 }
1754 else
1755 {
1756 yyextra->code->codify(yytext);
1757 }
1758 }
1759<CallEnd>[ \t\n]* { codifyLines(yyscanner,yytext); }
1760<CallEnd>[;:] {
1762 yyextra->bracketCount=0;
1763 if (*yytext==
';') yyextra->searchingForBody=
FALSE;
1764 if (!yyextra->type.isEmpty())
1765 {
1766 DBG_CTX((stderr,
"add variable yyextra->type=%s yyextra->name=%s)\n",
qPrint(yyextra->type),
qPrint(yyextra->name)));
1767 addVariable(yyscanner,yyextra->type,yyextra->name);
1768 }
1769 yyextra->parmType.clear();yyextra->parmName.clear();
1771 if (*yytext==';' || yyextra->insideBody)
1772 {
1773 if (!yyextra->insideBody)
1774 {
1775 yyextra->theVarContext.popScope();
1776 }
1777 yyextra->name.clear();yyextra->type.clear();
1778 BEGIN( Body );
1779 }
1780 else
1781 {
1782 yyextra->bracketCount=0;
1783 BEGIN( SkipInits );
1784 }
1785 }
1786<CallEnd>{ENDQopt}/{BN}*(";"|"="|"throw"{BN}*"(") {
1790 }
1791<CallEnd,OldStyleArgs>("const"|"volatile"|"sealed"|"override")*({BN}+("const"|"volatile"|"sealed"|"override"))*{BN}*"{" {
1792 if (yyextra->insideBody)
1793 {
1794 yyextra->theVarContext.pushScope();
1795 }
1796 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1797
1798 yyextra->parmType.clear();yyextra->parmName.clear();
1799 int index = yyextra->name.findRev("::");
1800 DBG_CTX((stderr,
"yyextra->name=%s\n",
qPrint(yyextra->name)));
1801 if (index!=-1)
1802 {
1804 if (!yyextra->scopeName.isEmpty()) scope.
prepend((yyextra->scopeName+
"::"));
1806 if (cd)
1807 {
1810 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1811 }
1812 else
1813 {
1814
1816 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1817 }
1818 }
1819 else
1820 {
1821 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1823 }
1824 yytext[yyleng-1]='\0';
1826 if (!cv.stripWhiteSpace().isEmpty())
1827 {
1831 }
1832 else
1833 {
1835 }
1836 yyextra->code->codify("{");
1837 if (yyextra->searchingForBody)
1838 {
1839 yyextra->searchingForBody=
FALSE;
1840 yyextra->insideBody=
TRUE;
1841 }
1842 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1843 yyextra->type.clear(); yyextra->name.clear();
1844 BEGIN( Body );
1845 }
static void setClassScope(yyscan_t yyscanner, const QCString &name)
1846<CallEnd>"try" { // function-try-block
1848 yyextra->code->codify(yytext);
1850 yyextra->inFunctionTryBlock=
TRUE;
1851 }
1852<CallEnd>"requires" { // function-try-block
1854 yyextra->code->codify(yytext);
1856 }
1857<CallEnd>{ID} {
1858 if (yyextra->insideBody || !yyextra->parmType.isEmpty())
1859 {
1860 REJECT;
1861 }
1862
1864 yyextra->parmName=yytext;
1866 BEGIN(OldStyleArgs);
1867 }
1868<OldStyleArgs>{ID} {
1870 yyextra->parmName=yytext;
1872 }
1873<OldStyleArgs>[,;] {
1874 yyextra->code->codify(yytext);
1875 addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
1876 if (*yytext==';') yyextra->parmType.clear();
1877 yyextra->parmName.clear();
1878 }
1879<CallEnd,OldStyleArgs>"#" {
1881 yyextra->lastSkipCppContext = Body;
1882 yyextra->code->codify(yytext);
1883 BEGIN( SkipCPP );
1884 }
1885<CallEnd>. {
1886 unput(*yytext);
1887 if (!yyextra->insideBody)
1888 {
1889 yyextra->theVarContext.popScope();
1890 }
1891 yyextra->name.clear();yyextra->args.clear();
1892 yyextra->parmType.clear();yyextra->parmName.clear();
1893 BEGIN( Body );
1894 }
1895<SkipInits>";" {
1896 yyextra->code->codify(yytext);
1897 yyextra->type.clear(); yyextra->name.clear();
1898 BEGIN( Body );
1899 }
1900<SkipInits>"{" {
1901 yyextra->code->codify(yytext);
1902 if (yyextra->searchingForBody)
1903 {
1904 yyextra->searchingForBody=
FALSE;
1905 yyextra->insideBody=
TRUE;
1906 }
1907 if (yyextra->insideBody) yyextra->bodyCurlyCount++;
1908 if (yyextra->name.find("::")!=-1)
1909 {
1910 DBG_CTX((stderr,
"** scope stack push SCOPEBLOCK\n"));
1913 }
1914 else
1915 {
1916 DBG_CTX((stderr,
"** scope stack push INNERBLOCK\n"));
1918 }
1919 yyextra->type.clear(); yyextra->name.clear();
1920 BEGIN( Body );
1921 }
1922<SkipInits>{ID}{B}*"{" {
1924 int bracketPos = text.
find(
'{');
1925 int spacePos = text.
find(
' ');
1926 int len = spacePos==-1 ? bracketPos : spacePos;
1928 yyextra->code->codify(
QCString(yytext+len));
1929 }
1930<SkipInits>{ID} {
1932 }
1933<FuncCall>{ID}/"(" {
1935 }
1936<FuncCall>{ID}/("."|"->") {
1937 yyextra->name=yytext;
1939 BEGIN( MemberCall2 );
1940 }
1941<FuncCall,MemberCall2>("("{B}*("*"{B}*)+{ID}+{B}*")"{B}*)/("."|"->") {
1942 yyextra->code->codify(yytext);
1943 uint32_t s=0;
while (!
isId(yytext[s])) s++;
1944 uint32_t e=(uint32_t)yyleng-1;
while (e>1 && !
isId(yytext[e])) e--;
1945 yyextra->name=((
QCString)yytext).mid(s,e-s+1);
1946 BEGIN( MemberCall2 );
1947 }
1948<MemberCall2>{ID}/([ \t\n]*"(") {
1949 if (!yyextra->args.isEmpty())
1951 else
1953 yyextra->args.clear();
1954 BEGIN( FuncCall );
1955 }
static void generateMemberLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &varName, const QCString &memName)
1956<MemberCall2>{ID}/([ \t\n]*("."|"->")) {
1957
1958 yyextra->name=yytext;
1960 BEGIN( MemberCall2 );
1961 }
1962<MemberCall2>"->"|"." {
1963 if (yytext[0]=='-')
1964 {
1966 }
1967 yyextra->code->codify(yytext);
1968 yyextra->memCallContext = YY_START;
1969 BEGIN( MemberCall );
1970 }
1971<SkipComment>{CCS}("!"?){CCE} {
1972 yyextra->code->codify(yytext);
1974 BEGIN( yyextra->lastCContext ) ;
1975 }
1976<SkipComment>{CPPC}|{CCS} {
1977 yyextra->code->codify(yytext);
1978 }
1979<SkipComment>[^*\/\n]+ {
1980 yyextra->code->codify(yytext);
1981 }
1982<SkipComment>[ \t]*{CCE} {
1983 yyextra->code->codify(yytext);
1985 if (yyextra->lastCContext==SkipCPP)
1986 {
1988 }
1989 BEGIN( yyextra->lastCContext ) ;
1990 }
1991<SkipCxxComment>[^\r\n]*"\\"[\r]?\n { // line continuation
1993 }
1994<SkipCxxComment>[^\r\n]+ {
1995 yyextra->code->codify(yytext);
1996 }
1997<SkipCxxComment>\r
1998<SkipCxxComment>\n {
1999 unput('\n');
2001 BEGIN( yyextra->lastCContext ) ;
2002 }
2003<SkipCxxComment>. {
2004 yyextra->code->codify(yytext);
2005 }
2006<MemberCall>[^a-z_A-Z0-9(\n] {
2007 yyextra->code->codify(yytext);
2008 yyextra->type.clear();
2009 yyextra->name.clear();
2010 BEGIN(yyextra->memCallContext);
2011 }
2012<*>\n({B}*{CPPC}[!/][^\n]*\n)+ { // remove special one-line comment
2013 if (YY_START==SkipCPP) REJECT;
2018 if (YY_START==SkipCxxComment)
2019 {
2020 BEGIN( yyextra->lastCContext ) ;
2021 }
2022 }
2023<SkipCPP>\n/(.|\n) {
2025 BEGIN( yyextra->lastSkipCppContext ) ;
2026 unput('\n');
2027 }
2028<*>\n{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2033 if (YY_START==SkipCxxComment)
2034 {
2035 BEGIN( yyextra->lastCContext ) ;
2036 }
2037 }
2038<*>\n{B}*{CCS}"@"[{}] { // remove one-line group marker
2039
2040 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2041 {
2042 yyextra->lastCContext = YY_START ;
2043 }
2046 BEGIN(SkipComment);
2047 }
2048<*>^{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
2053 }
2054<*>^{B}*{CCS}"@"[{}] { // remove multi-line group marker
2055
2056 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2057 {
2058 yyextra->lastCContext = YY_START ;
2059 }
2061 yyextra->code->codify(yytext);
2062 BEGIN(SkipComment);
2063 }
2064<*>^{B}*{CPPC}[!/][^\n]* { // remove special one-line comment
2068 }
2069<*>{CPPC}[!/][^\n]* { // strip special one-line comment
2070 if (YY_START==SkipComment || YY_START==SkipString) REJECT;
2074 }
2075<*>\n{B}*{CCS}[!*]/{NCOMM} {
2076
2077 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2078 {
2079 yyextra->lastCContext = YY_START ;
2080 }
2083 BEGIN(SkipComment);
2084 }
2085<*>^{B}*{CCS}"*"[*]+/[^/] {
2086
2087 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2088 {
2089 yyextra->lastCContext = YY_START ;
2090 }
2091
2093 yyextra->code->codify(yytext);
2094 BEGIN(SkipComment);
2095 }
2096<*>^{B}*{CCS}[!*]/{NCOMM} { // special C comment block at a new line
2097
2098 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2099 {
2100 yyextra->lastCContext = YY_START ;
2101 }
2103 yyextra->code->codify(yytext);
2104 BEGIN(SkipComment);
2105 }
2106<*>{CCS}[!*]/{NCOMM} { // special C comment block half way a line
2107 if (YY_START==SkipString) REJECT;
2108
2109 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2110 {
2111 yyextra->lastCContext = YY_START ;
2112 }
2114 yyextra->code->codify(yytext);
2115 BEGIN(SkipComment);
2116 }
2117<*>{CCS}("!"?){CCE} {
2118 if (YY_START==SkipString) REJECT;
2121 yyextra->code->codify(yytext);
2123 }
2124<SkipComment>[^\*\n]+ {
2125 yyextra->code->codify(yytext);
2126 }
2127<*>{CCS} {
2129 yyextra->code->codify(yytext);
2130
2131 if (YY_START != SkipComment && YY_START != SkipCxxComment)
2132 {
2133 yyextra->lastCContext = YY_START ;
2134 }
2135 BEGIN( SkipComment ) ;
2136 }
2137<*>[$]?@\" { // C# (interpolated) verbatim string
2139 yyextra->code->codify(yytext);
2140 yyextra->lastVerbStringContext=YY_START;
2141 BEGIN(SkipVerbString);
2142 }
2143<*>{CPPC} {
2145 yyextra->code->codify(yytext);
2146 yyextra->lastCContext = YY_START ;
2147 BEGIN( SkipCxxComment ) ;
2148 }
2149<*>"("|"[" {
2150 if (yytext[0]=='(') yyextra->bracketCount++;
2151 yyextra->code->codify(yytext);
2152 yyextra->theCallContext.pushScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2153 }
2154<*>")"|"]" {
2155 if (yytext[0]==')') yyextra->bracketCount--;
2156 yyextra->code->codify(yytext);
2157 yyextra->theCallContext.popScope(yyextra->name, yyextra->type, yyextra->bracketCount);
2158 }
2159<*>\n {
2161 }
2162<*>[\x80-\xFF]* { // keep utf8 characters together...
2163 yyextra->code->codify(yytext);
2164 }
2165<*>. {
2166 yyextra->code->codify(yytext);
2167 }
2168
2169%%