Slice states.
Prototype scanner states comment parsing states C++20 concepts Object-C Deprecated C++20 modules
502 {
503 if (!yyextra->insideObjC) REJECT;
504 }
505<*>"DEPRECATED_MSG_ATTRIBUTE(\"" { // Object-C attribute
506 if (!yyextra->insideObjC) REJECT;
507 yyextra->lastDeprecatedContext=YY_START;
508 yyextra->lastStringContext=Deprecated_round;
509 BEGIN(SkipString);
510 }
511<Deprecated_round>")" {
512 BEGIN(yyextra->lastDeprecatedContext);
513 }
514<Deprecated_round>{BNopt} {
516 }
517<Deprecated_round>. { }
518<NextSemi>"{" {
519 yyextra->curlyCount=0;
520 yyextra->needsSemi =
TRUE;
521 BEGIN(SkipCurlyBlock);
522 }
523<NextSemi>"(" {
524 yyextra->roundCount=0;
525 BEGIN(SkipRoundBlock);
526 }
527<SkipRoundBlock>"(" {
528 ++yyextra->roundCount;
529 }
530<SkipRoundBlock>")" {
531 if (yyextra->roundCount )
532 --yyextra->roundCount ;
533 else
534 BEGIN( NextSemi ) ;
535 }
536<SkipCurlyBlock>"{" {
537 ++yyextra->curlyCount ;
538 }
539<SkipCurlyBlock>"}" {
540 if( yyextra->curlyCount )
541 {
542 --yyextra->curlyCount ;
543 }
544 else if (yyextra->needsSemi)
545 {
546 BEGIN( NextSemi );
547 }
548 else
549 {
550 BEGIN( FindMembers );
551 }
552 }
553<NextSemi>\' {
554 if (yyextra->insidePHP)
555 {
556 yyextra->lastStringContext=NextSemi;
557 BEGIN(SkipPHPString);
558 }
559 }
560<NextSemi>{CHARLIT} { if (yyextra->insidePHP) REJECT; }
561<NextSemi>\" {
562 yyextra->lastStringContext=NextSemi;
563 BEGIN(SkipString);
564 }
565<NextSemi>[;,] {
566 unput(*yytext);
567 BEGIN( FindMembers );
568 }
569<BitFields>[;,] {
570 unput(*yytext);
571 BEGIN( FindMembers );
572 }
573<EnumBaseType>[{;,] {
574 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
575 unput(*yytext);
576 BEGIN( ClassVar );
577 }
578<FindMembers>"<?php" { // PHP code with unsupported extension?
579 yyextra->insidePHP =
TRUE;
580 }
581<FindMembersPHP>"<?"("php"?) { // PHP code start
582 BEGIN( FindMembers );
583 }
584<FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" { // PHP code start
586 BEGIN( FindMembers );
587 }
588<FindMembers>"?>"|"</script>" { // PHP code end
589 if (yyextra->insidePHP)
590 BEGIN( FindMembersPHP );
591 else
592 REJECT;
593 }
594<FindMembersPHP>[^\n<]+ { // Non-PHP code text, ignore
595 }
596<FindMembersPHP>\n { // Non-PHP code text, ignore
598 }
599<FindMembersPHP>. { // Non-PHP code text, ignore
600 }
601<FindMembers>{PHPKW} { if (yyextra->insidePHP)
602 BEGIN( NextSemi );
603 else
604 REJECT;
605 }
606<FindMembers>"%{"[^\n]* { // Mozilla XPIDL lang-specific block
607 if (!yyextra->insideIDL)
608 REJECT;
609 }
610<FindMembers>"%}" { // Mozilla XPIDL lang-specific block end
611 if (!yyextra->insideIDL)
612 REJECT;
613 }
614<FindMembers>{B}*("properties"){BN}*":"{BN}* { // IDL or Borland C++ builder property
616 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
617 }
static void initMethodProtection(yyscan_t yyscanner, Protection prot)
618
619<FindMembers>{B}*"k_dcop"{BN}*":"{BN}* {
621 yyextra->current->mtype = yyextra->mtype = MethodTypes::DCOP;
622 }
623
624<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* {
626 yyextra->current->mtype = yyextra->mtype = MethodTypes::Signal;
627 }
628
629<FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
631 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
632 }
633
634<FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
636 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
637 }
638
639<FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
641 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
642 }
643<FindMembers>{B}*("public"|"methods"|"__published"){BN}*":"{BN}* {
645 }
646<FindMembers>{B}*"internal"{BN}*":"{BN}* { // for now treat C++/CLI's internal as package...
647 if (yyextra->insideCli)
648 {
650 }
651 else
652 {
653 REJECT;
654 }
655 }
656<FindMembers>{B}*"protected"{BN}*":"{BN}* {
658 }
659<FindMembers>{B}*"private"{BN}*":"{BN}* {
661 }
662<FindMembers>{B}*"public"/({BN}|{CCS}|{CPPC}) {
663 if (!yyextra->insideCpp) REJECT;
665 BEGIN(CppProt);
666 }
667<FindMembers>{B}*"protected"/({BN}|{CCS}|{CPPC}) {
668 if (!yyextra->insideCpp) REJECT;
670 BEGIN(CppProt);
671 }
672<FindMembers>{B}*"private"/({BN}|{CCS}|{CPPC}) {
673 if (!yyextra->insideCpp) REJECT;
675 BEGIN(CppProt);
676 }
677<CppProt>":" {
678 BEGIN(FindMembers);
679 }
680<CppProt>. {
681 unput(*yytext);
682 BEGIN(FindMembers);
683 }
684<CppProt>{BN}+ { lineCount(yyscanner); }
685<CppProt>{CPPC}.*\n { lineCount(yyscanner); }
686<CppProt>{CCS} { yyextra->lastCContext = YY_START ;
687 BEGIN( SkipComment ) ;
688 }
689<CppProt>("slots"|"Q_SLOTS") {
690 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
691 }
692<FindMembers>{B}*"event"{BN}+ {
693 if (yyextra->insideCli)
694 {
695
697 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
698 yyextra->current->bodyLine = yyextra->yyLineNr;
699 yyextra->current->bodyColumn = yyextra->yyColNr;
700 yyextra->curlyCount=0;
701 BEGIN( CliPropertyType );
702 }
703 else if (yyextra->insideCS)
704 {
706 yyextra->current->mtype = MethodTypes::Event;
707 yyextra->current->bodyLine = yyextra->yyLineNr;
708 yyextra->current->bodyColumn = yyextra->yyColNr;
709 }
710 else
711 {
712 REJECT;
713 }
714 }
715<FindMembers>{B}*"property"{BN}+ {
716 if (yyextra->insideCli)
717 {
718
720 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
721 yyextra->current->bodyLine = yyextra->yyLineNr;
722 yyextra->current->bodyColumn = yyextra->yyColNr;
723 yyextra->curlyCount=0;
724 BEGIN( CliPropertyType );
725 }
726 else
727 {
728 REJECT;
729 }
730 }
731<CliPropertyType>{ID} {
733 yyextra->current->name = yytext;
734 }
static void addType(yyscan_t yyscanner)
735<CliPropertyType>"[" { // C++/CLI indexed property
736 yyextra->current->args = "[";
737 BEGIN( CliPropertyIndex );
738 }
739<CliPropertyType>"{" {
740 yyextra->curlyCount=0;
741
742 BEGIN( CSAccessorDecl );
743 }
744<CliPropertyType>";" {
745 unput(*yytext);
746 BEGIN( FindMembers );
747 }
748<CliPropertyType>\n {
750 }
751<CliPropertyType>{B}* {
752 }
753<CliPropertyType>. {
755 yyextra->current->type += yytext;
756 }
757<CliPropertyIndex>"]" {
758 BEGIN( CliPropertyType );
759 yyextra->current->args+=yytext;
760 }
761<CliPropertyIndex>. {
762 yyextra->current->args+=yytext;
763 }
764
765<FindMembers>{B}*"property"{BN}+ {
766 if (!yyextra->current->type.isEmpty())
767 {
768 REJECT;
769 }
770 else
771 {
772 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
774 }
775 }
776 */
777<FindMembers>{B}*"@private"{BN}+ {
779 }
780<FindMembers>{B}*"@protected"{BN}+ {
782 }
783<FindMembers>{B}*"@public"{BN}+ {
785 }
786<FindMembers>[\-+]{BN}* {
787 if (!yyextra->insideObjC)
788 {
789 REJECT;
790 }
791 else
792 {
793 yyextra->current->fileName = yyextra->fileName;
794 yyextra->current->startLine = yyextra->yyLineNr;
795 yyextra->current->startColumn = yyextra->yyColNr;
796 yyextra->current->bodyLine = yyextra->yyLineNr;
797 yyextra->current->bodyColumn = yyextra->yyColNr;
798 yyextra->current->section = EntryType::makeFunction();
799 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
800 yyextra->insideObjC =
TRUE;
801 yyextra->yyBegColNr = yyextra->yyColNr;
802 yyextra->yyBegLineNr = yyextra->yyLineNr;
803 yyextra->current->virt = Specifier::Virtual;
804
805 yyextra->current->isStatic=yytext[0]=='+';
807 BEGIN( ObjCMethod );
808 }
809 }
810<ObjCMethod>"(" { // start of method's return type
811 BEGIN( ObjCReturnType );
812 yyextra->current->type.clear();
813 yyextra->roundCount=0;
814 }
815<ObjCMethod>{ID} { // found method name
816 if (yyextra->current->type.isEmpty())
817 {
818 yyextra->current->type += "id";
819 }
820 yyextra->current->name = yytext;
822 }
static void storeClangId(yyscan_t yyscanner, const char *id)
823<ObjCMethod>":"{B}* { // start of parameter list
824 yyextra->current->name += ':';
826 yyextra->current->argList.push_back(a);
827 BEGIN( ObjCParams );
828 }
829<ObjCReturnType>[^()]* {
830 yyextra->current->type += yytext;
831 }
832<ObjCReturnType>"(^)(" { // Block return type
833 yyextra->current->type += yytext;
834 yyextra->roundCount++;
835 }
836<ObjCReturnType>"(" {
837 yyextra->current->type += yytext;
838 yyextra->roundCount++;
839 }
840<ObjCReturnType>")" {
841 if (yyextra->roundCount<=0)
842 {
843 BEGIN( ObjCMethod );
844 }
845 else
846 {
847 yyextra->current->type += yytext;
848 yyextra->roundCount--;
849 }
850 }
851<ObjCParams>({ID})?{BN}*":" { // Keyword of parameter
855 {
856 yyextra->current->name += " :";
857 }
858 else
859 {
860 yyextra->current->name += keyw+":";
861 }
862 if (yyextra->current->argList.back().type.isEmpty())
863 {
864 yyextra->current->argList.back().type="id";
865 }
868 yyextra->current->argList.push_back(a);
869 }
870<ObjCParams>{ID}{BN}* { // name of parameter
873 }
874<ObjCParams>","{BN}*"..." { // name of parameter
876
877
881 yyextra->current->argList.push_back(a);
882 }
883
884<ObjCParams>":" {
885 yyextra->current->name += ':';
886 }
887 */
888<ObjCParams>"(" {
889 yyextra->roundCount=0;
890 yyextra->current->argList.back().type.clear();
891 BEGIN( ObjCParamType );
892 }
893<ObjCParamType>"(" {
894 yyextra->roundCount++;
895 yyextra->current->argList.back().type+=yytext;
896 }
897<ObjCParamType>")"/{B}* {
898 if (yyextra->roundCount<=0)
899 {
900 BEGIN( ObjCParams );
901 }
902 else
903 {
904 yyextra->current->argList.back().type+=yytext;
905 yyextra->roundCount--;
906 }
907 }
908<ObjCParamType>[^()]* {
910 }
911<ObjCMethod,ObjCParams>";" { // end of method declaration
912 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
913 {
914 yyextra->current->argList.back().type="id";
915 }
916 if (yyextra->current->argList.empty())
917 {
918 yyextra->current->argList.setNoParameters(
TRUE);
919 }
921
922 unput(';');
923 BEGIN( SFunction );
924 }
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
925<ObjCMethod,ObjCParams>(";"{BN}+)?"{" { // start of a method body
927
928
929
930 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
931 {
932 yyextra->current->argList.back().type="id";
933 }
934 if (yyextra->current->argList.empty())
935 {
936 yyextra->current->argList.setNoParameters(
TRUE);
937 }
939 unput('{');
940 BEGIN( SFunction );
941 }
942<FindMembers>{B}*"sequence"{BN}*"<"{BN}* {
943 if (yyextra->insideSlice)
944 {
946 yyextra->current->bodyLine = yyextra->yyLineNr;
947 yyextra->current->bodyColumn = yyextra->yyColNr;
948 yyextra->current->fileName = yyextra->fileName ;
949 yyextra->current->startLine = yyextra->yyLineNr ;
950 yyextra->current->startColumn = yyextra->yyColNr;
951 yyextra->current->args.clear();
952 yyextra->current->section = EntryType::makeTypedef();
953 yyextra->isTypedef =
TRUE;
954 BEGIN( SliceSequence );
955 }
956 else
957 REJECT;
958 }
959<FindMembers>{B}*"dictionary"{BN}*"<"{BN}* {
960 if (yyextra->insideSlice)
961 {
963 yyextra->current->bodyLine = yyextra->yyLineNr;
964 yyextra->current->bodyColumn = yyextra->yyColNr;
965 yyextra->current->fileName = yyextra->fileName ;
966 yyextra->current->startLine = yyextra->yyLineNr ;
967 yyextra->current->startColumn = yyextra->yyColNr;
968 yyextra->current->args.clear();
969 yyextra->current->section = EntryType::makeTypedef() ;
970 yyextra->isTypedef =
TRUE;
971 BEGIN( SliceDictionary );
972 }
973 else
974 REJECT;
975 }
976<FindMembers>{BN}{1,80} {
978 }
979<FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
980 if (yyextra->insideJava)
981 {
983 yyextra->lastSkipRoundContext = YY_START;
984 yyextra->roundCount=0;
985 BEGIN( SkipRound );
986 }
988 {
989 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
990 yyextra->current->spec.setReadable(true).setWritable(true).setAssign(true);
991 yyextra->current->protection = Protection::Public ;
992 unput('(');
993 BEGIN( ObjCPropAttr );
994 }
995 else
996 {
997 REJECT;
998 }
999 }
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
1000<ObjCPropAttr>"getter="{ID} {
1001 yyextra->current->read = yytext+7;
1002 }
1003<ObjCPropAttr>"setter="{ID} {
1004 yyextra->current->write = yytext+7;
1005 }
1006<ObjCPropAttr>"readonly" {
1007 yyextra->current->spec.setWritable(false);
1008 }
1009<ObjCPropAttr>"readwrite" { // default
1010 }
1011<ObjCPropAttr>"assign" { // default
1012 }
1013<ObjCPropAttr>"unsafe_unretained" {
1014 yyextra->current->spec.setAssign(false);
1015 yyextra->current->spec.setUnretained(true);
1016 }
1017<ObjCPropAttr>"retain" {
1018 yyextra->current->spec.setAssign(false);
1019 yyextra->current->spec.setRetain(true);
1020 }
1021<ObjCPropAttr>"copy" {
1022 yyextra->current->spec.setAssign(false);
1023 yyextra->current->spec.setCopy(true);
1024 }
1025<ObjCPropAttr>"weak" {
1026 yyextra->current->spec.setAssign(false);
1027 yyextra->current->spec.setWeak(true);
1028 }
1029<ObjCPropAttr>"strong" {
1030 yyextra->current->spec.setAssign(false);
1031 yyextra->current->spec.setStrong(true);
1032 }
1033<ObjCPropAttr>"nonatomic" {
1034 yyextra->current->spec.setNonAtomic(true);
1035 }
1036<ObjCPropAttr>")" {
1037 BEGIN(FindMembers);
1038 }
1039<FindMembers>"@"{ID}("."{ID})+ {
1040 if (yyextra->insideJava)
1041 {
1042
1043 }
1044 else
1045 {
1046 REJECT;
1047 }
1048 }
1049<FindMembers>"@"{ID} {
1050 if (yyextra->insideJava)
1051 {
1052
1053 }
1054 else if (
qstrcmp(yytext,
"@property")==0)
1055 {
1056 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
1057 yyextra->current->spec.setWritable(true).setReadable(true);
1058 yyextra->current->protection = Protection::Public ;
1059 }
1060 else if (
qstrcmp(yytext,
"@synthesize")==0)
1061 {
1062 BEGIN( ObjCSkipStatement );
1063 }
1064 else if (
qstrcmp(yytext,
"@dynamic")==0)
1065 {
1066 BEGIN( ObjCSkipStatement );
1067 }
1068 else
1069 {
1070 REJECT;
1071 }
1072 }
int qstrcmp(const char *str1, const char *str2)
1073<ObjCSkipStatement>";" {
1074 BEGIN(FindMembers);
1075 }
1076<PackageName>{ID}(("."|"\\"){ID})* {
1077 yyextra->isTypedef=
FALSE;
1078
1079 yyextra->current->name = yytext;
1080 yyextra->current->name =
substitute(yyextra->current->name,
".",
"::");
1081 yyextra->current->name =
substitute(yyextra->current->name,
"\\",
"::");
1082 yyextra->current->section = EntryType::makeNamespace();
1083 yyextra->current->type = "namespace" ;
1084 yyextra->current->fileName = yyextra->fileName;
1085 yyextra->current->startLine = yyextra->yyLineNr;
1086 yyextra->current->startColumn = yyextra->yyColNr;
1087 yyextra->current->bodyLine = yyextra->yyLineNr;
1088 yyextra->current->bodyColumn = yyextra->yyColNr;
1090 }
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
1091<PackageName>";" {
1092 std::shared_ptr<Entry> tmp = yyextra->current;
1093 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1094 yyextra->current_root = std::move(tmp);
1096 BEGIN(FindMembers);
1097 }
1098<PackageName>"{" {
1099 yyextra->curlyCount=0;
1100 BEGIN( ReadNSBody );
1101 }
1102<FindMembers>{B}*"export"{BN}+"module"{BN}+ { // primary module interface unit
1103 if (!yyextra->insideCpp) REJECT;
1104
1105 yyextra->current->exported = true;
1107 BEGIN( ModuleName );
1108 }
1109<FindMembers>{B}*"module"{BN}*";" { // global module section
1110 if (!yyextra->insideCpp) REJECT;
1111 if (!yyextra->current->type.isEmpty() || !yyextra->current->name.isEmpty()) REJECT;
1112
1114 BEGIN( FindMembers );
1115 }
1116<FindMembers>{B}*"module"{BN}+ { // module implementation unit
1117 if (!yyextra->insideCpp) REJECT;
1118
1119 yyextra->current->exported = false;
1121 BEGIN( ModuleName );
1122 }
1123<FindMembers>{B}*"export"{BN}+"import"{BN}+ { // export an imported module
1124 if (!yyextra->insideCpp) REJECT;
1125 yyextra->current->exported = true;
1127 BEGIN( ModuleImport );
1128 }
1129<FindMembers>{B}*"import"{BN}+ { // start of a module import
1130 if (!yyextra->insideCpp) REJECT;
1132 BEGIN( ModuleImport );
1133 }
1134<ModuleName>{MODULE_ID}{BN}*":"{BN}*{MODULE_ID} { // module partition name, e.g. A.B:C.D'
1136 int i = name.
find(
':');
1140 yyextra->yyLineNr,
1141 yyextra->yyColNr,
1142 yyextra->current->exported,
1143 name,
1144 partition);
1145 yyextra->current->section = EntryType::makeModuleDoc();
1146 yyextra->isTypedef=
FALSE;
1148 yyextra->current->type += " module";
1149 yyextra->current->fileName = yyextra->fileName;
1150 yyextra->current->startLine = yyextra->yyLineNr;
1151 yyextra->current->startColumn = yyextra->yyColNr;
1152 yyextra->current->bodyLine = yyextra->yyLineNr;
1153 yyextra->current->bodyColumn = yyextra->yyColNr;
1154 yyextra->current->name = name+":"+partition;
1156 }
static ModuleManager & instance()
void createModuleDef(const QCString &fileName, int line, int column, bool exported, const QCString &moduleName, const QCString &partitionName=QCString())
1157<ModuleName>{MODULE_ID} { // primary module name, e.g. A.B
1159 yyextra->yyLineNr,
1160 yyextra->yyColNr,
1161 yyextra->current->exported,
1162 yytext);
1163 yyextra->current->section = EntryType::makeModuleDoc();
1164 yyextra->isTypedef=
FALSE;
1166 yyextra->current->type += " module";
1167 yyextra->current->fileName = yyextra->fileName;
1168 yyextra->current->startLine = yyextra->yyLineNr;
1169 yyextra->current->startColumn = yyextra->yyColNr;
1170 yyextra->current->bodyLine = yyextra->yyLineNr;
1171 yyextra->current->bodyColumn = yyextra->yyColNr;
1172 yyextra->current->name = yytext;
1174 }
1175<ModuleName>":"{BN}+"private" { // start of private section of the module interface
1176 yyextra->current->exported = yyextra->exported = false;
1178 }
1179<ModuleName>";" { unput(';');
1180 BEGIN(FindMembers);
1181 }
1182<ModuleName>\n { lineCount(yyscanner); }
1183<ModuleName>. {}
1184<ModuleImport>"\""[^"\n]*"\"" { // local header import
1186 yyextra->yyLineNr,
1188 false);
1189 }
void addHeader(const QCString &moduleFile, int line, const QCString &headerName, bool isSystem)
1190<ModuleImport>"<"[^>\n]*">" { // system header import
1192 yyextra->yyLineNr,
1194 true);
1195 }
1196<ModuleImport>{MODULE_ID}?{BN}*":"{BN}*{MODULE_ID} { // module partition import
1198 int i = name.
find(
':');
1202 yyextra->yyLineNr,
1203 name,
1204 yyextra->current->exported,
1205 partition);
1207 }
void addImport(const QCString &moduleFile, int line, const QCString &importName, bool isExported, const QCString &partitionName=QCString())
1208<ModuleImport>{MODULE_ID} { // module import
1210 yyextra->yyLineNr,
1211 yytext,
1212 yyextra->current->exported);
1214 }
1215<ModuleImport>";" { BEGIN(FindMembers); }
1216<ModuleImport>\n { lineCount(yyscanner); }
1217<ModuleImport>. {}
1218<FindMembers>{B}*"export"{BN}+"{" {
1219 yyextra->current->exported = yyextra->exported = true;
1220 }
1221<FindMembers>{B}*"export"{BN}+ {
1222 if (!yyextra->insideCpp) REJECT;
1223 yyextra->current->exported=true;
1224 }
1225<FindMembers>{B}*"initonly"{BN}+ { if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1226 yyextra->current->type += " initonly ";
1227 if (yyextra->insideCli) yyextra->current->spec.setInitonly(true);
1229 }
1230<FindMembers>{B}*"static"{BN}*/"{" { yyextra->current->type += " static ";
1231 yyextra->current->isStatic =
TRUE;
1233 }
1234<FindMembers>{B}*"static"{BN}+ { yyextra->current->type += " static ";
1235 yyextra->current->isStatic =
TRUE;
1237 }
1238<FindMembers>{B}*"extern"{BN}+ { if (yyextra->insideJava) REJECT;
1239 yyextra->current->isStatic =
FALSE;
1240 yyextra->current->explicitExternal =
TRUE;
1242 }
1243<FindMembers>{B}*"const"{BN}+ { if (yyextra->insideCS)
1244 {
1245 yyextra->current->type += " const ";
1246 if (yyextra->insideCS) yyextra->current->isStatic =
TRUE;
1248 }
1249 else
1250 {
1251 REJECT;
1252 }
1253 }
1254<FindMembers>{B}*"virtual"{BN}+ { if (yyextra->insideJava) REJECT;
1255 yyextra->current->type += " virtual ";
1256 yyextra->current->virt = Specifier::Virtual;
1258 }
1259<FindMembers>{B}*"constexpr"{BN}+ {
1260 if (yyextra->insideCpp)
1261 {
1262 yyextra->current->spec.setConstExpr(true);
1263 }
1264 REJECT;
1265 }
1266<FindMembers>{B}*"consteval"{BN}+ {
1267 if (yyextra->insideCpp)
1268 {
1269 yyextra->current->spec.setConstEval(true);
1270 }
1271 REJECT;
1272 }
1273<FindMembers>{B}*"constinit"{BN}+ {
1274 if (yyextra->insideCpp)
1275 {
1276 yyextra->current->spec.setConstInit(true);
1277 }
1278 REJECT;
1279 }
1280<FindMembers>{B}*"published"{BN}+ { // UNO IDL published keyword
1281 if (yyextra->insideIDL)
1282 {
1284 yyextra->current->spec.setPublished(true);
1285 }
1286 else
1287 {
1288 REJECT;
1289 }
1290 }
1291<FindMembers>{B}*"sealed"{BN}+ {
1292 if (yyextra->insideCS)
1293 {
1294 yyextra->current->spec.setSealed(true);
1295 }
1296 else
1297 {
1298 REJECT;
1299 }
1300 }
1301<FindMembers>{B}*"abstract"{BN}+ {
1302 if (yyextra->insidePHP || yyextra->insideCS)
1303 {
1304 yyextra->current->spec.setAbstract(true);
1305 }
1306 else
1307 {
1308 if (yyextra->insideCpp) REJECT;
1309 yyextra->current->type += " abstract ";
1310 if (!yyextra->insideJava)
1311 {
1312 yyextra->current->virt = Specifier::Pure;
1313 }
1314 else
1315 {
1316 yyextra->current->spec.setAbstract(true);
1317 }
1318 }
1320 }
1321<FindMembers>{B}*"inline"{BN}+ { if (yyextra->insideJava) REJECT;
1322 yyextra->current->spec.setInline(true);
1324 }
1325<FindMembers>{B}*"mutable"{BN}+ { if (yyextra->insideJava) REJECT;
1326 yyextra->current->spec.setMutable(true);
1328 }
1329<FindMembers>{B}*"thread_local"{BN}+ { if (yyextra->insideJava) REJECT;
1330 yyextra->current->spec.setThreadLocal(true);
1332 }
1333<FindMembers>{B}*"explicit"{BN}+ { if (yyextra->insideJava) REJECT;
1334 yyextra->current->spec.setExplicit(true);
1336 }
1337<FindMembers>{B}*"local"{BN}+ { if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1338 yyextra->current->spec.setLocal(true);
1340 }
1341<FindMembers>{B}*"@required"{BN}+ { // Objective C 2.0 protocol required section
1342 yyextra->current->spec.setOptional(false).setRequired(true);
1344 }
1345<FindMembers>{B}*"@optional"{BN}+ { // Objective C 2.0 protocol optional section
1346 yyextra->current->spec.setRequired(false).setOptional(true);
1348 }
1349
1350<FindMembers>{B}*"import"{BN}+ { // IDL import keyword
1351 BEGIN( NextSemi );
1352 }
1353 */
1354<FindMembers>{B}*"typename"{BN}+ { lineCount(yyscanner); }
1355<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] { if (yyextra->insideJava) REJECT;
1356 yyextra->isTypedef=
FALSE;
1357 yyextra->current->section = EntryType::makeNamespace();
1358 yyextra->current->type = "namespace" ;
1359 yyextra->current->fileName = yyextra->fileName;
1360 yyextra->current->startLine = yyextra->yyLineNr;
1361 yyextra->current->startColumn = yyextra->yyColNr;
1362 yyextra->current->bodyLine = yyextra->yyLineNr;
1363 yyextra->current->bodyColumn = yyextra->yyColNr;
1365 if (yyextra->insidePHP)
1366 {
1367 BEGIN( PackageName );
1368 }
1369 else
1370 {
1371 BEGIN( CompoundName );
1372 }
1373 }
1374<FindMembers>{B}*"module"{BN}+ {
1376 if (yyextra->insideIDL || yyextra->insideSlice)
1377 {
1378 yyextra->isTypedef=
FALSE;
1379 yyextra->current->section = EntryType::makeNamespace();
1380 yyextra->current->type = "module" ;
1381 yyextra->current->fileName = yyextra->fileName;
1382 yyextra->current->startLine = yyextra->yyLineNr;
1383 yyextra->current->startColumn = yyextra->yyColNr;
1384 yyextra->current->bodyLine = yyextra->yyLineNr;
1385 yyextra->current->bodyColumn = yyextra->yyColNr;
1386 BEGIN( CompoundName );
1387 }
1388 else if (yyextra->insideD)
1389 {
1391 BEGIN(PackageName);
1392 }
1393 else
1394 {
1397 }
1398 }
1399<FindMembers>{B}*"library"{BN}+ {
1401 if (yyextra->insideIDL)
1402 {
1403 yyextra->isTypedef=
FALSE;
1404 yyextra->current->section = EntryType::makeNamespace();
1405 yyextra->current->type = "library" ;
1406 yyextra->current->fileName = yyextra->fileName;
1407 yyextra->current->startLine = yyextra->yyLineNr;
1408 yyextra->current->startColumn = yyextra->yyColNr;
1409 yyextra->current->bodyLine = yyextra->yyLineNr;
1410 yyextra->current->bodyColumn = yyextra->yyColNr;
1411 BEGIN( CompoundName );
1412 }
1413 else
1414 {
1417 }
1418 }
1419<FindMembers>{B}*"constants"{BN}+ { // UNO IDL constant group
1421 if (yyextra->insideIDL)
1422 {
1423 yyextra->isTypedef=
FALSE;
1424 yyextra->current->section = EntryType::makeNamespace();
1425 yyextra->current->type = "constants";
1426 yyextra->current->fileName = yyextra->fileName;
1427 yyextra->current->startLine = yyextra->yyLineNr;
1428 yyextra->current->startColumn = yyextra->yyColNr;
1429 yyextra->current->bodyLine = yyextra->yyLineNr;
1430 yyextra->current->bodyColumn = yyextra->yyColNr;
1431 BEGIN( CompoundName );
1432 }
1433 else
1434 {
1437 }
1438 }
1439<FindMembers>{BN}*("service"){BN}+ { // UNO IDL service
1441 if (yyextra->insideIDL)
1442 {
1443 yyextra->isTypedef=
FALSE;
1444 yyextra->current->section = EntryType::makeClass();
1447
1448 setOptional(spec.isOptional()).setPublished(spec.isPublished());
1450 yyextra->current->type += " service " ;
1451 yyextra->current->fileName = yyextra->fileName;
1452 yyextra->current->startLine = yyextra->yyLineNr;
1453 yyextra->current->bodyLine = yyextra->yyLineNr;
1454 yyextra->current->bodyColumn = yyextra->yyColNr;
1455 BEGIN( CompoundName );
1456 }
1457 else
1458 {
1461 }
1462 }
Wrapper class for a number of boolean properties.
1463<FindMembers>{BN}*("singleton"){BN}+ { // UNO IDL singleton
1465 if (yyextra->insideIDL)
1466 {
1467 yyextra->isTypedef=
FALSE;
1468 yyextra->current->section = EntryType::makeClass();
1470 yyextra->current->spec =
TypeSpecifier().setSingleton(
true).
1471 setPublished(spec.isPublished());
1473 yyextra->current->type += " singleton " ;
1474 yyextra->current->fileName = yyextra->fileName;
1475 yyextra->current->startLine = yyextra->yyLineNr;
1476 yyextra->current->bodyLine = yyextra->yyLineNr;
1477 yyextra->current->bodyColumn = yyextra->yyColNr;
1478 BEGIN( CompoundName );
1479 }
1480 else
1481 {
1484 }
1485 }
1486<FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba/UNO IDL/Java/Slice interface
1488 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1489 {
1490 yyextra->isTypedef=
FALSE;
1491 yyextra->current->section = EntryType::makeClass();
1493 yyextra->current->spec =
TypeSpecifier().setInterface(
true).
1494
1495 setOptional(spec.isOptional()).
1496 setPublished(spec.isPublished()).
1497 setLocal(spec.isLocal());
1499 yyextra->current->type += " interface" ;
1500 yyextra->current->fileName = yyextra->fileName;
1501 yyextra->current->startLine = yyextra->yyLineNr;
1502 yyextra->current->startColumn = yyextra->yyColNr;
1503 yyextra->current->bodyLine = yyextra->yyLineNr;
1504 yyextra->current->bodyColumn = yyextra->yyColNr;
1506 BEGIN( CompoundName );
1507 }
1508 else
1509 {
1512 }
1513 }
static void setJavaProtection(yyscan_t yyscanner)
1514<FindMembers>{B}*"@implementation"{BN}+ { // Objective-C class implementation
1516 yyextra->isTypedef=
FALSE;
1517 yyextra->current->section = EntryType::makeObjcImpl();
1518 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1519 yyextra->insideObjC =
TRUE;
1520 yyextra->current->protection = yyextra->protection = Protection::Public ;
1522 yyextra->current->type += " implementation" ;
1523 yyextra->current->fileName = yyextra->fileName;
1524 yyextra->current->startLine = yyextra->yyLineNr;
1525 yyextra->current->bodyLine = yyextra->yyLineNr;
1526 yyextra->current->bodyColumn = yyextra->yyColNr;
1527 BEGIN( CompoundName );
1528 }
1529<FindMembers>{B}*"@interface"{BN}+ { // Objective-C class interface, or Java attribute
1531 yyextra->isTypedef=
FALSE;
1532 yyextra->current->section = EntryType::makeClass();
1533 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1534 if (!yyextra->insideJava)
1535 {
1536 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1537 yyextra->insideObjC =
TRUE;
1538 }
1539 yyextra->current->protection = yyextra->protection = Protection::Public ;
1541 yyextra->current->type += " interface" ;
1542 yyextra->current->fileName = yyextra->fileName;
1543 yyextra->current->startLine = yyextra->yyLineNr;
1544 yyextra->current->startColumn = yyextra->yyColNr;
1545 yyextra->current->bodyLine = yyextra->yyLineNr;
1546 yyextra->current->bodyColumn = yyextra->yyColNr;
1547 BEGIN( CompoundName );
1548 }
1549<FindMembers>{B}*"@protocol"{BN}+ { // Objective-C protocol definition
1551 yyextra->isTypedef=
FALSE;
1552 yyextra->current->section = EntryType::makeClass();
1554 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1555 yyextra->insideObjC =
TRUE;
1556 yyextra->current->protection = yyextra->protection = Protection::Public ;
1558 yyextra->current->type += " protocol" ;
1559 yyextra->current->fileName = yyextra->fileName;
1560 yyextra->current->startLine = yyextra->yyLineNr;
1561 yyextra->current->startColumn = yyextra->yyColNr;
1562 yyextra->current->bodyLine = yyextra->yyLineNr;
1563 yyextra->current->bodyColumn = yyextra->yyColNr;
1564 BEGIN( CompoundName );
1565 }
1566<FindMembers>{B}*"exception"{BN}+ { // Corba IDL/Slice exception
1567 if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1568 yyextra->isTypedef=
FALSE;
1569 yyextra->current->section = EntryType::makeClass();
1571
1572 yyextra->current->spec =
TypeSpecifier().setException(
true).
1573 setPublished(spec.isPublished()).setLocal(spec.isLocal());
1575 yyextra->current->type += " exception" ;
1576 yyextra->current->fileName = yyextra->fileName;
1577 yyextra->current->startLine = yyextra->yyLineNr;
1578 yyextra->current->startColumn = yyextra->yyColNr;
1579 yyextra->current->bodyLine = yyextra->yyLineNr;
1580 yyextra->current->bodyColumn = yyextra->yyColNr;
1582 BEGIN( CompoundName );
1583 }
1584<FindMembers>"@class" | // for Objective C class declarations
1585<FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1586<FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1588 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1589 bool isConst=decl.
find(
"const")!=-1;
1590 bool isVolatile=decl.
find(
"volatile")!=-1;
1591 yyextra->current->section = EntryType::makeClass();
1593 if (yyextra->insidePHP && yyextra->current->spec.isAbstract())
1594 {
1595
1596 yyextra->current->spec.setAbstract(false).setAbstractClass(true);
1597 }
1598 if (yyextra->insideSlice && yyextra->current->spec.isLocal())
1599 {
1600 yyextra->current->spec.setLocal(true);
1601 }
1602 if (isConst)
1603 {
1604 yyextra->current->type += " const";
1605 }
1606 else if (isVolatile)
1607 {
1608 yyextra->current->type += " volatile";
1609 }
1610 yyextra->current->type += " class" ;
1611 yyextra->current->fileName = yyextra->fileName;
1612 yyextra->current->startLine = yyextra->yyLineNr;
1613 yyextra->current->startColumn = yyextra->yyColNr;
1614 yyextra->current->bodyLine = yyextra->yyLineNr;
1615 yyextra->current->bodyColumn = yyextra->yyColNr;
1616 if (yytext[0]=='@')
1617 {
1618 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1619 yyextra->insideObjC =
TRUE;
1620 }
1622 if (yytext[yyleng-1]=='{') unput('{');
1623 BEGIN( CompoundName ) ;
1624 }
1625<FindMembers>{B}*"value class{" | // C++/CLI extension
1626<FindMembers>{B}*"value class"{BN}+ {
1627 yyextra->isTypedef=
FALSE;
1628 yyextra->current->section = EntryType::makeClass();
1631 yyextra->current->type += " value class" ;
1632 yyextra->current->fileName = yyextra->fileName;
1633 yyextra->current->startLine = yyextra->yyLineNr;
1634 yyextra->current->startColumn = yyextra->yyColNr;
1635 yyextra->current->bodyLine = yyextra->yyLineNr;
1636 yyextra->current->bodyColumn = yyextra->yyColNr;
1638 if (yytext[yyleng-1]=='{') unput('{');
1639 BEGIN( CompoundName ) ;
1640 }
1641<FindMembers>{B}*"ref class{" | // C++/CLI extension
1642<FindMembers>{B}*"ref class"{BN}+ {
1643 yyextra->isTypedef=
FALSE;
1644 yyextra->current->section = EntryType::makeClass();
1647 yyextra->current->type += " ref class" ;
1648 yyextra->current->fileName = yyextra->fileName;
1649 yyextra->current->startLine = yyextra->yyLineNr;
1650 yyextra->current->startColumn = yyextra->yyColNr;
1651 yyextra->current->bodyLine = yyextra->yyLineNr;
1652 yyextra->current->bodyColumn = yyextra->yyColNr;
1654 if (yytext[yyleng-1]=='{') unput('{');
1655 BEGIN( CompoundName ) ;
1656 }
1657<FindMembers>{B}*"interface class{" | // C++/CLI extension
1658<FindMembers>{B}*"interface class"{BN}+ {
1659 yyextra->isTypedef=
FALSE;
1660 yyextra->current->section = EntryType::makeClass();
1661 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1663 yyextra->current->type += " interface class" ;
1664 yyextra->current->fileName = yyextra->fileName;
1665 yyextra->current->startLine = yyextra->yyLineNr;
1666 yyextra->current->startColumn = yyextra->yyColNr;
1667 yyextra->current->bodyLine = yyextra->yyLineNr;
1668 yyextra->current->bodyColumn = yyextra->yyColNr;
1670 if (yytext[yyleng-1]=='{') unput('{');
1671 BEGIN( CompoundName ) ;
1672 }
1673<FindMembers>{B}*"coclass"{BN}+ {
1674 if (yyextra->insideIDL)
1675 {
1676 yyextra->isTypedef=
FALSE;
1677 yyextra->current->section = EntryType::makeClass();
1679 yyextra->current->type += " coclass" ;
1680 yyextra->current->fileName = yyextra->fileName;
1681 yyextra->current->startLine = yyextra->yyLineNr;
1682 yyextra->current->startColumn = yyextra->yyColNr;
1683 yyextra->current->bodyLine = yyextra->yyLineNr;
1684 yyextra->current->bodyColumn = yyextra->yyColNr;
1686 BEGIN( CompoundName ) ;
1687 }
1688 else
1689 {
1691 yyextra->current->name = yytext;
1692 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1694 }
1695 }
1696<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1697<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1698 if (yyextra->insideJava) REJECT;
1700 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1701 bool isConst=decl.
find(
"const")!=-1;
1702 bool isVolatile=decl.
find(
"volatile")!=-1;
1703 yyextra->current->section = EntryType::makeClass() ;
1706
1707 setPublished(spec.isPublished()).
1708 setInline(spec.isInline()).
1709 setLocal(spec.isLocal());
1710
1711
1713 if (isConst)
1714 {
1715 yyextra->current->type += " const";
1716 }
1717 else if (isVolatile)
1718 {
1719 yyextra->current->type += " volatile";
1720 }
1721 yyextra->current->type += " struct" ;
1722 yyextra->current->fileName = yyextra->fileName;
1723 yyextra->current->startLine = yyextra->yyLineNr;
1724 yyextra->current->startColumn = yyextra->yyColNr;
1725 yyextra->current->bodyLine = yyextra->yyLineNr;
1726 yyextra->current->bodyColumn = yyextra->yyColNr;
1728 if (yytext[yyleng-1]=='{') unput('{');
1729 BEGIN( CompoundName ) ;
1730 }
1731<FindMembers>{B}*"value struct{" | // C++/CLI extension
1732<FindMembers>{B}*"value struct"{BN}+ {
1733 yyextra->isTypedef=
FALSE;
1734 yyextra->current->section = EntryType::makeClass();
1735 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1737 yyextra->current->type += " value struct" ;
1738 yyextra->current->fileName = yyextra->fileName;
1739 yyextra->current->startLine = yyextra->yyLineNr;
1740 yyextra->current->startColumn = yyextra->yyColNr;
1741 yyextra->current->bodyLine = yyextra->yyLineNr;
1742 yyextra->current->bodyColumn = yyextra->yyColNr;
1744 if (yytext[yyleng-1]=='{') unput('{');
1745 BEGIN( CompoundName ) ;
1746 }
1747<FindMembers>{B}*"ref struct{" | // C++/CLI extension
1748<FindMembers>{B}*"ref struct"{BN}+ {
1749 yyextra->isTypedef=
FALSE;
1750 yyextra->current->section = EntryType::makeClass();
1751 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1753 yyextra->current->type += " ref struct" ;
1754 yyextra->current->fileName = yyextra->fileName;
1755 yyextra->current->startLine = yyextra->yyLineNr;
1756 yyextra->current->startColumn = yyextra->yyColNr;
1757 yyextra->current->bodyLine = yyextra->yyLineNr;
1758 yyextra->current->bodyColumn = yyextra->yyColNr;
1760 if (yytext[yyleng-1]=='{') unput('{');
1761 BEGIN( CompoundName ) ;
1762 }
1763<FindMembers>{B}*"interface struct{" | // C++/CLI extension
1764<FindMembers>{B}*"interface struct"{BN}+ {
1765 yyextra->isTypedef=
FALSE;
1766 yyextra->current->section = EntryType::makeClass();
1767 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1769 yyextra->current->type += " interface struct";
1770 yyextra->current->fileName = yyextra->fileName;
1771 yyextra->current->startLine = yyextra->yyLineNr;
1772 yyextra->current->startColumn = yyextra->yyColNr;
1773 yyextra->current->bodyLine = yyextra->yyLineNr;
1774 yyextra->current->bodyColumn = yyextra->yyColNr;
1776 if (yytext[yyleng-1]=='{') unput('{');
1777 BEGIN( CompoundName ) ;
1778 }
1779<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1780<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1781 if (yyextra->insideJava) REJECT;
1783 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1784 bool isConst=decl.
find(
"const")!=-1;
1785 bool isVolatile=decl.
find(
"volatile")!=-1;
1786 yyextra->current->section = EntryType::makeClass();
1788
1789
1791 if (isConst)
1792 {
1793 yyextra->current->type += " const";
1794 }
1795 else if (isVolatile)
1796 {
1797 yyextra->current->type += " volatile";
1798 }
1799 yyextra->current->type += " union" ;
1800 yyextra->current->fileName = yyextra->fileName;
1801 yyextra->current->startLine = yyextra->yyLineNr;
1802 yyextra->current->startColumn = yyextra->yyColNr;
1803 yyextra->current->bodyLine = yyextra->yyLineNr;
1804 yyextra->current->bodyColumn = yyextra->yyColNr;
1806 if (yytext[yyleng-1]=='{') unput('{');
1807 BEGIN( CompoundName ) ;
1808 }
1809<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1810<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum
1812 yyextra->isTypedef = text.
find(
"typedef")!=-1;
1813 bool isStrongEnum = text.
find(
"class")!=-1 || yyextra->insideCS;
1814 bool isEnumSytruct = text.
find(
"struct")!=-1;
1815 if (yyextra->insideJava)
1816 {
1817 yyextra->current->section = EntryType::makeClass();
1820 }
1821 else
1822 {
1823 yyextra->current->section = EntryType::makeEnum() ;
1824 }
1826 yyextra->current->type += " enum";
1827 if (isStrongEnum)
1828 {
1829 yyextra->current->spec.setStrong(true);
1830 }
1831 if (isEnumSytruct)
1832 {
1833 yyextra->current->spec.setStrong(true).setEnumStruct(true);
1834 }
1835 yyextra->current->fileName = yyextra->fileName;
1836 yyextra->current->startLine = yyextra->yyLineNr;
1837 yyextra->current->startColumn = yyextra->yyColNr;
1838 yyextra->current->bodyLine = yyextra->yyLineNr;
1839 yyextra->current->bodyColumn = yyextra->yyColNr;
1841 if (yytext[yyleng-1]=='{') unput('{');
1842 BEGIN( CompoundName ) ;
1843 }
1844<FindMembers>{B}*"concept"{BN}+ { // C++20 concept
1845 if (yyextra->insideJava) REJECT;
1846 yyextra->isTypedef=
FALSE;
1847 yyextra->current->section = EntryType::makeConcept();
1849 yyextra->current->type += " concept";
1850 yyextra->current->fileName = yyextra->fileName;
1851 yyextra->current->startLine = yyextra->yyLineNr;
1852 yyextra->current->startColumn = yyextra->yyColNr;
1853 yyextra->current->bodyLine = yyextra->yyLineNr;
1854 yyextra->current->bodyColumn = yyextra->yyColNr;
1856 BEGIN( ConceptName ) ;
1857 }
1858<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" { // A::operator()<int>(int arg)
1860 yyextra->current->name += "()";
1861 BEGIN( FindMembers );
1862 }
1863<Operator>"("{BN}*")"{BNopt}/"(" {
1865 yyextra->current->name += yytext ;
1866 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1867 BEGIN( FindMembers ) ;
1868 }
1869<Operator>";" { // can occur when importing members
1870 unput(';');
1871 BEGIN( FindMembers ) ;
1872 }
1873<Operator>[^(] {
1875 yyextra->current->name += *yytext ;
1876 }
1877<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" { /* skip guided templ specifiers */
1878 if (!yyextra->current->type.startsWith("friend "))
1879 {
1880 yyextra->current->name += yytext;
1881 }
1882 }
1883<Operator>"(" {
1884 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1885 unput(*yytext);
1886 BEGIN( FindMembers ) ;
1887 }
1888<FindMembers>("template"|"generic")({BN}*)"<"/[>]? { // generic is a C++/CLI extension
1891 yyextra->current->tArgLists.
push_back(al);
1892 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1893 yyextra->templateStr="<";
1894 yyextra->fullArgString = yyextra->templateStr;
1895 yyextra->copyArgString = &yyextra->templateStr;
1896 yyextra->currentArgumentContext = FindMembers;
1897 BEGIN( ReadTempArgs );
1898 }
void push_back(const Argument &a)
1899<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
1900 if (yyextra->insideJava) REJECT;
1902 BEGIN( NSAliasName );
1903 }
1904<NSAliasName>{ID} {
1905 yyextra->aliasName = yytext;
1906 BEGIN( NSAliasArg );
1907 }
1908<NSAliasArg>({ID}"::")*{ID} {
1909
1910 std::string ctx = yyextra->current_root->name.str();
1911 if (ctx.empty())
1912 {
1914 }
1915 else
1916 {
1918 }
1919 }
static NamespaceAliasInfoMap namespaceAliasMap
1920<NSAliasArg>";" {
1921 BEGIN( FindMembers );
1922 }
1923<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1925 yyextra->aliasName=yytext;
1926 BEGIN(PHPUseAs);
1927 }
1928<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1931
1932 yyextra->current->fileName = yyextra->fileName;
1933
1934 yyextra->current->section = EntryType::makeUsingDecl();
1935 yyextra->current_root->copyToSubEntry(yyextra->current);
1936
1937 yyextra->current->section = EntryType::makeUsingDir();
1938 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1940 yyextra->aliasName.clear();
1941 }
QCString removeRedundantWhiteSpace(const QCString &s)
1942<PHPUseAs>{BN}+"as"{BN}+ {
1944 }
1945<PHPUseAs>{PHPUSEKW} {
1946 }
1947<PHPUseAs>{ID} {
1948
1949 if (!yyextra->aliasName.isEmpty())
1950 {
1953 }
1954 yyextra->aliasName.clear();
1955 }
const std::string & str() const
1956<PHPUse,PHPUseAs>[,;] {
1957 if (*yytext==',')
1958 {
1959 BEGIN(PHPUse);
1960 }
1961 else
1962 {
1963 BEGIN(FindMembers);
1964 }
1965 }
1966<JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
1970 yyextra->current->fileName = yyextra->fileName;
1971 bool ambig = false;
1973 if (incFd)
1974 {
1976 }
1977 yyextra->current->section = EntryType::makeUsingDir();
1978 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1980 BEGIN(Using);
1981 }
static FileNameLinkedMap * inputNameLinkedMap
A model of a file symbol.
virtual void addIncludeDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
1982<JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
1986 yyextra->current->fileName = yyextra->fileName;
1987 bool ambig = false;
1990 if (fromFd)
1991 {
1993 }
1994 if (toFd && fromFd)
1995 {
1997 }
1998 if (yyextra->insideD)
1999 {
2000 yyextra->current->section = EntryType::makeUsingDir();
2001 }
2002 else
2003 {
2004
2005 yyextra->current->section = EntryType::makeUsingDecl();
2006 }
2007 yyextra->previous = yyextra->current;
2008 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2010 BEGIN(Using);
2011 }
virtual void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual const QCString & docName() const =0
2012<IDLImport>"\""[^"]*"\"" {
2013 QCString fileName(&yytext[1],yyleng-2);
2014 bool ambig = false;
2017 if (fromFd)
2018 {
2020 }
2021 if (toFd && fromFd)
2022 {
2024 }
2025 }
2026<IDLImport>";" {
2027 BEGIN(FindMembers);
2028 }
2029<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2030 if (yyextra->insideJava) REJECT;
2031 yyextra->current->startLine=yyextra->yyLineNr;
2032 yyextra->current->startColumn = yyextra->yyColNr;
2034 BEGIN(Using);
2035 }
2036<Using>"namespace"{BN}+ { lineCount(yyscanner); BEGIN(UsingDirective); }
2037<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2039 yyextra->current->name=yytext;
2040 yyextra->current->fileName = yyextra->fileName;
2041 yyextra->current->section = EntryType::makeUsingDecl();
2042 yyextra->current->startLine = yyextra->yyLineNr;
2043 yyextra->previous = yyextra->current;
2044 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2046 if (yyextra->insideCS)
2047
2048
2049
2050 {
2051 yyextra->current->name=yytext;
2052 yyextra->current->fileName = yyextra->fileName;
2053 yyextra->current->startLine = yyextra->yyLineNr;
2054 yyextra->current->startColumn = yyextra->yyColNr;
2055 yyextra->current->section = EntryType::makeUsingDir();
2056 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2058 }
2059 BEGIN(Using);
2060 }
2061<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" { // C++11 style using alias
2063 yyextra->current->fileName = yyextra->fileName;
2064 yyextra->current->section = EntryType::makeUsingDecl();
2065 yyextra->current->startLine = yyextra->yyLineNr;
2066 yyextra->current->bodyLine = yyextra->yyLineNr;
2067 yyextra->current->bodyColumn = yyextra->yyColNr;
2068 yyextra->lastInitializerContext = UsingAlias;
2069 yyextra->sharpCount=0;
2070 yyextra->initBracketCount=0;
2072 BEGIN(ReadInitializer);
2073 }
2074<UsingAlias>";" {
2075 yyextra->current->section = EntryType::makeVariable();
2077 init.stripPrefix(
"class ");
2078 init.stripPrefix(
"struct ");
2080 yyextra->current->type =
"typedef "+
init;
2081 yyextra->current->args.clear();
2082 yyextra->current->spec.setAlias(true);
2083 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2085 BEGIN(FindMembers);
2086 }
2087<UsingAlias>. {
2088 yyextra->current->initializer << yytext;
2089 }
2090<UsingAlias>\n {
2091 yyextra->current->initializer << yytext;
2093 }
2094<UsingDirective>{SCOPENAME} { yyextra->current->name=removeRedundantWhiteSpace(yytext);
2095 yyextra->current->fileName = yyextra->fileName;
2096 yyextra->current->section = EntryType::makeUsingDir();
2097 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2099 BEGIN(Using);
2100 }
2101<Using>";" { BEGIN(FindMembers); }
2102<FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl
2106 }
2107<FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
2109 if (yyextra->insideCpp && name=="import") REJECT;
2110 yyextra->roundCount=0;
2111 yyextra->sharpCount=0;
2114 yyextra->current->name=name;
2115
2116
2118 BEGIN( Operator );
2119 else
2120 BEGIN( EndTemplate );
2121 }
static bool nameIsOperator(QCString &name)
2122<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2123 yyextra->sharpCount=0;
2124 yyextra->roundCount=0;
2127
2128
2130 BEGIN( Operator );
2131 else
2132 BEGIN( EndTemplate );
2133 }
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
2134<EndTemplate>"<<<" {
2135 if (!yyextra->insidePHP)
2136 {
2137 REJECT;
2138 }
2139 else
2140 {
2141 yyextra->lastHereDocContext = YY_START;
2142 BEGIN(HereDoc);
2143 }
2144 }
2145<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2146 yyextra->current->name+=yytext;
2147
2148 }
2149<EndTemplate>"<" {
2150 if (yyextra->roundCount==0)
2151 {
2152
2153 yyextra->sharpCount++;
2154 }
2155 yyextra->current->name+=yytext;
2156 }
2157<ClassTemplSpec,EndTemplate>">=" {
2158 yyextra->current->name+=yytext;
2159 }
2160<ClassTemplSpec,EndTemplate>(">>") {
2161 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2162 {
2163 unput('>');
2164 unput(' ');
2165 unput('>');
2166 }
2167 else
2168 {
2169 yyextra->current->name+=yytext;
2170 }
2171
2172 }
2173<EndTemplate>">" {
2174 yyextra->current->name+='>';
2175
2176 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2177 {
2178 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2179
2180 BEGIN(FindMembers);
2181 }
2182 }
2183<EndTemplate>">"{BN}*"(" {
2185 yyextra->current->name+='>';
2186
2187 if (yyextra->roundCount==0)
2188 {
2189 --yyextra->sharpCount;
2190 }
2191 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2192 {
2193 yyextra->current->bodyLine = yyextra->yyLineNr;
2194 yyextra->current->bodyColumn = yyextra->yyColNr;
2195 yyextra->current->args = "(";
2196 yyextra->currentArgumentContext = FuncQual;
2197 yyextra->fullArgString = yyextra->current->args;
2198 yyextra->copyArgString = &yyextra->current->args;
2199
2200 BEGIN( ReadFuncArgType ) ;
2201 }
2202 else
2203 {
2204 yyextra->current->name+="(";
2205 yyextra->roundCount++;
2206 }
2207 }
2208<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
2210 yyextra->current->name+='>';
2211 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2212 {
2213 BEGIN(FindMembers);
2214 }
2215 }
2216<EndTemplate>">"{BNopt}/"::" {
2218 yyextra->current->name+='>';
2219
2220 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2221 {
2222 BEGIN(FindMemberName);
2223 }
2224 }
2225<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2226 yyextra->roundCount++;
2227 }
2228<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2229 if (yyextra->roundCount>0) yyextra->roundCount--;
2230 }
2231<EndTemplate>. {
2232 yyextra->current->name+=*yytext;
2233
2234 }
2235<FindMembers>"define"{BN}*"("{BN}*["'] {
2236 if (yyextra->insidePHP)
2237 {
2238 yyextra->current->bodyLine = yyextra->yyLineNr;
2239 yyextra->current->bodyColumn = yyextra->yyColNr;
2240 BEGIN( DefinePHP );
2241 }
2242 else
2243 REJECT;
2244 }
2245<CopyHereDoc>{ID} { // PHP heredoc
2246 yyextra->delimiter = yytext;
2247 *yyextra->pCopyHereDocGString << yytext;
2248 BEGIN(CopyHereDocEnd);
2249 }
2250<CopyHereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2251 yyextra->delimiter = &yytext[1];
2252 *yyextra->pCopyHereDocGString << yytext;
2253 BEGIN(CopyHereDocEnd);
2254 }
2255<CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
2256 yyextra->delimiter = &yytext[1];
2257 *yyextra->pCopyHereDocGString << yytext;
2258 BEGIN(CopyHereDocEnd);
2259 }
2260<HereDoc>{ID} { // PHP heredoc
2261 yyextra->delimiter = yytext;
2262 BEGIN(HereDocEnd);
2263 }
2264<HereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2265 yyextra->delimiter = &yytext[1];
2266 BEGIN(HereDocEnd);
2267 }
2268<HereDoc>"'"{ID}/"'" { // PHP nowdoc
2269 yyextra->delimiter = &yytext[1];
2270 BEGIN(HereDocEnd);
2271 }
2272<HereDocEnd>^{ID} { // id at start of the line could mark the end of the block
2273 if (yyextra->delimiter==yytext)
2274 {
2275 BEGIN(yyextra->lastHereDocContext);
2276 }
2277 }
2278<HereDocEnd>. { }
2279<CopyHereDocEnd>^{Bopt}{ID} { // id at start of the line could mark the end of the block
2280 *yyextra->pCopyHereDocGString << yytext;
2282 {
2283 BEGIN(yyextra->lastHereDocContext);
2284 }
2285 }
2286<CopyHereDocEnd>\n {
2288 *yyextra->pCopyHereDocGString << yytext;
2289 }
2290<CopyHereDocEnd>{ID} {
2291 *yyextra->pCopyHereDocGString << yytext;
2292 }
2293<CopyHereDocEnd>. {
2294 *yyextra->pCopyHereDocGString << yytext;
2295 }
2296<FindMembers>"Q_OBJECT"|"Q_GADGET" { // Qt object / gadget macro
2297 }
2298<FindMembers>"Q_PROPERTY" { // Qt property declaration
2299 yyextra->yyBegLineNr = yyextra->yyLineNr;
2300 yyextra->yyBegColNr = yyextra->yyColNr;
2301 yyextra->current->protection = Protection::Public ;
2302 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2303 yyextra->current->type.clear();
2304 BEGIN(QtPropType);
2305 }
2306<QtPropType>"(" { // start of property arguments
2307 }
2308<QtPropAttr>")" { // end of property arguments
2309 unput(';');
2310 BEGIN(FindMembers);
2311 }
2312<QtPropType>{BN}+ {
2313 yyextra->current->name+=yytext;
2314 }
2315<QtPropType>"*" {
2316 yyextra->current->type+= yyextra->current->name;
2317 yyextra->current->type+= yytext;
2318 yyextra->current->name="";
2319 }
2320<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2321 yyextra->current->type+= yyextra->current->name;
2322 yyextra->current->name=yytext;
2323 }
2324<QtPropType,QtPropAttr>{BN}+"READ"{BN}+ {
2325 yyextra->current->spec.setReadable(true);
2326 BEGIN(QtPropRead);
2327 }
2328<QtPropType,QtPropAttr>{BN}+"WRITE"{BN}+ {
2329 yyextra->current->spec.setWritable(true);
2330 BEGIN(QtPropWrite);
2331 }
2332<QtPropType,QtPropAttr>{BN}+"MEMBER"{BN}+{ID} | // member property => not supported yet
2333<QtPropType,QtPropAttr>{BN}+"RESET"{BN}+{ID} | // reset method => not supported yet
2334<QtPropType,QtPropAttr>{BN}+"SCRIPTABLE"{BN}+{ID} | // scriptable property => not supported yet
2335<QtPropType,QtPropAttr>{BN}+"DESIGNABLE"{BN}+{ID} | // designable property => not supported yet
2336<QtPropType,QtPropAttr>{BN}+"NOTIFY"{BN}+{ID} | // notify property => not supported yet
2337<QtPropType,QtPropAttr>{BN}+"REVISION"{BN}+{ID} | // revision property => not supported yet
2338<QtPropType,QtPropAttr>{BN}+"STORED"{BN}+{ID} | // stored property => not supported yet
2339<QtPropType,QtPropAttr>{BN}+"USER"{BN}+{ID} | // user property => not supported yet
2340<QtPropType,QtPropAttr>{BN}+"CONSTANT"{BN} | // constant property => not supported yet
2341<QtPropType,QtPropAttr>{BN}+"FINAL"{BN} { // final property => not supported yet
2342 BEGIN(QtPropAttr);
2343 }
2344<QtPropRead>{ID} {
2345 yyextra->current->read = yytext;
2346 BEGIN(QtPropAttr);
2347 }
2348<QtPropWrite>{ID} {
2349 yyextra->current->write = yytext;
2350 BEGIN(QtPropAttr);
2351 }
2352<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2353 yyextra->current->name=yytext;
2355 BEGIN(FindMembers);
2356 }
2357<FindMembers>"requires" { // C++20 requires clause
2358 if (yyextra->insideJava) REJECT;
2359 yyextra->current->req.clear();
2360 yyextra->requiresContext = YY_START;
2361 BEGIN(RequiresClause);
2362 }
2363<RequiresClause>"requires"{BN}*/"{" { // requires requires { ... }
2364 if (yyextra->insideJava) REJECT;
2366 yyextra->current->req+=yytext;
2367 BEGIN( RequiresExpression ) ;
2368 }
2369<RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
2370 if (yyextra->insideJava) REJECT;
2372 yyextra->current->req+=yytext;
2373 yyextra->lastRoundContext=RequiresExpression;
2374 yyextra->pCopyRoundString=&yyextra->current->req;
2375 yyextra->roundCount=0;
2376 BEGIN( CopyRound ) ;
2377 }
2378<RequiresExpression>"{" {
2379 yyextra->current->req+=yytext;
2380 yyextra->lastCurlyContext=RequiresClause;
2381 yyextra->pCopyCurlyString=&yyextra->current->req;
2382 yyextra->curlyCount=0;
2383 BEGIN( CopyCurly ) ;
2384 }
2385<RequiresExpression>\n {
2386 yyextra->current->req+=' ';
2388 }
2389<RequiresExpression>. {
2390 yyextra->current->req+=yytext;
2391 }
2392<RequiresClause>"(" { // requires "(A && B)"
2393 yyextra->current->req+=yytext;
2394 yyextra->lastRoundContext=RequiresClause;
2395 yyextra->pCopyRoundString=&yyextra->current->req;
2396 yyextra->roundCount=0;
2397 BEGIN( CopyRound ) ;
2398 }
2399<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" { // "requires func(x)"
2401 {
2403 yyextra->current->req+=yytext;
2404 yyextra->lastRoundContext=RequiresClause;
2405 yyextra->pCopyRoundString=&yyextra->current->req;
2406 yyextra->roundCount=0;
2407 BEGIN( CopyRound );
2408 }
2409 else
2410 {
2411 REJECT;
2412 }
2413 }
static bool startOfRequiresExpression(const QCString &req)
2414<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
2416 {
2418 yyextra->current->req+=yytext;
2419 yyextra->lastSharpContext=RequiresClause;
2420 yyextra->pCopySharpString=&yyextra->current->req;
2421 yyextra->sharpCount=0;
2422 BEGIN( CopySharp );
2423 }
2424 else
2425 {
2426 REJECT
2427 }
2428 }
2429<RequiresClause>{NOTopt}{SCOPENAME} { // something like "requires true" or "requires !my::value"
2431 {
2433 yyextra->current->req=yytext;
2434 BEGIN(yyextra->requiresContext);
2435 }
2436 else
2437 {
2438 REJECT;
2439 }
2440 }
2441<RequiresClause>{NOTopt}"::"{ID} {
2443 yyextra->current->req+=yytext;
2444 }
2445<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) { // "requires A || B" or "requires A && B"
2447 yyextra->current->req+=yytext;
2448 }
2449<RequiresClause>{BN}+ {
2450 yyextra->current->req+=' ';
2452 }
2453<RequiresClause>. {
2454 unput(*yytext);
2455 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2456 BEGIN(yyextra->requiresContext);
2457 }
2458<FindMembers,FindMemberName>{SCOPENAME} {
2460 yyextra->yyBegColNr=yyextra->yyColNr;
2461 yyextra->yyBegLineNr=yyextra->yyLineNr;
2463 if (yyextra->insideIDL && yyleng==9 &&
qstrcmp(yytext,
"cpp_quote")==0)
2464 {
2465 BEGIN(CppQuote);
2466 }
2467 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
qstrcmp(yytext,
"import")==0)
2468 {
2469 if (yyextra->insideIDL)
2470 BEGIN(IDLImport);
2471 else
2472 BEGIN(JavaImport);
2473 }
2474 else if (yyextra->insidePHP &&
qstrcmp(yytext,
"use")==0)
2475 {
2476 BEGIN(PHPUse);
2477 }
2478 else if (yyextra->insideJava &&
qstrcmp(yytext,
"package")==0)
2479 {
2481 BEGIN(PackageName);
2482 }
2483 else if (yyextra->insideIDL &&
qstrcmp(yytext,
"case")==0)
2484 {
2485 BEGIN(IDLUnionCase);
2486 }
2487 else if (yyextra->insideTryBlock &&
qstrcmp(yytext,
"catch")==0)
2488 {
2489 yyextra->insideTryBlock=
FALSE;
2490 BEGIN(TryFunctionBlock);
2491 }
2492 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"alignas")==0)
2493 {
2494 yyextra->lastAlignAsContext = YY_START;
2495 BEGIN(AlignAs);
2496 }
2497 else if (yyextra->insideJS &&
qstrcmp(yytext,
"var")==0)
2498 {
2499 yyextra->current->type="var";
2500 }
2501 else if (yyextra->insideJS &&
qstrcmp(yytext,
"function")==0)
2502 {
2503 yyextra->current->type="function";
2504 }
2505 else if (yyextra->insideCS &&
qstrcmp(yytext,
"this")==0)
2506 {
2507
2509 yyextra->current->name="this";
2510 BEGIN(CSIndexer);
2511 }
2512 else if (yyextra->insideCpp && (
qstrcmp(yytext,
"static_assert")==0 ||
qstrcmp(yytext,
"_Static_assert")==0))
2513 {
2514
2515 BEGIN(StaticAssert);
2516 }
2517 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"decltype")==0)
2518 {
2519
2521 if (!yyextra->current->type.isEmpty()) yyextra->current->type+=' ';
2522 yyextra->current->type+=yytext;
2523 BEGIN(DeclType);
2524 }
2525 else if (yyextra->insideSlice &&
qstrcmp(yytext,
"optional")==0)
2526 {
2527 if (yyextra->current->type.isEmpty())
2528 {
2529 yyextra->current->type = "optional";
2530 }
2531 else
2532 {
2533 yyextra->current->type += " optional";
2534 }
2535 yyextra->lastModifierContext = YY_START;
2536 BEGIN(SliceOptional);
2537 }
2538 else
2539 {
2540 if (YY_START==FindMembers)
2541 {
2543 }
2544 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2545 if (javaLike &&
qstrcmp(yytext,
"public")==0)
2546 {
2547 yyextra->current->protection = Protection::Public;
2548 }
2549 else if (javaLike &&
qstrcmp(yytext,
"protected")==0)
2550 {
2551 yyextra->current->protection = Protection::Protected;
2552 }
2553 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
qstrcmp(yytext,
"internal")==0)
2554 {
2555 yyextra->current->protection = Protection::Package;
2556 }
2557 else if (javaLike &&
qstrcmp(yytext,
"private")==0)
2558 {
2559 yyextra->current->protection = Protection::Private;
2560 }
2561 else if (javaLike &&
qstrcmp(yytext,
"static")==0)
2562 {
2563 if (YY_START==FindMembers)
2564 yyextra->current->name = yytext;
2565 else
2566 yyextra->current->name += yytext;
2567 yyextra->current->isStatic =
TRUE;
2568 }
2569 else
2570 {
2571 if (YY_START==FindMembers)
2572 yyextra->current->name = yytext;
2573 else
2574 yyextra->current->name += yytext;
2575 if (yyextra->current->name.startsWith("static "))
2576 {
2577 yyextra->current->isStatic =
TRUE;
2578 yyextra->current->name= yyextra->current->name.mid(7);
2579 }
2580 else if (yyextra->current->name.startsWith("inline "))
2581 {
2582 if (yyextra->current->type.isEmpty())
2583 {
2584 yyextra->current->type="inline";
2585 }
2586 else
2587 {
2588 yyextra->current->type+="inline ";
2589 }
2590 yyextra->current->name= yyextra->current->name.mid(7);
2591 }
2592 else if (yyextra->current->name.startsWith("constexpr "))
2593 {
2594 if (yyextra->current->type.isEmpty())
2595 {
2596 yyextra->current->type="constexpr";
2597 }
2598 else
2599 {
2600 yyextra->current->type+="constexpr ";
2601 }
2602 yyextra->current->name=yyextra->current->name.mid(10);
2603 }
2604 else if (yyextra->current->name.startsWith("consteval "))
2605 {
2606 if (yyextra->current->type.isEmpty())
2607 {
2608 yyextra->current->type="consteval";
2609 }
2610 else
2611 {
2612 yyextra->current->type+="consteval ";
2613 }
2614 yyextra->current->name=yyextra->current->name.mid(10);
2615 }
2616 else if (yyextra->current->name.startsWith("constinit "))
2617 {
2618 if (yyextra->current->type.isEmpty())
2619 {
2620 yyextra->current->type="constinit";
2621 }
2622 else
2623 {
2624 yyextra->current->type+="constinit ";
2625 }
2626 yyextra->current->name=yyextra->current->name.mid(10);
2627 }
2628 else if (yyextra->current->name.startsWith("const "))
2629 {
2630 if (yyextra->current->type.isEmpty())
2631 {
2632 yyextra->current->type="const";
2633 }
2634 else
2635 {
2636 yyextra->current->type+="const ";
2637 }
2638 yyextra->current->name=yyextra->current->name.mid(6);
2639 }
2640 else if (yyextra->current->name.startsWith("volatile "))
2641 {
2642 if (yyextra->current->type.isEmpty())
2643 {
2644 yyextra->current->type="volatile";
2645 }
2646 else
2647 {
2648 yyextra->current->type+="volatile ";
2649 }
2650 yyextra->current->name=yyextra->current->name.mid(9);
2651 }
2652 else if (yyextra->current->name.startsWith("typedef "))
2653 {
2654 if (yyextra->current->type.isEmpty())
2655 {
2656 yyextra->current->type="typedef";
2657 }
2658 else
2659 {
2660 yyextra->current->type+="typedef ";
2661 }
2662 yyextra->current->name=yyextra->current->name.mid(8);
2663 }
2664 }
2667 {
2668 BEGIN( Operator );
2669 }
2670 else
2671 {
2672 yyextra->externLinkage=
FALSE;
2673 BEGIN(FindMembers);
2674 }
2675 }
2676 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2677 }
2678<StaticAssert>"(" {
2679 yyextra->lastSkipRoundContext = FindMembers;
2680 yyextra->roundCount=0;
2681 BEGIN(SkipRound);
2682 }
2683<StaticAssert>{BN}+ { lineCount(yyscanner); }
2684<StaticAssert>. { // variable with static_assert as name?
2685 unput(*yytext);
2686 BEGIN(FindMembers);
2687 }
2688<DeclType>"(" {
2689 yyextra->current->type+=yytext;
2690 yyextra->lastRoundContext=FindMembers;
2691 yyextra->pCopyRoundString=&yyextra->current->type;
2692 yyextra->roundCount=0;
2693 BEGIN(CopyRound);
2694 }
2695<DeclType>{BN}+ { lineCount(yyscanner); }
2696<DeclType>. {
2697 unput(*yytext);
2698 BEGIN(FindMembers);
2699 }
2700<CSIndexer>"["[^\n\]]*"]" {
2702 BEGIN(FindMembers);
2703 }
2704<FindMembers>[0-9]{ID} { // some number where we did not expect one
2705 }
2706<FindMembers>"." {
2707 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2708 {
2709 yyextra->current->name+=".";
2710 }
2711 }
2712<FindMembers>"::" {
2713 yyextra->current->name+=yytext;
2714 }
2715<CppQuote>"("{B}*"\"" {
2716 yyextra->insideCppQuote=
TRUE;
2717 BEGIN(FindMembers);
2718 }
2719<IDLUnionCase>"::"
2720<IDLUnionCase>":" { BEGIN(FindMembers); }
2721<IDLUnionCase>\n { lineCount(yyscanner); }
2722<IDLUnionCase>.
2723<TryFunctionBlock>\n { lineCount(yyscanner); }
2724<TryFunctionBlock>"{" {
2725 yyextra->curlyCount=0;
2726 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2727 BEGIN( SkipCurly );
2728 }
2729<TryFunctionBlock>.
2730<TryFunctionBlockEnd>{BN}*"catch" { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
2731 }
2732<TryFunctionBlockEnd>\n { unput(*yytext); // rule added to fix bug id 601138
2733 BEGIN( FindMembers );
2734 }
2735<TryFunctionBlockEnd>. { unput(*yytext);
2736 BEGIN( FindMembers );
2737 }
2738<EndCppQuote>")" {
2739 yyextra->insideCppQuote=
FALSE;
2740 BEGIN(FindMembers);
2741 }
2742<FindMembers,FindFields>{B}*"#" { if (yyextra->insidePHP)
2743 REJECT;
2744 yyextra->lastCPPContext = YY_START;
2745 BEGIN( SkipCPP ) ;
2746 }
2747<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2748<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2749 if (yyextra->insidePHP)
2750 REJECT;
2751 yyextra->current->bodyLine = yyextra->yyLineNr;
2752 yyextra->current->bodyColumn = yyextra->yyColNr;
2753 yyextra->current->fileName = yyextra->fileName;
2754 yyextra->current->startLine = yyextra->yyLineNr;
2755 yyextra->current->startColumn = yyextra->yyColNr;
2756 yyextra->current->type.clear();
2757 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2758 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2759 yyextra->current->section = EntryType::makeDefine();
2760 yyextra->lastDefineContext = YY_START;
2761 BEGIN( SDefine );
2762 }
2763<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
2764 yyextra->yyLineNr = atoi(&yytext[1]);
2765
2766 yyextra->lastPreLineCtrlContext = YY_START;
2767 if (YY_START==ReadBody ||
2768 YY_START==ReadNSBody ||
2769 YY_START==ReadBodyIntf)
2770 {
2771 yyextra->current->program << yytext;
2772 }
2773 BEGIN( PreLineCtrl );
2774 }
2775<PreLineCtrl>"\""[^\n\"]*"\"" {
2777 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2778 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2779 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2780 {
2781 yyextra->current->program << yytext;
2782 }
2783 }
static QCString stripQuotes(const char *s)
2784<PreLineCtrl>. {
2785 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2786 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2787 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2788 {
2789 yyextra->current->program << yytext;
2790 }
2791 }
2792<PreLineCtrl>\n {
2793 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2794 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2795 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2796 {
2797 yyextra->current->program << yytext;
2798 }
2800 BEGIN( yyextra->lastPreLineCtrlContext );
2801 }
2802<SkipCPP>.
2803<SkipCPP>\\[\r]*"\n"[\r]* { lineCount(yyscanner); }
2804<SkipCPP>[\r]*\n[\r]* { lineCount(yyscanner);
2805 BEGIN( yyextra->lastCPPContext) ;
2806 }
2807<SDefine>{ID}{B}*"(" {
2808 yyextra->current->name = yytext;
2809 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2810 yyextra->current->args = "(";
2811 yyextra->current->bodyLine = yyextra->yyLineNr;
2812 yyextra->current->bodyColumn = yyextra->yyColNr;
2813 yyextra->currentArgumentContext = DefineEnd;
2814 yyextra->fullArgString=yyextra->current->args;
2815 yyextra->copyArgString=&yyextra->current->args;
2816 BEGIN( ReadFuncArgType ) ;
2817 }
2818
2819<DefineArg>")" {
2820
2821 yyextra->current->args += ')';
2822 BEGIN( DefineEnd );
2823 }
2824<DefineArg>. {
2825 yyextra->current->args += *yytext;
2826 }
2827 */
2828<SDefine>{ID} {
2829
2831 yyextra->current->bodyLine = yyextra->yyLineNr;
2832 yyextra->current->bodyColumn = yyextra->yyColNr;
2833 yyextra->current->name = yytext;
2834 BEGIN(DefineEnd);
2835 }
2836<DefineEnd><<EOF>> |
2837<DefineEnd>\n {
2838
2840 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2842 BEGIN(yyextra->lastDefineContext);
2843 }
2844<DefinePHPEnd>";" {
2845
2846 yyextra->current->fileName = yyextra->fileName;
2847 yyextra->current->startLine = yyextra->yyLineNr;
2848 yyextra->current->startColumn = yyextra->yyColNr;
2849 yyextra->current->type.clear();
2850 yyextra->current->type = "const";
2854 yyextra->current->initializer.str(
init.str());
2855 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2856 yyextra->current->section = EntryType::makeVariable();
2857 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2859 BEGIN(FindMembers);
2860 }
2861<DefinePHPEnd>.
2862<DefineEnd>\\[\r]?\n {
2864 yyextra->current->endBodyLine = yyextra->yyLineNr;
2865 }
2866<DefineEnd>\" {
2867 if (yyextra->insideIDL && yyextra->insideCppQuote)
2868 {
2869 BEGIN(EndCppQuote);
2870 }
2871 else
2872 {
2873 yyextra->lastStringContext=DefineEnd;
2874 BEGIN(SkipString);
2875 }
2876 }
2877<DefineEnd>.
2878<DefinePHP>{ID}["']{BN}*","{BN}* {
2879 yyextra->current->name = yytext;
2880 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2881 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2882 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
2883 yyextra->current->bodyLine = yyextra->yyLineNr;
2884 yyextra->current->bodyColumn = yyextra->yyColNr;
2885 yyextra->lastRoundContext = DefinePHPEnd;
2886 yyextra->pCopyRoundGString = &yyextra->current->initializer;
2887 yyextra->roundCount = 0;
2888 BEGIN( GCopyRound );
2889 }
2890
2891<FindMembers>[\^%] { // ^ and % are C++/CLI extensions
2892 if (yyextra->insideCli)
2893 {
2895 yyextra->current->name = yytext ;
2896 }
2897 else
2898 {
2899 REJECT;
2900 }
2901 }
2902<FindMembers>[*&]+ {
2903 yyextra->current->name += yytext ;
2905 }
2906<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
2907 if (yyextra->current->bodyLine==-1)
2908 {
2909 yyextra->current->bodyLine=yyextra->yyLineNr;
2910 yyextra->current->bodyColumn = yyextra->yyColNr;
2911 }
2912 yyextra->docBlockContext = YY_START;
2913 yyextra->docBlockInBody =
FALSE;
2914 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2916
2919 yyextra->docBlock.
str(indent.
str());
2920
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
static int computeIndent(const char *s, int startIndent)
2922
2923 yyextra->docBlockTerm = ';';
2924 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2925 {
2926 yyextra->current->bitfields = ":"+yyextra->current->args;
2927 yyextra->current->args.clear();
2928 yyextra->current->section = EntryType::makeVariable();
2929 }
2930 if (yytext[yyleng-3]=='/')
2931 {
2933 BEGIN( DocLine );
2934 }
2935 else
2936 {
2938 BEGIN( DocBlock );
2939 }
2940 }
static void startCommentBlock(yyscan_t yyscanner, bool)
2941<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
2942 yyextra->docBlockContext = YY_START;
2943 yyextra->docBlockInBody =
FALSE;
2944 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2946
2949 yyextra->docBlock.
str(indent.
str());
2951
2952 yyextra->docBlockTerm = ',';
2953 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2954 {
2955 yyextra->current->bitfields = ":"+yyextra->current->args;
2956 yyextra->current->args.clear();
2957 yyextra->current->section = EntryType::makeVariable();
2958 }
2959 if (yytext[yyleng-3]=='/')
2960 {
2962 BEGIN( DocLine );
2963 }
2964 else
2965 {
2967 BEGIN( DocBlock );
2968 }
2969 }
2970<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
2971 if (yyextra->current->bodyLine==-1)
2972 {
2973 yyextra->current->bodyLine=yyextra->yyLineNr;
2974 yyextra->current->bodyColumn = yyextra->yyColNr;
2975 }
2976 yyextra->docBlockContext = YY_START;
2977 yyextra->docBlockInBody =
FALSE;
2978 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2982 yyextra->docBlock.
str(indent.
str());
2984
2985 yyextra->docBlockTerm = 0;
2986 if (yytext[yyleng-3]=='/')
2987 {
2989 BEGIN( DocLine );
2990 }
2991 else
2992 {
2994 BEGIN( DocBlock );
2995 }
2996 }
2997
2998<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
2999
3000 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3001 {
3002
3003 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3004 }
3005 else
3006 {
3007
3008 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3009 }
3010
3012 if (yytext[1]=='/')
3013 {
3014 if (yytext[2]=='!' || yytext[2]=='/')
3015 {
3016 yyextra->docBlockContext = YY_START;
3017 yyextra->docBlockInBody =
FALSE;
3018 yyextra->docBlockAutoBrief =
FALSE;
3019 yyextra->docBlock.str(std::string());
3020 yyextra->docBlockTerm = 0;
3022 BEGIN(DocLine);
3023 }
3024 else
3025 {
3026 yyextra->lastCContext=YY_START;
3027 BEGIN(SkipCxxComment);
3028 }
3029 }
3030 else
3031 {
3032 if (yytext[2]=='!' || yytext[2]=='*')
3033 {
3034 yyextra->docBlockContext = YY_START;
3035 yyextra->docBlockInBody =
FALSE;
3036 yyextra->docBlock.str(std::string());
3037 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3039 yyextra->docBlockTerm = 0;
3041 BEGIN(DocBlock);
3042 }
3043 else
3044 {
3045 yyextra->lastCContext=YY_START;
3046 BEGIN(SkipComment);
3047 }
3048 }
3049 }
3050<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3051 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3052 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3054 }
3055<FindMembers>"=>" {
3056 if (!yyextra->insideCS) REJECT;
3057 yyextra->current->bodyLine = yyextra->yyLineNr;
3058 yyextra->current->bodyColumn = yyextra->yyColNr;
3059 yyextra->current->initializer.str(yytext);
3060 yyextra->lastInitializerContext = YY_START;
3061 yyextra->sharpCount=0;
3062 yyextra->initBracketCount=0;
3063 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3064 yyextra->current->spec.setGettable(true);
3065 BEGIN(ReadInitializerPtr);
3066 }
3067<FindMembers>"=" { // in PHP code this could also be due to "<?="
3068 yyextra->current->bodyLine = yyextra->yyLineNr;
3069 yyextra->current->bodyColumn = yyextra->yyColNr;
3070 yyextra->current->initializer.str(yytext);
3071 yyextra->lastInitializerContext = YY_START;
3072 yyextra->sharpCount=0;
3073 yyextra->initBracketCount=0;
3074 BEGIN(ReadInitializer);
3075 }
3076<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3078 yyextra->current->exception += " ";
3080 }
3081<UNOIDLAttributeBlock>"}" {
3082 yyextra->current->exception += " }";
3083 BEGIN(FindMembers);
3084 }
3085
3086<ReadInitializer,ReadInitializerPtr>"(" {
3087 yyextra->lastRoundContext=YY_START;
3088 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3089 yyextra->roundCount=0;
3090 yyextra->current->initializer << *yytext;
3091 BEGIN(GCopyRound);
3092 }
3093<ReadInitializer,ReadInitializerPtr>"[" {
3094 if (!yyextra->insidePHP) REJECT;
3095 yyextra->lastSquareContext=YY_START;
3096 yyextra->pCopySquareGString=&yyextra->current->initializer;
3097 yyextra->squareCount=0;
3098 yyextra->current->initializer << *yytext;
3099 BEGIN(GCopySquare);
3100 }
3101<ReadInitializer,ReadInitializerPtr>"{" {
3102 yyextra->lastCurlyContext=YY_START;
3103 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3104 yyextra->curlyCount=0;
3105 yyextra->current->initializer << *yytext;
3106 BEGIN(GCopyCurly);
3107 }
3108<ReadInitializer,ReadInitializerPtr>[;,] {
3109
3110 if (*yytext==';' && yyextra->current_root->spec.isEnum())
3111 {
3112 yyextra->current->fileName = yyextra->fileName;
3113 yyextra->current->startLine = yyextra->yyLineNr;
3114 yyextra->current->startColumn = yyextra->yyColNr;
3115 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3116 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3117 yyextra->current->section = EntryType::makeVariable();
3118 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3120 BEGIN(FindMembers);
3121 }
3122 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3123 {
3124 unput(*yytext);
3125 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3126 BEGIN(yyextra->lastInitializerContext);
3127 }
3128 else if (*yytext==',' && yyextra->initBracketCount==0)
3129 {
3130 unput(*yytext);
3131 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3132 BEGIN(yyextra->lastInitializerContext);
3133 }
3134 else
3135 {
3136 yyextra->current->initializer << *yytext;
3137 }
3138 }
3139<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
3140 if (!yyextra->insideCpp)
3141 {
3142 REJECT;
3143 }
3144 else
3145 {
3146 yyextra->current->initializer << yytext;
3148 yyextra->lastRawStringContext = YY_START;
3149 yyextra->pCopyRawGString = &yyextra->current->initializer;
3150 BEGIN(RawGString);
3151
3152 }
3153 }
QCString extractBeginRawStringDelimiter(const char *rawStart)
3154<RawGString>{RAWEND} {
3156 {
3157 *yyextra->pCopyRawGString << yytext;
3158 BEGIN(yyextra->lastRawStringContext);
3159 }
3160 else
3161 {
3162 REJECT;
3163 }
3164 }
QCString extractEndRawStringDelimiter(const char *rawEnd)
3165<RawGString>[^)\n]+ {
3166 *yyextra->pCopyRawGString << yytext;
3167 }
3168<RawGString>. {
3169 *yyextra->pCopyRawGString << yytext;
3170 }
3171<RawGString>\n {
3172 *yyextra->pCopyRawGString << yytext;
3174 }
3175<RawString>{RAWEND} {
3176 *yyextra->pCopyRawString+=yytext;
3177 yyextra->fullArgString+=yytext;
3179 {
3180 BEGIN(yyextra->lastRawStringContext);
3181 }
3182 }
3183<RawString>[^)]+ {
3184 *yyextra->pCopyRawString += yytext;
3185 yyextra->fullArgString+=yytext;
3186 }
3187<RawString>. {
3188 *yyextra->pCopyRawString += yytext;
3189 yyextra->fullArgString+=yytext;
3190 }
3191<RawString>\n {
3192 *yyextra->pCopyRawString += yytext;
3193 yyextra->fullArgString+=yytext;
3195 }
3196<ReadInitializer,ReadInitializerPtr>\" {
3197 if (yyextra->insideIDL && yyextra->insideCppQuote)
3198 {
3199 BEGIN(EndCppQuote);
3200 }
3201 else
3202 {
3203 yyextra->lastStringContext=YY_START;
3204 yyextra->current->initializer << yytext;
3205 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3206 yyextra->stopAtInvalidString=false;
3207 BEGIN(CopyGString);
3208 }
3209 }
3210<ReadInitializer,ReadInitializerPtr>"->" {
3211 yyextra->current->initializer << yytext;
3212 }
3213<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3214 yyextra->current->initializer << yytext;
3215 }
3216<ReadInitializer,ReadInitializerPtr>(">>") {
3217 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3218 {
3219
3220 yyextra->initBracketCount-=2;
3221 yyextra->sharpCount-=2;
3222 }
3223 yyextra->current->initializer << yytext;
3224 }
3225<ReadInitializer,ReadInitializerPtr>(">=") {
3226 yyextra->current->initializer << yytext;
3227 }
3228<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3229 yyextra->initBracketCount++;
3230 yyextra->sharpCount++;
3231 yyextra->current->initializer << *yytext;
3232 }
3233<ReadInitializer,ReadInitializerPtr>[>\]})] {
3234 yyextra->initBracketCount--;
3235 yyextra->sharpCount--;
3236 if (*yytext=='}')
3237 {
3238 yyextra->current->endBodyLine=yyextra->yyLineNr;
3239 }
3240 yyextra->current->initializer << *yytext;
3241 }
3242<ReadInitializer,ReadInitializerPtr>\' {
3243 if (yyextra->insidePHP)
3244 {
3245 yyextra->current->initializer << yytext;
3246 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3247 yyextra->lastStringContext=YY_START;
3248 BEGIN(CopyPHPGString);
3249 }
3250 else
3251 {
3252 yyextra->current->initializer << yytext;
3253 }
3254 }
3255<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3256 if (yyextra->insidePHP)
3257 {
3258 REJECT;
3259 }
3260 else
3261 {
3262 yyextra->current->initializer << yytext;
3263 }
3264 }
3265<ReadInitializer,ReadInitializerPtr>\n {
3266 yyextra->current->initializer << *yytext;
3268 }
3269<ReadInitializer,ReadInitializerPtr>"@\"" {
3270
3271 yyextra->current->initializer << yytext;
3272 if (!yyextra->insideCS && !yyextra->insideObjC)
3273 {
3274 REJECT;
3275 }
3276 else
3277 {
3278
3279 yyextra->lastSkipVerbStringContext=YY_START;
3280 yyextra->pSkipVerbString=&yyextra->current->initializer;
3281 BEGIN(SkipVerbString);
3282 }
3283 }
3284<SkipVerbString>[^\n"\\]+ {
3285 *yyextra->pSkipVerbString << yytext;
3286 }
3287<SkipVerbString>"\\\\" { // escaped backslash
3288 if (yyextra->insideCS) REJECT
3289 *yyextra->pSkipVerbString << yytext;
3290 }
3291<SkipVerbString>"\\\"" { // backslash escaped quote
3292 if (yyextra->insideCS) REJECT
3293 *yyextra->pSkipVerbString << yytext;
3294 }
3295<SkipVerbString>"\"\"" { // quote escape
3296 *yyextra->pSkipVerbString << yytext;
3297 }
3298<SkipVerbString>"\"" {
3299 *yyextra->pSkipVerbString << *yytext;
3300 BEGIN(yyextra->lastSkipVerbStringContext);
3301 }
3302<SkipVerbString>\n {
3303 *yyextra->pSkipVerbString << *yytext;
3305 }
3306<SkipVerbString>. {
3307 *yyextra->pSkipVerbString << *yytext;
3308 }
3309<ReadInitializer,ReadInitializerPtr>"?>" {
3310 if (yyextra->insidePHP)
3311 BEGIN( FindMembersPHP );
3312 else
3313 yyextra->current->initializer << yytext;
3314 }
3315<ReadInitializer,ReadInitializerPtr>. {
3316 yyextra->current->initializer << *yytext;
3317 }
3318
3319
3320<CopyString,CopyPHPString>\\. {
3321 *yyextra->pCopyQuotedString+=yytext;
3322 }
3323<CopyString>\" {
3324 *yyextra->pCopyQuotedString+=*yytext;
3325 BEGIN( yyextra->lastStringContext );
3326 }
3327<CopyPHPString>\' {
3328 *yyextra->pCopyQuotedString+=*yytext;
3329 BEGIN( yyextra->lastStringContext );
3330 }
3331<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3332 *yyextra->pCopyQuotedString+=yytext;
3333 }
3334<CopyString,CopyPHPString>\n {
3335 *yyextra->pCopyQuotedString+=*yytext;
3337 }
3338<CopyString,CopyPHPString>. {
3339 *yyextra->pCopyQuotedString+=*yytext;
3340 }
3341
3342
3343<CopyGString,CopyPHPGString>\\. {
3344 *yyextra->pCopyQuotedGString << yytext;
3345 }
3346<CopyGString>\" {
3347 *yyextra->pCopyQuotedGString << *yytext;
3348 BEGIN( yyextra->lastStringContext );
3349 }
3350<CopyPHPGString>\' {
3351 *yyextra->pCopyQuotedGString << *yytext;
3352 BEGIN( yyextra->lastStringContext );
3353 }
3354<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3355 *yyextra->pCopyQuotedGString << yytext;
3356 BEGIN( yyextra->lastStringContext );
3357 }
3358<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3359 *yyextra->pCopyQuotedGString << yytext;
3360 }
3361<CopyGString,CopyPHPGString>\n {
3362 *yyextra->pCopyQuotedGString << *yytext;
3363 if (yyextra->stopAtInvalidString)
3364 {
3365 BEGIN( yyextra->lastStringContext );
3366 }
3367 else
3368 {
3370 }
3371 }
3372<CopyGString,CopyPHPGString>. {
3373 *yyextra->pCopyQuotedGString << *yytext;
3374 }
3375
3376
3377<CopyRound>\" {
3378 *yyextra->pCopyRoundString += *yytext;
3379 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3380 yyextra->lastStringContext=YY_START;
3381 BEGIN(CopyString);
3382 }
3383<CopyRound>"(" {
3384 *yyextra->pCopyRoundString += *yytext;
3385 yyextra->roundCount++;
3386 }
3387<CopyRound>")" {
3388 *yyextra->pCopyRoundString += *yytext;
3389 if (--yyextra->roundCount<0)
3390 BEGIN(yyextra->lastRoundContext);
3391 }
3392<CopyRound>\n {
3394 *yyextra->pCopyRoundString += *yytext;
3395 }
3396<CopyRound>\' {
3397 if (yyextra->insidePHP)
3398 {
3399 yyextra->current->initializer << yytext;
3400 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3401 yyextra->lastStringContext=YY_START;
3402 BEGIN(CopyPHPString);
3403 }
3404 else
3405 {
3406 *yyextra->pCopyRoundString += yytext;
3407 }
3408 }
3409<CopyRound>{CHARLIT} {
3410 if (yyextra->insidePHP)
3411 {
3412 REJECT;
3413 }
3414 else
3415 {
3416 *yyextra->pCopyRoundString+=yytext;
3417 }
3418 }
3419<CopyRound>[^"'()\n,]+ {
3420 *yyextra->pCopyRoundString+=yytext;
3421 }
3422<CopyRound>. {
3423 *yyextra->pCopyRoundString+=*yytext;
3424 }
3425
3426
3427<CopySharp>\" {
3428 *yyextra->pCopySharpString += *yytext;
3429 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3430 yyextra->lastStringContext=YY_START;
3431 BEGIN(CopyString);
3432 }
3433<CopySharp>"<" {
3434 *yyextra->pCopySharpString += *yytext;
3435 yyextra->sharpCount++;
3436 }
3437<CopySharp>">" {
3438 *yyextra->pCopySharpString += *yytext;
3439 if (--yyextra->sharpCount<0)
3440 {
3441 BEGIN(yyextra->lastSharpContext);
3442 }
3443 }
3444<CopySharp>\n {
3446 *yyextra->pCopySharpString += *yytext;
3447 }
3448<CopySharp>\' {
3449 if (yyextra->insidePHP)
3450 {
3451 yyextra->current->initializer << yytext;
3452 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3453 yyextra->lastStringContext=YY_START;
3454 BEGIN(CopyPHPString);
3455 }
3456 else
3457 {
3458 *yyextra->pCopySharpString += yytext;
3459 }
3460 }
3461<CopySharp>{CHARLIT} {
3462 if (yyextra->insidePHP)
3463 {
3464 REJECT;
3465 }
3466 else
3467 {
3468 *yyextra->pCopySharpString+=yytext;
3469 }
3470 }
3471<CopySharp>[^"'<>\n,]+ {
3472 *yyextra->pCopySharpString+=yytext;
3473 }
3474<CopySharp>. {
3475 *yyextra->pCopySharpString+=*yytext;
3476 }
3477
3478
3479
3480<GCopyRound>\" {
3481 *yyextra->pCopyRoundGString << *yytext;
3482 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3483 yyextra->lastStringContext=YY_START;
3484 BEGIN(CopyGString);
3485 }
3486<GCopyRound>"(" {
3487 *yyextra->pCopyRoundGString << *yytext;
3488 yyextra->roundCount++;
3489 }
3490<GCopyRound>")" {
3491 *yyextra->pCopyRoundGString << *yytext;
3492 if (--yyextra->roundCount<0)
3493 BEGIN(yyextra->lastRoundContext);
3494 }
3495<GCopyRound>\n {
3497 *yyextra->pCopyRoundGString << *yytext;
3498 }
3499<GCopyRound>\' {
3500 if (yyextra->insidePHP)
3501 {
3502 yyextra->current->initializer << yytext;
3503 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3504 yyextra->lastStringContext=YY_START;
3505 BEGIN(CopyPHPGString);
3506 }
3507 else
3508 {
3509 *yyextra->pCopyRoundGString << yytext;
3510 }
3511 }
3512<GCopyRound>{CHARLIT} {
3513 if (yyextra->insidePHP)
3514 {
3515 REJECT;
3516 }
3517 else
3518 {
3519 *yyextra->pCopyRoundGString << yytext;
3520 }
3521 }
3522<GCopyRound>"@\"" {
3523 if (!yyextra->insideCS) REJECT;
3524 *yyextra->pCopyRoundGString << yytext;
3525 yyextra->lastSkipVerbStringContext=YY_START;
3526 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3527 BEGIN(SkipVerbString);
3528 }
3529<GCopyRound>[^"'()\n\/,R]+ { // R because of raw string start
3530 *yyextra->pCopyRoundGString << yytext;
3531 }
3532<GCopyRound>{RAWBEGIN} {
3533 *yyextra->pCopyRoundGString << yytext;
3535 yyextra->lastRawStringContext = YY_START;
3536 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3537 BEGIN(RawGString);
3538 }
3539<GCopyRound>. {
3540 *yyextra->pCopyRoundGString << *yytext;
3541 }
3542
3543
3544<GCopySquare>\" {
3545 *yyextra->pCopySquareGString << *yytext;
3546 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3547 yyextra->lastStringContext=YY_START;
3548 BEGIN(CopyGString);
3549 }
3550<GCopySquare>\' {
3551 *yyextra->pCopySquareGString << *yytext;
3552 if (yyextra->insidePHP)
3553 {
3554 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3555 yyextra->lastStringContext=YY_START;
3556 BEGIN(CopyPHPGString);
3557 }
3558 }
3559<GCopySquare>"[" {
3560 *yyextra->pCopySquareGString << *yytext;
3561 yyextra->squareCount++;
3562 }
3563<GCopySquare>"]" {
3564 *yyextra->pCopySquareGString << *yytext;
3565 if (--yyextra->squareCount<0)
3566 BEGIN(yyextra->lastSquareContext);
3567 }
3568<GCopySquare>\n {
3570 *yyextra->pCopySquareGString << *yytext;
3571 }
3572<GCopySquare>\' {
3573 if (yyextra->insidePHP)
3574 {
3575 yyextra->current->initializer << yytext;
3576 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3577 yyextra->lastStringContext=YY_START;
3578 BEGIN(CopyPHPGString);
3579 }
3580 else
3581 {
3582 *yyextra->pCopySquareGString << yytext;
3583 }
3584 }
3585<GCopySquare>{CHARLIT} {
3586 if (yyextra->insidePHP)
3587 {
3588 REJECT;
3589 }
3590 else
3591 {
3592 *yyextra->pCopySquareGString << yytext;
3593 }
3594 }
3595<GCopySquare>[^"'\[\]\n\/,]+ {
3596 *yyextra->pCopySquareGString << yytext;
3597 }
3598<GCopySquare>. {
3599 *yyextra->pCopySquareGString << *yytext;
3600 }
3601
3602
3603<CopyCurly>\" {
3604 *yyextra->pCopyCurlyString += *yytext;
3605 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3606 yyextra->lastStringContext=YY_START;
3607 BEGIN(CopyString);
3608 }
3609<CopyCurly>\' {
3610 *yyextra->pCopyCurlyString += *yytext;
3611 if (yyextra->insidePHP)
3612 {
3613 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3614 yyextra->lastStringContext=YY_START;
3615 BEGIN(CopyPHPString);
3616 }
3617 }
3618<CopyCurly>"{" {
3619 *yyextra->pCopyCurlyString += *yytext;
3620 yyextra->curlyCount++;
3621 }
3622<CopyCurly>"}" {
3623 *yyextra->pCopyCurlyString += *yytext;
3624 if (--yyextra->curlyCount<0)
3625 BEGIN(yyextra->lastCurlyContext);
3626 }
3627<CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3628 {
3629 REJECT;
3630 }
3631 else
3632 {
3633 *yyextra->pCopyCurlyString += yytext;
3634 }
3635 }
3636<CopyCurly>[^"'{}\/\n,]+ {
3637 *yyextra->pCopyCurlyString += yytext;
3638 }
3639<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3640<CopyCurly>\n {
3642 *yyextra->pCopyCurlyString += *yytext;
3643 }
3644<CopyCurly>. {
3645 *yyextra->pCopyCurlyString += *yytext;
3646 }
3647
3648
3649<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3650 }
3651<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3653 int s = line.
find(
' ');
3654 int e = line.
find(
'"',s);
3655 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3656 if (yytext[yyleng-1]=='\n')
3657 {
3659 yyextra->column=0;
3660 }
3661 }
int toInt(bool *ok=nullptr, int base=10) const
3662<GCopyCurly>\" {
3663 *yyextra->pCopyCurlyGString << *yytext;
3664 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3665 yyextra->lastStringContext=YY_START;
3666 BEGIN(CopyGString);
3667 }
3668<GCopyCurly>\' {
3669 *yyextra->pCopyCurlyGString << *yytext;
3670 if (yyextra->insidePHP)
3671 {
3672 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3673 yyextra->lastStringContext=YY_START;
3674 BEGIN(CopyPHPGString);
3675 }
3676 }
3677<GCopyCurly>"{" {
3678 *yyextra->pCopyCurlyGString << *yytext;
3679 yyextra->curlyCount++;
3680 }
3681<GCopyCurly>"}" {
3682 *yyextra->pCopyCurlyGString << *yytext;
3683 if (--yyextra->curlyCount<0)
3684 {
3685 yyextra->current->endBodyLine = yyextra->yyLineNr;
3686 BEGIN(yyextra->lastCurlyContext);
3687 }
3688 }
3689<GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3690 {
3691 REJECT;
3692 }
3693 else
3694 {
3695 *yyextra->pCopyCurlyGString << yytext;
3696 }
3697 }
3698<GCopyCurly>[^"'{}\/\n,]+ {
3699 *yyextra->pCopyCurlyGString << yytext;
3700 }
3701<GCopyCurly>[,]+ {
3702 *yyextra->pCopyCurlyGString << yytext;
3703 }
3704<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3705<GCopyCurly>\n {
3707 *yyextra->pCopyCurlyGString << *yytext;
3708 }
3709<GCopyCurly>. {
3710 *yyextra->pCopyCurlyGString << *yytext;
3711 }
3712
3713
3714
3715
3716<FindMembers>":" {
3717 if (yyextra->current->type.isEmpty() &&
3718 yyextra->current->name=="enum")
3719 {
3720 yyextra->current->section = EntryType::makeEnum();
3721 yyextra->current->name.clear();
3722 yyextra->current->args.clear();
3723 BEGIN(EnumBaseType);
3724 }
3725 else
3726 {
3727 if (yyextra->current->type.isEmpty())
3728 {
3730 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
3731 }
3732 BEGIN(BitFields);
3733 yyextra->current->bitfields+=":";
3734 }
3735 }
3736<BitFields>. {
3737 yyextra->current->bitfields+=*yytext;
3738 }
3739<EnumBaseType>. {
3740 yyextra->current->args+=*yytext;
3741 }
3742<EnumBaseType>\n {
3744 yyextra->current->args+=' ';
3745 }
3746<FindMembers>[;,] {
3747 QCString oldType = yyextra->current->type;
3748 if (yyextra->current->bodyLine==-1)
3749 {
3750 yyextra->current->bodyLine = yyextra->yyLineNr;
3751 yyextra->current->bodyColumn = yyextra->yyColNr;
3752 }
3753 if ( yyextra->insidePHP && yyextra->current->type.startsWith("var"))
3754 {
3755 yyextra->current->type = yyextra->current->type.mid(3);
3756 }
3757 if (yyextra->isTypedef && !yyextra->current->type.startsWith("typedef "))
3758 {
3759 yyextra->current->type.prepend("typedef ");
3760 }
3761 bool isStatic = yyextra->current->isStatic;
3762 Protection prot = yyextra->current->protection;
3763 bool isConcept = yyextra->current->section.isConcept();
3764 bool isModule = yyextra->current->section.isModuleDoc();
3765 if (isConcept)
3766 {
3767 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3769 }
3770 else if (isModule)
3771 {
3772 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3774 }
3775 else if (!yyextra->current->name.isEmpty() && !yyextra->current->section.isEnum())
3776 {
3777 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
3779 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
3780 if (yyextra->current->section.isClass())
3781 {
3783 }
3784 yyextra->current->section = EntryType::makeVariable() ;
3785 yyextra->current->fileName = yyextra->fileName;
3786 yyextra->current->startLine = yyextra->yyBegLineNr;
3787 yyextra->current->startColumn = yyextra->yyBegColNr;
3788 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3790 }
3791 if ( *yytext == ',')
3792 {
3793 yyextra->current->isStatic = isStatic;
3794 yyextra->current->protection = prot;
3795 yyextra->current->name.clear();
3796 yyextra->current->args.clear();
3797 yyextra->current->brief.clear();
3798 yyextra->current->doc.clear();
3799 yyextra->current->initializer.str(std::string());
3800 yyextra->current->bitfields.clear();
3802 }
3803 else
3804 {
3805 yyextra->mtype = MethodTypes::Method;
3806 yyextra->virt = Specifier::Normal;
3807 yyextra->current->bodyLine = -1;
3808 yyextra->current->bodyColumn = 1;
3809 yyextra->current->groups.clear();
3811 }
3812 }
static QCString stripFuncPtr(const QCString &type)
3813
3814<FindMembers>"[" {
3815 if (yyextra->insideSlice)
3816 {
3817 yyextra->squareCount=1;
3818 yyextra->lastSquareContext = YY_START;
3819 yyextra->current->metaData += "[";
3820 BEGIN( SliceMetadata );
3821 }
3822 else if (!yyextra->insideCS &&
3823 (yyextra->current->name.isEmpty() ||
3824 yyextra->current->name=="typedef"
3825 )
3826 )
3827 {
3828 yyextra->squareCount=1;
3829 yyextra->lastSquareContext = YY_START;
3830 yyextra->idlAttr.clear();
3831 yyextra->idlProp.clear();
3832 yyextra->current->mtype = yyextra->mtype;
3833
3835 yyextra->current->mtype == MethodTypes::Property)
3836 {
3837 yyextra->odlProp = true;
3838 yyextra->current->spec.setGettable(true).setSettable(true);
3839 }
3840
3841 BEGIN( IDLAttribute );
3842 }
3843 else if (yyextra->insideCS &&
3844 yyextra->current->name.isEmpty())
3845 {
3846 yyextra->squareCount=1;
3847 yyextra->lastSquareContext = YY_START;
3848
3849
3850 yyextra->current->args.clear();
3851 BEGIN( SkipSquare );
3852 }
3853 else
3854 {
3855 yyextra->current->args += yytext ;
3856 yyextra->squareCount=1;
3857 yyextra->externLinkage=
FALSE;
3858 BEGIN( Array ) ;
3859 }
3860 }
3861<SliceMetadata>"[" { // Global metadata.
3862 yyextra->squareCount++;
3863 yyextra->current->metaData += "[";
3864 }
3865<SliceMetadata>{BN}* {
3867 }
3868<SliceMetadata>\"[^\"]*\" {
3869 yyextra->current->metaData += yytext;
3870 }
3871<SliceMetadata>"," {
3872 yyextra->current->metaData += yytext;
3873 }
3874<SliceMetadata>"]" {
3875 yyextra->current->metaData += yytext;
3876 if (--yyextra->squareCount<=0)
3877 {
3878 BEGIN (yyextra->lastSquareContext);
3879 }
3880 }
3881<SliceOptional>"(" {
3882 yyextra->current->type += "(";
3883 yyextra->roundCount++;
3884 }
3885<SliceOptional>[0-9]+ {
3886 yyextra->current->type += yytext;
3887 }
3888<SliceOptional>")" {
3889 yyextra->current->type += ")";
3890 if(--yyextra->roundCount<=0)
3891 {
3892 BEGIN (yyextra->lastModifierContext);
3893 }
3894 }
3895<IDLAttribute>"]" {
3896
3897 if (--yyextra->squareCount<=0)
3898 {
3900 if (yyextra->current->mtype == MethodTypes::Property)
3901 BEGIN( IDLPropName );
3902 else
3903 BEGIN( yyextra->lastSquareContext );
3904 }
3905 }
3906<IDLAttribute>"propput" {
3908 {
3909 yyextra->current->mtype = MethodTypes::Property;
3910 }
3911 yyextra->current->spec.setSettable(true);
3912 }
3913<IDLAttribute>"propget" {
3915 {
3916 yyextra->current->mtype = MethodTypes::Property;
3917 }
3918 yyextra->current->spec.setGettable(true);
3919 }
3920<IDLAttribute>"property" { // UNO IDL property
3921 yyextra->current->spec.setProperty(true);
3922 }
3923<IDLAttribute>"attribute" { // UNO IDL attribute
3924 yyextra->current->spec.setAttribute(true);
3925 }
3926<IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
3927 yyextra->current->spec.setOptional(true);
3928 }
3929<IDLAttribute>"readonly" { // on UNO IDL attribute or property
3931 {
3932 yyextra->current->spec.setSettable(false);
3933 }
3934 else
3935 {
3936 yyextra->current->spec.setReadonly(true);
3937 }
3938 }
3939<IDLAttribute>"bound" { // on UNO IDL attribute or property
3940 yyextra->current->spec.setBound(true);
3941 }
3942<IDLAttribute>"removable" { // on UNO IDL property
3943 yyextra->current->spec.setRemovable(true);
3944 }
3945<IDLAttribute>"constrained" { // on UNO IDL property
3946 yyextra->current->spec.setConstrained(true);
3947 }
3948<IDLAttribute>"transient" { // on UNO IDL property
3949 yyextra->current->spec.setTransient(true);
3950 }
3951<IDLAttribute>"maybevoid" { // on UNO IDL property
3952 yyextra->current->spec.setMaybeVoid(true);
3953 }
3954<IDLAttribute>"maybedefault" { // on UNO IDL property
3955 yyextra->current->spec.setMaybeDefault(true);
3956 }
3957<IDLAttribute>"maybeambiguous" { // on UNO IDL property
3958 yyextra->current->spec.setMaybeAmbiguous(true);
3959 }
3960<IDLAttribute>. {
3961 }
3962<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
3963
3964
3965 if (yyextra->odlProp)
3966 {
3967 yyextra->idlProp = yytext;
3968 }
3969 }
3970<IDLPropName>{ID}{BN}*"(" {
3971 yyextra->current->name = yytext;
3972 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3973 yyextra->current->startLine = yyextra->yyLineNr;
3974 yyextra->current->startColumn = yyextra->yyColNr;
3975 BEGIN( IDLProp );
3976 }
3977<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
3978 if (yyextra->odlProp)
3979 {
3980 yyextra->idlProp += yytext;
3981 }
3982 }
3983<IDLPropName>{ID}{BNopt}/";" {
3984 if (yyextra->odlProp)
3985 {
3986 yyextra->current->name = yytext;
3987 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
3988 yyextra->odlProp = false;
3989
3990 BEGIN( IDLProp );
3991 }
3992 }
3993<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
3994 yyextra->idlAttr = yytext;
3995 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
3996 }
3997<IDLProp>{ID} { // property type
3998 yyextra->idlProp = yytext;
3999 }
4000<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
4001 if (yyextra->current->args.isEmpty())
4002 yyextra->current->args = "(";
4003 else
4004 yyextra->current->args += ", ";
4005 yyextra->current->args += yyextra->idlAttr;
4006 yyextra->current->args += " ";
4007 yyextra->current->args += yyextra->idlProp;
4008 yyextra->current->args += " ";
4009 yyextra->current->args += yytext;
4010 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4011 yyextra->idlProp.clear();
4012 yyextra->idlAttr.clear();
4013 BEGIN( IDLProp );
4014 }
4015<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4016
4017 }
4018<IDLProp>";" {
4019 yyextra->current->fileName = yyextra->fileName;
4020 yyextra->current->type = yyextra->idlProp;
4021 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4022 if (!yyextra->current->args.isEmpty())
4023 yyextra->current->args += ")";
4024 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4025 yyextra->current->section = EntryType::makeVariable();
4026 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4028 BEGIN( FindMembers );
4029 }
4030<IDLProp>. { // spaces, *, or other stuff
4031
4032 }
4033<Array>"]" { yyextra->current->args += *yytext ;
4034 if (--yyextra->squareCount<=0)
4035 BEGIN( FindMembers ) ;
4036 }
4037<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4038 if (--yyextra->squareCount<=0)
4039 BEGIN( SFunction ) ;
4040 }
4041<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4042 yyextra->squareCount++;
4043 }
4044<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4045<SkipSquare>"[" { yyextra->squareCount++; }
4046<SkipSquare>"]" {
4047 if (--yyextra->squareCount<=0)
4048 BEGIN( yyextra->lastSquareContext );
4049 }
4050<SkipSquare>\" {
4051 yyextra->lastStringContext=YY_START;
4052 BEGIN( SkipString );
4053 }
4054<SkipSquare>[^\n\[\]\"]+
4055<FindMembers>"<" { addType(yyscanner);
4056 yyextra->current->type += yytext ;
4057 BEGIN( Sharp ) ;
4058 }
4059<Sharp>">" { yyextra->current->type += *yytext ;
4060 if (--yyextra->sharpCount<=0)
4061 BEGIN( FindMembers ) ;
4062 }
4063<Sharp>"<" { yyextra->current->type += *yytext ;
4064 yyextra->sharpCount++;
4065 }
4066<Sharp>{BN}+ {
4067 yyextra->current->type += ' ';
4069 }
4070<Sharp>. { yyextra->current->type += *yytext ; }
4071<FindFields>{ID} {
4073 yyextra->current->bodyLine = yyextra->yyLineNr;
4074 yyextra->current->bodyColumn = yyextra->yyColNr;
4075 yyextra->current->name = yytext;
4076 }
4077<FindFields>[({] {
4078
4079 unput(*yytext);
4080 yyextra->lastInitializerContext = YY_START;
4081 yyextra->sharpCount=0;
4082 yyextra->initBracketCount=0;
4083 yyextra->current->initializer.str("=");
4084 BEGIN(ReadInitializer);
4085 }
4086<FindFields>"=" {
4087 yyextra->lastInitializerContext = YY_START;
4088 yyextra->sharpCount=0;
4089 yyextra->initBracketCount=0;
4090 yyextra->current->initializer.str(yytext);
4091 BEGIN(ReadInitializer);
4092 }
4093<FindFields>";" {
4094 if (yyextra->insideJava)
4095 {
4096 if (!yyextra->current->name.isEmpty())
4097 {
4098 yyextra->current->fileName = yyextra->fileName;
4099 yyextra->current->startLine = yyextra->yyLineNr;
4100 yyextra->current->startColumn = yyextra->yyColNr;
4101 if (!yyextra->current_root->spec.isEnum())
4102 {
4103 yyextra->current->type = "@";
4104 }
4105 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4106 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4107 yyextra->current->section = EntryType::makeVariable();
4108 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4110 }
4111
4112 BEGIN( FindMembers );
4113 }
4114 else
4115 {
4116 REJECT;
4117 }
4118 }
4119<FindFields>"," {
4120
4121
4122
4123 if (!yyextra->current->name.isEmpty())
4124 {
4125 yyextra->current->fileName = yyextra->fileName;
4126 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4127 {
4128 yyextra->current->startLine = yyextra->current->bodyLine;
4129 yyextra->current->startColumn = yyextra->current->bodyColumn;
4130 }
4131 else
4132 {
4133 yyextra->current->startLine = yyextra->yyLineNr;
4134 yyextra->current->startColumn = yyextra->yyColNr;
4135 }
4136 if (!yyextra->current_root->spec.isEnum())
4137 {
4138 yyextra->current->type = "@";
4139 }
4140 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4141 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4142 yyextra->current->section = EntryType::makeVariable();
4143
4144 if (!yyextra->insideCS && !yyextra->insideJava &&
4145 !yyextra->current_root->spec.isStrong())
4146
4147
4148 {
4149
4150
4151
4152 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4153 }
4154 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4156 }
4157 else
4158 {
4159 yyextra->current->reset();
4161 }
4162 }
4163<FindFields>"[" { // attribute list in IDL
4164 yyextra->squareCount=1;
4165 yyextra->lastSquareContext = YY_START;
4166 BEGIN(SkipSquare);
4167 }
4168<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; } // R because of raw string start
4169<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4170<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
4171 REJECT;
4172
4173 yyextra->current->program << yytext ;
4174 }
4175
4176<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
4177 yyextra->current->program << yytext ;
4178 yyextra->pSkipInterpString = &yyextra->current->program;
4179 yyextra->lastSkipInterpStringContext=YY_START;
4180 BEGIN( SkipInterpString );
4181 }
4182<SkipInterpString>([^"\\{}\x000D\x000A\x0085\x2028\x2029]|"{{"|"}}"|"\\'"|"\\\""|"\\\\"|"\\0"|"\\a"|"\\b"|"\\f"|"\\n"|"\\r"|"\\t"|"\\v"|"\\x"{HEXDIGIT}{HEXDIGIT}?{HEXDIGIT}?{HEXDIGIT}?|"\\"[uU]{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT})* {
4183 *yyextra->pSkipInterpString << yytext;
4184 }
4185<SkipInterpString>\" {
4186 *yyextra->pSkipInterpString << *yytext;
4187 BEGIN( yyextra->lastSkipInterpStringContext );
4188 }
4189
4190<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$@\" { if (!yyextra->insideCS) REJECT
4191 yyextra->current->program << yytext ;
4192 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4193 yyextra->lastSkipInterpVerbStringContext=YY_START;
4194 BEGIN( SkipInterpVerbString );
4195 }
4196<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4197 *yyextra->pSkipInterpVerbString << yytext;
4198 }
4199<SkipInterpString>"{"[^}]*"}" {
4200 *yyextra->pSkipInterpString << yytext;
4201 }
4202<SkipInterpVerbString>"{"[^}]*"}" {
4203 *yyextra->pSkipInterpVerbString << yytext;
4204 }
4205<SkipInterpVerbString>\" {
4206 *yyextra->pSkipInterpVerbString << *yytext;
4207 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4208 }
4209<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4210<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4211 yyextra->pSkipVerbString = &yyextra->current->program;
4212 yyextra->lastSkipVerbStringContext=YY_START;
4213 BEGIN( SkipVerbString );
4214 }
4215<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
4216 {
4217 yyextra->current->program << yytext ;
4218 yyextra->pCopyHereDocGString = &yyextra->current->program;
4219 yyextra->lastHereDocContext=YY_START;
4220 BEGIN( CopyHereDoc );
4221 }
4222 else
4223 {
4224 REJECT;
4225 }
4226 }
4227<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4228 yyextra->current->program << yytext;
4230 yyextra->lastRawStringContext = YY_START;
4231 yyextra->pCopyRawGString = &yyextra->current->program;
4232 BEGIN(RawGString);
4233 }
4234<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4235 yyextra->pCopyQuotedGString = &yyextra->current->program;
4236 yyextra->lastStringContext=YY_START;
4237 yyextra->stopAtInvalidString=false;
4238 BEGIN( CopyGString );
4239 }
4240<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=true; REJECT;}
4241<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4242 yyextra->lastContext = YY_START ;
4243 BEGIN( Comment ) ;
4244 }
4245<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4246 ++yyextra->yyLineNr ;
4247 yyextra->lastContext = YY_START ;
4248 BEGIN( Comment ) ;
4249 }
4250<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4251 if (!yyextra->insidePHP)
4252 {
4253 yyextra->current->program << yytext;
4254 }
4255 else
4256 {
4257 yyextra->current->program << yytext;
4258 yyextra->pCopyQuotedGString = &yyextra->current->program;
4259 yyextra->lastStringContext=YY_START;
4260 BEGIN(CopyPHPGString);
4261 }
4262 }
4263<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4264 if (yyextra->insidePHP)
4265 {
4266 REJECT;
4267
4268 }
4269 else
4270 {
4271 yyextra->current->program << yytext;
4272 }
4273 }
4274<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4275 ++yyextra->curlyCount ;
4276 }
4277<ReadBodyIntf>"}" {
4278 yyextra->current->program << yytext ;
4279 --yyextra->curlyCount ;
4280 }
4281<ReadBody,ReadNSBody>"}" {
4282 if ( yyextra->curlyCount>0 )
4283 {
4284 yyextra->current->program << yytext ;
4285 --yyextra->curlyCount ;
4286 }
4287 else
4288 {
4289 yyextra->current->endBodyLine = yyextra->yyLineNr;
4290 std::shared_ptr<Entry> original_root = yyextra->current_root;
4291 if (yyextra->current->section.isNamespace() && yyextra->current->type == "namespace")
4292 {
4293 int split_point;
4294
4295 QCString doc = yyextra->current->doc;
4296 int docLine = yyextra->current->docLine;
4297 QCString docFile = yyextra->current->docFile;
4298 QCString brief = yyextra->current->brief;
4299 int briefLine = yyextra->current->briefLine;
4300 QCString briefFile = yyextra->current->briefFile;
4301
4302 yyextra->current->doc = "";
4303 yyextra->current->docLine = 0;
4304 yyextra->current->docFile = "";
4305 yyextra->current->brief = "";
4306 yyextra->current->briefLine = 0;
4307 yyextra->current->briefFile = "";
4308 while ((split_point = yyextra->current->name.find("::")) != -1)
4309 {
4310 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4311 yyextra->current->program.str(std::string());
4312 new_current->name = yyextra->current->name.mid(split_point + 2);
4313 yyextra->current->name = yyextra->current->name.left(split_point);
4314 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
4315
4316 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4317 yyextra->current_root = yyextra->current;
4318 yyextra->current = new_current;
4319 }
4320
4321 yyextra->current->doc = doc;
4322 yyextra->current->docLine = docLine;
4323 yyextra->current->docFile = docFile;
4324 yyextra->current->brief = brief;
4325 yyextra->current->briefLine = briefLine;
4326 yyextra->current->briefFile = briefFile;
4327 }
4328 QCString &cn = yyextra->current->name;
4329 QCString rn = yyextra->current_root->name;
4330
4332 {
4334 }
4335 if (yyextra->isTypedef && cn.
isEmpty())
4336 {
4337
4338 BEGIN( TypedefName );
4339 }
4340 else
4341 {
4342 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4343 {
4344 yyextra->current->program << ',';
4345 }
4346
4348
4349 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4350 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4351
4352 if (yyextra->insideObjC &&
4353 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4354 )
4355 {
4356 BEGIN( ReadBodyIntf ) ;
4357 }
4358 else
4359 {
4360 yyextra->memspecEntry = yyextra->current;
4361 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4362 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4363 if (yyextra->current->section.isNamespace() ||
4364 yyextra->current->spec.isInterface() ||
4365 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4366 yyextra->insideSlice
4367 )
4368 {
4369 yyextra->current->reset();
4370 yyextra->current_root = std::move(original_root);
4372 yyextra->memspecEntry.reset();
4373 BEGIN( FindMembers ) ;
4374 }
4375 else
4376 {
4377 static const reg::Ex re(R
"(@\d+$)");
4378 if (!yyextra->isTypedef && yyextra->memspecEntry &&
4379 !
reg::search(yyextra->memspecEntry->name.str(),re))
4380 {
4381
4382 yyextra->current->doc.clear();
4383 yyextra->current->brief.clear();
4384 }
4385 BEGIN( MemberSpec ) ;
4386 }
4387 }
4388 }
4389 }
4390 }
static void prependScope(yyscan_t yyscanner)
4391<ReadBody>"}"{BN}+"typedef"{BN}+ {
4393 if ( yyextra->curlyCount>0 )
4394 {
4395 yyextra->current->program << yytext ;
4396 --yyextra->curlyCount ;
4397 }
4398 else
4399 {
4400 yyextra->isTypedef =
TRUE;
4401 yyextra->current->endBodyLine = yyextra->yyLineNr;
4402 QCString &cn = yyextra->current->name;
4403 QCString rn = yyextra->current_root->name;
4405 {
4407 }
4408 BEGIN( TypedefName );
4409 }
4410 }
4411<TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
4413 yyextra->current->type.prepend(yytext);
4414 }
4415<TypedefName>{ID} {
4416 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4417 {
4418 yyextra->current->program << ",";
4419 }
4420 yyextra->current->name=yytext;
4422 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4423 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4424
4425 if (!yyextra->firstTypedefEntry)
4426 {
4427 yyextra->firstTypedefEntry = yyextra->current;
4428 }
4429 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4431 yyextra->isTypedef=
TRUE;
4432 BEGIN(MemberSpecSkip);
4433 }
4434<TypedefName>";" { /* typedef of anonymous type */
4436 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4437 {
4438 yyextra->current->program << ',';
4439 }
4440
4441 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4442 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4443 yyextra->memspecEntry = yyextra->current;
4444 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4446 unput(';');
4447 BEGIN( MemberSpec ) ;
4448 }
QCString generateAnonymousAnchor(const QCString &fileName, int count)
4449<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4451 int i=0,l=(int)yyleng,j;
4452 while (i<l && (!
isId(yytext[i]))) i++;
4454 j=yyextra->msName.
find(
"[");
4455 if (j!=-1)
4456 {
4457 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4458 yyextra->msName=yyextra->msName.left(j);
4459 }
QCString right(size_t len) const
4461
4462
4463 if (yyextra->firstTypedefEntry)
4464 {
4465 if (yyextra->firstTypedefEntry->spec.isStruct())
4466 {
4467 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4468 }
4469 else if (yyextra->firstTypedefEntry->spec.isUnion())
4470 {
4471 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4472 }
4473 else if (yyextra->firstTypedefEntry->section.isEnum())
4474 {
4475 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4476 }
4477 else
4478 {
4479 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4480 }
4481 }
4482 }
4483<MemberSpec>"(" { // function with struct return type
4485 yyextra->current->name = yyextra->msName;
4487 unput('(');
4488 BEGIN(FindMembers);
4489 }
4490<MemberSpec>[,;] {
4491 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4492 {
4493
4494
4495
4496
4497 const Entry *p=yyextra->current.get();
4498 while (p)
4499 {
4500
4502 {
4503
4505 int pi = (i==-1) ? 0 : i+2;
4507 {
4508
4509
4511 break;
4512 }
4513 }
4514
4515 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4516 }
4517 }
4518
4519 if (!yyextra->msName.isEmpty()
4520 )
4521 {
4523
4524
4525 if (typedefHidesStruct &&
4526 yyextra->isTypedef &&
4527 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4528 yyextra->msType.stripWhiteSpace().isEmpty() &&
4529 yyextra->memspecEntry)
4530 {
4531 yyextra->memspecEntry->name=yyextra->msName;
4532 }
4533 else
4534 {
4535 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4536 varEntry->lang = yyextra->language;
4537 varEntry->protection = yyextra->current->protection ;
4538 varEntry->mtype = yyextra->current->mtype;
4539 varEntry->virt = yyextra->current->virt;
4540 varEntry->isStatic = yyextra->current->isStatic;
4541 varEntry->section = EntryType::makeVariable();
4542 varEntry->name = yyextra->msName.stripWhiteSpace();
4543 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4544 varEntry->args = yyextra->msArgs;
4545 if (yyextra->isTypedef)
4546 {
4547 varEntry->type.prepend("typedef ");
4548
4549 }
4550 if (typedefHidesStruct &&
4551 yyextra->isTypedef &&
4552 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4553 yyextra->memspecEntry
4554 )
4555 {
4556 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4557 }
4558 else
4559 {
4560 varEntry->type+=yyextra->current->name+yyextra->msType;
4561 }
4562 varEntry->fileName = yyextra->fileName;
4563 varEntry->startLine = yyextra->yyLineNr;
4564 varEntry->startColumn = yyextra->yyColNr;
4565 varEntry->doc = yyextra->current->doc;
4566 varEntry->brief = yyextra->current->brief;
4567 varEntry->mGrpId = yyextra->current->mGrpId;
4568 varEntry->initializer.str(yyextra->current->initializer.str());
4569 varEntry->groups = yyextra->current->groups;
4570 varEntry->sli = yyextra->current->sli;
Represents an unstructured piece of information, about an entity found in the sources.
EntryType section
entry type (see Sections);
ENTRY_TYPES constexpr bool isCompound() const noexcept
int findRev(char c, int index=-1, bool cs=TRUE) const
4571
4572
4573
4574
4575 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4576 }
4577 }
4578 if (*yytext==';')
4579 {
4580 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && yyextra->current->section.isCompound())
4581 {
4582 if (!yyextra->current->doc.isEmpty())
4583 {
4584 yyextra->memspecEntry->doc += yyextra->current->doc;
4585 }
4586 if (!yyextra->current->brief.isEmpty())
4587 {
4588 yyextra->memspecEntry->brief += yyextra->current->brief;
4589 }
4590 }
4591 yyextra->msType.clear();
4592 yyextra->msName.clear();
4593 yyextra->msArgs.clear();
4594 yyextra->isTypedef=
FALSE;
4595 yyextra->firstTypedefEntry.reset();
4596 yyextra->memspecEntry.reset();
4597 yyextra->current->reset();
4599 BEGIN( FindMembers );
4600 }
4601 else
4602 {
4603 yyextra->current->doc.clear();
4604 yyextra->current->brief.clear();
4605 }
4606
4607 }
4608<MemberSpec>"=" {
4609 yyextra->lastInitializerContext=YY_START;
4610 yyextra->sharpCount=0;
4611 yyextra->initBracketCount=0;
4612 yyextra->current->initializer.str(yytext);
4613 BEGIN(ReadInitializer);
4614
4615 }
4616
4617<MemberSpecSkip>"{" {
4618 yyextra->curlyCount=0;
4619 yyextra->lastCurlyContext = MemberSpecSkip;
4620 yyextra->previous = yyextra->current;
4621 BEGIN(SkipCurly);
4622 }
4623 */
4624<MemberSpecSkip>"," { BEGIN(MemberSpec); }
4625<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4626<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4628 }
4629<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4630 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4632 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
4633 yyextra->insideObjC=
FALSE;
4634 BEGIN( FindMembers );
4635 }
4636<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
4637<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
4638
4639<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
4640<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
4641 if (yyextra->insidePHP)
4642 {
4643 REJECT
4644 }
4645 else
4646 {
4647 yyextra->current->bodyLine = yyextra->yyLineNr;
4648 yyextra->current->bodyColumn = yyextra->yyColNr;
4651 yyextra->funcPtrType=yytext;
4652 yyextra->roundCount=0;
4653
4654 BEGIN( FuncPtr );
4655 }
4656 }
4657<FuncPtr>{SCOPENAME} {
4658 yyextra->current->name = yytext;
4660 {
4661 BEGIN( FuncPtrOperator );
4662 }
4663 else
4664 {
4665 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
4666 {
4667 yyextra->funcPtrType += yyextra->current->name;
4668 }
4669 else
4670 {
4671 BEGIN( EndFuncPtr );
4672 }
4673 }
4674 }
4675<FuncPtr>. {
4676
4677 }
4678<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
4679 yyextra->current->name += yytext;
4680 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
4682 }
4683<FuncPtrOperator>\n {
4685 yyextra->current->name += *yytext;
4686 }
4687<FuncPtrOperator>"(" {
4688 unput(*yytext);
4689 BEGIN( EndFuncPtr );
4690 }
4691<FuncPtrOperator>. {
4692 yyextra->current->name += *yytext;
4693 }
4694<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
4696 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4697 BEGIN(FindMembers);
4698 }
4699<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
4701 if (yyextra->funcPtrType!="(")
4702 {
4703 yyextra->current->type+=yyextra->funcPtrType+")";
4704 }
4705 BEGIN(FindMembers);
4706 }
4707<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
4709 yyextra->current->type+=yyextra->funcPtrType;
4710 yyextra->current->args += ")";
4711 BEGIN(FindMembers);
4712 }
4713<EndFuncPtr>"(" { // a function returning a function or
4714
4715 yyextra->current->args += *yytext ;
4716
4717
4718 yyextra->current->bodyLine = yyextra->yyLineNr;
4719 yyextra->current->bodyColumn = yyextra->yyColNr;
4720 yyextra->currentArgumentContext = FuncFuncEnd;
4721 yyextra->fullArgString=yyextra->current->args;
4722 yyextra->copyArgString=&yyextra->current->args;
4723 BEGIN( ReadFuncArgType ) ;
4724 }
4725<EndFuncPtr>"["[^\n\]]*"]" {
4726 yyextra->funcPtrType+=yytext;
4727 }
4728<EndFuncPtr>")" {
4729 BEGIN(FindMembers);
4730 }
4731<FuncFunc>"(" {
4732 yyextra->current->args += *yytext ;
4733 ++yyextra->roundCount;
4734 }
4735<FuncFunc>")" {
4736 yyextra->current->args += *yytext ;
4737 if ( yyextra->roundCount )
4738 --yyextra->roundCount;
4739 else
4740 {
4741 BEGIN(FuncFuncEnd);
4742 }
4743 }
4744<FuncFuncEnd>")"{BN}*"(" {
4746 yyextra->current->type+=yyextra->funcPtrType+")(";
4747 BEGIN(FuncFuncType);
4748 }
4749<FuncFuncEnd>")"{BNopt}/[;{] {
4751 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4752 BEGIN(SFunction);
4753 }
4754<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
4756 yyextra->current->type+=yyextra->funcPtrType;
4757 yyextra->current->args+=")";
4758 BEGIN(FuncFuncArray);
4759 }
4760<FuncFuncEnd>. {
4761 yyextra->current->args += *yytext;
4762 }
4763<FuncFuncType>"(" {
4764 yyextra->current->type += *yytext;
4765 yyextra->roundCount++;
4766 }
4767<FuncFuncType>")" {
4768 yyextra->current->type += *yytext;
4769 if (yyextra->roundCount)
4770 --yyextra->roundCount;
4771 else
4772 BEGIN(SFunction);
4773 }
4774<FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
4775<FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
4776<FuncFuncType>. {
4777 yyextra->current->type += *yytext;
4778 }
4779<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
4780 if (yyextra->current->type.startsWith("typedef") &&
4781 yyextra->current->bodyLine==-1)
4782
4783 {
4784 yyextra->current->bodyLine = yyextra->yyLineNr;
4785 yyextra->current->bodyColumn = yyextra->yyColNr;
4786 BEGIN( GetCallType );
4787 }
4788 else if (!yyextra->current->name.isEmpty())
4789 {
4790 yyextra->current->args = yytext;
4791 yyextra->current->bodyLine = yyextra->yyLineNr;
4792 yyextra->current->bodyColumn = yyextra->yyColNr;
4793 yyextra->currentArgumentContext = FuncQual;
4794 yyextra->fullArgString=yyextra->current->args;
4795 yyextra->copyArgString=&yyextra->current->args;
4796 BEGIN( ReadFuncArgType ) ;
4797
4798 }
4799 }
4800<GetCallType>{BN}*{ID}{BN}*"*" {
4803 yyextra->funcPtrType="(";
4804 yyextra->funcPtrType+=yytext;
4805 yyextra->roundCount=0;
4806 BEGIN( FuncPtr );
4807 }
4808<FindMembers>"(" {
4809 if (!yyextra->current->name.isEmpty())
4810 {
4811 yyextra->current->args = yytext;
4812 yyextra->current->bodyLine = yyextra->yyLineNr;
4813 yyextra->current->bodyColumn = yyextra->yyColNr;
4814 yyextra->currentArgumentContext = FuncQual;
4815 yyextra->fullArgString=yyextra->current->args;
4816 yyextra->copyArgString=&yyextra->current->args;
4817 BEGIN( ReadFuncArgType ) ;
4818
4819 }
4820 }
4821
4822<FindMembers>"("{BN}*("void"{BN}*)?")" {
4824 yyextra->current->args = "()";
4825 BEGIN( FuncQual );
4826 }
4827 */
4828
4829
4830
4831<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
4832 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
4833 else yyextra->fullArgString+=yytext;
4834 }
4835<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
4836 yyextra->fullArgString+=yytext;
4837 }
4838<CopyArgRound>[^\/\n\)\(\"\']+ {
4839 *yyextra->copyArgString+=yytext;
4840 yyextra->fullArgString+=yytext;
4841 }
4842<CopyArgSquare>[^\/\n\]\[\"\']+ {
4843 *yyextra->copyArgString+=yytext;
4844 yyextra->fullArgString+=yytext;
4845 }
4846<ReadFuncArgType,ReadTempArgs>{BN}* {
4847 *yyextra->copyArgString+=" ";
4848 yyextra->fullArgString+=" ";
4850 }
4851<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
4853 yyextra->lastRawStringContext = YY_START;
4854 yyextra->pCopyRawString = yyextra->copyArgString;
4855 *yyextra->pCopyRawString+=yytext;
4856 yyextra->fullArgString+=yytext;
4857 BEGIN(RawString);
4858 }
4859<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
4860 *yyextra->copyArgString+=*yytext;
4861 yyextra->fullArgString+=*yytext;
4862 yyextra->lastCopyArgStringContext = YY_START;
4863 BEGIN( CopyArgString );
4864 }
4865<ReadFuncArgType>"[" {
4866 if (!yyextra->insidePHP) REJECT;
4867 *yyextra->copyArgString+=*yytext;
4868 yyextra->fullArgString+=*yytext;
4869 yyextra->argSquareCount=0;
4870 yyextra->lastCopyArgContext = YY_START;
4871 BEGIN( CopyArgSquare );
4872 }
4873<ReadFuncArgType,ReadTempArgs>"(" {
4874 *yyextra->copyArgString+=*yytext;
4875 yyextra->fullArgString+=*yytext;
4876 yyextra->argRoundCount=0;
4877 yyextra->lastCopyArgContext = YY_START;
4878 BEGIN( CopyArgRound );
4879 }
4880<ReadFuncArgType>")" {
4881 *yyextra->copyArgString+=*yytext;
4882 yyextra->fullArgString+=*yytext;
4884 if (yyextra->insideJS)
4885 {
4887 }
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
void fixArgumentListForJavaScript(ArgumentList &al)
static void handleParametersCommentBlocks(yyscan_t yyscanner, ArgumentList &al)
4889
4890
4891
4892
4893
4894
4895 yyextra->docBackup = yyextra->current->doc;
4896 yyextra->briefBackup = yyextra->current->brief;
4897
4898 BEGIN( yyextra->currentArgumentContext );
4899 }
4900
4901<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
4902 if (yyextra->currentArgumentContext==DefineEnd)
4903 {
4904
4905
4906 int i;for (i=(int)yyleng-1;i>=0;i--)
4907 {
4908 unput(yytext[i]);
4909 }
4912 BEGIN( yyextra->currentArgumentContext );
4913 }
4914 else
4915 {
4916
4917
4918 yyextra->fullArgString+=yytext;
4919 yyextra->lastCopyArgChar=0;
4920 yyextra->lastCommentInArgContext=YY_START;
4921 if (yytext[1]=='/')
4922 BEGIN( CopyArgCommentLine );
4923 else
4924 BEGIN( CopyArgComment );
4925 }
4926 }
4927
4928<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
4929<ReadFuncArgType,ReadTempArgs>{CCS} {
4930 yyextra->lastCContext = YY_START;
4931 BEGIN( SkipComment );
4932 }
4933<ReadFuncArgType,ReadTempArgs>{CPPC} {
4934 yyextra->lastCContext = YY_START;
4935 BEGIN( SkipCxxComment );
4936 }
4937
4938<ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
4939 REJECT;
4940 *yyextra->copyArgString+=yytext;
4941 yyextra->fullArgString+=yytext;
4942 }
4943<ReadFuncArgType,ReadTempArgs>"#" {
4944 if (!yyextra->insidePHP)
4945 REJECT;
4946 yyextra->lastCContext = YY_START;
4947 BEGIN( SkipCxxComment );
4948 }
4949 */
4950
4951<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
4953 if (yyextra->currentArgumentContext==DefineEnd)
4954 {
4955
4956
4957 int i;for (i=(int)yyleng-1;i>0;i--)
4958 {
4959 unput(yytext[i]);
4960 }
4961 *yyextra->copyArgString+=*yytext;
4962 yyextra->fullArgString+=*yytext;
4965 BEGIN( yyextra->currentArgumentContext );
4966 }
4967 else
4968 {
4969
4970
4971 yyextra->lastCopyArgChar=*yytext;
4974 yyextra->lastCommentInArgContext=YY_START;
4975 yyextra->fullArgString+=text;
4976 if (text.
find(
"//")!=-1)
4977 BEGIN( CopyArgCommentLine );
4978 else
4979 BEGIN( CopyArgComment );
4980 }
4981 }
4982<CopyArgComment>^{B}*"*"+/{BN}+
4983<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
4984<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
4985 if (yyextra->lastCopyArgChar!=0)
4986 unput(yyextra->lastCopyArgChar);
4987 BEGIN( yyextra->lastCommentInArgContext );
4988 }
4989<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
4991 if (yyextra->lastCopyArgChar!=0)
4992 unput(yyextra->lastCopyArgChar);
4993 BEGIN( yyextra->lastCommentInArgContext );
4994 }
4995<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
4996 yyextra->docBlockName="uml";
4997 yyextra->fullArgString+=yytext;
4998 BEGIN(CopyArgVerbatim);
4999 }
5000<CopyArgCommentLine>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
5001 yyextra->docBlockName=&yytext[1];
5002 yyextra->fullArgString+=yytext;
5003 BEGIN(CopyArgVerbatim);
5004 }
5005<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5006 yyextra->docBlockName=&yytext[1];
5007 if (yyextra->docBlockName.at(1)=='[')
5008 {
5009 yyextra->docBlockName.at(1)=']';
5010 }
5011 if (yyextra->docBlockName.at(1)=='{')
5012 {
5013 yyextra->docBlockName.at(1)='}';
5014 }
5015 if (yyextra->docBlockName.at(1)=='(')
5016 {
5017 yyextra->docBlockName.at(1)=')';
5018 }
5019 yyextra->fullArgString+=yytext;
5020 BEGIN(CopyArgVerbatim);
5021 }
5022<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] { // end of verbatim block
5023 yyextra->fullArgString+=yytext;
5024 if (&yytext[4]==yyextra->docBlockName)
5025 {
5026 yyextra->docBlockName="";
5027 BEGIN(CopyArgCommentLine);
5028 }
5029 }
5030<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") { // end of verbatim block
5031 yyextra->fullArgString+=yytext;
5032 if (yyextra->docBlockName==&yytext[1])
5033 {
5034 yyextra->docBlockName="";
5035 BEGIN(CopyArgCommentLine);
5036 }
5037 }
5038<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5039<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5040<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
5041<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5042<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5043 warn(yyextra->fileName,yyextra->yyLineNr,
5044 "Ignoring {:c}brief command inside argument documentation",*yytext
5045 );
5046 yyextra->fullArgString+=' ';
5047 }
5048<ReadTempArgs>"<" {
5049 *yyextra->copyArgString+=*yytext;
5050 yyextra->fullArgString+=*yytext;
5051 yyextra->argSharpCount=1;
5052 BEGIN( CopyArgSharp );
5053 }
5054<ReadTempArgs>">" {
5055 *yyextra->copyArgString+=*yytext;
5056 yyextra->fullArgString+=*yytext;
5057
5058 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5060 BEGIN( yyextra->currentArgumentContext );
5061 }
5062<CopyArgRound>"(" {
5063 yyextra->argRoundCount++;
5064 *yyextra->copyArgString+=*yytext;
5065 yyextra->fullArgString+=*yytext;
5066 }
5067<CopyArgRound>")" {
5068 *yyextra->copyArgString+=*yytext;
5069 yyextra->fullArgString+=*yytext;
5070 if (yyextra->argRoundCount>0)
5071 yyextra->argRoundCount--;
5072 else
5073 BEGIN( yyextra->lastCopyArgContext );
5074 }
5075<CopyArgSquare>"[" {
5076 yyextra->argSquareCount++;
5077 *yyextra->copyArgString+=*yytext;
5078 yyextra->fullArgString+=*yytext;
5079 }
5080<CopyArgSquare>"]" {
5081 *yyextra->copyArgString+=*yytext;
5082 yyextra->fullArgString+=*yytext;
5083 if (yyextra->argSquareCount>0)
5084 yyextra->argSquareCount--;
5085 else
5086 BEGIN( yyextra->lastCopyArgContext );
5087 }
5088<CopyArgSharp>"(" {
5089 *yyextra->copyArgString+=*yytext;
5090 yyextra->fullArgString+=*yytext;
5091 yyextra->argRoundCount=0;
5092 yyextra->lastCopyArgContext = YY_START;
5093 BEGIN( CopyArgRound );
5094 }
5095<CopyArgSharp>"<" {
5096 yyextra->argSharpCount++;
5097
5098 *yyextra->copyArgString+=*yytext;
5099 yyextra->fullArgString+=*yytext;
5100 }
5101<CopyArgSharp>">" {
5102 *yyextra->copyArgString+=*yytext;
5103 yyextra->fullArgString+=*yytext;
5104 yyextra->argSharpCount--;
5105 if (yyextra->argSharpCount>0)
5106 {
5107
5108 }
5109 else
5110 {
5111 BEGIN( ReadTempArgs );
5112
5113 }
5114 }
5115<CopyArgString,CopyArgPHPString>\\. {
5116 *yyextra->copyArgString+=yytext;
5117 yyextra->fullArgString+=yytext;
5118 }
5119<CopyArgString>\" {
5120 *yyextra->copyArgString+=*yytext;
5121 yyextra->fullArgString+=*yytext;
5122 BEGIN( yyextra->lastCopyArgStringContext );
5123 }
5124<CopyArgPHPString>\' {
5125 *yyextra->copyArgString+=*yytext;
5126 yyextra->fullArgString+=*yytext;
5127 BEGIN( yyextra->lastCopyArgStringContext );
5128 }
5129<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5130 if (yyextra->insidePHP)
5131 {
5132 REJECT;
5133 }
5134 else
5135 {
5136 *yyextra->copyArgString+=yytext;
5137 yyextra->fullArgString+=yytext;
5138 }
5139 }
5140<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5141 *yyextra->copyArgString+=yytext;
5142 yyextra->fullArgString+=yytext;
5143 if (yyextra->insidePHP)
5144 {
5145 yyextra->lastCopyArgStringContext=YY_START;
5146 BEGIN(SkipPHPString);
5147 }
5148 }
5149<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5150 *yyextra->copyArgString+=yytext;
5151 yyextra->fullArgString+=yytext;
5152 }
5153<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5155 *yyextra->copyArgString+=*yytext;
5156 yyextra->fullArgString+=*yytext;
5157 }
5158<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5159 *yyextra->copyArgString+=yytext;
5160 yyextra->fullArgString+=yytext;
5161 }
5162<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5163 *yyextra->copyArgString+=*yytext;
5164 yyextra->fullArgString+=*yytext;
5165 }
5166
5167
5168
5169
5170
5171
5172<FuncRound>"(" { yyextra->current->args += *yytext ;
5173 ++yyextra->roundCount ;
5174 }
5175<FuncRound>")" { yyextra->current->args += *yytext ;
5176 if ( yyextra->roundCount )
5177 --yyextra->roundCount ;
5178 else
5179 BEGIN( FuncQual ) ;
5180 }
5181
5182<FuncQual>"#" { if (yyextra->insidePHP)
5183 REJECT;
5184 yyextra->lastCPPContext = YY_START;
5185 BEGIN(SkipCPP);
5186 }
5187 */
5188<FuncQual>[{:;,] {
5189 if (
qstrcmp(yytext,
";")==0 &&
5190 ((yyextra->insideJS || yyextra->insidePHP) &&
5192 {
5193 yyextra->current->reset();
5195 BEGIN( FindMembers );
5196 }
5197 else
5198 {
5199 unput(*yytext); BEGIN( SFunction );
5200 }
5201 }
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
5202<FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
5204 yyextra->current->virt = Specifier::Pure;
5205 yyextra->current->args += " override ";
5206 }
5207<FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
5209 yyextra->current->spec.setOverride(true);
5210 yyextra->current->args += " override ";
5211 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5212 BEGIN(FuncQual);
5213 }
5214<FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
5216 yyextra->current->spec.setFinal(true);
5217 yyextra->current->args += " final ";
5218 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5219 BEGIN(FuncQual);
5220 }
5221<FuncQual>{BN}*"sealed"{BN}* { // sealed member function
5223 yyextra->current->spec.setSealed(true);
5224 yyextra->current->args += " sealed ";
5225 }
5226<FuncQual>{BN}*"new"{BN}* { // new member function
5228 yyextra->current->spec.setNew(true);
5229 yyextra->current->args += " new ";
5230 }
5231<FuncQual>{BN}*"const"{BN}* { // const member function
5233 yyextra->current->args += " const ";
5234 yyextra->current->argList.setConstSpecifier(
TRUE);
5235 }
5236<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
5238 yyextra->current->args += " volatile ";
5239 yyextra->current->argList.setVolatileSpecifier(
TRUE);
5240 }
5241<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
5243 yyextra->current->args += " noexcept ";
5244 yyextra->current->spec.setNoExcept(true);
5245 }
5246<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* { // noexcept(false) expression
5248 yyextra->current->args += " noexcept(false)";
5249 }
5250<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
5252 yyextra->current->args += " noexcept(";
5253 yyextra->current->spec.setNoExcept(true);
5254 yyextra->lastRoundContext=FuncQual;
5255 yyextra->pCopyRoundString=&yyextra->current->args;
5256 yyextra->roundCount=0;
5257 BEGIN(CopyRound);
5258 }
5259<FuncQual>{BN}*"&" {
5260 yyextra->current->args += " &";
5262 }
5263<FuncQual>{BN}*"&&" {
5264 yyextra->current->args += " &&";
5266 }
5267
5268<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
5270 yyextra->current->args += " = 0";
5271 yyextra->current->virt = Specifier::Pure;
5272 yyextra->current->argList.setPureSpecifier(
TRUE);
5273 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5274 BEGIN(FuncQual);
5275 }
5276<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
5278 yyextra->current->args += " = delete";
5279 yyextra->current->spec.setDelete(true);
5280 yyextra->current->argList.setIsDeleted(
TRUE);
5281 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5282 BEGIN(FuncQual);
5283 }
5284<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
5286 yyextra->current->args += " = default";
5287 yyextra->current->spec.setDefault(true);
5288 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5289 BEGIN(FuncQual);
5290 }
5291<FuncQual>{BN}*"->"{BN}* {
5293 yyextra->current->argList.setTrailingReturnType(" -> ");
5294 yyextra->current->args += " -> ";
5295 yyextra->roundCount=0;
5296 BEGIN(TrailingReturn);
5297 }
5298<TrailingReturn>[{;] {
5299 if (yyextra->roundCount>0) REJECT;
5300 unput(*yytext);
5301 yyextra->current->argList.finishTrailingReturnType();
5302 BEGIN(FuncQual);
5303 }
5304<TrailingReturn>"requires"{BN}+ {
5305 if (yyextra->insideJava) REJECT;
5306 yyextra->requiresContext = FuncQual;
5307 yyextra->current->req+=' ';
5308 yyextra->current->argList.finishTrailingReturnType();
5309 BEGIN(RequiresClause);
5310 }
5311<TrailingReturn>"(" {
5312 yyextra->roundCount++;
5313 yyextra->current->argList.appendTrailingReturnType(yytext);
5314 yyextra->current->args+=yytext;
5315 }
5316<TrailingReturn>")" {
5317 if (yyextra->roundCount>0)
5318 {
5319 yyextra->roundCount--;
5320 }
5321 else
5322 {
5323 warn(yyextra->fileName,yyextra->yyLineNr,
5324 "Found ')' without opening '(' for trailing return type '{})...'",
5325 yyextra->current->argList.trailingReturnType());
5326 }
5327 yyextra->current->argList.appendTrailingReturnType(yytext);
5328 yyextra->current->args+=yytext;
5329 }
5330<TrailingReturn>. {
5331 yyextra->current->argList.appendTrailingReturnType(yytext);
5332 yyextra->current->args+=yytext;
5333 }
5334<TrailingReturn>\n {
5336 yyextra->current->argList.appendTrailingReturnType(yytext);
5337 yyextra->current->args+=' ';
5338 }
5339<FuncRound,FuncFunc>{BN}*","{BN}* {
5341 yyextra->current->args += ", " ;
5342 }
5343<FuncQual,FuncRound,FuncFunc>{BN}+ {
5345 yyextra->current->args += ' ' ;
5346 }
5347<SFunction,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
5348 REJECT;
5349 yyextra->lastCPPContext = YY_START;
5350 BEGIN(SkipCPP);
5351 }
5352<FuncQual>"=" {
5353 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5354 {
5355 BEGIN(CliOverride);
5356 }
5357 else
5358 {
5359
5360 yyextra->lastInitializerContext=YY_START;
5361 yyextra->sharpCount=0;
5362 yyextra->initBracketCount=0;
5363 yyextra->current->initializer.str(yytext);
5364 BEGIN(ReadInitializer);
5365 }
5366 }
5367<CliOverride>{ID} {
5368 }
5369<CliOverride>"{" {
5370 unput(*yytext);
5371 BEGIN(FuncQual);
5372 }
5373<CliOverride>\n {
5375 }
5376<CliOverride>. {
5377 }
5378<FuncQual>{ID} {
5379 if (yyextra->insideCpp &&
qstrcmp(yytext,
"requires")==0)
5380 {
5381
5382 yyextra->requiresContext = YY_START;
5383 yyextra->current->req+=' ';
5384 BEGIN(RequiresClause);
5385 }
5386 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
5387 {
5388
5389 yyextra->current->typeConstr.clear();
5390 yyextra->current->typeConstr.push_back(
Argument());
5391 yyextra->lastCSConstraint = YY_START;
5392 BEGIN( CSConstraintName );
5393 }
5395 {
5396 yyextra->current->args = yytext;
5397 yyextra->oldStyleArgType.clear();
5398 BEGIN(OldStyleArgs);
5399 }
5400 else
5401 {
5402 yyextra->current->args += yytext;
5403 }
5404 }
static bool checkForKnRstyleC(yyscan_t yyscanner)
5405<OldStyleArgs>[,;] {
5408 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5410 if (yyextra->current->doc!=yyextra->docBackup)
5411 {
5412 doc=yyextra->current->doc;
5413 yyextra->current->doc=yyextra->docBackup;
5414 }
5415 if (yyextra->current->brief!=yyextra->briefBackup)
5416 {
5417 brief=yyextra->current->brief;
5418 yyextra->current->brief=yyextra->briefBackup;
5419 }
5420 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5421 oldStyleArgName,brief,doc);
5422 yyextra->current->args.clear();
5423 if (*yytext==';') yyextra->oldStyleArgType.clear();
5424 }
static void addKnRArgInfo(yyscan_t yyscanner, const QCString &type, const QCString &name, const QCString &brief, const QCString &docs)
static void splitKnRArg(yyscan_t yyscanner, QCString &oldStyleArgPtr, QCString &oldStyleArgName)
5425<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5426<OldStyleArgs>"{" {
5427 if (yyextra->current->argList.empty())
5428 {
5429 yyextra->current->argList.setNoParameters(
TRUE);
5430 }
5432 unput('{');
5433 BEGIN(FuncQual);
5434 }
5435<OldStyleArgs>. { yyextra->current->args += *yytext; }
5436<FuncQual,FuncRound,FuncFunc>\" {
5437 if (yyextra->insideIDL && yyextra->insideCppQuote)
5438 {
5439 BEGIN(EndCppQuote);
5440 }
5441 else
5442 {
5443 yyextra->current->args += *yytext;
5444 }
5445 }
5446<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5447<FuncQual>{BN}*"try:" |
5448<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
5449 yyextra->insideTryBlock=
TRUE;
5451 if (yytext[yyleng-1]==':')
5452 {
5453 unput(':');
5454 BEGIN( SFunction );
5455 }
5456 }
5457<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
5458 yyextra->current->exception = " throw (" ;
5459 yyextra->roundCount=0;
5461 BEGIN( ExcpRound ) ;
5462 }
5463<FuncQual>{BN}*"raises"{BN}*"(" {
5464 yyextra->current->exception = " raises (" ;
5466 yyextra->roundCount=0;
5467 BEGIN( ExcpRound ) ;
5468 }
5469<FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
5470 yyextra->current->exception = " throws " ;
5472 BEGIN( ExcpList );
5473 }
5474<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5475 ++yyextra->roundCount ;
5476 }
5477<ExcpRound>")" { yyextra->current->exception += *yytext ;
5478 if ( yyextra->roundCount )
5479 --yyextra->roundCount ;
5480 else
5481 BEGIN( FuncQual ) ;
5482 }
5483<ExcpRound>. {
5484 yyextra->current->exception += *yytext;
5485 }
5486<ExcpList>"{" {
5487 unput('{'); BEGIN( FuncQual );
5488 }
5489<ExcpList>";" {
5490 unput(';'); BEGIN( FuncQual );
5491 }
5492<ExcpList>"\n" {
5493 yyextra->current->exception += ' ';
5495 }
5496<ExcpList>. {
5497 yyextra->current->exception += *yytext;
5498 }
5499<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5500 yyextra->current->name = yyextra->current->args ;
5501 yyextra->current->args = yytext ;
5502 yyextra->roundCount=0;
5503 BEGIN( FuncRound ) ;
5504 }
5505<SFunction>":" {
5506 if (!yyextra->insidePHP) BEGIN(SkipInits);
5507 }
5508<SFunction>[;{,] {
5512 yyextra->current->fileName = yyextra->fileName;
5513 yyextra->current->startLine = yyextra->yyBegLineNr;
5514 yyextra->current->startColumn = yyextra->yyBegColNr;
5515 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5517 std::string type = yyextra->current->type.str();
5518 int ti=-1;
5520 {
5521 ti = (int)
match.position();
5522 }
5523 if (ti!=-1)
5524 {
5525 int di = yyextra->current->type.find("decltype(");
5526 if (di!=-1 && di<ti)
5527 {
5528 ti=-1;
5529 }
5530 }
5531 int ts=yyextra->current->type.find('<');
5532 int te=yyextra->current->type.findRev('>');
5533
5534
5535 bool startsWithTypedef = yyextra->current->type.startsWith("typedef ");
5536 bool isFunction = ti==-1 ||
5537 (ts!=-1 && ts<te && ts<ti && ti<te);
5538 bool isVariable = !yyextra->current->type.isEmpty() &&
5539 (!isFunction || startsWithTypedef);
5540
5541
5542
5543
5544 if (*yytext!=';' || yyextra->current_root->section.isCompound())
5545 {
5546 if (isVariable)
5547 {
5548
5549 if (yyextra->isTypedef && !startsWithTypedef)
5550 {
5551 yyextra->current->type.prepend("typedef ");
5552 }
5553 yyextra->current->section = EntryType::makeVariable() ;
5554 }
5555 else
5556 {
5557
5558 yyextra->current->section = EntryType::makeFunction() ;
5559 yyextra->current->proto = *yytext==';';
5560 }
5561 }
5562 else
5563 {
5564
5565 if (isVariable)
5566 {
5567 if (yyextra->isTypedef && !startsWithTypedef)
5568 {
5569 yyextra->current->type.prepend("typedef ");
5570 }
5571
5572 yyextra->current->section = EntryType::makeVariable();
5573 }
5574 else
5575 {
5576
5577 yyextra->current->section = EntryType::makeFunction();
5578 yyextra->current->proto =
TRUE;
5579 }
5580 }
5581
5582 if ( yyextra->insidePHP)
5583 {
5585 {
5586 yyextra->current->spec.setFinal(true);
5587 }
5589 {
5590 yyextra->current->spec.setAbstract(true);
5591 }
5592 }
5593 if ( yyextra->insidePHP && !
containsWord(yyextra->current->type,
"function"))
5594 {
5596 if ( *yytext == '{' )
5597 {
5598 yyextra->lastCurlyContext = FindMembers;
5599 yyextra->curlyCount=0;
5600 BEGIN( SkipCurly );
5601 }
5602 else
5603 {
5604 BEGIN( FindMembers );
5605 }
5606 }
5607 else
5608 {
5609 if ( yyextra->insidePHP)
5610 {
5612 }
5613 yyextra->previous = yyextra->current;
5614 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5616
5617 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
5618 {
5619 yyextra->current->spec.setOptional(true).setRequired(true);
5620 }
5621 yyextra->lastCurlyContext = FindMembers;
5622 if ( *yytext == ',' )
5623 {
5624 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
5625 }
5626 if ( *yytext == '{' )
5627 {
5628 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
5629 {
5630 yyextra->previous->spec.setInline(true);
5631 }
5632
5633 yyextra->curlyCount=0;
5634 BEGIN( SkipCurly ) ;
5635 }
5636 else
5637 {
5638 if (!yyextra->previous->section.isVariable())
5639 yyextra->previous->bodyLine=-1;
5640 BEGIN( FindMembers ) ;
5641 }
5642 }
5643 }
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
5644<SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
5646 yyextra->curlyCount=1;
5647 BEGIN(SkipC11Inits);
5648 }
5649<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
5651 yyextra->curlyCount=1;
5652 BEGIN(SkipC11Inits);
5653 }
5654<SkipC11Inits>"{" {
5655 ++yyextra->curlyCount;
5656 }
5657<SkipC11Inits>"}" {
5658 if ( --yyextra->curlyCount<=0 )
5659 {
5660 BEGIN(SkipInits);
5661 }
5662 }
5663<SkipC11Attribute>"]]" {
5664 BEGIN(yyextra->lastC11AttributeContext);
5665 }
5666<SkipInits>"{" { // C++11 style initializer
5667 unput('{');
5668 BEGIN( SFunction );
5669 }
5670<SkipCurly>"{" {
5671
5672 ++yyextra->curlyCount ;
5673 }
5674<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
5675<SkipCurly>"}" {
5676
5677 if( yyextra->curlyCount )
5678 {
5679 --yyextra->curlyCount ;
5680 }
5681 else
5682 {
5683 if (!yyextra->current->sli.empty() && yyextra->previous)
5684 {
5685 yyextra->previous->sli = yyextra->current->sli;
5686 yyextra->current->sli.clear();
5687 }
5688 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5689 BEGIN( yyextra->lastCurlyContext ) ;
5690 }
5691 }
5692<SkipCurly>"}"{BN}*{DCOMM}"<" {
5694 if ( yyextra->curlyCount )
5695 {
5696
5697 --yyextra->curlyCount ;
5698 }
5699 else
5700 {
5701 yyextra->current->endBodyLine=yyextra->yyLineNr;
5702 yyextra->tempEntry = yyextra->current;
5703 yyextra->current = yyextra->previous;
5704
5705 yyextra->docBlockContext = SkipCurlyEndDoc;
5706 yyextra->docBlockInBody =
FALSE;
5707 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5709 yyextra->docBlock.str(std::string());
5710 yyextra->docBlockTerm = '}';
5711 if (yytext[yyleng-3]=='/')
5712 {
5714 BEGIN( DocLine );
5715 }
5716 else
5717 {
5719 BEGIN( DocBlock );
5720 }
5721 }
5722 }
5723<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
5724 yyextra->docBlockContext = SkipCurlyEndDoc;
5725 yyextra->docBlockInBody =
FALSE;
5726 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5728 yyextra->docBlock.str(std::string());
5729 yyextra->docBlockTerm = '}';
5730 if (yytext[yyleng-3]=='/')
5731 {
5733 BEGIN( DocLine );
5734 }
5735 else
5736 {
5738 BEGIN( DocBlock );
5739 }
5740 }
5741<SkipCurlyEndDoc>"}" {
5742
5743 if (yyextra->tempEntry)
5744 {
5745 yyextra->current = yyextra->tempEntry;
5746 yyextra->tempEntry.reset();
5747 }
5748 BEGIN( yyextra->lastCurlyContext );
5749 }
5750<SkipCurly>\" {
5751
5752 yyextra->lastStringContext=SkipCurly;
5753 BEGIN( SkipString );
5754 }
5755<SkipCurly>^{B}*"#" {
5756 if (yyextra->insidePHP)
5757 REJECT;
5758
5759 BEGIN( SkipCurlyCpp );
5760 }
5761<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n {
5763
5764 }
5765<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
5766 if (!yyextra->insidePHP)
5767 {
5768 REJECT;
5769 }
5770 else
5771 {
5772 yyextra->lastHereDocContext = YY_START;
5773 BEGIN(HereDoc);
5774 }
5775 }
5776<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
5778 yyextra->lastRawStringContext = YY_START;
5779 yyextra->dummyRawString.clear();
5780 yyextra->pCopyRawString = &yyextra->dummyRawString;
5781 *yyextra->pCopyRawString += yytext;
5782 BEGIN(RawString);
5783 }
5784<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
5786
5787 }
5788<SkipCurly,SkipCurlyCpp>"\$" {}
5789<SkipCurlyCpp>\n {
5790
5792 yyextra->lastCurlyContext = FindMembers;
5793 BEGIN( SkipCurly );
5794 }
5795<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
5796
5798 }
5799<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CCS} {
5800
5801 yyextra->lastCContext = YY_START;
5802 BEGIN(SkipComment);
5803 }
5804<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CPPC} {
5805
5806 yyextra->lastCContext = YY_START;
5807 BEGIN(SkipCxxComment);
5808 }
5809<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
5810 yyextra->roundCount=0;
5811 yyextra->lastSkipRoundContext=YY_START;
5812 BEGIN(SkipRound);
5813 }
5814<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
5815 yyextra->lastStringContext=YY_START;
5816 BEGIN( SkipString );
5817 }
5818<SkipInits>; {
5819 warn(yyextra->fileName,yyextra->yyLineNr,
5820 "Found ';' while parsing initializer list! "
5821 "(doxygen could be confused by a macro call without semicolon)"
5822 );
5823 BEGIN( FindMembers );
5824 }
5825<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
5826 if (!yyextra->insidePHP)
5827 REJECT;
5828
5829 yyextra->lastCContext = YY_START;
5830 BEGIN(SkipCxxComment);
5831 }
5832<SkipInits,SkipCurly,SkipCurlyCpp>@\" {
5833 if (!yyextra->insideCS) REJECT;
5834
5835
5836 yyextra->lastSkipVerbStringContext=YY_START;
5837 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
5838 yyextra->dummyTextStream.clear();
5839 BEGIN(SkipVerbString);
5840 }
5841<SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} {
5842 if (yyextra->insidePHP) REJECT;
5843 }
5844<SkipInits,SkipCurly,SkipCurlyCpp>\' {
5845 if (yyextra->insidePHP)
5846 {
5847 yyextra->lastStringContext=YY_START;
5848 BEGIN(SkipPHPString);
5849 }
5850 }
5851<SkipC11Attribute>{ID} {
5853 {
5854 yyextra->current->spec.setNoDiscard(true);
5855 }
5856 }
5857<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>. { }
5858<SkipString,SkipPHPString>\\. { }
5859<SkipString>\" {
5860 BEGIN( yyextra->lastStringContext );
5861 }
5862<SkipPHPString>\' {
5863 BEGIN( yyextra->lastStringContext );
5864 }
5865<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
5866<SkipString,SkipPHPString>\n {
5868 }
5869<SkipString>"[[" { }
5870<SkipString,SkipPHPString>. { }
5871<CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
5872 unput(':');
5873 BEGIN(ClassVar);
5874 }
5875<CompoundName>";" {
5876 yyextra->current->section = EntryType::makeEmpty() ;
5877 yyextra->current->type.clear() ;
5878 yyextra->current->name.clear() ;
5879 yyextra->current->args.clear() ;
5880 yyextra->current->argList.clear();
5881 BEGIN( FindMembers ) ;
5882 }
5883<Bases>";" {
5884 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
5885 {
5886
5887
5888 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
5889 {
5891 }
5892 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
5893
5894 if (!yyextra->baseName.isEmpty())
5895 {
5896 yyextra->current->extends.emplace_back(
5897 yyextra->baseName,Protection::Public,Specifier::Normal);
5898 yyextra->baseName.clear();
5899 }
5900 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5902 }
5903 else
5904 {
5905 yyextra->current->section = EntryType::makeEmpty() ;
5906 yyextra->current->type.clear() ;
5907 yyextra->current->name.clear() ;
5908 yyextra->current->args.clear() ;
5909 yyextra->current->argList.clear();
5910 }
5911 BEGIN( FindMembers ) ;
5912 }
5913<CompoundName>{SCOPENAME}/{BN}*"<" {
5914 yyextra->sharpCount = 0;
5915 yyextra->current->name = yytext ;
5917 if (yyextra->current->spec.isProtocol())
5918 {
5919 yyextra->current->name+="-p";
5920 }
5922 yyextra->lastClassTemplSpecContext = ClassVar;
5923 if (yyextra->insideObjC)
5924 {
5925 BEGIN( ObjCProtocolList );
5926 }
5927 else if (yyextra->insideCS)
5928 {
5929
5930 BEGIN( CSGeneric );
5931 }
5932 else
5933 {
5934 yyextra->roundCount=0;
5935 BEGIN( ClassTemplSpec );
5936 }
5937 }
5938<CSGeneric>"<" {
5940
5941
5942 yyextra->current->tArgLists.
push_back(al);
5943 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
5944 yyextra->templateStr="<";
5945 yyextra->current->name += "<";
5946 yyextra->fullArgString = yyextra->templateStr;
5947 yyextra->copyArgString = &yyextra->current->name;
5948
5949 yyextra->currentArgumentContext = ClassVar;
5950 BEGIN( ReadTempArgs );
5951 }
5952<ObjCProtocolList>"<" {
5953 yyextra->insideProtocolList=
TRUE;
5954 BEGIN( Bases );
5955 }
5956<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
5957 yyextra->current->name += yytext;
5959 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
5960 {
5962 if (yyextra->current->spec.isProtocol())
5963 {
5964 unput('{');
5965 BEGIN( ClassVar );
5966 }
5967 else
5968 {
5969 BEGIN( yyextra->lastClassTemplSpecContext );
5970 }
5971 }
5972 }
5973<ClassTemplSpec>"<" {
5974 yyextra->current->name += yytext;
5975 if (yyextra->roundCount==0) yyextra->sharpCount++;
5976 }
5977<ClassTemplSpec>. {
5978 yyextra->current->name += yytext;
5979 }
5980<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" { // forward declaration?
5981 if (yyextra->insideCS && yyextra->current->type == "namespace")
5982 {
5983
5985 yyextra->current->name =
substitute(yytext,
".",
"::");
5986 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5987 yyextra->fakeNS++;
5988 unput('{');
5989 BEGIN( ClassVar );
5990 }
5991 else if (!yyextra->current->tArgLists.empty())
5992 {
5993
5994
5995 yyextra->current->name = yytext;
5996 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5998
5999 QCString rn = yyextra->current_root->name;
6000
6001 if (!yyextra->current->name.isEmpty() && !rn.
isEmpty())
6002 {
6004 }
6005 yyextra->current->spec.setForwardDecl(true);
6006 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6007 }
6008 else if (yyextra->insideIDL &&
6009 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6010 yyextra->current->spec.isInterface()) ||
6011 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6012 yyextra->current->spec.isService())
6013 )
6014 )
6015 {
6016
6017
6018
6019
6020 yyextra->current->name = yytext;
6021 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6022 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6024
6025 yyextra->current->spec.setInterface(false).setService(false);
6026
6027
6028
6029 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6030 }
6031
6032 if (!(yyextra->insideCS && yyextra->current->type == "namespace"))
6033 {
6034 unput(';');
6035 yyextra->current->reset();
6037 if (yyextra->insideObjC)
6038 {
6039 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6040 yyextra->insideObjC =
FALSE;
6041 }
6042 if (yyextra->isTypedef)
6043 {
6044 yyextra->current->type.prepend("typedef");
6045 }
6046 BEGIN( FindMembers );
6047 }
6048 }
6049<CompoundName>{SCOPENAME}/{BN}*"(" {
6050 yyextra->current->name = yytext ;
6053 if (yyextra->insideCpp && yyextra->current->name=="alignas")
6054 {
6055 yyextra->lastAlignAsContext = YY_START;
6056 BEGIN( AlignAs );
6057 }
6058 else
6059 {
6060 if (yyextra->current->spec.isProtocol())
6061 {
6062 yyextra->current->name += "-p";
6063 }
6064 BEGIN( ClassVar );
6065 }
6066 }
6067<AlignAs>"(" { yyextra->roundCount=0;
6068 BEGIN( AlignAsEnd );
6069 }
6070<AlignAs>\n { lineCount(yyscanner); }
6071<AlignAs>.
6072<AlignAsEnd>"(" { yyextra->roundCount++; }
6073<AlignAsEnd>")" { if (--yyextra->roundCount<0)
6074 {
6075 BEGIN( yyextra->lastAlignAsContext );
6076 }
6077 }
6078<AlignAsEnd>\n { lineCount(yyscanner); }
6079<AlignAsEnd>.
6080<ConceptName>{ID} {
6081 yyextra->current->name = yytext ;
6083 }
6084<ConceptName>"=" {
6085 yyextra->current->bodyLine = yyextra->yyLineNr;
6086 yyextra->current->bodyColumn = yyextra->yyColNr;
6087 yyextra->current->initializer.str(std::string());
6088 yyextra->lastInitializerContext = FindMembers;
6089 yyextra->sharpCount=0;
6090 yyextra->initBracketCount=0;
6091 BEGIN(ReadInitializer);
6092 }
6093<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
6094
6095 yyextra->current->reset();
6097 }
6098<CompoundName>{SCOPENAME} {
6099 yyextra->current->name = yytext ;
6102 if (yyextra->current->spec.isProtocol())
6103 {
6104 yyextra->current->name += "-p";
6105 }
6106 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6107 {
6108 unput('{');
6109 }
6110 BEGIN( ClassVar );
6111 }
6112<CompoundName>{CSSCOPENAME} { // C# style scope
6113 yyextra->current->name =
substitute(yytext,
".",
"::");
6115 BEGIN( ClassVar );
6116 }
6117<ClassVar>{SCOPENAME}{BNopt}/"(" {
6118 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6119 {
6120
6121 yyextra->roundCount=0;
6122 BEGIN(SkipUnionSwitch);
6123 }
6124 else
6125 {
6127 yyextra->yyBegColNr=yyextra->yyColNr;
6128 yyextra->yyBegLineNr=yyextra->yyLineNr;
6129 yyextra->current->name = yytext;
6130 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6133 BEGIN( FindMembers );
6134 }
6135 }
6136<ClassVar>"," {
6137 if (yyextra->isTypedef)
6138 {
6139
6140 unput(',');
6141 yyextra->current->type.prepend("typedef ");
6142 BEGIN(FindMembers);
6143 }
6144 else
6145 {
6146
6147 }
6148 }
6149<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6150 if (yyextra->insideCli)
6151 {
6152 if (yytext[0]=='s')
6153 yyextra->current->spec.setSealedClass(true);
6154 else
6155 yyextra->current->spec.setAbstractClass(true);
6156 BEGIN( ClassVar );
6157 }
6158 else
6159 {
6160 REJECT;
6161 }
6162 }
6163<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6164 yyextra->yyBegColNr=yyextra->yyColNr;
6165 yyextra->yyBegLineNr=yyextra->yyLineNr;
6168 if (yyextra->current->section.isEnum())
6169 {
6170 yyextra->current->section = EntryType::makeVariable() ;
6171 }
6172 yyextra->current->type += ' ' ;
6173 yyextra->current->type += yyextra->current->name ;
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
6175
6177 {
6178 BEGIN( Operator );
6179 }
6180 }
6181<ClassVar>{ID} {
6182 yyextra->yyBegColNr=yyextra->yyColNr;
6183 yyextra->yyBegLineNr=yyextra->yyLineNr;
6185 if (yyextra->insideIDL &&
qstrcmp(yytext,
"switch")==0)
6186 {
6187
6188 yyextra->roundCount=0;
6189 BEGIN(SkipUnionSwitch);
6190 }
6191 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
qstrcmp(yytext,
"implements")==0 ||
qstrcmp(yytext,
"extends")==0))
6192 {
6193 yyextra->current->type.clear();
6194 yyextra->baseProt = Protection::Public;
6195 yyextra->baseVirt = Specifier::Normal;
6196 yyextra->baseName.clear();
6197 BEGIN( BasesProt ) ;
6198 }
6199 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
6200 {
6201 yyextra->current->typeConstr.clear();
6202 yyextra->current->typeConstr.push_back(
Argument());
6203 yyextra->lastCSConstraint = YY_START;
6204 BEGIN( CSConstraintName );
6205 }
6206 else if (yyextra->insideCli &&
qstrcmp(yytext,
"abstract")==0)
6207 {
6208 yyextra->current->spec.setAbstract(true);
6209 }
6210 else if (yyextra->insideCli &&
qstrcmp(yytext,
"sealed")==0)
6211 {
6212 yyextra->current->spec.setSealed(true);
6213 }
6214 else if (
qstrcmp(yytext,
"final")==0)
6215 {
6216 yyextra->current->spec.setFinal(true);
6217 }
6218 else
6219 {
6220 if (yyextra->current->section.isEnum())
6221 {
6222 yyextra->current->section = EntryType::makeVariable() ;
6223 }
6224 yyextra->current->type += ' ' ;
6225 yyextra->current->type += yyextra->current->name ;
6226 yyextra->current->name = yytext ;
6227
6229 {
6230 BEGIN( Operator );
6231 }
6232 }
6233 }
6234<ClassVar>[(\[] {
6235 if (yyextra->insideObjC && *yytext=='(')
6236 {
6237 yyextra->current->name+='(';
6238
6239
6240 yyextra->current->spec.setCategory(true);
6241
6242 BEGIN( ClassCategory );
6243 }
6244 else
6245 {
6246
6247 unput(*yytext);
6248 BEGIN( FindMembers );
6249 }
6250 }
6251<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
6252<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
6253 yyextra->fullArgString.clear();
6254 yyextra->lastCopyArgChar='#';
6255 yyextra->lastCommentInArgContext=YY_START;
6256 if (yytext[1]=='/')
6257 BEGIN( CopyArgCommentLine );
6258 else
6259 BEGIN( CopyArgComment );
6260 }
6261<CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
6262 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6263 }
6264<CSConstraintType>"=>" { // end of type constraint reached
6265
6267 unput('>');
6268 unput('=');
6269 BEGIN( yyextra->lastCSConstraint );
6270 }
6271<CSConstraintType>"{" { // end of type constraint reached
6272
6274 unput('{');
6275 BEGIN( yyextra->lastCSConstraint );
6276 }
6277<CSConstraintType,CSConstraintName>";" {
6279 unput(';');
6280 BEGIN( yyextra->lastCSConstraint );
6281 }
6282<CSConstraintName>":" {
6283 BEGIN( CSConstraintType );
6284 }
6285<CSConstraintName>{ID} {
6286
6287 yyextra->current->typeConstr.back().name=yytext;
6288 }
6289<CSConstraintType>"where" { // another constraint for a different param
6290 yyextra->current->typeConstr.push_back(
Argument());
6291 BEGIN( CSConstraintName );
6292 }
6293<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6294 if (yyextra->current->typeConstr.back().type.isEmpty())
6295
6296 {
6297 yyextra->current->typeConstr.back().type=yytext;
6298 }
6299 else
6300 {
6301 QCString name = yyextra->current->typeConstr.back().name;
6302 yyextra->current->typeConstr.push_back(
Argument());
6303 yyextra->current->typeConstr.back().name=name;
6304 yyextra->current->typeConstr.back().type=yytext;
6305 }
6306 }
6307<CSConstraintName,CSConstraintType>\n {
6309 }
6310<CSConstraintName,CSConstraintType>. {
6311 }
6312<ClassCategory>{ID} {
6313 yyextra->current->name+=yytext;
6314 }
6315<ClassCategory>")"/{BN}*"{" {
6316 yyextra->current->name+=')';
6317 BEGIN( ClassVar );
6318 }
6319<ClassCategory>")"/{BN}*"<" {
6320 yyextra->current->name+=')';
6321 BEGIN( ObjCProtocolList );
6322 }
6323<ClassCategory>")" {
6324 yyextra->current->name+=')';
6325 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6326 {
6327 unput('{');
6328 }
6329 else
6330 {
6331 unput('}');
6332 unput('{');
6333 }
6334 BEGIN( ClassVar );
6335 }
6336<ClassVar>":" {
6337 if (yyextra->current->section.isVariable())
6338 {
6339 yyextra->current->bitfields+=":";
6340 yyextra->current->args.clear();
6341 BEGIN(BitFields);
6342 }
6343 else if (yyextra->current->section.isEnum())
6344
6345 {
6346 yyextra->current->args.clear();
6347 BEGIN(EnumBaseType);
6348 }
6349 else
6350 {
6351 yyextra->current->type.clear();
6352 if (yyextra->current->spec.isInterface() ||
6353 yyextra->current->spec.isStruct() ||
6354 yyextra->current->spec.isRef() ||
6355 yyextra->current->spec.isValue() ||
6356 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6357 )
6358 {
6359 yyextra->baseProt = Protection::Public;
6360 }
6361 else
6362 {
6363 yyextra->baseProt = Protection::Private;
6364 }
6365 yyextra->baseVirt = Specifier::Normal;
6366 yyextra->baseName.clear();
6367 BEGIN( BasesProt ) ;
6368 }
6369 }
6370<ClassVar>[;=*&] {
6371 if (yyextra->isTypedef)
6372 {
6373 yyextra->current->type.prepend("typedef");
6374 }
6375 if ((yytext[0]=='*' || yytext[0]=='&') && yyextra->current->section.isEnum())
6376 {
6377 yyextra->current->section = EntryType::makeVariable() ;
6378 }
6379 if (yytext[0]==';' && yyextra->current->section.isEnum())
6380 {
6381 yyextra->current->reset();
6383 }
6384 else
6385 {
6386 unput(*yytext);
6387 }
6388 BEGIN( FindMembers );
6389 }
6390<Bases,ClassVar>{CPPC}"/"/[^/] {
6391 if (!yyextra->insideObjC)
6392 {
6393 REJECT;
6394 }
6395 else
6396 {
6398 yyextra->current->program << yytext;
6399 yyextra->current->fileName = yyextra->fileName ;
6400 yyextra->current->startLine = yyextra->yyLineNr ;
6401 yyextra->current->startColumn = yyextra->yyColNr;
6402 yyextra->curlyCount=0;
6403 BEGIN( ReadBodyIntf );
6404 }
6405 }
6406<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6407<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6408<Bases,ClassVar>{CPPC}"!" |
6409<Bases,ClassVar>[\-+]{BN}* {
6410 if (!yyextra->insideObjC)
6411 {
6412 REJECT;
6413 }
6414 else
6415 {
6417 yyextra->current->program << yytext;
6418 yyextra->current->fileName = yyextra->fileName ;
6419 yyextra->current->startLine = yyextra->yyLineNr ;
6420 yyextra->current->startColumn = yyextra->yyColNr;
6421 yyextra->curlyCount=0;
6422 BEGIN( ReadBodyIntf );
6423 }
6424 }
6425<CompoundName,ClassVar>{B}*"{"{B}* {
6426 yyextra->current->program.str(std::string());
6427 yyextra->current->fileName = yyextra->fileName ;
6428 yyextra->current->bodyLine = yyextra->yyLineNr;
6429 yyextra->current->bodyColumn = yyextra->yyColNr;
6431 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef)
6432 {
6433 if (yyextra->current->section.isNamespace())
6434 {
6436 {
6437 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6438 }
6439 else
6440 {
6442 }
6443 }
6444 else
6445 {
6447 }
6448 }
6449 yyextra->curlyCount=0;
6450 if (yyextra->current_root &&
6451 !yyextra->current_root->spec.isInterface() &&
6452 (yyextra->current->spec.isInterface() ||
6453 yyextra->current->spec.isProtocol() ||
6454 yyextra->current->spec.isCategory() ||
6455 yyextra->current->section.isObjcImpl()
6456 ) &&
6457 yyextra->insideObjC
6458 )
6459 {
6460 BEGIN( ReadBodyIntf );
6461 }
6462 else if (yyextra->current->section.isNamespace())
6463 {
6464 BEGIN( ReadNSBody );
6465 }
6466 else
6467 {
6468 BEGIN( ReadBody ) ;
6469 }
6470 }
QCString stripPath(const QCString &s)
6471<BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6472<BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6473<BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6474<BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6475<BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6476<BasesProt>{BN} { lineCount(yyscanner); }
6477<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6478<Bases>"decltype"{BN}*"(" {
6480 yyextra->roundCount=0;
6481 yyextra->lastSkipRoundContext=YY_START;
6482 BEGIN(SkipRound);
6483 }
6484<Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
6485 if (!yyextra->insidePHP)
6486 {
6487 REJECT;
6488 }
6489 else
6490 {
6494 yyextra->baseName += bn;
6495 yyextra->current->args += ' ';
6496 yyextra->current->args += yytext;
6497 }
6498 }
6499<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6503 {
6504
6505 yyextra->current->typeConstr.clear();
6506 yyextra->current->typeConstr.push_back(
Argument());
6507 yyextra->lastCSConstraint = YY_START;
6508 BEGIN( CSConstraintName );
6509 }
6510 else
6511 {
6512 yyextra->baseName+=yytext;
6513 yyextra->current->args += ' ';
6514 yyextra->current->args += yytext;
6515 }
6516 }
6517<Bases>{BN}*{ID}("."{ID})* { // Java style class
6519 yyextra->baseName += name;
6520 yyextra->current->args += ' ';
6521 yyextra->current->args += name;
6522 }
6523<ClassVar,Bases>\n/{BN}*[^{, \t\n] {
6524 if (!yyextra->insideObjC)
6525 {
6526 REJECT;
6527 }
6528 else
6529 {
6531 unput('{');
6532 }
6533 }
6534<ClassVar,Bases>"@end" { // empty ObjC interface
6535 unput('d');
6536 unput('n');
6537 unput('e');
6538 unput('@');
6539 unput('}');
6540 unput('{');
6541 }
6542<ClassVar>"<" { yyextra->current->name += *yytext;
6543 yyextra->sharpCount=1;
6544 yyextra->roundCount=0;
6545 yyextra->lastSkipSharpContext = YY_START;
6546 yyextra->specName = &yyextra->current->name;
6547 BEGIN ( Specialization );
6548 }
6549<Bases>{BN}*"<" {
6551 yyextra->sharpCount=1;
6552 yyextra->roundCount=0;
6553 yyextra->lastSkipSharpContext = YY_START;
6554 if (yyextra->insideObjC)
6555 {
6556 unput(',');
6557 }
6558 else
6559 {
6560
6561
6562
6563
6564 yyextra->templateStr = yytext;
6565 yyextra->specName = &yyextra->templateStr;
6566 BEGIN ( Specialization );
6567 }
6568 }
6569<Specialization>"<" { *yyextra->specName += *yytext;
6570 if (yyextra->roundCount==0) yyextra->sharpCount++;
6571 }
6572<Specialization>">" {
6573 *yyextra->specName += *yytext;
6574 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6575 {
6577 BEGIN(yyextra->lastSkipSharpContext);
6578 }
6579 }
6580<Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6581<Specialization>"<<" { *yyextra->specName += yytext; }
6582<Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6583 unput('>');
6584 unput(' ');
6585 unput('>');
6586 }
6587<Specialization>">>" {
6588 if (yyextra->insideCS)
6589 {
6590 REJECT;
6591 }
6592 else
6593
6594
6595
6596
6597 {
6598 if (yyextra->roundCount>0)
6599 {
6600 *yyextra->specName += yytext;
6601 }
6602 else
6603 {
6604 unput('>');
6605 unput(' ');
6606 unput('>');
6607 }
6608 }
6609 }
6610<Specialization>"typename"{BN}+ { lineCount(yyscanner); }
6611<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
6612<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
6613
6614<Specialization>"\\\\" { *yyextra->specName += *yytext;}
6615<Specialization>"\\'" { *yyextra->specName += *yytext;}
6616<Specialization>"\\\"" { *yyextra->specName += *yytext;}
6617<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
6618<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
6619<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
6620<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
6621<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6622<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
6623<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6624<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
6625
6626<Specialization>. {
6627 *yyextra->specName += *yytext;
6628 }
6629<SkipRound>"(" { ++yyextra->roundCount; }
6630<SkipRound>")" { if (--yyextra->roundCount<0)
6631 BEGIN ( yyextra->lastSkipRoundContext );
6632 }
6633<SkipRound>\" {
6634 yyextra->lastStringContext=SkipRound;
6635 BEGIN(SkipString);
6636 }
6637<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
6638 if (yyextra->insideProtocolList)
6639 {
6640 yyextra->baseName+="-p";
6641 }
6642 else
6643 {
6644 yyextra->current->args += ',' ;
6645 }
6647 if (!yyextra->baseName.isEmpty())
6648 {
6649 yyextra->current->extends.emplace_back(
6650 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6651 );
6652 }
6653 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
6654 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
6655 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
6656 {
6657 yyextra->baseProt=Protection::Public;
6658 }
6659 else
6660 {
6661 yyextra->baseProt=Protection::Private;
6662 }
6663 yyextra->baseVirt=Specifier::Normal;
6664 yyextra->baseName.clear();
6665 if (*yytext=='>')
6666 {
6667 yyextra->insideProtocolList=
FALSE;
6668 if (yyleng==1)
6669 {
6670 unput('{');
6671 }
6672 else
6673 {
6674 yyless(1);
6675 }
6676 }
6677 else
6678 {
6679 if (*yytext==',' && yyextra->insideObjC)
6680 {
6681 yyextra->insideProtocolList=
TRUE;
6682 }
6683 BEGIN(BasesProt);
6684 }
6685 }
6686<Bases>{B}*"{"{B}* {
6687 yyextra->current->program.str(std::string());
6688 yyextra->current->fileName = yyextra->fileName ;
6689 yyextra->current->bodyLine = yyextra->yyLineNr;
6690 yyextra->current->bodyColumn = yyextra->yyColNr;
6692 if (!yyextra->baseName.isEmpty())
6693 yyextra->current->extends.emplace_back(
6694 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6695 );
6696 yyextra->curlyCount=0;
6697 if (yyextra->insideObjC)
6698 {
6699 BEGIN( ReadBodyIntf );
6700 }
6701 else
6702 {
6703 BEGIN( ReadBody ) ;
6704 }
6705 }
6706<SkipUnionSwitch>{B}*"(" {
6707 yyextra->roundCount++;
6708 }
6709<SkipUnionSwitch>")" {
6710 if (--yyextra->roundCount==0)
6711 {
6712 BEGIN(ClassVar);
6713 }
6714 }
6715<SkipUnionSwitch>\n { lineCount(yyscanner); }
6716<SkipUnionSwitch>.
6717<Comment>{BN}+ { yyextra->current->program << yytext ;
6719 }
6720<Comment>{CCS} { yyextra->current->program << yytext ; }
6721<Comment>{CPPC} { yyextra->current->program << yytext ; }
6722<Comment>{CMD}("code"|"verbatim"|"iliteral") {
6723 if (yyextra->doxygenComment) yyextra->insideCode=
TRUE;
6724 yyextra->current->program << yytext ;
6725 }
6726<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
6727 if (yyextra->doxygenComment) yyextra->insideCode=
FALSE;
6728 yyextra->current->program << yytext ;
6729 }
6730<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
6731<Comment>{CCE} { yyextra->current->program << yytext ;
6732 if (!yyextra->insideCode)
6733 {
6734 yyextra->doxygenComment=false;
6735 BEGIN( yyextra->lastContext );
6736 }
6737 }
6738<Comment>. { yyextra->current->program << *yytext ; }
6739
6740<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
6741
6742 if (!yyextra->current->doc.isEmpty())
6743 {
6744 yyextra->current->doc+="\n\n";
6745 }
6746 else
6747 {
6748 yyextra->current->docLine = yyextra->yyLineNr;
6749 yyextra->current->docFile = yyextra->fileName;
6750 }
6751
6752 yyextra->lastDocContext = YY_START;
6753 if (yyextra->current_root->section.isScope())
6754 {
6755 yyextra->current->inside = yyextra->current_root->name+"::";
6756 }
6757 yyextra->docBlockContext = YY_START;
6758 yyextra->docBlockInBody = YY_START==SkipCurly;
6760
6763 yyextra->docBlock.
str(indent.
str());
6764
6765 if (yyextra->docBlockAutoBrief)
6766 {
6767 yyextra->current->briefLine = yyextra->yyLineNr;
6768 yyextra->current->briefFile = yyextra->fileName;
6769 }
6771 BEGIN( DocBlock );
6772 }
6773<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
6776
6777 if( javadocBanner )
6778 {
6779 yyextra->lastDocContext = YY_START;
6780
6781
6782 if (yyextra->current_root->section.isScope())
6783 {
6784 yyextra->current->inside = yyextra->current_root->name+"::";
6785 }
6786 yyextra->current->docLine = yyextra->yyLineNr;
6787 yyextra->current->docFile = yyextra->fileName;
6788 yyextra->docBlockContext = YY_START;
6789 yyextra->docBlockInBody = YY_START==SkipCurly;
6791 yyextra->docBlockAutoBrief = javadocAutoBrief;
6792
6795 yyextra->docBlock.
str(indent.
str());
6796
6797 if (yyextra->docBlockAutoBrief)
6798 {
6799 yyextra->current->briefLine = yyextra->yyLineNr;
6800 yyextra->current->briefFile = yyextra->fileName;
6801 }
6803 BEGIN( DocBlock );
6804 }
6805 else
6806 {
6807 yyextra->current->program << yytext ;
6808 yyextra->lastContext = YY_START ;
6809 yyextra->doxygenComment=true;
6810 BEGIN( Comment ) ;
6811 }
6812 }
6813<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6815 yyextra->yyColNr=1;
6816 REJECT;
6817 }
6818<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6819 yyextra->lastDocContext = YY_START;
6820
6821
6822 if (yyextra->current_root->section.isScope())
6823 {
6824 yyextra->current->inside = yyextra->current_root->name+"::";
6825 }
6826 yyextra->current->docLine = yyextra->yyLineNr;
6827 yyextra->current->docFile = yyextra->fileName;
6828 yyextra->docBlockContext = YY_START;
6829 yyextra->docBlockInBody = YY_START==SkipCurly;
6831 yyextra->docBlockAutoBrief = javadocAutoBrief;
6832
6835 yyextra->docBlock.
str(indent.
str());
6836
6837 if (yyextra->docBlockAutoBrief)
6838 {
6839 yyextra->current->briefLine = yyextra->yyLineNr;
6840 yyextra->current->briefFile = yyextra->fileName;
6841 }
6843 BEGIN( DocBlock );
6844 }
6845<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
6846 yyextra->lastDocContext = YY_START;
6847 if (yyextra->current_root->section.isScope())
6848 {
6849 yyextra->current->inside = yyextra->current_root->name+"::";
6850 }
6851 yyextra->docBlockContext = YY_START;
6852 yyextra->docBlockInBody = YY_START==SkipCurly;
6853 yyextra->docBlockAutoBrief =
FALSE;
6854
6857 yyextra->docBlock.
str(indent.
str());
6858
6860 BEGIN( DocLine );
6861 }
6862<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
6863 yyextra->lastDocContext = YY_START;
6864 if (yyextra->current_root->section.isScope())
6865 {
6866 yyextra->current->inside = yyextra->current_root->name+"::";
6867 }
6868 yyextra->docBlockContext = YY_START;
6869 yyextra->docBlockInBody = YY_START==SkipCurly;
6870 yyextra->docBlockAutoBrief =
FALSE;
6873 yyextra->docBlock.
str(indent.
str());
6875 BEGIN( DocLine );
6876 }
6877<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
6879 yyextra->externLinkage=
TRUE;
6880 }
6881<FindMembers>"{" {
6882 if (yyextra->externLinkage)
6883 {
6884 yyextra->externLinkage=
FALSE;
6885 }
6886 else if (yyextra->insideCS &&
6887 !yyextra->current->name.isEmpty() &&
6888 !yyextra->current->type.isEmpty())
6889 {
6890 if (yyextra->current->mtype == MethodTypes::Event)
6891 {
6892 yyextra->mtype = MethodTypes::Event;
6893 }
6895 {
6896 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
6897 }
6898 else
6899 {
6900 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
6901 }
6902 yyextra->current->bodyLine = yyextra->yyLineNr;
6903 yyextra->current->bodyColumn = yyextra->yyColNr;
6904 yyextra->curlyCount=0;
6905 BEGIN( CSAccessorDecl );
6906 }
6907 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
6908 {
6909
6910
6911 yyextra->current->exception = " {";
6912 BEGIN(UNOIDLAttributeBlock);
6913 }
6914 else
6915 {
6916 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
6917 yyextra->current->name.isEmpty()
6918 )
6919 {
6920
6921 yyextra->needsSemi =
FALSE;
6922 if (yyextra->current->isStatic)
6923 {
6924 yyextra->current->name="[static initializer]";
6925 yyextra->current->type.clear();
6926 }
6927 else
6928 {
6929 yyextra->current->name="[instance initializer]";
6930 }
6931 unput(*yytext);
6932 BEGIN( SFunction );
6933 }
6934 else
6935 {
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946 yyextra->current->bodyLine = yyextra->yyLineNr;
6947 yyextra->current->bodyColumn = yyextra->yyColNr;
6948 yyextra->current->initializer.str(yytext);
6949 yyextra->lastInitializerContext = YY_START;
6950 yyextra->sharpCount=0;
6951 yyextra->initBracketCount=1;
6952 BEGIN(ReadInitializer);
6953 }
6954 }
6955 }
6956<CSAccessorDecl>"{" { yyextra->curlyCount++; }
6957<CSAccessorDecl>"}"{B}*"=" {
6958
6959 if (yyextra->curlyCount != 0) REJECT;
6960 yyextra->current->initializer.str("=");
6961 yyextra->current->endBodyLine=yyextra->yyLineNr;
6962 yyextra->lastInitializerContext = FindMembers;
6963 BEGIN(ReadInitializer);
6964 }
6965<CSAccessorDecl>"}" {
6966 if (yyextra->curlyCount)
6967 {
6968 yyextra->curlyCount--;
6969 }
6970 else
6971 {
6972 yyextra->mtype = MethodTypes::Method;
6973 yyextra->virt = Specifier::Normal;
6974
6975 yyextra->current->endBodyLine=yyextra->yyLineNr;
6976 unput(';');
6977 BEGIN(FindMembers);
6978 }
6979 }
6980<CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(true); }
6981<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(true); }
6982<CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(true); }
6983<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(true); }
6984<CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(true); }
6985<CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(true); }
6986<CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(true); }
6987<CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(true); }
6988<CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(true); }
6989<CSAccessorDecl>{CHARLIT} {}
6990<CSAccessorDecl>"\"" { BEGIN(CSString);}
6991<CSAccessorDecl>"." {}
6992<CSAccessorDecl>\n { lineCount(yyscanner); }
6993<CSString>"\"" { BEGIN(CSAccessorDecl);}
6994<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
6995<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
6996<CSString>\n { lineCount(yyscanner); }
6997<CSString>"." {}
6998
6999
7000
7001<SliceSequence>{SCOPENAME} {
7002 if (yyextra->current->spec.isLocal())
7003 {
7004 yyextra->current->type = "local ";
7005 }
7006 yyextra->current->type += "sequence<";
7007 yyextra->current->type += yytext;
7008 yyextra->current->type += ">";
7009 }
7010
7011<SliceSequence>{BN}*">"{BN}* {
7013 BEGIN(SliceSequenceName);
7014 }
7015
7016<SliceSequenceName>{ID}{BN}* {
7018 yyextra->current->name = yytext ;
7019 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7020 }
7021
7022<SliceSequenceName>";" {
7023 yyextra->current->section = EntryType::makeVariable();
7024 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7026 BEGIN(FindMembers);
7027 }
7028
7029<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7031 if (yyextra->current->spec.isLocal())
7032 {
7033 yyextra->current->type = "local ";
7034 }
7035 yyextra->current->type += "dictionary<";
7036 yyextra->current->type += yytext;
7037 yyextra->current->type += ">";
7038 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7039 }
7040
7041<SliceDictionary>{BN}*">"{BN}* {
7043 BEGIN(SliceDictionaryName);
7044 }
7045
7046<SliceDictionaryName>{ID}{BN}* {
7048 yyextra->current->name = yytext ;
7049 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7050 }
7051
7052<SliceDictionaryName>";" {
7053 yyextra->current->section = EntryType::makeVariable();
7054 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7056 BEGIN(FindMembers);
7057 }
7058
7059
7060
7061
7062
7063
7064<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
7065 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
7066 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7068 }
7069<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
7070 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7071 BEGIN( yyextra->docBlockContext );
7072 }
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
7073<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
7074 yyextra->docBlock << yytext;
7075 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7076 BEGIN( yyextra->docBlockContext );
7077 }
7078<DocLine>{NONLopt}/"\n" { // whole line
7079 yyextra->docBlock << yytext;
7080 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7081 BEGIN( yyextra->docBlockContext );
7082 }
7083
7084
7085
7086<DocBlock>"*"*{CCE} { // end of comment block
7088 BEGIN(yyextra->docBlockContext);
7089 }
7090<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7093 yyextra->docBlock << "\\ilinebr " << indent;
7094 }
7095<DocBlock>^{B}*"*"+/[^/] {
7098 yyextra->docBlock << indent;
7099 }
7100<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
7103 yyextra->docBlock << indent;
7104 }
7105<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
7106 }
7107<DocBlock>{CPPC} { // slashes in the middle of a comment block
7108 yyextra->docBlock << yytext;
7109 }
7110<DocBlock>{CCS} { // start of a new comment in the
7111
7112 yyextra->docBlock << yytext;
7113 }
7114<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
7115 yyextra->docBlock << yytext;
7116 }
7117<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7118 yyextra->docBlock << yytext;
7119 char blockName[] = "f$";
7120 char c = yytext[2];
7121 if (c=='[') blockName[1]=']';
7122 else if (c=='{') blockName[1]='}';
7123 else if (c=='(') blockName[1]=')';
7125 BEGIN(DocCopyBlock);
7126 }
static void startVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0, bool codeBlock=false)
7127<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7128 yyextra->fileName = &yytext[6];
7129 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7130 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7131 yyextra->docBlock << yytext;
7132 }
7133<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7134 yyextra->fileName = &yytext[6];
7135 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7136 yyextra->docBlock << yytext;
7137 }
7138<DocBlock>{CMD}"iline"{LINENR}{B} {
7139 bool ok = false;
7141 if (!ok)
7142 {
7143 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7144 }
7145 else
7146 {
7147 yyextra->yyLineNr = nr;
7148 }
7149 yyextra->docBlock << yytext;
7150 }
7151<DocBlock>{B}*"<"{PRE}">" {
7152 yyextra->docBlock << yytext;
7154 BEGIN(DocCopyBlock);
7155 }
7156<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7157 yyextra->docBlock << yytext;
7159 BEGIN(DocCopyBlock);
7160 }
7161<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7162 yyextra->docBlock << yytext;
7164 BEGIN(DocCopyBlock);
7165 }
7166<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7167 yyextra->docBlock << yytext;
7169 BEGIN(DocCopyBlock);
7170 }
7171<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7173 yyextra->docBlock << "\\ilinebr ";
7174 yyextra->docBlock << pat;
7176 BEGIN(DocCopyBlock);
7177 }
7178<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7180 yyextra->docBlock << pat;
7182 BEGIN(DocCopyBlock);
7183 }
7184<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7185<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7186<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7188 yyextra->docBlock << "\\ilinebr ";
7189 yyextra->docBlock << pat;
7191 BEGIN(DocCopyBlock);
7192 }
7193<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7194<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7195<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7197 yyextra->docBlock << pat;
7199 BEGIN(DocCopyBlock);
7200 }
7201<DocBlock>"```" { // skip ``` if not at the start of a line
7202 yyextra->docBlock << "```";
7203 }
7204<DocBlock>"\\`" { // skip escaped backtick
7205 yyextra->docBlock << yytext;
7206 }
7207<DocBlock>"`"{1,2} {
7208 yyextra->docBlock << yytext;
7210 BEGIN(DocCopyBlock);
7211 }
7212<DocBlock>{B}*"<"{CODE}">" {
7213 if (yyextra->insideCS)
7214 {
7215 yyextra->docBlock << yytext;
7217 BEGIN(DocCopyBlock);
7218 }
7219 else
7220 {
7221 REJECT;
7222 }
7223 }
7224<DocBlock>[^@*~`'\/\\\n]+ { // any character that isn't special
7225 yyextra->docBlock << yytext;
7226 }
7227<DocBlock>\n { // newline
7229 yyextra->docBlock << *yytext;
7230 }
7231<DocBlock>. { // command block
7232 yyextra->docBlock << *yytext;
7233 }
7234
7235
7236
7237<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
7239 {
7240 BEGIN(DocBlock);
7241 }
7242 yyextra->docBlock << yytext;
7243 }
static bool endVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7244<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
7246 {
7247 BEGIN(DocBlock);
7248 }
7249 yyextra->docBlock << yytext;
7250 }
7251<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7253 {
7254 BEGIN(DocBlock);
7255 }
7256 yyextra->docBlock << yytext;
7257 }
7258<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
7260 {
7261 BEGIN(DocBlock);
7262 }
7263 yyextra->docBlock << yytext;
7264 }
7265<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
7266 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7267 {
7268 REJECT;
7269 }
7270 else
7271 {
7274 yyextra->docBlock << indent;
7275 }
7276 }
7277<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
7278 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7279 {
7282 yyextra->docBlock << indent;
7283 }
7284 else
7285 {
7286 REJECT;
7287 }
7288 }
7289<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
7290 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7291 {
7294 yyextra->docBlock << indent+"*";
7295 }
7296 else
7297 {
7298 REJECT;
7299 }
7300 }
7301<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
7302 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7303 {
7305 if (yyextra->nestedComment>0)
7306 {
7308 yyextra->docBlock << indent+"*";
7309 }
7310 else
7311 {
7313 yyextra->docBlock << indent;
7314 }
7315 }
7316 else
7317 {
7318 REJECT;
7319 }
7320 }
7321<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7324 {
7325 BEGIN(DocBlock);
7326 }
7327 yyextra->docBlock << pat;
7328 }
7329<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7332 {
7333 BEGIN(DocBlock);
7334 }
7335 yyextra->docBlock << pat;
7336 }
7337<DocCopyBlock>"```" { // backtick + end marker
7338 if (yyextra->docBlockName=="``")
7339 {
7340 yyextra->docBlock << "`";
7342 yyextra->docBlock << "``";
7343 BEGIN(DocBlock);
7344 }
7345 else
7346 {
7347 yyextra->docBlock << yytext;
7348 }
7349 }
7350<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7352 {
7353 BEGIN(DocBlock);
7354 }
7355 yyextra->docBlock << yytext;
7356 }
7357<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7359 {
7360 BEGIN(DocBlock);
7361 }
7362 yyextra->docBlock << yytext;
7363 }
7364<DocCopyBlock>"`"{1,2} {
7366 {
7367 BEGIN(DocBlock);
7368 }
7369 yyextra->docBlock << yytext;
7370 }
7371<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ { // any character that is not special
7372 yyextra->docBlock << yytext;
7373 }
7374<DocCopyBlock>\" {
7375 yyextra->docBlock << yytext;
7376 if (yyextra->docBlockName=="code" || yyextra->docBlockName=="iliteral")
7377
7378
7379 {
7380 yyextra->lastStringContext=YY_START;
7381 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7382 yyextra->stopAtInvalidString=true;
7383 BEGIN(CopyGString);
7384 }
7385 }
7386<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7387 if (yytext[1]=='*')
7388 {
7389 yyextra->nestedComment++;
7390 }
7391 else if (yytext[0]=='*' && yyextra->nestedComment>0)
7392 {
7393 yyextra->nestedComment--;
7394 }
7395 else if (yytext[0]=='*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7396 {
7397 warn(yyextra->fileName,yyextra->yyLineNr,
7398 "Found end of C comment inside a '{}' block without matching start of the comment!"
7399 " Maybe the end marker for the block is missing?",
7400 yyextra->docBlockName);
7401 BEGIN(DocBlock);
7402 }
7403 yyextra->docBlock << yytext;
7404 }
7405<DocCopyBlock>\n { // newline
7406 yyextra->docBlock << *yytext;
7408 }
7409<DocCopyBlock>. { // any other character
7410 yyextra->docBlock << *yytext;
7411 }
7412<DocCopyBlock><<EOF>> {
7413 warn(yyextra->fileName,yyextra->yyLineNr,
7414 "reached end of file while inside a '{}' block!"
7415 " The command that should end the block seems to be missing!",
7416 yyextra->docBlockName);
7418 }
7419
7420
7421
7422
7423<Prototype>"operator"{B}*"("{B}*")" {
7424 yyextra->current->name+=yytext;
7425 }
7426<Prototype>"(" {
7427 yyextra->current->args+=*yytext;
7428 yyextra->currentArgumentContext = PrototypeQual;
7429 yyextra->fullArgString = yyextra->current->args;
7430 yyextra->copyArgString = &yyextra->current->args;
7431 BEGIN( ReadFuncArgType ) ;
7432 }
7433<Prototype>"("({ID}"::")*({B}*[&*])+ {
7434 if (yyextra->insidePHP)
7435 {
7436 REJECT;
7437 }
7438 else
7439 {
7440 yyextra->current->type+=yyextra->current->name+yytext;
7441 yyextra->current->name.clear();
7442 BEGIN( PrototypePtr );
7443 }
7444 }
7445<PrototypePtr>{SCOPENAME} {
7446 yyextra->current->name+=yytext;
7447 }
7448<PrototypePtr>"(" {
7449 yyextra->current->args+=*yytext;
7450 yyextra->currentArgumentContext = PrototypeQual;
7451 yyextra->fullArgString = yyextra->current->args;
7452 yyextra->copyArgString = &yyextra->current->args;
7453 BEGIN( ReadFuncArgType ) ;
7454 }
7455<PrototypePtr>")" {
7456 yyextra->current->type+=')';
7457 BEGIN( Prototype );
7458 }
7459<PrototypePtr>. {
7460 yyextra->current->name+=yytext;
7461 }
7462<PrototypeQual>"{" {
7463 BEGIN( PrototypeSkipLine);
7464 }
7465<PrototypeQual>{B}*"const"{B}* {
7466 yyextra->current->args += " const ";
7467 yyextra->current->argList.setConstSpecifier(
TRUE);
7468 }
7469<PrototypeQual>{B}*"volatile"{B}* {
7470 yyextra->current->args += " volatile ";
7471 yyextra->current->argList.setVolatileSpecifier(
TRUE);
7472 }
7473<PrototypeQual>{B}*"="{B}*"0"{B}* {
7474 yyextra->current->args += " = 0";
7475 yyextra->current->virt = Specifier::Pure;
7476 yyextra->current->argList.setPureSpecifier(
TRUE);
7477 }
7478<PrototypeQual>"throw"{B}*"(" {
7479 yyextra->current->exception = "throw(";
7480 BEGIN(PrototypeExc);
7481 }
7482<PrototypeExc>")" {
7483 yyextra->current->exception += ')';
7484 BEGIN(PrototypeQual);
7485 }
7486<PrototypeExc>. {
7487 yyextra->current->exception += *yytext;
7488 }
7489<PrototypeQual>. {
7490 yyextra->current->args += *yytext;
7491 }
7492<Prototype>. {
7493 yyextra->current->name += *yytext;
7494 }
7495<PrototypeSkipLine>. {
7496 }
7497
7498
7499
7500
7501<SkipCxxComment>.*"\\\n" { // line continuation
7502 if (yyextra->insideCS)
7503 {
7504 REJECT;
7505 }
7506 else
7507 {
7509 }
7510 }
7511<SkipCxxComment>{ANYopt}/\n {
7512 BEGIN( yyextra->lastCContext ) ;
7513 }
7514<SkipComment>[^\*\n]+
7515
7516
7517
7518<*>"[[" { // C++11 attribute
7519 if (!yyextra->insideCpp) REJECT;
7520 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7521 yyextra->lastC11AttributeContext = YY_START;
7522 BEGIN( SkipC11Attribute );
7523 }
7524
7525<*>\n { lineCount(yyscanner); }
7526<*>\" {
7527 if (yyextra->insideIDL && yyextra->insideCppQuote)
7528 {
7529 BEGIN(EndCppQuote);
7530 }
7531 else if (yyextra->insidePHP)
7532 {
7533 yyextra->lastStringContext=YY_START;
7534 BEGIN(SkipString);
7535 }
7536 }
7537<*>^{B}*"#" {
7538 if (!yyextra->insidePHP)
7539 {
7540 yyextra->lastCPPContext = YY_START;
7541 BEGIN( SkipCPP ) ;
7542 }
7543 else
7544 {
7545 yyextra->lastCContext = YY_START ;
7546 BEGIN( SkipCxxComment ) ;
7547 }
7548 }
7549<*>"#" {
7550 if (!yyextra->insidePHP)
7551 REJECT;
7552 yyextra->lastCContext = YY_START ;
7553 BEGIN( SkipCxxComment ) ;
7554 }
7555<*>\' {
7556 if (yyextra->insidePHP)
7557 {
7558 yyextra->lastStringContext=YY_START;
7559 BEGIN(SkipPHPString);
7560 }
7561 }
7562<*>\? {
7563 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
7564 {
7565 if (yyextra->current->type.isEmpty())
7566 {
7567 if (yyextra->current->name.isEmpty())
7568 yyextra->current->name="?";
7569 else
7570 yyextra->current->name+="?";
7571 }
7572 else
7573 {
7574 yyextra->current->type+="?";
7575 }
7576 }
7577 }
7578<*>"}" { yyextra->exported=false; }
7579<*>.
7580<SkipComment>{CPPC}|{CCS}
7581<*>{CCS} { yyextra->lastCContext = YY_START ;
7582 BEGIN( SkipComment ) ;
7583 }
7584<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
7585<*>{CPPC} {
7586 yyextra->lastCContext = YY_START ;
7587 BEGIN( SkipCxxComment ) ;
7588 }
7589<<EOF>> {
7590 if (yyextra->insideCS && yyextra->fakeNS)
7591 {
7592 yyextra->fakeNS--;
7593 unput('}');
7594 BEGIN ( ReadNSBody);
7595 }
7596 else
7597 {
7599 }
7600 }
7601%%