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
617 }
static void initMethodProtection(yyscan_t yyscanner, Protection prot)
618
619<FindMembers>{B}*"k_dcop"{BN}*":"{BN}* {
622 }
623
624<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* {
627 }
628
629<FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
632 }
633
634<FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
637 }
638
639<FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
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") {
691 }
692<FindMembers>{B}*"event"{BN}+ {
693 if (yyextra->insideCli)
694 {
695
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 {
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
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 {
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();
800 yyextra->insideObjC =
TRUE;
801 yyextra->yyBegColNr = yyextra->yyColNr;
802 yyextra->yyBegLineNr = yyextra->yyLineNr;
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 }
987 else if (
qstrncmp(yytext,
"@property",9)==0)
988 {
990 yyextra->current->spec.setReadable(true).setWritable(true).setAssign(true);
992 unput('(');
993 BEGIN( ObjCPropAttr );
994 }
995 else
996 {
997 REJECT;
998 }
999 }
int qstrncmp(const char *str1, const char *str2, size_t len)
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 {
1057 yyextra->current->spec.setWritable(true).setReadable(true);
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 ";
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 {
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}*"explicit"{BN}+ { if (yyextra->insideJava) REJECT;
1330 yyextra->current->spec.setExplicit(true);
1332 }
1333<FindMembers>{B}*"local"{BN}+ { if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1334 yyextra->current->spec.setLocal(true);
1336 }
1337<FindMembers>{B}*"@required"{BN}+ { // Objective C 2.0 protocol required section
1338 yyextra->current->spec.setOptional(false).setRequired(true);
1340 }
1341<FindMembers>{B}*"@optional"{BN}+ { // Objective C 2.0 protocol optional section
1342 yyextra->current->spec.setRequired(false).setOptional(true);
1344 }
1345
1346<FindMembers>{B}*"import"{BN}+ { // IDL import keyword
1347 BEGIN( NextSemi );
1348 }
1349 */
1350<FindMembers>{B}*"typename"{BN}+ { lineCount(yyscanner); }
1351<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] { if (yyextra->insideJava) REJECT;
1352 yyextra->isTypedef=
FALSE;
1353 yyextra->current->section = EntryType::makeNamespace();
1354 yyextra->current->type = "namespace" ;
1355 yyextra->current->fileName = yyextra->fileName;
1356 yyextra->current->startLine = yyextra->yyLineNr;
1357 yyextra->current->startColumn = yyextra->yyColNr;
1358 yyextra->current->bodyLine = yyextra->yyLineNr;
1359 yyextra->current->bodyColumn = yyextra->yyColNr;
1361 if (yyextra->insidePHP)
1362 {
1363 BEGIN( PackageName );
1364 }
1365 else
1366 {
1367 BEGIN( CompoundName );
1368 }
1369 }
1370<FindMembers>{B}*"module"{BN}+ {
1372 if (yyextra->insideIDL || yyextra->insideSlice)
1373 {
1374 yyextra->isTypedef=
FALSE;
1375 yyextra->current->section = EntryType::makeNamespace();
1376 yyextra->current->type = "module" ;
1377 yyextra->current->fileName = yyextra->fileName;
1378 yyextra->current->startLine = yyextra->yyLineNr;
1379 yyextra->current->startColumn = yyextra->yyColNr;
1380 yyextra->current->bodyLine = yyextra->yyLineNr;
1381 yyextra->current->bodyColumn = yyextra->yyColNr;
1382 BEGIN( CompoundName );
1383 }
1384 else if (yyextra->insideD)
1385 {
1387 BEGIN(PackageName);
1388 }
1389 else
1390 {
1393 }
1394 }
1395<FindMembers>{B}*"library"{BN}+ {
1397 if (yyextra->insideIDL)
1398 {
1399 yyextra->isTypedef=
FALSE;
1400 yyextra->current->section = EntryType::makeNamespace();
1401 yyextra->current->type = "library" ;
1402 yyextra->current->fileName = yyextra->fileName;
1403 yyextra->current->startLine = yyextra->yyLineNr;
1404 yyextra->current->startColumn = yyextra->yyColNr;
1405 yyextra->current->bodyLine = yyextra->yyLineNr;
1406 yyextra->current->bodyColumn = yyextra->yyColNr;
1407 BEGIN( CompoundName );
1408 }
1409 else
1410 {
1413 }
1414 }
1415<FindMembers>{B}*"constants"{BN}+ { // UNO IDL constant group
1417 if (yyextra->insideIDL)
1418 {
1419 yyextra->isTypedef=
FALSE;
1420 yyextra->current->section = EntryType::makeNamespace();
1421 yyextra->current->type = "constants";
1422 yyextra->current->fileName = yyextra->fileName;
1423 yyextra->current->startLine = yyextra->yyLineNr;
1424 yyextra->current->startColumn = yyextra->yyColNr;
1425 yyextra->current->bodyLine = yyextra->yyLineNr;
1426 yyextra->current->bodyColumn = yyextra->yyColNr;
1427 BEGIN( CompoundName );
1428 }
1429 else
1430 {
1433 }
1434 }
1435<FindMembers>{BN}*("service"){BN}+ { // UNO IDL service
1437 if (yyextra->insideIDL)
1438 {
1439 yyextra->isTypedef=
FALSE;
1440 yyextra->current->section = EntryType::makeClass();
1443
1444 setOptional(spec.isOptional()).setPublished(spec.isPublished());
1446 yyextra->current->type += " service " ;
1447 yyextra->current->fileName = yyextra->fileName;
1448 yyextra->current->startLine = yyextra->yyLineNr;
1449 yyextra->current->bodyLine = yyextra->yyLineNr;
1450 yyextra->current->bodyColumn = yyextra->yyColNr;
1451 BEGIN( CompoundName );
1452 }
1453 else
1454 {
1457 }
1458 }
Wrapper class for a number of boolean properties.
1459<FindMembers>{BN}*("singleton"){BN}+ { // UNO IDL singleton
1461 if (yyextra->insideIDL)
1462 {
1463 yyextra->isTypedef=
FALSE;
1464 yyextra->current->section = EntryType::makeClass();
1466 yyextra->current->spec =
TypeSpecifier().setSingleton(
true).
1467 setPublished(spec.isPublished());
1469 yyextra->current->type += " singleton " ;
1470 yyextra->current->fileName = yyextra->fileName;
1471 yyextra->current->startLine = yyextra->yyLineNr;
1472 yyextra->current->bodyLine = yyextra->yyLineNr;
1473 yyextra->current->bodyColumn = yyextra->yyColNr;
1474 BEGIN( CompoundName );
1475 }
1476 else
1477 {
1480 }
1481 }
1482<FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba/UNO IDL/Java/Slice interface
1484 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1485 {
1486 yyextra->isTypedef=
FALSE;
1487 yyextra->current->section = EntryType::makeClass();
1489 yyextra->current->spec =
TypeSpecifier().setInterface(
true).
1490
1491 setOptional(spec.isOptional()).
1492 setPublished(spec.isPublished()).
1493 setLocal(spec.isLocal());
1495 yyextra->current->type += " interface" ;
1496 yyextra->current->fileName = yyextra->fileName;
1497 yyextra->current->startLine = yyextra->yyLineNr;
1498 yyextra->current->startColumn = yyextra->yyColNr;
1499 yyextra->current->bodyLine = yyextra->yyLineNr;
1500 yyextra->current->bodyColumn = yyextra->yyColNr;
1502 BEGIN( CompoundName );
1503 }
1504 else
1505 {
1508 }
1509 }
static void setJavaProtection(yyscan_t yyscanner)
1510<FindMembers>{B}*"@implementation"{BN}+ { // Objective-C class implementation
1512 yyextra->isTypedef=
FALSE;
1513 yyextra->current->section = EntryType::makeObjcImpl();
1515 yyextra->insideObjC =
TRUE;
1518 yyextra->current->type += " implementation" ;
1519 yyextra->current->fileName = yyextra->fileName;
1520 yyextra->current->startLine = yyextra->yyLineNr;
1521 yyextra->current->bodyLine = yyextra->yyLineNr;
1522 yyextra->current->bodyColumn = yyextra->yyColNr;
1523 BEGIN( CompoundName );
1524 }
1525<FindMembers>{B}*"@interface"{BN}+ { // Objective-C class interface, or Java attribute
1527 yyextra->isTypedef=
FALSE;
1528 yyextra->current->section = EntryType::makeClass();
1529 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1530 if (!yyextra->insideJava)
1531 {
1533 yyextra->insideObjC =
TRUE;
1534 }
1537 yyextra->current->type += " interface" ;
1538 yyextra->current->fileName = yyextra->fileName;
1539 yyextra->current->startLine = yyextra->yyLineNr;
1540 yyextra->current->startColumn = yyextra->yyColNr;
1541 yyextra->current->bodyLine = yyextra->yyLineNr;
1542 yyextra->current->bodyColumn = yyextra->yyColNr;
1543 BEGIN( CompoundName );
1544 }
1545<FindMembers>{B}*"@protocol"{BN}+ { // Objective-C protocol definition
1547 yyextra->isTypedef=
FALSE;
1548 yyextra->current->section = EntryType::makeClass();
1551 yyextra->insideObjC =
TRUE;
1554 yyextra->current->type += " protocol" ;
1555 yyextra->current->fileName = yyextra->fileName;
1556 yyextra->current->startLine = yyextra->yyLineNr;
1557 yyextra->current->startColumn = yyextra->yyColNr;
1558 yyextra->current->bodyLine = yyextra->yyLineNr;
1559 yyextra->current->bodyColumn = yyextra->yyColNr;
1560 BEGIN( CompoundName );
1561 }
1562<FindMembers>{B}*"exception"{BN}+ { // Corba IDL/Slice exception
1563 if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1564 yyextra->isTypedef=
FALSE;
1565 yyextra->current->section = EntryType::makeClass();
1567
1568 yyextra->current->spec =
TypeSpecifier().setException(
true).
1569 setPublished(spec.isPublished()).setLocal(spec.isLocal());
1571 yyextra->current->type += " exception" ;
1572 yyextra->current->fileName = yyextra->fileName;
1573 yyextra->current->startLine = yyextra->yyLineNr;
1574 yyextra->current->startColumn = yyextra->yyColNr;
1575 yyextra->current->bodyLine = yyextra->yyLineNr;
1576 yyextra->current->bodyColumn = yyextra->yyColNr;
1578 BEGIN( CompoundName );
1579 }
1580<FindMembers>"@class" | // for Objective C class declarations
1581<FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1582<FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1584 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1585 bool isConst=decl.
find(
"const")!=-1;
1586 bool isVolatile=decl.
find(
"volatile")!=-1;
1587 yyextra->current->section = EntryType::makeClass();
1589 if (yyextra->insidePHP && yyextra->current->spec.isAbstract())
1590 {
1591
1592 yyextra->current->spec.setAbstract(false).setAbstractClass(true);
1593 }
1594 if (yyextra->insideSlice && yyextra->current->spec.isLocal())
1595 {
1596 yyextra->current->spec.setLocal(true);
1597 }
1598 if (isConst)
1599 {
1600 yyextra->current->type += " const";
1601 }
1602 else if (isVolatile)
1603 {
1604 yyextra->current->type += " volatile";
1605 }
1606 yyextra->current->type += " class" ;
1607 yyextra->current->fileName = yyextra->fileName;
1608 yyextra->current->startLine = yyextra->yyLineNr;
1609 yyextra->current->startColumn = yyextra->yyColNr;
1610 yyextra->current->bodyLine = yyextra->yyLineNr;
1611 yyextra->current->bodyColumn = yyextra->yyColNr;
1612 if (yytext[0]=='@')
1613 {
1615 yyextra->insideObjC =
TRUE;
1616 }
1618 if (yytext[yyleng-1]=='{') unput('{');
1619 BEGIN( CompoundName ) ;
1620 }
1621<FindMembers>{B}*"value class{" | // C++/CLI extension
1622<FindMembers>{B}*"value class"{BN}+ {
1623 yyextra->isTypedef=
FALSE;
1624 yyextra->current->section = EntryType::makeClass();
1627 yyextra->current->type += " value class" ;
1628 yyextra->current->fileName = yyextra->fileName;
1629 yyextra->current->startLine = yyextra->yyLineNr;
1630 yyextra->current->startColumn = yyextra->yyColNr;
1631 yyextra->current->bodyLine = yyextra->yyLineNr;
1632 yyextra->current->bodyColumn = yyextra->yyColNr;
1634 if (yytext[yyleng-1]=='{') unput('{');
1635 BEGIN( CompoundName ) ;
1636 }
1637<FindMembers>{B}*"ref class{" | // C++/CLI extension
1638<FindMembers>{B}*"ref class"{BN}+ {
1639 yyextra->isTypedef=
FALSE;
1640 yyextra->current->section = EntryType::makeClass();
1643 yyextra->current->type += " ref class" ;
1644 yyextra->current->fileName = yyextra->fileName;
1645 yyextra->current->startLine = yyextra->yyLineNr;
1646 yyextra->current->startColumn = yyextra->yyColNr;
1647 yyextra->current->bodyLine = yyextra->yyLineNr;
1648 yyextra->current->bodyColumn = yyextra->yyColNr;
1650 if (yytext[yyleng-1]=='{') unput('{');
1651 BEGIN( CompoundName ) ;
1652 }
1653<FindMembers>{B}*"interface class{" | // C++/CLI extension
1654<FindMembers>{B}*"interface class"{BN}+ {
1655 yyextra->isTypedef=
FALSE;
1656 yyextra->current->section = EntryType::makeClass();
1657 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1659 yyextra->current->type += " interface class" ;
1660 yyextra->current->fileName = yyextra->fileName;
1661 yyextra->current->startLine = yyextra->yyLineNr;
1662 yyextra->current->startColumn = yyextra->yyColNr;
1663 yyextra->current->bodyLine = yyextra->yyLineNr;
1664 yyextra->current->bodyColumn = yyextra->yyColNr;
1666 if (yytext[yyleng-1]=='{') unput('{');
1667 BEGIN( CompoundName ) ;
1668 }
1669<FindMembers>{B}*"coclass"{BN}+ {
1670 if (yyextra->insideIDL)
1671 {
1672 yyextra->isTypedef=
FALSE;
1673 yyextra->current->section = EntryType::makeClass();
1675 yyextra->current->type += " coclass" ;
1676 yyextra->current->fileName = yyextra->fileName;
1677 yyextra->current->startLine = yyextra->yyLineNr;
1678 yyextra->current->startColumn = yyextra->yyColNr;
1679 yyextra->current->bodyLine = yyextra->yyLineNr;
1680 yyextra->current->bodyColumn = yyextra->yyColNr;
1682 BEGIN( CompoundName ) ;
1683 }
1684 else
1685 {
1687 yyextra->current->name = yytext;
1688 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1690 }
1691 }
1692<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1693<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1694 if (yyextra->insideJava) REJECT;
1696 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1697 bool isConst=decl.
find(
"const")!=-1;
1698 bool isVolatile=decl.
find(
"volatile")!=-1;
1699 yyextra->current->section = EntryType::makeClass() ;
1702
1703 setPublished(spec.isPublished()).
1704 setInline(spec.isInline()).
1705 setLocal(spec.isLocal());
1706
1707
1709 if (isConst)
1710 {
1711 yyextra->current->type += " const";
1712 }
1713 else if (isVolatile)
1714 {
1715 yyextra->current->type += " volatile";
1716 }
1717 yyextra->current->type += " struct" ;
1718 yyextra->current->fileName = yyextra->fileName;
1719 yyextra->current->startLine = yyextra->yyLineNr;
1720 yyextra->current->startColumn = yyextra->yyColNr;
1721 yyextra->current->bodyLine = yyextra->yyLineNr;
1722 yyextra->current->bodyColumn = yyextra->yyColNr;
1724 if (yytext[yyleng-1]=='{') unput('{');
1725 BEGIN( CompoundName ) ;
1726 }
1727<FindMembers>{B}*"value struct{" | // C++/CLI extension
1728<FindMembers>{B}*"value struct"{BN}+ {
1729 yyextra->isTypedef=
FALSE;
1730 yyextra->current->section = EntryType::makeClass();
1731 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1733 yyextra->current->type += " value struct" ;
1734 yyextra->current->fileName = yyextra->fileName;
1735 yyextra->current->startLine = yyextra->yyLineNr;
1736 yyextra->current->startColumn = yyextra->yyColNr;
1737 yyextra->current->bodyLine = yyextra->yyLineNr;
1738 yyextra->current->bodyColumn = yyextra->yyColNr;
1740 if (yytext[yyleng-1]=='{') unput('{');
1741 BEGIN( CompoundName ) ;
1742 }
1743<FindMembers>{B}*"ref struct{" | // C++/CLI extension
1744<FindMembers>{B}*"ref struct"{BN}+ {
1745 yyextra->isTypedef=
FALSE;
1746 yyextra->current->section = EntryType::makeClass();
1747 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1749 yyextra->current->type += " ref struct" ;
1750 yyextra->current->fileName = yyextra->fileName;
1751 yyextra->current->startLine = yyextra->yyLineNr;
1752 yyextra->current->startColumn = yyextra->yyColNr;
1753 yyextra->current->bodyLine = yyextra->yyLineNr;
1754 yyextra->current->bodyColumn = yyextra->yyColNr;
1756 if (yytext[yyleng-1]=='{') unput('{');
1757 BEGIN( CompoundName ) ;
1758 }
1759<FindMembers>{B}*"interface struct{" | // C++/CLI extension
1760<FindMembers>{B}*"interface struct"{BN}+ {
1761 yyextra->isTypedef=
FALSE;
1762 yyextra->current->section = EntryType::makeClass();
1763 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1765 yyextra->current->type += " interface struct";
1766 yyextra->current->fileName = yyextra->fileName;
1767 yyextra->current->startLine = yyextra->yyLineNr;
1768 yyextra->current->startColumn = yyextra->yyColNr;
1769 yyextra->current->bodyLine = yyextra->yyLineNr;
1770 yyextra->current->bodyColumn = yyextra->yyColNr;
1772 if (yytext[yyleng-1]=='{') unput('{');
1773 BEGIN( CompoundName ) ;
1774 }
1775<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1776<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1777 if (yyextra->insideJava) REJECT;
1779 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1780 bool isConst=decl.
find(
"const")!=-1;
1781 bool isVolatile=decl.
find(
"volatile")!=-1;
1782 yyextra->current->section = EntryType::makeClass();
1784
1785
1787 if (isConst)
1788 {
1789 yyextra->current->type += " const";
1790 }
1791 else if (isVolatile)
1792 {
1793 yyextra->current->type += " volatile";
1794 }
1795 yyextra->current->type += " union" ;
1796 yyextra->current->fileName = yyextra->fileName;
1797 yyextra->current->startLine = yyextra->yyLineNr;
1798 yyextra->current->startColumn = yyextra->yyColNr;
1799 yyextra->current->bodyLine = yyextra->yyLineNr;
1800 yyextra->current->bodyColumn = yyextra->yyColNr;
1802 if (yytext[yyleng-1]=='{') unput('{');
1803 BEGIN( CompoundName ) ;
1804 }
1805<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1806<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum
1808 yyextra->isTypedef = text.
find(
"typedef")!=-1;
1809 bool isStrongEnum = text.
find(
"class")!=-1 || yyextra->insideCS;
1810 bool isEnumSytruct = text.
find(
"struct")!=-1;
1811 if (yyextra->insideJava)
1812 {
1813 yyextra->current->section = EntryType::makeClass();
1816 }
1817 else
1818 {
1819 yyextra->current->section = EntryType::makeEnum() ;
1820 }
1822 yyextra->current->type += " enum";
1823 if (isStrongEnum)
1824 {
1825 yyextra->current->spec.setStrong(true);
1826 }
1827 if (isEnumSytruct)
1828 {
1829 yyextra->current->spec.setStrong(true).setEnumStruct(true);
1830 }
1831 yyextra->current->fileName = yyextra->fileName;
1832 yyextra->current->startLine = yyextra->yyLineNr;
1833 yyextra->current->startColumn = yyextra->yyColNr;
1834 yyextra->current->bodyLine = yyextra->yyLineNr;
1835 yyextra->current->bodyColumn = yyextra->yyColNr;
1837 if (yytext[yyleng-1]=='{') unput('{');
1838 BEGIN( CompoundName ) ;
1839 }
1840<FindMembers>{B}*"concept"{BN}+ { // C++20 concept
1841 if (yyextra->insideJava) REJECT;
1842 yyextra->isTypedef=
FALSE;
1843 yyextra->current->section = EntryType::makeConcept();
1845 yyextra->current->type += " concept";
1846 yyextra->current->fileName = yyextra->fileName;
1847 yyextra->current->startLine = yyextra->yyLineNr;
1848 yyextra->current->startColumn = yyextra->yyColNr;
1849 yyextra->current->bodyLine = yyextra->yyLineNr;
1850 yyextra->current->bodyColumn = yyextra->yyColNr;
1852 BEGIN( ConceptName ) ;
1853 }
1854<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" { // A::operator()<int>(int arg)
1856 yyextra->current->name += "()";
1857 BEGIN( FindMembers );
1858 }
1859<Operator>"("{BN}*")"{BNopt}/"(" {
1861 yyextra->current->name += yytext ;
1862 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1863 BEGIN( FindMembers ) ;
1864 }
1865<Operator>";" { // can occur when importing members
1866 unput(';');
1867 BEGIN( FindMembers ) ;
1868 }
1869<Operator>[^(] {
1871 yyextra->current->name += *yytext ;
1872 }
1873<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" { /* skip guided templ specifiers */
1874 if (!yyextra->current->type.startsWith("friend "))
1875 {
1876 yyextra->current->name += yytext;
1877 }
1878 }
1879<Operator>"(" {
1880 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1881 unput(*yytext);
1882 BEGIN( FindMembers ) ;
1883 }
1884<FindMembers>("template"|"generic")({BN}*)"<"/[>]? { // generic is a C++/CLI extension
1887 yyextra->current->tArgLists.
push_back(al);
1888 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1889 yyextra->templateStr="<";
1890 yyextra->fullArgString = yyextra->templateStr;
1891 yyextra->copyArgString = &yyextra->templateStr;
1892 yyextra->currentArgumentContext = FindMembers;
1893 BEGIN( ReadTempArgs );
1894 }
void push_back(const Argument &a)
1895<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
1896 if (yyextra->insideJava) REJECT;
1898 BEGIN( NSAliasName );
1899 }
1900<NSAliasName>{ID} {
1901 yyextra->aliasName = yytext;
1902 BEGIN( NSAliasArg );
1903 }
1904<NSAliasArg>({ID}"::")*{ID} {
1905
1906 std::string ctx = yyextra->current_root->name.str();
1907 if (ctx.empty())
1908 {
1910 }
1911 else
1912 {
1914 }
1915 }
static NamespaceAliasInfoMap namespaceAliasMap
1916<NSAliasArg>";" {
1917 BEGIN( FindMembers );
1918 }
1919<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1921 yyextra->aliasName=yytext;
1922 BEGIN(PHPUseAs);
1923 }
1924<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1927
1928 yyextra->current->fileName = yyextra->fileName;
1929
1930 yyextra->current->section = EntryType::makeUsingDecl();
1931 yyextra->current_root->copyToSubEntry(yyextra->current);
1932
1933 yyextra->current->section = EntryType::makeUsingDir();
1934 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1936 yyextra->aliasName.clear();
1937 }
QCString removeRedundantWhiteSpace(const QCString &s)
1938<PHPUseAs>{BN}+"as"{BN}+ {
1940 }
1941<PHPUseAs>{PHPUSEKW} {
1942 }
1943<PHPUseAs>{ID} {
1944
1945 if (!yyextra->aliasName.isEmpty())
1946 {
1949 }
1950 yyextra->aliasName.clear();
1951 }
const std::string & str() const
1952<PHPUse,PHPUseAs>[,;] {
1953 if (*yytext==',')
1954 {
1955 BEGIN(PHPUse);
1956 }
1957 else
1958 {
1959 BEGIN(FindMembers);
1960 }
1961 }
1962<JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
1966 yyextra->current->fileName = yyextra->fileName;
1967 bool ambig = false;
1969 if (incFd)
1970 {
1972 }
1973 yyextra->current->section = EntryType::makeUsingDir();
1974 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1976 BEGIN(Using);
1977 }
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)
1978<JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
1982 yyextra->current->fileName = yyextra->fileName;
1983 bool ambig = false;
1986 if (fromFd)
1987 {
1989 }
1990 if (toFd && fromFd)
1991 {
1993 }
1994 if (yyextra->insideD)
1995 {
1996 yyextra->current->section = EntryType::makeUsingDir();
1997 }
1998 else
1999 {
2000
2001 yyextra->current->section = EntryType::makeUsingDecl();
2002 }
2003 yyextra->previous = yyextra->current;
2004 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2006 BEGIN(Using);
2007 }
virtual void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual const QCString & docName() const =0
2008<IDLImport>"\""[^"]*"\"" {
2009 QCString fileName(&yytext[1],yyleng-2);
2010 bool ambig = false;
2013 if (fromFd)
2014 {
2016 }
2017 if (toFd && fromFd)
2018 {
2020 }
2021 }
2022<IDLImport>";" {
2023 BEGIN(FindMembers);
2024 }
2025<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2026 if (yyextra->insideJava) REJECT;
2027 yyextra->current->startLine=yyextra->yyLineNr;
2028 yyextra->current->startColumn = yyextra->yyColNr;
2030 BEGIN(Using);
2031 }
2032<Using>"namespace"{BN}+ { lineCount(yyscanner); BEGIN(UsingDirective); }
2033<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2035 yyextra->current->name=yytext;
2036 yyextra->current->fileName = yyextra->fileName;
2037 yyextra->current->section = EntryType::makeUsingDecl();
2038 yyextra->current->startLine = yyextra->yyLineNr;
2039 yyextra->previous = yyextra->current;
2040 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2042 if (yyextra->insideCS)
2043
2044
2045
2046 {
2047 yyextra->current->name=yytext;
2048 yyextra->current->fileName = yyextra->fileName;
2049 yyextra->current->startLine = yyextra->yyLineNr;
2050 yyextra->current->startColumn = yyextra->yyColNr;
2051 yyextra->current->section = EntryType::makeUsingDir();
2052 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2054 }
2055 BEGIN(Using);
2056 }
2057<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" { // C++11 style using alias
2059 yyextra->current->fileName = yyextra->fileName;
2060 yyextra->current->section = EntryType::makeUsingDecl();
2061 yyextra->current->startLine = yyextra->yyLineNr;
2062 yyextra->current->bodyLine = yyextra->yyLineNr;
2063 yyextra->current->bodyColumn = yyextra->yyColNr;
2064 yyextra->lastInitializerContext = UsingAlias;
2065 yyextra->initBracketCount=0;
2066 BEGIN(ReadInitializer);
2067 }
2068<UsingAlias>";" {
2069 yyextra->current->section = EntryType::makeVariable();
2071 init.stripPrefix(
"class ");
2072 init.stripPrefix(
"struct ");
2074 yyextra->current->type =
"typedef "+
init;
2075 yyextra->current->args.clear();
2076 yyextra->current->spec.setAlias(true);
2077 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2079 BEGIN(FindMembers);
2080 }
2081<UsingAlias>. {
2082 yyextra->current->initializer << yytext;
2083 }
2084<UsingAlias>\n {
2085 yyextra->current->initializer << yytext;
2087 }
2088<UsingDirective>{SCOPENAME} { yyextra->current->name=removeRedundantWhiteSpace(yytext);
2089 yyextra->current->fileName = yyextra->fileName;
2090 yyextra->current->section = EntryType::makeUsingDir();
2091 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2093 BEGIN(Using);
2094 }
2095<Using>";" { BEGIN(FindMembers); }
2096<FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl
2100 }
2101<FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
2103 if (yyextra->insideCpp && name=="import") REJECT;
2104 yyextra->roundCount=0;
2105 yyextra->sharpCount=0;
2108 yyextra->current->name=name;
2109
2110
2112 BEGIN( Operator );
2113 else
2114 BEGIN( EndTemplate );
2115 }
static bool nameIsOperator(QCString &name)
2116<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2117 yyextra->sharpCount=0;
2118 yyextra->roundCount=0;
2121
2122
2124 BEGIN( Operator );
2125 else
2126 BEGIN( EndTemplate );
2127 }
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...
2128<EndTemplate>"<<<" {
2129 if (!yyextra->insidePHP)
2130 {
2131 REJECT;
2132 }
2133 else
2134 {
2135 yyextra->lastHereDocContext = YY_START;
2136 BEGIN(HereDoc);
2137 }
2138 }
2139<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2140 yyextra->current->name+=yytext;
2141
2142 }
2143<EndTemplate>"<" {
2144 if (yyextra->roundCount==0)
2145 {
2146
2147 yyextra->sharpCount++;
2148 }
2149 yyextra->current->name+=yytext;
2150 }
2151<ClassTemplSpec,EndTemplate>">=" {
2152 yyextra->current->name+=yytext;
2153 }
2154<ClassTemplSpec,EndTemplate>(">>") {
2155 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2156 {
2157 unput('>');
2158 unput(' ');
2159 unput('>');
2160 }
2161 else
2162 {
2163 yyextra->current->name+=yytext;
2164 }
2165
2166 }
2167<EndTemplate>">" {
2168 yyextra->current->name+='>';
2169
2170 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2171 {
2172 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2173
2174 BEGIN(FindMembers);
2175 }
2176 }
2177<EndTemplate>">"{BN}*"(" {
2179 yyextra->current->name+='>';
2180
2181 if (yyextra->roundCount==0)
2182 {
2183 --yyextra->sharpCount;
2184 }
2185 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2186 {
2187 yyextra->current->bodyLine = yyextra->yyLineNr;
2188 yyextra->current->bodyColumn = yyextra->yyColNr;
2189 yyextra->current->args = "(";
2190 yyextra->currentArgumentContext = FuncQual;
2191 yyextra->fullArgString = yyextra->current->args;
2192 yyextra->copyArgString = &yyextra->current->args;
2193
2194 BEGIN( ReadFuncArgType ) ;
2195 }
2196 else
2197 {
2198 yyextra->current->name+="(";
2199 yyextra->roundCount++;
2200 }
2201 }
2202<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
2204 yyextra->current->name+='>';
2205 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2206 {
2207 BEGIN(FindMembers);
2208 }
2209 }
2210<EndTemplate>">"{BNopt}/"::" {
2212 yyextra->current->name+='>';
2213
2214 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2215 {
2216 BEGIN(FindMemberName);
2217 }
2218 }
2219<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2220 yyextra->roundCount++;
2221 }
2222<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2223 if (yyextra->roundCount>0) yyextra->roundCount--;
2224 }
2225<EndTemplate>. {
2226 yyextra->current->name+=*yytext;
2227
2228 }
2229<FindMembers>"define"{BN}*"("{BN}*["'] {
2230 if (yyextra->insidePHP)
2231 {
2232 yyextra->current->bodyLine = yyextra->yyLineNr;
2233 yyextra->current->bodyColumn = yyextra->yyColNr;
2234 BEGIN( DefinePHP );
2235 }
2236 else
2237 REJECT;
2238 }
2239<CopyHereDoc>{ID} { // PHP heredoc
2240 yyextra->delimiter = yytext;
2241 *yyextra->pCopyHereDocGString << yytext;
2242 BEGIN(CopyHereDocEnd);
2243 }
2244<CopyHereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2245 yyextra->delimiter = &yytext[1];
2246 *yyextra->pCopyHereDocGString << yytext;
2247 BEGIN(CopyHereDocEnd);
2248 }
2249<CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
2250 yyextra->delimiter = &yytext[1];
2251 *yyextra->pCopyHereDocGString << yytext;
2252 BEGIN(CopyHereDocEnd);
2253 }
2254<HereDoc>{ID} { // PHP heredoc
2255 yyextra->delimiter = yytext;
2256 BEGIN(HereDocEnd);
2257 }
2258<HereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2259 yyextra->delimiter = &yytext[1];
2260 BEGIN(HereDocEnd);
2261 }
2262<HereDoc>"'"{ID}/"'" { // PHP nowdoc
2263 yyextra->delimiter = &yytext[1];
2264 BEGIN(HereDocEnd);
2265 }
2266<HereDocEnd>^{ID} { // id at start of the line could mark the end of the block
2267 if (yyextra->delimiter==yytext)
2268 {
2269 BEGIN(yyextra->lastHereDocContext);
2270 }
2271 }
2272<HereDocEnd>. { }
2273<CopyHereDocEnd>^{Bopt}{ID} { // id at start of the line could mark the end of the block
2274 *yyextra->pCopyHereDocGString << yytext;
2276 {
2277 BEGIN(yyextra->lastHereDocContext);
2278 }
2279 }
2280<CopyHereDocEnd>\n {
2282 *yyextra->pCopyHereDocGString << yytext;
2283 }
2284<CopyHereDocEnd>{ID} {
2285 *yyextra->pCopyHereDocGString << yytext;
2286 }
2287<CopyHereDocEnd>. {
2288 *yyextra->pCopyHereDocGString << yytext;
2289 }
2290<FindMembers>"Q_OBJECT"|"Q_GADGET" { // Qt object / gadget macro
2291 }
2292<FindMembers>"Q_PROPERTY" { // Qt property declaration
2293 yyextra->yyBegLineNr = yyextra->yyLineNr;
2294 yyextra->yyBegColNr = yyextra->yyColNr;
2297 yyextra->current->type.clear();
2298 BEGIN(QtPropType);
2299 }
2300<QtPropType>"(" { // start of property arguments
2301 }
2302<QtPropAttr>")" { // end of property arguments
2303 unput(';');
2304 BEGIN(FindMembers);
2305 }
2306<QtPropType>{B}+ {
2307 yyextra->current->name+=yytext;
2308 }
2309<QtPropType>"*" {
2310 yyextra->current->type+= yyextra->current->name;
2311 yyextra->current->type+= yytext;
2312 yyextra->current->name="";
2313 }
2314<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2315 yyextra->current->type+= yyextra->current->name;
2316 yyextra->current->name=yytext;
2317 }
2318<QtPropType,QtPropAttr>{B}+"READ"{B}+ {
2319 yyextra->current->spec.setReadable(true);
2320 BEGIN(QtPropRead);
2321 }
2322<QtPropType,QtPropAttr>{B}+"WRITE"{B}+ {
2323 yyextra->current->spec.setWritable(true);
2324 BEGIN(QtPropWrite);
2325 }
2326<QtPropType,QtPropAttr>{B}+"MEMBER"{B}+{ID} | // member property => not supported yet
2327<QtPropType,QtPropAttr>{B}+"RESET"{B}+{ID} | // reset method => not supported yet
2328<QtPropType,QtPropAttr>{B}+"SCRIPTABLE"{B}+{ID} | // scriptable property => not supported yet
2329<QtPropType,QtPropAttr>{B}+"DESIGNABLE"{B}+{ID} | // designable property => not supported yet
2330<QtPropType,QtPropAttr>{B}+"NOTIFY"{B}+{ID} | // notify property => not supported yet
2331<QtPropType,QtPropAttr>{B}+"REVISION"{B}+{ID} | // revision property => not supported yet
2332<QtPropType,QtPropAttr>{B}+"STORED"{B}+{ID} | // stored property => not supported yet
2333<QtPropType,QtPropAttr>{B}+"USER"{B}+{ID} | // user property => not supported yet
2334<QtPropType,QtPropAttr>{B}+"CONSTANT"{B} | // constant property => not supported yet
2335<QtPropType,QtPropAttr>{B}+"FINAL"{B} { // final property => not supported yet
2336 BEGIN(QtPropAttr);
2337 }
2338<QtPropRead>{ID} {
2339 yyextra->current->read = yytext;
2340 BEGIN(QtPropAttr);
2341 }
2342<QtPropWrite>{ID} {
2343 yyextra->current->write = yytext;
2344 BEGIN(QtPropAttr);
2345 }
2346<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2347 yyextra->current->name=yytext;
2349 BEGIN(FindMembers);
2350 }
2351<FindMembers>"requires" { // C++20 requires clause
2352 if (yyextra->insideJava) REJECT;
2353 yyextra->current->req.clear();
2354 yyextra->requiresContext = YY_START;
2355 BEGIN(RequiresClause);
2356 }
2357<RequiresClause>"requires"{BN}*/"{" { // requires requires { ... }
2358 if (yyextra->insideJava) REJECT;
2360 yyextra->current->req+=yytext;
2361 BEGIN( RequiresExpression ) ;
2362 }
2363<RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
2364 if (yyextra->insideJava) REJECT;
2366 yyextra->current->req+=yytext;
2367 yyextra->lastRoundContext=RequiresExpression;
2368 yyextra->pCopyRoundString=&yyextra->current->req;
2369 yyextra->roundCount=0;
2370 BEGIN( CopyRound ) ;
2371 }
2372<RequiresExpression>"{" {
2373 yyextra->current->req+=yytext;
2374 yyextra->lastCurlyContext=RequiresClause;
2375 yyextra->pCopyCurlyString=&yyextra->current->req;
2376 yyextra->curlyCount=0;
2377 BEGIN( CopyCurly ) ;
2378 }
2379<RequiresExpression>\n {
2380 yyextra->current->req+=' ';
2382 }
2383<RequiresExpression>. {
2384 yyextra->current->req+=yytext;
2385 }
2386<RequiresClause>"(" { // requires "(A && B)"
2387 yyextra->current->req+=yytext;
2388 yyextra->lastRoundContext=RequiresClause;
2389 yyextra->pCopyRoundString=&yyextra->current->req;
2390 yyextra->roundCount=0;
2391 BEGIN( CopyRound ) ;
2392 }
2393<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" { // "requires func(x)"
2395 {
2397 yyextra->current->req+=yytext;
2398 yyextra->lastRoundContext=RequiresClause;
2399 yyextra->pCopyRoundString=&yyextra->current->req;
2400 yyextra->roundCount=0;
2401 BEGIN( CopyRound );
2402 }
2403 else
2404 {
2405 REJECT;
2406 }
2407 }
static bool startOfRequiresExpression(const QCString &req)
2408<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
2410 {
2412 yyextra->current->req+=yytext;
2413 yyextra->lastSharpContext=RequiresClause;
2414 yyextra->pCopySharpString=&yyextra->current->req;
2415 yyextra->sharpCount=0;
2416 BEGIN( CopySharp );
2417 }
2418 else
2419 {
2420 REJECT
2421 }
2422 }
2423<RequiresClause>{NOTopt}{SCOPENAME} { // something like "requires true" or "requires !my::value"
2425 {
2427 yyextra->current->req=yytext;
2428 BEGIN(yyextra->requiresContext);
2429 }
2430 else
2431 {
2432 REJECT;
2433 }
2434 }
2435<RequiresClause>{NOTopt}"::"{ID} {
2437 yyextra->current->req+=yytext;
2438 }
2439<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) { // "requires A || B" or "requires A && B"
2441 yyextra->current->req+=yytext;
2442 }
2443<RequiresClause>{BN}+ {
2444 yyextra->current->req+=' ';
2446 }
2447<RequiresClause>. {
2448 unput(*yytext);
2449 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2450 BEGIN(yyextra->requiresContext);
2451 }
2452<FindMembers,FindMemberName>{SCOPENAME} {
2454 yyextra->yyBegColNr=yyextra->yyColNr;
2455 yyextra->yyBegLineNr=yyextra->yyLineNr;
2457 if (yyextra->insideIDL && yyleng==9 &&
qstrcmp(yytext,
"cpp_quote")==0)
2458 {
2459 BEGIN(CppQuote);
2460 }
2461 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
qstrcmp(yytext,
"import")==0)
2462 {
2463 if (yyextra->insideIDL)
2464 BEGIN(IDLImport);
2465 else
2466 BEGIN(JavaImport);
2467 }
2468 else if (yyextra->insidePHP &&
qstrcmp(yytext,
"use")==0)
2469 {
2470 BEGIN(PHPUse);
2471 }
2472 else if (yyextra->insideJava &&
qstrcmp(yytext,
"package")==0)
2473 {
2475 BEGIN(PackageName);
2476 }
2477 else if (yyextra->insideIDL &&
qstrcmp(yytext,
"case")==0)
2478 {
2479 BEGIN(IDLUnionCase);
2480 }
2481 else if (yyextra->insideTryBlock &&
qstrcmp(yytext,
"catch")==0)
2482 {
2483 yyextra->insideTryBlock=
FALSE;
2484 BEGIN(TryFunctionBlock);
2485 }
2486 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"alignas")==0)
2487 {
2488 yyextra->lastAlignAsContext = YY_START;
2489 BEGIN(AlignAs);
2490 }
2491 else if (yyextra->insideJS &&
qstrcmp(yytext,
"var")==0)
2492 {
2493 yyextra->current->type="var";
2494 }
2495 else if (yyextra->insideJS &&
qstrcmp(yytext,
"function")==0)
2496 {
2497 yyextra->current->type="function";
2498 }
2499 else if (yyextra->insideCS &&
qstrcmp(yytext,
"this")==0)
2500 {
2501
2503 yyextra->current->name="this";
2504 BEGIN(CSIndexer);
2505 }
2506 else if (yyextra->insideCpp && (
qstrcmp(yytext,
"static_assert")==0 ||
qstrcmp(yytext,
"_Static_assert")==0))
2507 {
2508
2509 BEGIN(StaticAssert);
2510 }
2511 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"decltype")==0)
2512 {
2513
2515 if (!yyextra->current->type.isEmpty()) yyextra->current->type+=' ';
2516 yyextra->current->type+=yytext;
2517 BEGIN(DeclType);
2518 }
2519 else if (yyextra->insideSlice &&
qstrcmp(yytext,
"optional")==0)
2520 {
2521 if (yyextra->current->type.isEmpty())
2522 {
2523 yyextra->current->type = "optional";
2524 }
2525 else
2526 {
2527 yyextra->current->type += " optional";
2528 }
2529 yyextra->lastModifierContext = YY_START;
2530 BEGIN(SliceOptional);
2531 }
2532 else
2533 {
2534 if (YY_START==FindMembers)
2535 {
2537 }
2538 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2539 if (javaLike &&
qstrcmp(yytext,
"public")==0)
2540 {
2542 }
2543 else if (javaLike &&
qstrcmp(yytext,
"protected")==0)
2544 {
2546 }
2547 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
qstrcmp(yytext,
"internal")==0)
2548 {
2550 }
2551 else if (javaLike &&
qstrcmp(yytext,
"private")==0)
2552 {
2554 }
2555 else if (javaLike &&
qstrcmp(yytext,
"static")==0)
2556 {
2557 if (YY_START==FindMembers)
2558 yyextra->current->name = yytext;
2559 else
2560 yyextra->current->name += yytext;
2561 yyextra->current->isStatic =
TRUE;
2562 }
2563 else
2564 {
2565 if (YY_START==FindMembers)
2566 yyextra->current->name = yytext;
2567 else
2568 yyextra->current->name += yytext;
2569 if (yyextra->current->name.startsWith("static "))
2570 {
2571 yyextra->current->isStatic =
TRUE;
2572 yyextra->current->name= yyextra->current->name.mid(7);
2573 }
2574 else if (yyextra->current->name.startsWith("inline "))
2575 {
2576 if (yyextra->current->type.isEmpty())
2577 {
2578 yyextra->current->type="inline";
2579 }
2580 else
2581 {
2582 yyextra->current->type+="inline ";
2583 }
2584 yyextra->current->name= yyextra->current->name.mid(7);
2585 }
2586 else if (yyextra->current->name.startsWith("constexpr "))
2587 {
2588 if (yyextra->current->type.isEmpty())
2589 {
2590 yyextra->current->type="constexpr";
2591 }
2592 else
2593 {
2594 yyextra->current->type+="constexpr ";
2595 }
2596 yyextra->current->name=yyextra->current->name.mid(10);
2597 }
2598 else if (yyextra->current->name.startsWith("consteval "))
2599 {
2600 if (yyextra->current->type.isEmpty())
2601 {
2602 yyextra->current->type="consteval";
2603 }
2604 else
2605 {
2606 yyextra->current->type+="consteval ";
2607 }
2608 yyextra->current->name=yyextra->current->name.mid(10);
2609 }
2610 else if (yyextra->current->name.startsWith("constinit "))
2611 {
2612 if (yyextra->current->type.isEmpty())
2613 {
2614 yyextra->current->type="constinit";
2615 }
2616 else
2617 {
2618 yyextra->current->type+="constinit ";
2619 }
2620 yyextra->current->name=yyextra->current->name.mid(10);
2621 }
2622 else if (yyextra->current->name.startsWith("const "))
2623 {
2624 if (yyextra->current->type.isEmpty())
2625 {
2626 yyextra->current->type="const";
2627 }
2628 else
2629 {
2630 yyextra->current->type+="const ";
2631 }
2632 yyextra->current->name=yyextra->current->name.mid(6);
2633 }
2634 else if (yyextra->current->name.startsWith("volatile "))
2635 {
2636 if (yyextra->current->type.isEmpty())
2637 {
2638 yyextra->current->type="volatile";
2639 }
2640 else
2641 {
2642 yyextra->current->type+="volatile ";
2643 }
2644 yyextra->current->name=yyextra->current->name.mid(9);
2645 }
2646 else if (yyextra->current->name.startsWith("typedef "))
2647 {
2648 if (yyextra->current->type.isEmpty())
2649 {
2650 yyextra->current->type="typedef";
2651 }
2652 else
2653 {
2654 yyextra->current->type+="typedef ";
2655 }
2656 yyextra->current->name=yyextra->current->name.mid(8);
2657 }
2658 }
2661 {
2662 BEGIN( Operator );
2663 }
2664 else
2665 {
2666 yyextra->externLinkage=
FALSE;
2667 BEGIN(FindMembers);
2668 }
2669 }
2670 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2671 }
2672<StaticAssert>"(" {
2673 yyextra->lastSkipRoundContext = FindMembers;
2674 yyextra->roundCount=0;
2675 BEGIN(SkipRound);
2676 }
2677<StaticAssert>{BN}+ { lineCount(yyscanner); }
2678<StaticAssert>. { // variable with static_assert as name?
2679 unput(*yytext);
2680 BEGIN(FindMembers);
2681 }
2682<DeclType>"(" {
2683 yyextra->current->type+=yytext;
2684 yyextra->lastRoundContext=FindMembers;
2685 yyextra->pCopyRoundString=&yyextra->current->type;
2686 yyextra->roundCount=0;
2687 BEGIN(CopyRound);
2688 }
2689<DeclType>{BN}+ { lineCount(yyscanner); }
2690<DeclType>. {
2691 unput(*yytext);
2692 BEGIN(FindMembers);
2693 }
2694<CSIndexer>"["[^\n\]]*"]" {
2696 BEGIN(FindMembers);
2697 }
2698<FindMembers>[0-9]{ID} { // some number where we did not expect one
2699 }
2700<FindMembers>"." {
2701 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2702 {
2703 yyextra->current->name+=".";
2704 }
2705 }
2706<FindMembers>"::" {
2707 yyextra->current->name+=yytext;
2708 }
2709<CppQuote>"("{B}*"\"" {
2710 yyextra->insideCppQuote=
TRUE;
2711 BEGIN(FindMembers);
2712 }
2713<IDLUnionCase>"::"
2714<IDLUnionCase>":" { BEGIN(FindMembers); }
2715<IDLUnionCase>\n { lineCount(yyscanner); }
2716<IDLUnionCase>.
2717<TryFunctionBlock>\n { lineCount(yyscanner); }
2718<TryFunctionBlock>"{" {
2719 yyextra->curlyCount=0;
2720 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2721 BEGIN( SkipCurly );
2722 }
2723<TryFunctionBlock>.
2724<TryFunctionBlockEnd>{BN}*"catch" { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
2725 }
2726<TryFunctionBlockEnd>\n { unput(*yytext); // rule added to fix bug id 601138
2727 BEGIN( FindMembers );
2728 }
2729<TryFunctionBlockEnd>. { unput(*yytext);
2730 BEGIN( FindMembers );
2731 }
2732<EndCppQuote>")" {
2733 yyextra->insideCppQuote=
FALSE;
2734 BEGIN(FindMembers);
2735 }
2736<FindMembers,FindFields>{B}*"#" { if (yyextra->insidePHP)
2737 REJECT;
2738 yyextra->lastCPPContext = YY_START;
2739 BEGIN( SkipCPP ) ;
2740 }
2741<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2742<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2743 if (yyextra->insidePHP)
2744 REJECT;
2745 yyextra->current->bodyLine = yyextra->yyLineNr;
2746 yyextra->current->bodyColumn = yyextra->yyColNr;
2747 yyextra->current->fileName = yyextra->fileName;
2748 yyextra->current->startLine = yyextra->yyLineNr;
2749 yyextra->current->startColumn = yyextra->yyColNr;
2750 yyextra->current->type.clear();
2751 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2752 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2753 yyextra->current->section = EntryType::makeDefine();
2754 yyextra->lastDefineContext = YY_START;
2755 BEGIN( SDefine );
2756 }
2757<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
2758 yyextra->yyLineNr = atoi(&yytext[1]);
2759
2760 yyextra->lastPreLineCtrlContext = YY_START;
2761 if (YY_START==ReadBody ||
2762 YY_START==ReadNSBody ||
2763 YY_START==ReadBodyIntf)
2764 {
2765 yyextra->current->program << yytext;
2766 }
2767 BEGIN( PreLineCtrl );
2768 }
2769<PreLineCtrl>"\""[^\n\"]*"\"" {
2771 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2772 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2773 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2774 {
2775 yyextra->current->program << yytext;
2776 }
2777 }
static QCString stripQuotes(const char *s)
2778<PreLineCtrl>. {
2779 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2780 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2781 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2782 {
2783 yyextra->current->program << yytext;
2784 }
2785 }
2786<PreLineCtrl>\n {
2787 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2788 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2789 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2790 {
2791 yyextra->current->program << yytext;
2792 }
2794 BEGIN( yyextra->lastPreLineCtrlContext );
2795 }
2796<SkipCPP>.
2797<SkipCPP>\\[\r]*"\n"[\r]* { lineCount(yyscanner); }
2798<SkipCPP>[\r]*\n[\r]* { lineCount(yyscanner);
2799 BEGIN( yyextra->lastCPPContext) ;
2800 }
2801<SDefine>{ID}{B}*"(" {
2802 yyextra->current->name = yytext;
2803 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2804 yyextra->current->args = "(";
2805 yyextra->current->bodyLine = yyextra->yyLineNr;
2806 yyextra->current->bodyColumn = yyextra->yyColNr;
2807 yyextra->currentArgumentContext = DefineEnd;
2808 yyextra->fullArgString=yyextra->current->args;
2809 yyextra->copyArgString=&yyextra->current->args;
2810 BEGIN( ReadFuncArgType ) ;
2811 }
2812
2813<DefineArg>")" {
2814
2815 yyextra->current->args += ')';
2816 BEGIN( DefineEnd );
2817 }
2818<DefineArg>. {
2819 yyextra->current->args += *yytext;
2820 }
2821 */
2822<SDefine>{ID} {
2823
2825 yyextra->current->bodyLine = yyextra->yyLineNr;
2826 yyextra->current->bodyColumn = yyextra->yyColNr;
2827 yyextra->current->name = yytext;
2828 BEGIN(DefineEnd);
2829 }
2830<DefineEnd><<EOF>> |
2831<DefineEnd>\n {
2832
2834 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2836 BEGIN(yyextra->lastDefineContext);
2837 }
2838<DefinePHPEnd>";" {
2839
2840 yyextra->current->fileName = yyextra->fileName;
2841 yyextra->current->startLine = yyextra->yyLineNr;
2842 yyextra->current->startColumn = yyextra->yyColNr;
2843 yyextra->current->type.clear();
2844 yyextra->current->type = "const";
2848 yyextra->current->initializer.str(
init.str());
2849 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2850 yyextra->current->section = EntryType::makeVariable();
2851 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2853 BEGIN(FindMembers);
2854 }
2855<DefinePHPEnd>.
2856<DefineEnd>\\[\r]?\n {
2858 yyextra->current->endBodyLine = yyextra->yyLineNr;
2859 }
2860<DefineEnd>\" {
2861 if (yyextra->insideIDL && yyextra->insideCppQuote)
2862 {
2863 BEGIN(EndCppQuote);
2864 }
2865 else
2866 {
2867 yyextra->lastStringContext=DefineEnd;
2868 BEGIN(SkipString);
2869 }
2870 }
2871<DefineEnd>.
2872<DefinePHP>{ID}["']{BN}*","{BN}* {
2873 yyextra->current->name = yytext;
2874 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2875 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2876 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
2877 yyextra->current->bodyLine = yyextra->yyLineNr;
2878 yyextra->current->bodyColumn = yyextra->yyColNr;
2879 yyextra->lastRoundContext = DefinePHPEnd;
2880 yyextra->pCopyRoundGString = &yyextra->current->initializer;
2881 yyextra->roundCount = 0;
2882 BEGIN( GCopyRound );
2883 }
2884
2885<FindMembers>[\^%] { // ^ and % are C++/CLI extensions
2886 if (yyextra->insideCli)
2887 {
2889 yyextra->current->name = yytext ;
2890 }
2891 else
2892 {
2893 REJECT;
2894 }
2895 }
2896<FindMembers>[*&]+ {
2897 yyextra->current->name += yytext ;
2899 }
2900<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
2901 if (yyextra->current->bodyLine==-1)
2902 {
2903 yyextra->current->bodyLine=yyextra->yyLineNr;
2904 yyextra->current->bodyColumn = yyextra->yyColNr;
2905 }
2906 yyextra->docBlockContext = YY_START;
2907 yyextra->docBlockInBody =
FALSE;
2908 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2910
2913 yyextra->docBlock.str(indent.
str());
2914
void fill(char c, int len=-1)
Fills a string with a predefined character.
static int computeIndent(const char *s, int startIndent)
2916
2917 yyextra->docBlockTerm = ';';
2918 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2919 {
2920 yyextra->current->bitfields = ":"+yyextra->current->args;
2921 yyextra->current->args.clear();
2922 yyextra->current->section = EntryType::makeVariable();
2923 }
2924 if (yytext[yyleng-3]=='/')
2925 {
2927 BEGIN( DocLine );
2928 }
2929 else
2930 {
2932 BEGIN( DocBlock );
2933 }
2934 }
static void startCommentBlock(yyscan_t yyscanner, bool)
2935<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
2936 yyextra->docBlockContext = YY_START;
2937 yyextra->docBlockInBody =
FALSE;
2938 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2940
2943 yyextra->docBlock.str(indent.
str());
2945
2946 yyextra->docBlockTerm = ',';
2947 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2948 {
2949 yyextra->current->bitfields = ":"+yyextra->current->args;
2950 yyextra->current->args.clear();
2951 yyextra->current->section = EntryType::makeVariable();
2952 }
2953 if (yytext[yyleng-3]=='/')
2954 {
2956 BEGIN( DocLine );
2957 }
2958 else
2959 {
2961 BEGIN( DocBlock );
2962 }
2963 }
2964<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
2965 if (yyextra->current->bodyLine==-1)
2966 {
2967 yyextra->current->bodyLine=yyextra->yyLineNr;
2968 yyextra->current->bodyColumn = yyextra->yyColNr;
2969 }
2970 yyextra->docBlockContext = YY_START;
2971 yyextra->docBlockInBody =
FALSE;
2972 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2976 yyextra->docBlock.str(indent.
str());
2978
2979 yyextra->docBlockTerm = 0;
2980 if (yytext[yyleng-3]=='/')
2981 {
2983 BEGIN( DocLine );
2984 }
2985 else
2986 {
2988 BEGIN( DocBlock );
2989 }
2990 }
2991
2992<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
2993
2994 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
2995 {
2996
2997 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
2998 }
2999 else
3000 {
3001
3002 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3003 }
3004
3006 if (yytext[1]=='/')
3007 {
3008 if (yytext[2]=='!' || yytext[2]=='/')
3009 {
3010 yyextra->docBlockContext = YY_START;
3011 yyextra->docBlockInBody =
FALSE;
3012 yyextra->docBlockAutoBrief =
FALSE;
3013 yyextra->docBlock.str(std::string());
3014 yyextra->docBlockTerm = 0;
3016 BEGIN(DocLine);
3017 }
3018 else
3019 {
3020 yyextra->lastCContext=YY_START;
3021 BEGIN(SkipCxxComment);
3022 }
3023 }
3024 else
3025 {
3026 if (yytext[2]=='!' || yytext[2]=='*')
3027 {
3028 yyextra->docBlockContext = YY_START;
3029 yyextra->docBlockInBody =
FALSE;
3030 yyextra->docBlock.str(std::string());
3031 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3033 yyextra->docBlockTerm = 0;
3035 BEGIN(DocBlock);
3036 }
3037 else
3038 {
3039 yyextra->lastCContext=YY_START;
3040 BEGIN(SkipComment);
3041 }
3042 }
3043 }
3044<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3045 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3046 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3048 }
3049<FindMembers>"=>" {
3050 if (!yyextra->insideCS) REJECT;
3051 yyextra->current->bodyLine = yyextra->yyLineNr;
3052 yyextra->current->bodyColumn = yyextra->yyColNr;
3053 yyextra->current->initializer.str(yytext);
3054 yyextra->lastInitializerContext = YY_START;
3055 yyextra->initBracketCount=0;
3057 yyextra->current->spec.setGettable(true);
3058 BEGIN(ReadInitializerPtr);
3059 }
3060<FindMembers>"=" { // in PHP code this could also be due to "<?="
3061 yyextra->current->bodyLine = yyextra->yyLineNr;
3062 yyextra->current->bodyColumn = yyextra->yyColNr;
3063 yyextra->current->initializer.str(yytext);
3064 yyextra->lastInitializerContext = YY_START;
3065 yyextra->initBracketCount=0;
3066 BEGIN(ReadInitializer);
3067 }
3068<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3070 yyextra->current->exception += " ";
3072 }
3073<UNOIDLAttributeBlock>"}" {
3074 yyextra->current->exception += " }";
3075 BEGIN(FindMembers);
3076 }
3077
3078<ReadInitializer,ReadInitializerPtr>"(" {
3079 yyextra->lastRoundContext=YY_START;
3080 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3081 yyextra->roundCount=0;
3082 yyextra->current->initializer << *yytext;
3083 BEGIN(GCopyRound);
3084 }
3085<ReadInitializer,ReadInitializerPtr>"[" {
3086 if (!yyextra->insidePHP) REJECT;
3087 yyextra->lastSquareContext=YY_START;
3088 yyextra->pCopySquareGString=&yyextra->current->initializer;
3089 yyextra->squareCount=0;
3090 yyextra->current->initializer << *yytext;
3091 BEGIN(GCopySquare);
3092 }
3093<ReadInitializer,ReadInitializerPtr>"{" {
3094 yyextra->lastCurlyContext=YY_START;
3095 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3096 yyextra->curlyCount=0;
3097 yyextra->current->initializer << *yytext;
3098 BEGIN(GCopyCurly);
3099 }
3100<ReadInitializer,ReadInitializerPtr>[;,] {
3101
3102 if (*yytext==';' && yyextra->current_root->spec.isEnum())
3103 {
3104 yyextra->current->fileName = yyextra->fileName;
3105 yyextra->current->startLine = yyextra->yyLineNr;
3106 yyextra->current->startColumn = yyextra->yyColNr;
3107 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3108 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3109 yyextra->current->section = EntryType::makeVariable();
3110 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3112 BEGIN(FindMembers);
3113 }
3114 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3115 {
3116 unput(*yytext);
3117 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3118 BEGIN(yyextra->lastInitializerContext);
3119 }
3120 else if (*yytext==',' && yyextra->initBracketCount==0)
3121 {
3122 unput(*yytext);
3123 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3124 BEGIN(yyextra->lastInitializerContext);
3125 }
3126 else
3127 {
3128 yyextra->current->initializer << *yytext;
3129 }
3130 }
3131<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
3132 if (!yyextra->insideCpp)
3133 {
3134 REJECT;
3135 }
3136 else
3137 {
3138 yyextra->current->initializer << yytext;
3140 yyextra->lastRawStringContext = YY_START;
3141 yyextra->pCopyRawGString = &yyextra->current->initializer;
3142 BEGIN(RawGString);
3143
3144 }
3145 }
static QCString extractBeginRawStringDelimiter(const char *str)
3146<RawGString>{RAWEND} {
3148 {
3149 *yyextra->pCopyRawGString << yytext;
3150 BEGIN(yyextra->lastRawStringContext);
3151 }
3152 else
3153 {
3154 REJECT;
3155 }
3156 }
static QCString extractEndRawStringDelimiter(const char *str)
3157<RawGString>[^)\n]+ {
3158 *yyextra->pCopyRawGString << yytext;
3159 }
3160<RawGString>. {
3161 *yyextra->pCopyRawGString << yytext;
3162 }
3163<RawGString>\n {
3164 *yyextra->pCopyRawGString << yytext;
3166 }
3167<RawString>{RAWEND} {
3168 *yyextra->pCopyRawString+=yytext;
3169 yyextra->fullArgString+=yytext;
3171 {
3172 BEGIN(yyextra->lastRawStringContext);
3173 }
3174 }
3175<RawString>[^)]+ {
3176 *yyextra->pCopyRawString += yytext;
3177 yyextra->fullArgString+=yytext;
3178 }
3179<RawString>. {
3180 *yyextra->pCopyRawString += yytext;
3181 yyextra->fullArgString+=yytext;
3182 }
3183<RawString>\n {
3184 *yyextra->pCopyRawString += yytext;
3185 yyextra->fullArgString+=yytext;
3187 }
3188<ReadInitializer,ReadInitializerPtr>\" {
3189 if (yyextra->insideIDL && yyextra->insideCppQuote)
3190 {
3191 BEGIN(EndCppQuote);
3192 }
3193 else
3194 {
3195 yyextra->lastStringContext=YY_START;
3196 yyextra->current->initializer << yytext;
3197 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3198 yyextra->stopAtInvalidString=false;
3199 BEGIN(CopyGString);
3200 }
3201 }
3202<ReadInitializer,ReadInitializerPtr>"->" {
3203 yyextra->current->initializer << yytext;
3204 }
3205<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3206 yyextra->current->initializer << yytext;
3207 }
3208<ReadInitializer,ReadInitializerPtr>(">>"|">=") {
3209 yyextra->current->initializer << yytext;
3210 }
3211<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3212 yyextra->initBracketCount++;
3213 yyextra->current->initializer << *yytext;
3214 }
3215<ReadInitializer,ReadInitializerPtr>[>\]})] {
3216 yyextra->initBracketCount--;
3217 if (*yytext=='}')
3218 {
3219 yyextra->current->endBodyLine=yyextra->yyLineNr;
3220 }
3221 yyextra->current->initializer << *yytext;
3222 }
3223<ReadInitializer,ReadInitializerPtr>\' {
3224 if (yyextra->insidePHP)
3225 {
3226 yyextra->current->initializer << yytext;
3227 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3228 yyextra->lastStringContext=YY_START;
3229 BEGIN(CopyPHPGString);
3230 }
3231 else
3232 {
3233 yyextra->current->initializer << yytext;
3234 }
3235 }
3236<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3237 if (yyextra->insidePHP)
3238 {
3239 REJECT;
3240 }
3241 else
3242 {
3243 yyextra->current->initializer << yytext;
3244 }
3245 }
3246<ReadInitializer,ReadInitializerPtr>\n {
3247 yyextra->current->initializer << *yytext;
3249 }
3250<ReadInitializer,ReadInitializerPtr>"@\"" {
3251
3252 yyextra->current->initializer << yytext;
3253 if (!yyextra->insideCS && !yyextra->insideObjC)
3254 {
3255 REJECT;
3256 }
3257 else
3258 {
3259
3260 yyextra->lastSkipVerbStringContext=YY_START;
3261 yyextra->pSkipVerbString=&yyextra->current->initializer;
3262 BEGIN(SkipVerbString);
3263 }
3264 }
3265<SkipVerbString>[^\n"\\]+ {
3266 *yyextra->pSkipVerbString << yytext;
3267 }
3268<SkipVerbString>"\\\\" { // escaped backslash
3269 if (yyextra->insideCS) REJECT
3270 *yyextra->pSkipVerbString << yytext;
3271 }
3272<SkipVerbString>"\\\"" { // backslash escaped quote
3273 if (yyextra->insideCS) REJECT
3274 *yyextra->pSkipVerbString << yytext;
3275 }
3276<SkipVerbString>"\"\"" { // quote escape
3277 *yyextra->pSkipVerbString << yytext;
3278 }
3279<SkipVerbString>"\"" {
3280 *yyextra->pSkipVerbString << *yytext;
3281 BEGIN(yyextra->lastSkipVerbStringContext);
3282 }
3283<SkipVerbString>\n {
3284 *yyextra->pSkipVerbString << *yytext;
3286 }
3287<SkipVerbString>. {
3288 *yyextra->pSkipVerbString << *yytext;
3289 }
3290<ReadInitializer,ReadInitializerPtr>"?>" {
3291 if (yyextra->insidePHP)
3292 BEGIN( FindMembersPHP );
3293 else
3294 yyextra->current->initializer << yytext;
3295 }
3296<ReadInitializer,ReadInitializerPtr>. {
3297 yyextra->current->initializer << *yytext;
3298 }
3299
3300
3301<CopyString,CopyPHPString>\\. {
3302 *yyextra->pCopyQuotedString+=yytext;
3303 }
3304<CopyString>\" {
3305 *yyextra->pCopyQuotedString+=*yytext;
3306 BEGIN( yyextra->lastStringContext );
3307 }
3308<CopyPHPString>\' {
3309 *yyextra->pCopyQuotedString+=*yytext;
3310 BEGIN( yyextra->lastStringContext );
3311 }
3312<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3313 *yyextra->pCopyQuotedString+=yytext;
3314 }
3315<CopyString,CopyPHPString>\n {
3316 *yyextra->pCopyQuotedString+=*yytext;
3318 }
3319<CopyString,CopyPHPString>. {
3320 *yyextra->pCopyQuotedString+=*yytext;
3321 }
3322
3323
3324<CopyGString,CopyPHPGString>\\. {
3325 *yyextra->pCopyQuotedGString << yytext;
3326 }
3327<CopyGString>\" {
3328 *yyextra->pCopyQuotedGString << *yytext;
3329 BEGIN( yyextra->lastStringContext );
3330 }
3331<CopyPHPGString>\' {
3332 *yyextra->pCopyQuotedGString << *yytext;
3333 BEGIN( yyextra->lastStringContext );
3334 }
3335<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3336 *yyextra->pCopyQuotedGString << yytext;
3337 BEGIN( yyextra->lastStringContext );
3338 }
3339<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3340 *yyextra->pCopyQuotedGString << yytext;
3341 }
3342<CopyGString,CopyPHPGString>\n {
3343 *yyextra->pCopyQuotedGString << *yytext;
3344 if (yyextra->stopAtInvalidString)
3345 {
3346 BEGIN( yyextra->lastStringContext );
3347 }
3348 else
3349 {
3351 }
3352 }
3353<CopyGString,CopyPHPGString>. {
3354 *yyextra->pCopyQuotedGString << *yytext;
3355 }
3356
3357
3358<CopyRound>\" {
3359 *yyextra->pCopyRoundString += *yytext;
3360 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3361 yyextra->lastStringContext=YY_START;
3362 BEGIN(CopyString);
3363 }
3364<CopyRound>"(" {
3365 *yyextra->pCopyRoundString += *yytext;
3366 yyextra->roundCount++;
3367 }
3368<CopyRound>")" {
3369 *yyextra->pCopyRoundString += *yytext;
3370 if (--yyextra->roundCount<0)
3371 BEGIN(yyextra->lastRoundContext);
3372 }
3373<CopyRound>\n {
3375 *yyextra->pCopyRoundString += *yytext;
3376 }
3377<CopyRound>\' {
3378 if (yyextra->insidePHP)
3379 {
3380 yyextra->current->initializer << yytext;
3381 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3382 yyextra->lastStringContext=YY_START;
3383 BEGIN(CopyPHPString);
3384 }
3385 else
3386 {
3387 *yyextra->pCopyRoundString += yytext;
3388 }
3389 }
3390<CopyRound>{CHARLIT} {
3391 if (yyextra->insidePHP)
3392 {
3393 REJECT;
3394 }
3395 else
3396 {
3397 *yyextra->pCopyRoundString+=yytext;
3398 }
3399 }
3400<CopyRound>[^"'()\n,]+ {
3401 *yyextra->pCopyRoundString+=yytext;
3402 }
3403<CopyRound>. {
3404 *yyextra->pCopyRoundString+=*yytext;
3405 }
3406
3407
3408<CopySharp>\" {
3409 *yyextra->pCopySharpString += *yytext;
3410 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3411 yyextra->lastStringContext=YY_START;
3412 BEGIN(CopyString);
3413 }
3414<CopySharp>"<" {
3415 *yyextra->pCopySharpString += *yytext;
3416 yyextra->sharpCount++;
3417 }
3418<CopySharp>">" {
3419 *yyextra->pCopySharpString += *yytext;
3420 if (--yyextra->sharpCount<0)
3421 {
3422 BEGIN(yyextra->lastSharpContext);
3423 }
3424 }
3425<CopySharp>\n {
3427 *yyextra->pCopySharpString += *yytext;
3428 }
3429<CopySharp>\' {
3430 if (yyextra->insidePHP)
3431 {
3432 yyextra->current->initializer << yytext;
3433 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3434 yyextra->lastStringContext=YY_START;
3435 BEGIN(CopyPHPString);
3436 }
3437 else
3438 {
3439 *yyextra->pCopySharpString += yytext;
3440 }
3441 }
3442<CopySharp>{CHARLIT} {
3443 if (yyextra->insidePHP)
3444 {
3445 REJECT;
3446 }
3447 else
3448 {
3449 *yyextra->pCopySharpString+=yytext;
3450 }
3451 }
3452<CopySharp>[^"'<>\n,]+ {
3453 *yyextra->pCopySharpString+=yytext;
3454 }
3455<CopySharp>. {
3456 *yyextra->pCopySharpString+=*yytext;
3457 }
3458
3459
3460
3461<GCopyRound>\" {
3462 *yyextra->pCopyRoundGString << *yytext;
3463 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3464 yyextra->lastStringContext=YY_START;
3465 BEGIN(CopyGString);
3466 }
3467<GCopyRound>"(" {
3468 *yyextra->pCopyRoundGString << *yytext;
3469 yyextra->roundCount++;
3470 }
3471<GCopyRound>")" {
3472 *yyextra->pCopyRoundGString << *yytext;
3473 if (--yyextra->roundCount<0)
3474 BEGIN(yyextra->lastRoundContext);
3475 }
3476<GCopyRound>\n {
3478 *yyextra->pCopyRoundGString << *yytext;
3479 }
3480<GCopyRound>\' {
3481 if (yyextra->insidePHP)
3482 {
3483 yyextra->current->initializer << yytext;
3484 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3485 yyextra->lastStringContext=YY_START;
3486 BEGIN(CopyPHPGString);
3487 }
3488 else
3489 {
3490 *yyextra->pCopyRoundGString << yytext;
3491 }
3492 }
3493<GCopyRound>{CHARLIT} {
3494 if (yyextra->insidePHP)
3495 {
3496 REJECT;
3497 }
3498 else
3499 {
3500 *yyextra->pCopyRoundGString << yytext;
3501 }
3502 }
3503<GCopyRound>"@\"" {
3504 if (!yyextra->insideCS) REJECT;
3505 *yyextra->pCopyRoundGString << yytext;
3506 yyextra->lastSkipVerbStringContext=YY_START;
3507 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3508 BEGIN(SkipVerbString);
3509 }
3510<GCopyRound>[^"'()\n\/,R]+ { // R because of raw string start
3511 *yyextra->pCopyRoundGString << yytext;
3512 }
3513<GCopyRound>{RAWBEGIN} {
3514 *yyextra->pCopyRoundGString << yytext;
3516 yyextra->lastRawStringContext = YY_START;
3517 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3518 BEGIN(RawGString);
3519 }
3520<GCopyRound>. {
3521 *yyextra->pCopyRoundGString << *yytext;
3522 }
3523
3524
3525<GCopySquare>\" {
3526 *yyextra->pCopySquareGString << *yytext;
3527 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3528 yyextra->lastStringContext=YY_START;
3529 BEGIN(CopyGString);
3530 }
3531<GCopySquare>\' {
3532 *yyextra->pCopySquareGString << *yytext;
3533 if (yyextra->insidePHP)
3534 {
3535 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3536 yyextra->lastStringContext=YY_START;
3537 BEGIN(CopyPHPGString);
3538 }
3539 }
3540<GCopySquare>"[" {
3541 *yyextra->pCopySquareGString << *yytext;
3542 yyextra->squareCount++;
3543 }
3544<GCopySquare>"]" {
3545 *yyextra->pCopySquareGString << *yytext;
3546 if (--yyextra->squareCount<0)
3547 BEGIN(yyextra->lastSquareContext);
3548 }
3549<GCopySquare>\n {
3551 *yyextra->pCopySquareGString << *yytext;
3552 }
3553<GCopySquare>\' {
3554 if (yyextra->insidePHP)
3555 {
3556 yyextra->current->initializer << yytext;
3557 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3558 yyextra->lastStringContext=YY_START;
3559 BEGIN(CopyPHPGString);
3560 }
3561 else
3562 {
3563 *yyextra->pCopySquareGString << yytext;
3564 }
3565 }
3566<GCopySquare>{CHARLIT} {
3567 if (yyextra->insidePHP)
3568 {
3569 REJECT;
3570 }
3571 else
3572 {
3573 *yyextra->pCopySquareGString << yytext;
3574 }
3575 }
3576<GCopySquare>[^"'\[\]\n\/,]+ {
3577 *yyextra->pCopySquareGString << yytext;
3578 }
3579<GCopySquare>. {
3580 *yyextra->pCopySquareGString << *yytext;
3581 }
3582
3583
3584<CopyCurly>\" {
3585 *yyextra->pCopyCurlyString += *yytext;
3586 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3587 yyextra->lastStringContext=YY_START;
3588 BEGIN(CopyString);
3589 }
3590<CopyCurly>\' {
3591 *yyextra->pCopyCurlyString += *yytext;
3592 if (yyextra->insidePHP)
3593 {
3594 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3595 yyextra->lastStringContext=YY_START;
3596 BEGIN(CopyPHPString);
3597 }
3598 }
3599<CopyCurly>"{" {
3600 *yyextra->pCopyCurlyString += *yytext;
3601 yyextra->curlyCount++;
3602 }
3603<CopyCurly>"}" {
3604 *yyextra->pCopyCurlyString += *yytext;
3605 if (--yyextra->curlyCount<0)
3606 BEGIN(yyextra->lastCurlyContext);
3607 }
3608<CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3609 {
3610 REJECT;
3611 }
3612 else
3613 {
3614 *yyextra->pCopyCurlyString += yytext;
3615 }
3616 }
3617<CopyCurly>[^"'{}\/\n,]+ {
3618 *yyextra->pCopyCurlyString += yytext;
3619 }
3620<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3621<CopyCurly>\n {
3623 *yyextra->pCopyCurlyString += *yytext;
3624 }
3625<CopyCurly>. {
3626 *yyextra->pCopyCurlyString += *yytext;
3627 }
3628
3629
3630<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3631 }
3632<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3634 int s = line.
find(
' ');
3635 int e = line.
find(
'"',s);
3636 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3637 if (yytext[yyleng-1]=='\n')
3638 {
3640 yyextra->column=0;
3641 }
3642 }
int toInt(bool *ok=nullptr, int base=10) const
3643<GCopyCurly>\" {
3644 *yyextra->pCopyCurlyGString << *yytext;
3645 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3646 yyextra->lastStringContext=YY_START;
3647 BEGIN(CopyGString);
3648 }
3649<GCopyCurly>\' {
3650 *yyextra->pCopyCurlyGString << *yytext;
3651 if (yyextra->insidePHP)
3652 {
3653 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3654 yyextra->lastStringContext=YY_START;
3655 BEGIN(CopyPHPGString);
3656 }
3657 }
3658<GCopyCurly>"{" {
3659 *yyextra->pCopyCurlyGString << *yytext;
3660 yyextra->curlyCount++;
3661 }
3662<GCopyCurly>"}" {
3663 *yyextra->pCopyCurlyGString << *yytext;
3664 if (--yyextra->curlyCount<0)
3665 {
3666 yyextra->current->endBodyLine = yyextra->yyLineNr;
3667 BEGIN(yyextra->lastCurlyContext);
3668 }
3669 }
3670<GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3671 {
3672 REJECT;
3673 }
3674 else
3675 {
3676 *yyextra->pCopyCurlyGString << yytext;
3677 }
3678 }
3679<GCopyCurly>[^"'{}\/\n,]+ {
3680 *yyextra->pCopyCurlyGString << yytext;
3681 }
3682<GCopyCurly>[,]+ {
3683 *yyextra->pCopyCurlyGString << yytext;
3684 }
3685<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3686<GCopyCurly>\n {
3688 *yyextra->pCopyCurlyGString << *yytext;
3689 }
3690<GCopyCurly>. {
3691 *yyextra->pCopyCurlyGString << *yytext;
3692 }
3693
3694
3695
3696
3697<FindMembers>":" {
3698 if (yyextra->current->type.isEmpty() &&
3699 yyextra->current->name=="enum")
3700 {
3701 yyextra->current->section = EntryType::makeEnum();
3702 yyextra->current->name.clear();
3703 yyextra->current->args.clear();
3704 BEGIN(EnumBaseType);
3705 }
3706 else
3707 {
3708 if (yyextra->current->type.isEmpty())
3709 {
3711 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
3712 }
3713 BEGIN(BitFields);
3714 yyextra->current->bitfields+=":";
3715 }
3716 }
3717<BitFields>. {
3718 yyextra->current->bitfields+=*yytext;
3719 }
3720<EnumBaseType>. {
3721 yyextra->current->args+=*yytext;
3722 }
3723<EnumBaseType>\n {
3725 yyextra->current->args+=' ';
3726 }
3727<FindMembers>[;,] {
3728 QCString oldType = yyextra->current->type;
3729 if (yyextra->current->bodyLine==-1)
3730 {
3731 yyextra->current->bodyLine = yyextra->yyLineNr;
3732 yyextra->current->bodyColumn = yyextra->yyColNr;
3733 }
3734 if ( yyextra->insidePHP && yyextra->current->type.startsWith("var"))
3735 {
3736 yyextra->current->type = yyextra->current->type.mid(3);
3737 }
3738 if (yyextra->isTypedef && !yyextra->current->type.startsWith("typedef "))
3739 {
3740 yyextra->current->type.prepend("typedef ");
3741 }
3742 bool isStatic = yyextra->current->isStatic;
3743 Protection prot = yyextra->current->protection;
3744 bool isConcept = yyextra->current->section.isConcept();
3745 bool isModule = yyextra->current->section.isModuleDoc();
3746 if (isConcept)
3747 {
3748 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3750 }
3751 else if (isModule)
3752 {
3753 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3755 }
3756 else if (!yyextra->current->name.isEmpty() && !yyextra->current->section.isEnum())
3757 {
3758 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
3760 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
3761 if (yyextra->current->section.isClass())
3762 {
3764 }
3765 yyextra->current->section = EntryType::makeVariable() ;
3766 yyextra->current->fileName = yyextra->fileName;
3767 yyextra->current->startLine = yyextra->yyBegLineNr;
3768 yyextra->current->startColumn = yyextra->yyBegColNr;
3769 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3771 }
3772 if ( *yytext == ',')
3773 {
3774 yyextra->current->isStatic = isStatic;
3775 yyextra->current->protection = prot;
3776 yyextra->current->name.clear();
3777 yyextra->current->args.clear();
3778 yyextra->current->brief.clear();
3779 yyextra->current->doc.clear();
3780 yyextra->current->initializer.str(std::string());
3781 yyextra->current->bitfields.clear();
3783 }
3784 else
3785 {
3788 yyextra->current->bodyLine = -1;
3789 yyextra->current->bodyColumn = 1;
3790 yyextra->current->groups.clear();
3792 }
3793 }
static QCString stripFuncPtr(const QCString &type)
Protection
Protection level of members.
3794
3795<FindMembers>"[" {
3796 if (yyextra->insideSlice)
3797 {
3798 yyextra->squareCount=1;
3799 yyextra->lastSquareContext = YY_START;
3800 yyextra->current->metaData += "[";
3801 BEGIN( SliceMetadata );
3802 }
3803 else if (!yyextra->insideCS &&
3804 (yyextra->current->name.isEmpty() ||
3805 yyextra->current->name=="typedef"
3806 )
3807 )
3808 {
3809 yyextra->squareCount=1;
3810 yyextra->lastSquareContext = YY_START;
3811 yyextra->idlAttr.clear();
3812 yyextra->idlProp.clear();
3813 yyextra->current->mtype = yyextra->mtype;
3814
3817 {
3818 yyextra->odlProp = true;
3819 yyextra->current->spec.setGettable(true).setSettable(true);
3820 }
3821
3822 BEGIN( IDLAttribute );
3823 }
3824 else if (yyextra->insideCS &&
3825 yyextra->current->name.isEmpty())
3826 {
3827 yyextra->squareCount=1;
3828 yyextra->lastSquareContext = YY_START;
3829
3830
3831 yyextra->current->args.clear();
3832 BEGIN( SkipSquare );
3833 }
3834 else
3835 {
3836 yyextra->current->args += yytext ;
3837 yyextra->squareCount=1;
3838 yyextra->externLinkage=
FALSE;
3839 BEGIN( Array ) ;
3840 }
3841 }
3842<SliceMetadata>"[" { // Global metadata.
3843 yyextra->squareCount++;
3844 yyextra->current->metaData += "[";
3845 }
3846<SliceMetadata>{BN}* {
3848 }
3849<SliceMetadata>\"[^\"]*\" {
3850 yyextra->current->metaData += yytext;
3851 }
3852<SliceMetadata>"," {
3853 yyextra->current->metaData += yytext;
3854 }
3855<SliceMetadata>"]" {
3856 yyextra->current->metaData += yytext;
3857 if (--yyextra->squareCount<=0)
3858 {
3859 BEGIN (yyextra->lastSquareContext);
3860 }
3861 }
3862<SliceOptional>"(" {
3863 yyextra->current->type += "(";
3864 yyextra->roundCount++;
3865 }
3866<SliceOptional>[0-9]+ {
3867 yyextra->current->type += yytext;
3868 }
3869<SliceOptional>")" {
3870 yyextra->current->type += ")";
3871 if(--yyextra->roundCount<=0)
3872 {
3873 BEGIN (yyextra->lastModifierContext);
3874 }
3875 }
3876<IDLAttribute>"]" {
3877
3878 if (--yyextra->squareCount<=0)
3879 {
3882 BEGIN( IDLPropName );
3883 else
3884 BEGIN( yyextra->lastSquareContext );
3885 }
3886 }
3887<IDLAttribute>"propput" {
3889 {
3891 }
3892 yyextra->current->spec.setSettable(true);
3893 }
3894<IDLAttribute>"propget" {
3896 {
3898 }
3899 yyextra->current->spec.setGettable(true);
3900 }
3901<IDLAttribute>"property" { // UNO IDL property
3902 yyextra->current->spec.setProperty(true);
3903 }
3904<IDLAttribute>"attribute" { // UNO IDL attribute
3905 yyextra->current->spec.setAttribute(true);
3906 }
3907<IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
3908 yyextra->current->spec.setOptional(true);
3909 }
3910<IDLAttribute>"readonly" { // on UNO IDL attribute or property
3912 {
3913 yyextra->current->spec.setSettable(false);
3914 }
3915 else
3916 {
3917 yyextra->current->spec.setReadonly(true);
3918 }
3919 }
3920<IDLAttribute>"bound" { // on UNO IDL attribute or property
3921 yyextra->current->spec.setBound(true);
3922 }
3923<IDLAttribute>"removable" { // on UNO IDL property
3924 yyextra->current->spec.setRemovable(true);
3925 }
3926<IDLAttribute>"constrained" { // on UNO IDL property
3927 yyextra->current->spec.setConstrained(true);
3928 }
3929<IDLAttribute>"transient" { // on UNO IDL property
3930 yyextra->current->spec.setTransient(true);
3931 }
3932<IDLAttribute>"maybevoid" { // on UNO IDL property
3933 yyextra->current->spec.setMaybeVoid(true);
3934 }
3935<IDLAttribute>"maybedefault" { // on UNO IDL property
3936 yyextra->current->spec.setMaybeDefault(true);
3937 }
3938<IDLAttribute>"maybeambiguous" { // on UNO IDL property
3939 yyextra->current->spec.setMaybeAmbiguous(true);
3940 }
3941<IDLAttribute>. {
3942 }
3943<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
3944
3945
3946 if (yyextra->odlProp)
3947 {
3948 yyextra->idlProp = yytext;
3949 }
3950 }
3951<IDLPropName>{ID}{BN}*"(" {
3952 yyextra->current->name = yytext;
3953 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3954 yyextra->current->startLine = yyextra->yyLineNr;
3955 yyextra->current->startColumn = yyextra->yyColNr;
3956 BEGIN( IDLProp );
3957 }
3958<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
3959 if (yyextra->odlProp)
3960 {
3961 yyextra->idlProp += yytext;
3962 }
3963 }
3964<IDLPropName>{ID}{BNopt}/";" {
3965 if (yyextra->odlProp)
3966 {
3967 yyextra->current->name = yytext;
3968 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
3969 yyextra->odlProp = false;
3970
3971 BEGIN( IDLProp );
3972 }
3973 }
3974<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
3975 yyextra->idlAttr = yytext;
3976 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
3977 }
3978<IDLProp>{ID} { // property type
3979 yyextra->idlProp = yytext;
3980 }
3981<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
3982 if (yyextra->current->args.isEmpty())
3983 yyextra->current->args = "(";
3984 else
3985 yyextra->current->args += ", ";
3986 yyextra->current->args += yyextra->idlAttr;
3987 yyextra->current->args += " ";
3988 yyextra->current->args += yyextra->idlProp;
3989 yyextra->current->args += " ";
3990 yyextra->current->args += yytext;
3991 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
3992 yyextra->idlProp.clear();
3993 yyextra->idlAttr.clear();
3994 BEGIN( IDLProp );
3995 }
3996<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
3997
3998 }
3999<IDLProp>";" {
4000 yyextra->current->fileName = yyextra->fileName;
4001 yyextra->current->type = yyextra->idlProp;
4002 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4003 if (!yyextra->current->args.isEmpty())
4004 yyextra->current->args += ")";
4005 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4006 yyextra->current->section = EntryType::makeVariable();
4007 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4009 BEGIN( FindMembers );
4010 }
4011<IDLProp>. { // spaces, *, or other stuff
4012
4013 }
4014<Array>"]" { yyextra->current->args += *yytext ;
4015 if (--yyextra->squareCount<=0)
4016 BEGIN( FindMembers ) ;
4017 }
4018<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4019 if (--yyextra->squareCount<=0)
4020 BEGIN( SFunction ) ;
4021 }
4022<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4023 yyextra->squareCount++;
4024 }
4025<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4026<SkipSquare>"[" { yyextra->squareCount++; }
4027<SkipSquare>"]" {
4028 if (--yyextra->squareCount<=0)
4029 BEGIN( yyextra->lastSquareContext );
4030 }
4031<SkipSquare>\" {
4032 yyextra->lastStringContext=YY_START;
4033 BEGIN( SkipString );
4034 }
4035<SkipSquare>[^\n\[\]\"]+
4036<FindMembers>"<" { addType(yyscanner);
4037 yyextra->current->type += yytext ;
4038 BEGIN( Sharp ) ;
4039 }
4040<Sharp>">" { yyextra->current->type += *yytext ;
4041 if (--yyextra->sharpCount<=0)
4042 BEGIN( FindMembers ) ;
4043 }
4044<Sharp>"<" { yyextra->current->type += *yytext ;
4045 yyextra->sharpCount++;
4046 }
4047<Sharp>{BN}+ {
4048 yyextra->current->type += ' ';
4050 }
4051<Sharp>. { yyextra->current->type += *yytext ; }
4052<FindFields>{ID} {
4054 yyextra->current->bodyLine = yyextra->yyLineNr;
4055 yyextra->current->bodyColumn = yyextra->yyColNr;
4056 yyextra->current->name = yytext;
4057 }
4058<FindFields>[({] {
4059
4060 unput(*yytext);
4061 yyextra->lastInitializerContext = YY_START;
4062 yyextra->initBracketCount=0;
4063 yyextra->current->initializer.str("=");
4064 BEGIN(ReadInitializer);
4065 }
4066<FindFields>"=" {
4067 yyextra->lastInitializerContext = YY_START;
4068 yyextra->initBracketCount=0;
4069 yyextra->current->initializer.str(yytext);
4070 BEGIN(ReadInitializer);
4071 }
4072<FindFields>";" {
4073 if (yyextra->insideJava)
4074 {
4075 if (!yyextra->current->name.isEmpty())
4076 {
4077 yyextra->current->fileName = yyextra->fileName;
4078 yyextra->current->startLine = yyextra->yyLineNr;
4079 yyextra->current->startColumn = yyextra->yyColNr;
4080 if (!yyextra->current_root->spec.isEnum())
4081 {
4082 yyextra->current->type = "@";
4083 }
4084 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4085 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4086 yyextra->current->section = EntryType::makeVariable();
4087 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4089 }
4090
4091 BEGIN( FindMembers );
4092 }
4093 else
4094 {
4095 REJECT;
4096 }
4097 }
4098<FindFields>"," {
4099
4100
4101
4102 if (!yyextra->current->name.isEmpty())
4103 {
4104 yyextra->current->fileName = yyextra->fileName;
4105 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4106 {
4107 yyextra->current->startLine = yyextra->current->bodyLine;
4108 yyextra->current->startColumn = yyextra->current->bodyColumn;
4109 }
4110 else
4111 {
4112 yyextra->current->startLine = yyextra->yyLineNr;
4113 yyextra->current->startColumn = yyextra->yyColNr;
4114 }
4115 if (!yyextra->current_root->spec.isEnum())
4116 {
4117 yyextra->current->type = "@";
4118 }
4119 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4120 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4121 yyextra->current->section = EntryType::makeVariable();
4122
4123 if (!yyextra->insideCS && !yyextra->insideJava &&
4124 !yyextra->current_root->spec.isStrong())
4125
4126
4127 {
4128
4129
4130
4131 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4132 }
4133 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4135 }
4136 else
4137 {
4138 yyextra->current->reset();
4140 }
4141 }
4142<FindFields>"[" { // attribute list in IDL
4143 yyextra->squareCount=1;
4144 yyextra->lastSquareContext = YY_START;
4145 BEGIN(SkipSquare);
4146 }
4147<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; } // R because of raw string start
4148<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4149<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
4150 REJECT;
4151
4152 yyextra->current->program << yytext ;
4153 }
4154
4155<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
4156 yyextra->current->program << yytext ;
4157 yyextra->pSkipInterpString = &yyextra->current->program;
4158 yyextra->lastSkipInterpStringContext=YY_START;
4159 BEGIN( SkipInterpString );
4160 }
4161<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})* {
4162 *yyextra->pSkipInterpString << yytext;
4163 }
4164<SkipInterpString>\" {
4165 *yyextra->pSkipInterpString << *yytext;
4166 BEGIN( yyextra->lastSkipInterpStringContext );
4167 }
4168
4169<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$@\" { if (!yyextra->insideCS) REJECT
4170 yyextra->current->program << yytext ;
4171 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4172 yyextra->lastSkipInterpVerbStringContext=YY_START;
4173 BEGIN( SkipInterpVerbString );
4174 }
4175<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4176 *yyextra->pSkipInterpVerbString << yytext;
4177 }
4178<SkipInterpString>"{"[^}]*"}" {
4179 *yyextra->pSkipInterpString << yytext;
4180 }
4181<SkipInterpVerbString>"{"[^}]*"}" {
4182 *yyextra->pSkipInterpVerbString << yytext;
4183 }
4184<SkipInterpVerbString>\" {
4185 *yyextra->pSkipInterpVerbString << *yytext;
4186 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4187 }
4188<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4189<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4190 yyextra->pSkipVerbString = &yyextra->current->program;
4191 yyextra->lastSkipVerbStringContext=YY_START;
4192 BEGIN( SkipVerbString );
4193 }
4194<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
4195 {
4196 yyextra->current->program << yytext ;
4197 yyextra->pCopyHereDocGString = &yyextra->current->program;
4198 yyextra->lastHereDocContext=YY_START;
4199 BEGIN( CopyHereDoc );
4200 }
4201 else
4202 {
4203 REJECT;
4204 }
4205 }
4206<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4207 yyextra->current->program << yytext;
4209 yyextra->lastRawStringContext = YY_START;
4210 yyextra->pCopyRawGString = &yyextra->current->program;
4211 BEGIN(RawGString);
4212 }
4213<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4214 yyextra->pCopyQuotedGString = &yyextra->current->program;
4215 yyextra->lastStringContext=YY_START;
4216 yyextra->stopAtInvalidString=false;
4217 BEGIN( CopyGString );
4218 }
4219<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=true; REJECT;}
4220<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4221 yyextra->lastContext = YY_START ;
4222 BEGIN( Comment ) ;
4223 }
4224<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4225 ++yyextra->yyLineNr ;
4226 yyextra->lastContext = YY_START ;
4227 BEGIN( Comment ) ;
4228 }
4229<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4230 if (!yyextra->insidePHP)
4231 {
4232 yyextra->current->program << yytext;
4233 }
4234 else
4235 {
4236 yyextra->current->program << yytext;
4237 yyextra->pCopyQuotedGString = &yyextra->current->program;
4238 yyextra->lastStringContext=YY_START;
4239 BEGIN(CopyPHPGString);
4240 }
4241 }
4242<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4243 if (yyextra->insidePHP)
4244 {
4245 REJECT;
4246
4247 }
4248 else
4249 {
4250 yyextra->current->program << yytext;
4251 }
4252 }
4253<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4254 ++yyextra->curlyCount ;
4255 }
4256<ReadBodyIntf>"}" {
4257 yyextra->current->program << yytext ;
4258 --yyextra->curlyCount ;
4259 }
4260<ReadBody,ReadNSBody>"}" { //err("%d:ReadBody count=%d\n",yyextra->yyLineNr,yyextra->curlyCount);
4261 if ( yyextra->curlyCount>0 )
4262 {
4263 yyextra->current->program << yytext ;
4264 --yyextra->curlyCount ;
4265 }
4266 else
4267 {
4268 yyextra->current->endBodyLine = yyextra->yyLineNr;
4269 std::shared_ptr<Entry> original_root = yyextra->current_root;
4270 if (yyextra->current->section.isNamespace() && yyextra->current->type == "namespace")
4271 {
4272 int split_point;
4273
4274 QCString doc = yyextra->current->doc;
4275 int docLine = yyextra->current->docLine;
4276 QCString docFile = yyextra->current->docFile;
4277 QCString brief = yyextra->current->brief;
4278 int briefLine = yyextra->current->briefLine;
4279 QCString briefFile = yyextra->current->briefFile;
4280
4281 yyextra->current->doc = "";
4282 yyextra->current->docLine = 0;
4283 yyextra->current->docFile = "";
4284 yyextra->current->brief = "";
4285 yyextra->current->briefLine = 0;
4286 yyextra->current->briefFile = "";
4287 while ((split_point = yyextra->current->name.find("::")) != -1)
4288 {
4289 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4290 yyextra->current->program.str(std::string());
4291 new_current->name = yyextra->current->name.mid(split_point + 2);
4292 yyextra->current->name = yyextra->current->name.left(split_point);
4293 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
4294
4295 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4296 yyextra->current_root = yyextra->current;
4297 yyextra->current = new_current;
4298 }
4299
4300 yyextra->current->doc = doc;
4301 yyextra->current->docLine = docLine;
4302 yyextra->current->docFile = docFile;
4303 yyextra->current->brief = brief;
4304 yyextra->current->briefLine = briefLine;
4305 yyextra->current->briefFile = briefFile;
4306 }
4307 QCString &cn = yyextra->current->name;
4308 QCString rn = yyextra->current_root->name;
4309
4311 {
4313 }
4314 if (yyextra->isTypedef && cn.
isEmpty())
4315 {
4316
4317 BEGIN( TypedefName );
4318 }
4319 else
4320 {
4321 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4322 {
4323 yyextra->current->program << ',';
4324 }
4325
4327
4328 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4329 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4330
4331 if (yyextra->insideObjC &&
4332 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4333 )
4334 {
4335 BEGIN( ReadBodyIntf ) ;
4336 }
4337 else
4338 {
4339 yyextra->memspecEntry = yyextra->current;
4340 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4341 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4342 if (yyextra->current->section.isNamespace() ||
4343 yyextra->current->spec.isInterface() ||
4344 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4345 yyextra->insideSlice
4346 )
4347 {
4348 yyextra->current->reset();
4349 yyextra->current_root = std::move(original_root);
4351 yyextra->memspecEntry.reset();
4352 BEGIN( FindMembers ) ;
4353 }
4354 else
4355 {
4356 static const reg::Ex re(R
"(@\d+$)");
4357 if (!yyextra->isTypedef && yyextra->memspecEntry &&
4358 !
reg::search(yyextra->memspecEntry->name.str(),re))
4359 {
4360
4361 yyextra->current->doc.clear();
4362 yyextra->current->brief.clear();
4363 }
4364 BEGIN( MemberSpec ) ;
4365 }
4366 }
4367 }
4368 }
4369 }
static void prependScope(yyscan_t yyscanner)
4370<ReadBody>"}"{BN}+"typedef"{BN}+ { //err("ReadBody count=%d\n",yyextra->curlyCount);
4372 if ( yyextra->curlyCount>0 )
4373 {
4374 yyextra->current->program << yytext ;
4375 --yyextra->curlyCount ;
4376 }
4377 else
4378 {
4379 yyextra->isTypedef =
TRUE;
4380 yyextra->current->endBodyLine = yyextra->yyLineNr;
4381 QCString &cn = yyextra->current->name;
4382 QCString rn = yyextra->current_root->name;
4384 {
4386 }
4387 BEGIN( TypedefName );
4388 }
4389 }
4390<TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
4392 yyextra->current->type.prepend(yytext);
4393 }
4394<TypedefName>{ID} {
4395 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4396 {
4397 yyextra->current->program << ",";
4398 }
4399 yyextra->current->name=yytext;
4401 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4402 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4403
4404 if (!yyextra->firstTypedefEntry)
4405 {
4406 yyextra->firstTypedefEntry = yyextra->current;
4407 }
4408 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4410 yyextra->isTypedef=
TRUE;
4411 BEGIN(MemberSpecSkip);
4412 }
4413<TypedefName>";" { /* typedef of anonymous type */
4415 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4416 {
4417 yyextra->current->program << ',';
4418 }
4419
4420 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4421 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4422 yyextra->memspecEntry = yyextra->current;
4423 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4425 unput(';');
4426 BEGIN( MemberSpec ) ;
4427 }
QCString generateAnonymousAnchor(const QCString &fileName, int count)
4428<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4430 int i=0,l=(int)yyleng,j;
4431 while (i<l && (!
isId(yytext[i]))) i++;
4433 j=yyextra->msName.
find(
"[");
4434 if (j!=-1)
4435 {
4436 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4437 yyextra->msName=yyextra->msName.left(j);
4438 }
QCString right(size_t len) const
4440
4441
4442 if (yyextra->firstTypedefEntry)
4443 {
4444 if (yyextra->firstTypedefEntry->spec.isStruct())
4445 {
4446 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4447 }
4448 else if (yyextra->firstTypedefEntry->spec.isUnion())
4449 {
4450 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4451 }
4452 else if (yyextra->firstTypedefEntry->section.isEnum())
4453 {
4454 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4455 }
4456 else
4457 {
4458 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4459 }
4460 }
4461 }
4462<MemberSpec>"(" { // function with struct return type
4464 yyextra->current->name = yyextra->msName;
4466 unput('(');
4467 BEGIN(FindMembers);
4468 }
4469<MemberSpec>[,;] {
4470 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4471 {
4472
4473
4474
4475
4476 const Entry *p=yyextra->current.get();
4477 while (p)
4478 {
4479
4481 {
4482
4484 int pi = (i==-1) ? 0 : i+2;
4486 {
4487
4488
4490 break;
4491 }
4492 }
4493
4494 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4495 }
4496 }
4497
4498 if (!yyextra->msName.isEmpty()
4499 )
4500 {
4502
4503
4504 if (typedefHidesStruct &&
4505 yyextra->isTypedef &&
4506 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4507 yyextra->msType.stripWhiteSpace().isEmpty() &&
4508 yyextra->memspecEntry)
4509 {
4510 yyextra->memspecEntry->name=yyextra->msName;
4511 }
4512 else
4513 {
4514 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4515 varEntry->lang = yyextra->language;
4516 varEntry->protection = yyextra->current->protection ;
4517 varEntry->mtype = yyextra->current->mtype;
4518 varEntry->virt = yyextra->current->virt;
4519 varEntry->isStatic = yyextra->current->isStatic;
4520 varEntry->section = EntryType::makeVariable();
4521 varEntry->name = yyextra->msName.stripWhiteSpace();
4522 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4523 varEntry->args = yyextra->msArgs;
4524 if (yyextra->isTypedef)
4525 {
4526 varEntry->type.prepend("typedef ");
4527
4528 }
4529 if (typedefHidesStruct &&
4530 yyextra->isTypedef &&
4531 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4532 yyextra->memspecEntry
4533 )
4534 {
4535 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4536 }
4537 else
4538 {
4539 varEntry->type+=yyextra->current->name+yyextra->msType;
4540 }
4541 varEntry->fileName = yyextra->fileName;
4542 varEntry->startLine = yyextra->yyLineNr;
4543 varEntry->startColumn = yyextra->yyColNr;
4544 varEntry->doc = yyextra->current->doc;
4545 varEntry->brief = yyextra->current->brief;
4546 varEntry->mGrpId = yyextra->current->mGrpId;
4547 varEntry->initializer.str(yyextra->current->initializer.str());
4548 varEntry->groups = yyextra->current->groups;
4549 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 bool isCompound() const
int findRev(char c, int index=-1, bool cs=TRUE) const
4550
4551
4552
4553
4554 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4555 }
4556 }
4557 if (*yytext==';')
4558 {
4559 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && yyextra->current->section.isCompound())
4560 {
4561 if (!yyextra->current->doc.isEmpty())
4562 {
4563 yyextra->memspecEntry->doc += yyextra->current->doc;
4564 }
4565 if (!yyextra->current->brief.isEmpty())
4566 {
4567 yyextra->memspecEntry->brief += yyextra->current->brief;
4568 }
4569 }
4570 yyextra->msType.clear();
4571 yyextra->msName.clear();
4572 yyextra->msArgs.clear();
4573 yyextra->isTypedef=
FALSE;
4574 yyextra->firstTypedefEntry.reset();
4575 yyextra->memspecEntry.reset();
4576 yyextra->current->reset();
4578 BEGIN( FindMembers );
4579 }
4580 else
4581 {
4582 yyextra->current->doc.clear();
4583 yyextra->current->brief.clear();
4584 }
4585
4586 }
4587<MemberSpec>"=" {
4588 yyextra->lastInitializerContext=YY_START;
4589 yyextra->initBracketCount=0;
4590 yyextra->current->initializer.str(yytext);
4591 BEGIN(ReadInitializer);
4592
4593 }
4594
4595<MemberSpecSkip>"{" {
4596 yyextra->curlyCount=0;
4597 yyextra->lastCurlyContext = MemberSpecSkip;
4598 yyextra->previous = yyextra->current;
4599 BEGIN(SkipCurly);
4600 }
4601 */
4602<MemberSpecSkip>"," { BEGIN(MemberSpec); }
4603<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4604<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4606 }
4607<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4608 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4611 yyextra->insideObjC=
FALSE;
4612 BEGIN( FindMembers );
4613 }
4614<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
4615<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
4616
4617<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
4618<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
4619 if (yyextra->insidePHP)
4620 {
4621 REJECT
4622 }
4623 else
4624 {
4625 yyextra->current->bodyLine = yyextra->yyLineNr;
4626 yyextra->current->bodyColumn = yyextra->yyColNr;
4629 yyextra->funcPtrType=yytext;
4630 yyextra->roundCount=0;
4631
4632 BEGIN( FuncPtr );
4633 }
4634 }
4635<FuncPtr>{SCOPENAME} {
4636 yyextra->current->name = yytext;
4638 {
4639 BEGIN( FuncPtrOperator );
4640 }
4641 else
4642 {
4643 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
4644 {
4645 yyextra->funcPtrType += yyextra->current->name;
4646 }
4647 else
4648 {
4649 BEGIN( EndFuncPtr );
4650 }
4651 }
4652 }
4653<FuncPtr>. {
4654
4655 }
4656<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
4657 yyextra->current->name += yytext;
4658 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
4660 }
4661<FuncPtrOperator>\n {
4663 yyextra->current->name += *yytext;
4664 }
4665<FuncPtrOperator>"(" {
4666 unput(*yytext);
4667 BEGIN( EndFuncPtr );
4668 }
4669<FuncPtrOperator>. {
4670 yyextra->current->name += *yytext;
4671 }
4672<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
4674 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4675 BEGIN(FindMembers);
4676 }
4677<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
4679 if (yyextra->funcPtrType!="(")
4680 {
4681 yyextra->current->type+=yyextra->funcPtrType+")";
4682 }
4683 BEGIN(FindMembers);
4684 }
4685<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
4687 yyextra->current->type+=yyextra->funcPtrType;
4688 yyextra->current->args += ")";
4689 BEGIN(FindMembers);
4690 }
4691<EndFuncPtr>"(" { // a function returning a function or
4692
4693 yyextra->current->args += *yytext ;
4694
4695
4696 yyextra->current->bodyLine = yyextra->yyLineNr;
4697 yyextra->current->bodyColumn = yyextra->yyColNr;
4698 yyextra->currentArgumentContext = FuncFuncEnd;
4699 yyextra->fullArgString=yyextra->current->args;
4700 yyextra->copyArgString=&yyextra->current->args;
4701 BEGIN( ReadFuncArgType ) ;
4702 }
4703<EndFuncPtr>"["[^\n\]]*"]" {
4704 yyextra->funcPtrType+=yytext;
4705 }
4706<EndFuncPtr>")" {
4707 BEGIN(FindMembers);
4708 }
4709<FuncFunc>"(" {
4710 yyextra->current->args += *yytext ;
4711 ++yyextra->roundCount;
4712 }
4713<FuncFunc>")" {
4714 yyextra->current->args += *yytext ;
4715 if ( yyextra->roundCount )
4716 --yyextra->roundCount;
4717 else
4718 {
4719 BEGIN(FuncFuncEnd);
4720 }
4721 }
4722<FuncFuncEnd>")"{BN}*"(" {
4724 yyextra->current->type+=yyextra->funcPtrType+")(";
4725 BEGIN(FuncFuncType);
4726 }
4727<FuncFuncEnd>")"{BNopt}/[;{] {
4729 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4730 BEGIN(SFunction);
4731 }
4732<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
4734 yyextra->current->type+=yyextra->funcPtrType;
4735 yyextra->current->args+=")";
4736 BEGIN(FuncFuncArray);
4737 }
4738<FuncFuncEnd>. {
4739 yyextra->current->args += *yytext;
4740 }
4741<FuncFuncType>"(" {
4742 yyextra->current->type += *yytext;
4743 yyextra->roundCount++;
4744 }
4745<FuncFuncType>")" {
4746 yyextra->current->type += *yytext;
4747 if (yyextra->roundCount)
4748 --yyextra->roundCount;
4749 else
4750 BEGIN(SFunction);
4751 }
4752<FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
4753<FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
4754<FuncFuncType>. {
4755 yyextra->current->type += *yytext;
4756 }
4757<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
4758 if (yyextra->current->type.startsWith("typedef") &&
4759 yyextra->current->bodyLine==-1)
4760
4761 {
4762 yyextra->current->bodyLine = yyextra->yyLineNr;
4763 yyextra->current->bodyColumn = yyextra->yyColNr;
4764 BEGIN( GetCallType );
4765 }
4766 else if (!yyextra->current->name.isEmpty())
4767 {
4768 yyextra->current->args = yytext;
4769 yyextra->current->bodyLine = yyextra->yyLineNr;
4770 yyextra->current->bodyColumn = yyextra->yyColNr;
4771 yyextra->currentArgumentContext = FuncQual;
4772 yyextra->fullArgString=yyextra->current->args;
4773 yyextra->copyArgString=&yyextra->current->args;
4774 BEGIN( ReadFuncArgType ) ;
4775
4776 }
4777 }
4778<GetCallType>{BN}*{ID}{BN}*"*" {
4781 yyextra->funcPtrType="(";
4782 yyextra->funcPtrType+=yytext;
4783 yyextra->roundCount=0;
4784 BEGIN( FuncPtr );
4785 }
4786<FindMembers>"(" {
4787 if (!yyextra->current->name.isEmpty())
4788 {
4789 yyextra->current->args = yytext;
4790 yyextra->current->bodyLine = yyextra->yyLineNr;
4791 yyextra->current->bodyColumn = yyextra->yyColNr;
4792 yyextra->currentArgumentContext = FuncQual;
4793 yyextra->fullArgString=yyextra->current->args;
4794 yyextra->copyArgString=&yyextra->current->args;
4795 BEGIN( ReadFuncArgType ) ;
4796
4797 }
4798 }
4799
4800<FindMembers>"("{BN}*("void"{BN}*)?")" {
4802 yyextra->current->args = "()";
4803 BEGIN( FuncQual );
4804 }
4805 */
4806
4807
4808
4809<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
4810 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
4811 else yyextra->fullArgString+=yytext;
4812 }
4813<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
4814 yyextra->fullArgString+=yytext;
4815 }
4816<CopyArgRound>[^\/\n\)\(\"\']+ {
4817 *yyextra->copyArgString+=yytext;
4818 yyextra->fullArgString+=yytext;
4819 }
4820<CopyArgSquare>[^\/\n\]\[\"\']+ {
4821 *yyextra->copyArgString+=yytext;
4822 yyextra->fullArgString+=yytext;
4823 }
4824<ReadFuncArgType,ReadTempArgs>{BN}* {
4825 *yyextra->copyArgString+=" ";
4826 yyextra->fullArgString+=" ";
4828 }
4829<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
4831 yyextra->lastRawStringContext = YY_START;
4832 yyextra->pCopyRawString = yyextra->copyArgString;
4833 *yyextra->pCopyRawString+=yytext;
4834 yyextra->fullArgString+=yytext;
4835 BEGIN(RawString);
4836 }
4837<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
4838 *yyextra->copyArgString+=*yytext;
4839 yyextra->fullArgString+=*yytext;
4840 yyextra->lastCopyArgStringContext = YY_START;
4841 BEGIN( CopyArgString );
4842 }
4843<ReadFuncArgType>"[" {
4844 if (!yyextra->insidePHP) REJECT;
4845 *yyextra->copyArgString+=*yytext;
4846 yyextra->fullArgString+=*yytext;
4847 yyextra->argSquareCount=0;
4848 yyextra->lastCopyArgContext = YY_START;
4849 BEGIN( CopyArgSquare );
4850 }
4851<ReadFuncArgType,ReadTempArgs>"(" {
4852 *yyextra->copyArgString+=*yytext;
4853 yyextra->fullArgString+=*yytext;
4854 yyextra->argRoundCount=0;
4855 yyextra->lastCopyArgContext = YY_START;
4856 BEGIN( CopyArgRound );
4857 }
4858<ReadFuncArgType>")" {
4859 *yyextra->copyArgString+=*yytext;
4860 yyextra->fullArgString+=*yytext;
4862 if (yyextra->insideJS)
4863 {
4865 }
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)
4867
4868
4869
4870
4871
4872
4873 yyextra->docBackup = yyextra->current->doc;
4874 yyextra->briefBackup = yyextra->current->brief;
4875
4876 BEGIN( yyextra->currentArgumentContext );
4877 }
4878
4879<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
4880 if (yyextra->currentArgumentContext==DefineEnd)
4881 {
4882
4883
4884 int i;for (i=(int)yyleng-1;i>=0;i--)
4885 {
4886 unput(yytext[i]);
4887 }
4890 BEGIN( yyextra->currentArgumentContext );
4891 }
4892 else
4893 {
4894
4895
4896 yyextra->fullArgString+=yytext;
4897 yyextra->lastCopyArgChar=0;
4898 yyextra->lastCommentInArgContext=YY_START;
4899 if (yytext[1]=='/')
4900 BEGIN( CopyArgCommentLine );
4901 else
4902 BEGIN( CopyArgComment );
4903 }
4904 }
4905
4906<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
4907<ReadFuncArgType,ReadTempArgs>{CCS} {
4908 yyextra->lastCContext = YY_START;
4909 BEGIN( SkipComment );
4910 }
4911<ReadFuncArgType,ReadTempArgs>{CPPC} {
4912 yyextra->lastCContext = YY_START;
4913 BEGIN( SkipCxxComment );
4914 }
4915
4916<ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
4917 REJECT;
4918 *yyextra->copyArgString+=yytext;
4919 yyextra->fullArgString+=yytext;
4920 }
4921<ReadFuncArgType,ReadTempArgs>"#" {
4922 if (!yyextra->insidePHP)
4923 REJECT;
4924 yyextra->lastCContext = YY_START;
4925 BEGIN( SkipCxxComment );
4926 }
4927 */
4928
4929<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
4931 if (yyextra->currentArgumentContext==DefineEnd)
4932 {
4933
4934
4935 int i;for (i=(int)yyleng-1;i>0;i--)
4936 {
4937 unput(yytext[i]);
4938 }
4939 *yyextra->copyArgString+=*yytext;
4940 yyextra->fullArgString+=*yytext;
4943 BEGIN( yyextra->currentArgumentContext );
4944 }
4945 else
4946 {
4947
4948
4949 yyextra->lastCopyArgChar=*yytext;
4952 yyextra->lastCommentInArgContext=YY_START;
4953 yyextra->fullArgString+=text;
4954 if (text.
find(
"//")!=-1)
4955 BEGIN( CopyArgCommentLine );
4956 else
4957 BEGIN( CopyArgComment );
4958 }
4959 }
4960<CopyArgComment>^{B}*"*"+/{BN}+
4961<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
4962<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
4963 if (yyextra->lastCopyArgChar!=0)
4964 unput(yyextra->lastCopyArgChar);
4965 BEGIN( yyextra->lastCommentInArgContext );
4966 }
4967<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
4969 if (yyextra->lastCopyArgChar!=0)
4970 unput(yyextra->lastCopyArgChar);
4971 BEGIN( yyextra->lastCommentInArgContext );
4972 }
4973<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
4974 yyextra->docBlockName="uml";
4975 yyextra->fullArgString+=yytext;
4976 BEGIN(CopyArgVerbatim);
4977 }
4978<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!)
4979 yyextra->docBlockName=&yytext[1];
4980 yyextra->fullArgString+=yytext;
4981 BEGIN(CopyArgVerbatim);
4982 }
4983<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
4984 yyextra->docBlockName=&yytext[1];
4985 if (yyextra->docBlockName.at(1)=='[')
4986 {
4987 yyextra->docBlockName.at(1)=']';
4988 }
4989 if (yyextra->docBlockName.at(1)=='{')
4990 {
4991 yyextra->docBlockName.at(1)='}';
4992 }
4993 if (yyextra->docBlockName.at(1)=='(')
4994 {
4995 yyextra->docBlockName.at(1)=')';
4996 }
4997 yyextra->fullArgString+=yytext;
4998 BEGIN(CopyArgVerbatim);
4999 }
5000<CopyArgVerbatim>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] { // end of verbatim block
5001 yyextra->fullArgString+=yytext;
5002 if (&yytext[4]==yyextra->docBlockName)
5003 {
5004 yyextra->docBlockName="";
5005 BEGIN(CopyArgCommentLine);
5006 }
5007 }
5008<CopyArgVerbatim>[\\@]("f$"|"f]"|"f}"|"f)") { // end of verbatim block
5009 yyextra->fullArgString+=yytext;
5010 if (yyextra->docBlockName==&yytext[1])
5011 {
5012 yyextra->docBlockName="";
5013 BEGIN(CopyArgCommentLine);
5014 }
5015 }
5016<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5017<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5018<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
5019<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5020<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5021 warn(yyextra->fileName,yyextra->yyLineNr,
5022 "Ignoring %cbrief command inside argument documentation",*yytext
5023 );
5024 yyextra->fullArgString+=' ';
5025 }
5026<ReadTempArgs>"<" {
5027 *yyextra->copyArgString+=*yytext;
5028 yyextra->fullArgString+=*yytext;
5029 yyextra->argSharpCount=1;
5030 BEGIN( CopyArgSharp );
5031 }
5032<ReadTempArgs>">" {
5033 *yyextra->copyArgString+=*yytext;
5034 yyextra->fullArgString+=*yytext;
5035
5036 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5037 BEGIN( yyextra->currentArgumentContext );
5038 }
5039<CopyArgRound>"(" {
5040 yyextra->argRoundCount++;
5041 *yyextra->copyArgString+=*yytext;
5042 yyextra->fullArgString+=*yytext;
5043 }
5044<CopyArgRound>")" {
5045 *yyextra->copyArgString+=*yytext;
5046 yyextra->fullArgString+=*yytext;
5047 if (yyextra->argRoundCount>0)
5048 yyextra->argRoundCount--;
5049 else
5050 BEGIN( yyextra->lastCopyArgContext );
5051 }
5052<CopyArgSquare>"[" {
5053 yyextra->argSquareCount++;
5054 *yyextra->copyArgString+=*yytext;
5055 yyextra->fullArgString+=*yytext;
5056 }
5057<CopyArgSquare>"]" {
5058 *yyextra->copyArgString+=*yytext;
5059 yyextra->fullArgString+=*yytext;
5060 if (yyextra->argSquareCount>0)
5061 yyextra->argSquareCount--;
5062 else
5063 BEGIN( yyextra->lastCopyArgContext );
5064 }
5065<CopyArgSharp>"(" {
5066 *yyextra->copyArgString+=*yytext;
5067 yyextra->fullArgString+=*yytext;
5068 yyextra->argRoundCount=0;
5069 yyextra->lastCopyArgContext = YY_START;
5070 BEGIN( CopyArgRound );
5071 }
5072<CopyArgSharp>"<" {
5073 yyextra->argSharpCount++;
5074
5075 *yyextra->copyArgString+=*yytext;
5076 yyextra->fullArgString+=*yytext;
5077 }
5078<CopyArgSharp>">" {
5079 *yyextra->copyArgString+=*yytext;
5080 yyextra->fullArgString+=*yytext;
5081 yyextra->argSharpCount--;
5082 if (yyextra->argSharpCount>0)
5083 {
5084
5085 }
5086 else
5087 {
5088 BEGIN( ReadTempArgs );
5089
5090 }
5091 }
5092<CopyArgString,CopyArgPHPString>\\. {
5093 *yyextra->copyArgString+=yytext;
5094 yyextra->fullArgString+=yytext;
5095 }
5096<CopyArgString>\" {
5097 *yyextra->copyArgString+=*yytext;
5098 yyextra->fullArgString+=*yytext;
5099 BEGIN( yyextra->lastCopyArgStringContext );
5100 }
5101<CopyArgPHPString>\' {
5102 *yyextra->copyArgString+=*yytext;
5103 yyextra->fullArgString+=*yytext;
5104 BEGIN( yyextra->lastCopyArgStringContext );
5105 }
5106<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5107 if (yyextra->insidePHP)
5108 {
5109 REJECT;
5110 }
5111 else
5112 {
5113 *yyextra->copyArgString+=yytext;
5114 yyextra->fullArgString+=yytext;
5115 }
5116 }
5117<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5118 *yyextra->copyArgString+=yytext;
5119 yyextra->fullArgString+=yytext;
5120 if (yyextra->insidePHP)
5121 {
5122 yyextra->lastCopyArgStringContext=YY_START;
5123 BEGIN(CopyArgPHPString);
5124 }
5125 }
5126<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5127 *yyextra->copyArgString+=yytext;
5128 yyextra->fullArgString+=yytext;
5129 }
5130<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5132 *yyextra->copyArgString+=*yytext;
5133 yyextra->fullArgString+=*yytext;
5134 }
5135<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5136 *yyextra->copyArgString+=yytext;
5137 yyextra->fullArgString+=yytext;
5138 }
5139<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5140 *yyextra->copyArgString+=*yytext;
5141 yyextra->fullArgString+=*yytext;
5142 }
5143
5144
5145
5146
5147
5148
5149<FuncRound>"(" { yyextra->current->args += *yytext ;
5150 ++yyextra->roundCount ;
5151 }
5152<FuncRound>")" { yyextra->current->args += *yytext ;
5153 if ( yyextra->roundCount )
5154 --yyextra->roundCount ;
5155 else
5156 BEGIN( FuncQual ) ;
5157 }
5158
5159<FuncQual>"#" { if (yyextra->insidePHP)
5160 REJECT;
5161 yyextra->lastCPPContext = YY_START;
5162 BEGIN(SkipCPP);
5163 }
5164 */
5165<FuncQual>[{:;,] {
5166 if (
qstrcmp(yytext,
";")==0 &&
5167 ((yyextra->insideJS || yyextra->insidePHP) &&
5169 {
5170 yyextra->current->reset();
5172 BEGIN( FindMembers );
5173 }
5174 else
5175 {
5176 unput(*yytext); BEGIN( SFunction );
5177 }
5178 }
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
5179<FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
5182 yyextra->current->args += " override ";
5183 }
5184<FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
5186 yyextra->current->spec.setOverride(true);
5187 yyextra->current->args += " override ";
5188 BEGIN(FuncQual);
5189 }
5190<FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
5192 yyextra->current->spec.setFinal(true);
5193 yyextra->current->args += " final ";
5194 BEGIN(FuncQual);
5195 }
5196<FuncQual>{BN}*"sealed"{BN}* { // sealed member function
5198 yyextra->current->spec.setSealed(true);
5199 yyextra->current->args += " sealed ";
5200 }
5201<FuncQual>{BN}*"new"{BN}* { // new member function
5203 yyextra->current->spec.setNew(true);
5204 yyextra->current->args += " new ";
5205 }
5206<FuncQual>{BN}*"const"{BN}* { // const member function
5208 yyextra->current->args += " const ";
5209 yyextra->current->argList.setConstSpecifier(
TRUE);
5210 }
5211<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
5213 yyextra->current->args += " volatile ";
5214 yyextra->current->argList.setVolatileSpecifier(
TRUE);
5215 }
5216<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
5218 yyextra->current->args += " noexcept ";
5219 yyextra->current->spec.setNoExcept(true);
5220 }
5221<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* { // noexcept(false) expression
5223 yyextra->current->args += " noexcept(false)";
5224 }
5225<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
5227 yyextra->current->args += " noexcept(";
5228 yyextra->current->spec.setNoExcept(true);
5229 yyextra->lastRoundContext=FuncQual;
5230 yyextra->pCopyRoundString=&yyextra->current->args;
5231 yyextra->roundCount=0;
5232 BEGIN(CopyRound);
5233 }
5234<FuncQual>{BN}*"&" {
5235 yyextra->current->args += " &";
5237 }
5238<FuncQual>{BN}*"&&" {
5239 yyextra->current->args += " &&";
5241 }
5242
5243<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
5245 yyextra->current->args += " = 0";
5247 yyextra->current->argList.setPureSpecifier(
TRUE);
5248 BEGIN(FuncQual);
5249 }
5250<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
5252 yyextra->current->args += " = delete";
5253 yyextra->current->spec.setDelete(true);
5254 yyextra->current->argList.setIsDeleted(
TRUE);
5255 BEGIN(FuncQual);
5256 }
5257<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
5259 yyextra->current->args += " = default";
5260 yyextra->current->spec.setDefault(true);
5261 BEGIN(FuncQual);
5262 }
5263<FuncQual>{BN}*"->"{BN}* {
5265 yyextra->current->argList.setTrailingReturnType(" -> ");
5266 yyextra->current->args += " -> ";
5267 yyextra->roundCount=0;
5268 BEGIN(TrailingReturn);
5269 }
5270<TrailingReturn>[{;] {
5271 if (yyextra->roundCount>0) REJECT;
5272 unput(*yytext);
5273 BEGIN(FuncQual);
5274 }
5275<TrailingReturn>"requires"{BN}+ {
5276 if (yyextra->insideJava) REJECT;
5277 yyextra->requiresContext = FuncQual;
5278 yyextra->current->req+=' ';
5279 BEGIN(RequiresClause);
5280 }
5281<TrailingReturn>"(" {
5282 yyextra->roundCount++;
5283 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5284 yyextra->current->args+=yytext;
5285 }
5286<TrailingReturn>")" {
5287 if (yyextra->roundCount>0)
5288 {
5289 yyextra->roundCount--;
5290 }
5291 else
5292 {
5293 warn(yyextra->fileName,yyextra->yyLineNr,
5294 "Found ')' without opening '(' for trailing return type '%s)...'",
5295 qPrint(yyextra->current->argList.trailingReturnType()));
5296 }
5297 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5298 yyextra->current->args+=yytext;
5299 }
5300<TrailingReturn>. {
5301 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5302 yyextra->current->args+=yytext;
5303 }
5304<TrailingReturn>\n {
5306 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5307 yyextra->current->args+=' ';
5308 }
5309<FuncRound,FuncFunc>{BN}*","{BN}* {
5311 yyextra->current->args += ", " ;
5312 }
5313<FuncQual,FuncRound,FuncFunc>{BN}+ {
5315 yyextra->current->args += ' ' ;
5316 }
5317<SFunction,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
5318 REJECT;
5319 yyextra->lastCPPContext = YY_START;
5320 BEGIN(SkipCPP);
5321 }
5322<FuncQual>"=" {
5323 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5324 {
5325 BEGIN(CliOverride);
5326 }
5327 else
5328 {
5329
5330 yyextra->lastInitializerContext=YY_START;
5331 yyextra->initBracketCount=0;
5332 yyextra->current->initializer.str(yytext);
5333 BEGIN(ReadInitializer);
5334 }
5335 }
5336<CliOverride>{ID} {
5337 }
5338<CliOverride>"{" {
5339 unput(*yytext);
5340 BEGIN(FuncQual);
5341 }
5342<CliOverride>\n {
5344 }
5345<CliOverride>. {
5346 }
5347<FuncQual>{ID} {
5348 if (yyextra->insideCpp &&
qstrcmp(yytext,
"requires")==0)
5349 {
5350
5351 yyextra->requiresContext = YY_START;
5352 yyextra->current->req+=' ';
5353 BEGIN(RequiresClause);
5354 }
5355 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
5356 {
5357
5358 yyextra->current->typeConstr.clear();
5359 yyextra->current->typeConstr.push_back(
Argument());
5360 yyextra->lastCSConstraint = YY_START;
5361 BEGIN( CSConstraintName );
5362 }
5364 {
5365 yyextra->current->args = yytext;
5366 yyextra->oldStyleArgType.clear();
5367 BEGIN(OldStyleArgs);
5368 }
5369 else
5370 {
5371 yyextra->current->args += yytext;
5372 }
5373 }
static bool checkForKnRstyleC(yyscan_t yyscanner)
5374<OldStyleArgs>[,;] {
5377 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5379 if (yyextra->current->doc!=yyextra->docBackup)
5380 {
5381 doc=yyextra->current->doc;
5382 yyextra->current->doc=yyextra->docBackup;
5383 }
5384 if (yyextra->current->brief!=yyextra->briefBackup)
5385 {
5386 brief=yyextra->current->brief;
5387 yyextra->current->brief=yyextra->briefBackup;
5388 }
5389 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5390 oldStyleArgName,brief,doc);
5391 yyextra->current->args.clear();
5392 if (*yytext==';') yyextra->oldStyleArgType.clear();
5393 }
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)
5394<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5395<OldStyleArgs>"{" {
5396 if (yyextra->current->argList.empty())
5397 {
5398 yyextra->current->argList.setNoParameters(
TRUE);
5399 }
5401 unput('{');
5402 BEGIN(FuncQual);
5403 }
5404<OldStyleArgs>. { yyextra->current->args += *yytext; }
5405<FuncQual,FuncRound,FuncFunc>\" {
5406 if (yyextra->insideIDL && yyextra->insideCppQuote)
5407 {
5408 BEGIN(EndCppQuote);
5409 }
5410 else
5411 {
5412 yyextra->current->args += *yytext;
5413 }
5414 }
5415<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5416<FuncQual>{BN}*"try:" |
5417<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
5418 yyextra->insideTryBlock=
TRUE;
5420 if (yytext[yyleng-1]==':')
5421 {
5422 unput(':');
5423 BEGIN( SFunction );
5424 }
5425 }
5426<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
5427 yyextra->current->exception = " throw (" ;
5428 yyextra->roundCount=0;
5430 BEGIN( ExcpRound ) ;
5431 }
5432<FuncQual>{BN}*"raises"{BN}*"(" {
5433 yyextra->current->exception = " raises (" ;
5435 yyextra->roundCount=0;
5436 BEGIN( ExcpRound ) ;
5437 }
5438<FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
5439 yyextra->current->exception = " throws " ;
5441 BEGIN( ExcpList );
5442 }
5443<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5444 ++yyextra->roundCount ;
5445 }
5446<ExcpRound>")" { yyextra->current->exception += *yytext ;
5447 if ( yyextra->roundCount )
5448 --yyextra->roundCount ;
5449 else
5450 BEGIN( FuncQual ) ;
5451 }
5452<ExcpRound>. {
5453 yyextra->current->exception += *yytext;
5454 }
5455<ExcpList>"{" {
5456 unput('{'); BEGIN( FuncQual );
5457 }
5458<ExcpList>";" {
5459 unput(';'); BEGIN( FuncQual );
5460 }
5461<ExcpList>"\n" {
5462 yyextra->current->exception += ' ';
5464 }
5465<ExcpList>. {
5466 yyextra->current->exception += *yytext;
5467 }
5468<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5469 yyextra->current->name = yyextra->current->args ;
5470 yyextra->current->args = yytext ;
5471 yyextra->roundCount=0;
5472 BEGIN( FuncRound ) ;
5473 }
5474<SFunction>":" {
5475 if (!yyextra->insidePHP) BEGIN(SkipInits);
5476 }
5477<SFunction>[;{,] {
5481 yyextra->current->fileName = yyextra->fileName;
5482 yyextra->current->startLine = yyextra->yyBegLineNr;
5483 yyextra->current->startColumn = yyextra->yyBegColNr;
5484 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5486 std::string type = yyextra->current->type.str();
5487 int ti=-1;
5489 {
5490 ti = (int)
match.position();
5491 }
5492 if (ti!=-1)
5493 {
5494 int di = yyextra->current->type.find("decltype(");
5495 if (di!=-1 && di<ti)
5496 {
5497 ti=-1;
5498 }
5499 }
5500 int ts=yyextra->current->type.find('<');
5501 int te=yyextra->current->type.findRev('>');
5502
5503
5504 bool startsWithTypedef = yyextra->current->type.startsWith("typedef ");
5505 bool isFunction = ti==-1 ||
5506 (ts!=-1 && ts<te && ts<ti && ti<te);
5507 bool isVariable = !yyextra->current->type.isEmpty() &&
5508 (!isFunction || startsWithTypedef);
5509
5510
5511
5512
5513 if (*yytext!=';' || yyextra->current_root->section.isCompound())
5514 {
5515 if (isVariable)
5516 {
5517
5518 if (yyextra->isTypedef && !startsWithTypedef)
5519 {
5520 yyextra->current->type.prepend("typedef ");
5521 }
5522 yyextra->current->section = EntryType::makeVariable() ;
5523 }
5524 else
5525 {
5526
5527 yyextra->current->section = EntryType::makeFunction() ;
5528 yyextra->current->proto = *yytext==';';
5529 }
5530 }
5531 else
5532 {
5533
5534 if (isVariable)
5535 {
5536 if (yyextra->isTypedef && !startsWithTypedef)
5537 {
5538 yyextra->current->type.prepend("typedef ");
5539 }
5540
5541 yyextra->current->section = EntryType::makeVariable();
5542 }
5543 else
5544 {
5545
5546 yyextra->current->section = EntryType::makeFunction();
5547 yyextra->current->proto =
TRUE;
5548 }
5549 }
5550
5551 if ( yyextra->insidePHP)
5552 {
5554 {
5555 yyextra->current->spec.setFinal(true);
5556 }
5558 {
5559 yyextra->current->spec.setAbstract(true);
5560 }
5561 }
5562 if ( yyextra->insidePHP && !
containsWord(yyextra->current->type,
"function"))
5563 {
5565 if ( *yytext == '{' )
5566 {
5567 yyextra->lastCurlyContext = FindMembers;
5568 yyextra->curlyCount=0;
5569 BEGIN( SkipCurly );
5570 }
5571 else
5572 {
5573 BEGIN( FindMembers );
5574 }
5575 }
5576 else
5577 {
5578 if ( yyextra->insidePHP)
5579 {
5581 }
5582 yyextra->previous = yyextra->current;
5583 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5585
5586 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
5587 {
5588 yyextra->current->spec.setOptional(true).setRequired(true);
5589 }
5590 yyextra->lastCurlyContext = FindMembers;
5591 if ( *yytext == ',' )
5592 {
5593 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
5594 }
5595 if ( *yytext == '{' )
5596 {
5597 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
5598 {
5599 yyextra->previous->spec.setInline(true);
5600 }
5601
5602 yyextra->curlyCount=0;
5603 BEGIN( SkipCurly ) ;
5604 }
5605 else
5606 {
5607 if (!yyextra->previous->section.isVariable())
5608 yyextra->previous->bodyLine=-1;
5609 BEGIN( FindMembers ) ;
5610 }
5611 }
5612 }
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
5613<SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
5615 yyextra->curlyCount=1;
5616 BEGIN(SkipC11Inits);
5617 }
5618<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
5620 yyextra->curlyCount=1;
5621 BEGIN(SkipC11Inits);
5622 }
5623<SkipC11Inits>"{" {
5624 ++yyextra->curlyCount;
5625 }
5626<SkipC11Inits>"}" {
5627 if ( --yyextra->curlyCount<=0 )
5628 {
5629 BEGIN(SkipInits);
5630 }
5631 }
5632<SkipC11Attribute>"]]" {
5633 BEGIN(yyextra->lastC11AttributeContext);
5634 }
5635<SkipInits>"{" { // C++11 style initializer
5636 unput('{');
5637 BEGIN( SFunction );
5638 }
5639<SkipCurly>"{" {
5640
5641 ++yyextra->curlyCount ;
5642 }
5643<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
5644<SkipCurly>"}" {
5645
5646 if( yyextra->curlyCount )
5647 {
5648 --yyextra->curlyCount ;
5649 }
5650 else
5651 {
5652 if (!yyextra->current->sli.empty() && yyextra->previous)
5653 {
5654 yyextra->previous->sli = yyextra->current->sli;
5655 yyextra->current->sli.clear();
5656 }
5657 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5658 BEGIN( yyextra->lastCurlyContext ) ;
5659 }
5660 }
5661<SkipCurly>"}"{BN}*{DCOMM}"<" {
5663 if ( yyextra->curlyCount )
5664 {
5665
5666 --yyextra->curlyCount ;
5667 }
5668 else
5669 {
5670 yyextra->current->endBodyLine=yyextra->yyLineNr;
5671 yyextra->tempEntry = yyextra->current;
5672 yyextra->current = yyextra->previous;
5673
5674 yyextra->docBlockContext = SkipCurlyEndDoc;
5675 yyextra->docBlockInBody =
FALSE;
5676 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5678 yyextra->docBlock.str(std::string());
5679 yyextra->docBlockTerm = '}';
5680 if (yytext[yyleng-3]=='/')
5681 {
5683 BEGIN( DocLine );
5684 }
5685 else
5686 {
5688 BEGIN( DocBlock );
5689 }
5690 }
5691 }
5692<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
5693 yyextra->docBlockContext = SkipCurlyEndDoc;
5694 yyextra->docBlockInBody =
FALSE;
5695 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5697 yyextra->docBlock.str(std::string());
5698 yyextra->docBlockTerm = '}';
5699 if (yytext[yyleng-3]=='/')
5700 {
5702 BEGIN( DocLine );
5703 }
5704 else
5705 {
5707 BEGIN( DocBlock );
5708 }
5709 }
5710<SkipCurlyEndDoc>"}" {
5711
5712 if (yyextra->tempEntry)
5713 {
5714 yyextra->current = yyextra->tempEntry;
5715 yyextra->tempEntry.reset();
5716 }
5717 BEGIN( yyextra->lastCurlyContext );
5718 }
5719<SkipCurly>\" {
5720
5721 yyextra->lastStringContext=SkipCurly;
5722 BEGIN( SkipString );
5723 }
5724<SkipCurly>^{B}*"#" {
5725 if (yyextra->insidePHP)
5726 REJECT;
5727
5728 BEGIN( SkipCurlyCpp );
5729 }
5730<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n {
5732
5733 }
5734<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
5735 if (!yyextra->insidePHP)
5736 {
5737 REJECT;
5738 }
5739 else
5740 {
5741 yyextra->lastHereDocContext = YY_START;
5742 BEGIN(HereDoc);
5743 }
5744 }
5745<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
5747 yyextra->lastRawStringContext = YY_START;
5748 yyextra->dummyRawString.clear();
5749 yyextra->pCopyRawString = &yyextra->dummyRawString;
5750 *yyextra->pCopyRawString += yytext;
5751 BEGIN(RawString);
5752 }
5753<SkipCurly,SkipCurlyCpp>[^\n#"'@\\/{}<\$]+ {
5755
5756 }
5757<SkipCurly,SkipCurlyCpp>"\$" {}
5758<SkipCurlyCpp>\n {
5759
5761 yyextra->lastCurlyContext = FindMembers;
5762 BEGIN( SkipCurly );
5763 }
5764<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
5765
5767 }
5768<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CCS} {
5769
5770 yyextra->lastCContext = YY_START;
5771 BEGIN(SkipComment);
5772 }
5773<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CPPC} {
5774
5775 yyextra->lastCContext = YY_START;
5776 BEGIN(SkipCxxComment);
5777 }
5778<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
5779 yyextra->roundCount=0;
5780 yyextra->lastSkipRoundContext=YY_START;
5781 BEGIN(SkipRound);
5782 }
5783<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
5784 yyextra->lastStringContext=YY_START;
5785 BEGIN( SkipString );
5786 }
5787<SkipInits>; {
5788 warn(yyextra->fileName,yyextra->yyLineNr,
5789 "Found ';' while parsing initializer list! "
5790 "(doxygen could be confused by a macro call without semicolon)"
5791 );
5792 BEGIN( FindMembers );
5793 }
5794<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
5795 if (!yyextra->insidePHP)
5796 REJECT;
5797
5798 yyextra->lastCContext = YY_START;
5799 BEGIN(SkipCxxComment);
5800 }
5801<SkipInits,SkipCurly,SkipCurlyCpp>@\" {
5802 if (!yyextra->insideCS) REJECT;
5803
5804
5805 yyextra->lastSkipVerbStringContext=YY_START;
5806 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
5807 yyextra->dummyTextStream.clear();
5808 BEGIN(SkipVerbString);
5809 }
5810<SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} {
5811 if (yyextra->insidePHP) REJECT;
5812 }
5813<SkipInits,SkipCurly,SkipCurlyCpp>\' {
5814 if (yyextra->insidePHP)
5815 {
5816 yyextra->lastStringContext=YY_START;
5817 BEGIN(SkipPHPString);
5818 }
5819 }
5820<SkipC11Attribute>{ID} {
5822 {
5823 yyextra->current->spec.setNoDiscard(true);
5824 }
5825 }
5826<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>. { }
5827<SkipString,SkipPHPString>\\. { }
5828<SkipString>\" {
5829 BEGIN( yyextra->lastStringContext );
5830 }
5831<SkipPHPString>\' {
5832 BEGIN( yyextra->lastStringContext );
5833 }
5834<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
5835<SkipString,SkipPHPString>\n {
5837 }
5838<SkipString>"[[" { }
5839<SkipString,SkipPHPString>. { }
5840<CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
5841 unput(':');
5842 BEGIN(ClassVar);
5843 }
5844<CompoundName>";" {
5845 yyextra->current->section = EntryType::makeEmpty() ;
5846 yyextra->current->type.clear() ;
5847 yyextra->current->name.clear() ;
5848 yyextra->current->args.clear() ;
5849 yyextra->current->argList.clear();
5850 BEGIN( FindMembers ) ;
5851 }
5852<Bases>";" {
5853 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
5854 {
5855
5856
5857 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
5858 {
5860 }
5861 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
5862
5863 if (!yyextra->baseName.isEmpty())
5864 {
5865 yyextra->current->extends.emplace_back(
5867 yyextra->baseName.clear();
5868 }
5869 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5871 }
5872 else
5873 {
5874 yyextra->current->section = EntryType::makeEmpty() ;
5875 yyextra->current->type.clear() ;
5876 yyextra->current->name.clear() ;
5877 yyextra->current->args.clear() ;
5878 yyextra->current->argList.clear();
5879 }
5880 BEGIN( FindMembers ) ;
5881 }
5882<CompoundName>{SCOPENAME}/{BN}*"<" {
5883 yyextra->sharpCount = 0;
5884 yyextra->current->name = yytext ;
5885 if (yyextra->current->spec.isProtocol())
5886 {
5887 yyextra->current->name+="-p";
5888 }
5890 yyextra->lastClassTemplSpecContext = ClassVar;
5891 if (yyextra->insideObjC)
5892 {
5893 BEGIN( ObjCProtocolList );
5894 }
5895 else if (yyextra->insideCS)
5896 {
5897
5898 BEGIN( CSGeneric );
5899 }
5900 else
5901 {
5902 yyextra->roundCount=0;
5903 BEGIN( ClassTemplSpec );
5904 }
5905 }
5906<CSGeneric>"<" {
5908
5909
5910 yyextra->current->tArgLists.
push_back(al);
5911 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
5912 yyextra->templateStr="<";
5913 yyextra->current->name += "<";
5914 yyextra->fullArgString = yyextra->templateStr;
5915 yyextra->copyArgString = &yyextra->current->name;
5916
5917 yyextra->currentArgumentContext = ClassVar;
5918 BEGIN( ReadTempArgs );
5919 }
5920<ObjCProtocolList>"<" {
5921 yyextra->insideProtocolList=
TRUE;
5922 BEGIN( Bases );
5923 }
5924<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
5925 yyextra->current->name += yytext;
5927 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
5928 {
5930 if (yyextra->current->spec.isProtocol())
5931 {
5932 unput('{');
5933 BEGIN( ClassVar );
5934 }
5935 else
5936 {
5937 BEGIN( yyextra->lastClassTemplSpecContext );
5938 }
5939 }
5940 }
5941<ClassTemplSpec>"<" {
5942 yyextra->current->name += yytext;
5943 if (yyextra->roundCount==0) yyextra->sharpCount++;
5944 }
5945<ClassTemplSpec>. {
5946 yyextra->current->name += yytext;
5947 }
5948<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" { // forward declaration?
5949 if (yyextra->insideCS && yyextra->current->type == "namespace")
5950 {
5951
5953 yyextra->current->name =
substitute(yytext,
".",
"::");
5954 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5955 yyextra->fakeNS++;
5956 unput('{');
5957 BEGIN( ClassVar );
5958 }
5959 else if (!yyextra->current->tArgLists.empty())
5960 {
5961
5962
5963 yyextra->current->name = yytext;
5964 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5965
5966 QCString rn = yyextra->current_root->name;
5967
5968 if (!yyextra->current->name.isEmpty() && !rn.
isEmpty())
5969 {
5971 }
5972 yyextra->current->spec.setForwardDecl(true);
5973 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5974 }
5975 else if (yyextra->insideIDL &&
5976 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
5977 yyextra->current->spec.isInterface()) ||
5978 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
5979 yyextra->current->spec.isService())
5980 )
5981 )
5982 {
5983
5984
5985
5986
5987 yyextra->current->name = yytext;
5988 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5989 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
5991
5992 yyextra->current->spec.setInterface(false).setService(false);
5993
5994
5995
5996 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5997 }
5998
5999 if (!(yyextra->insideCS && yyextra->current->type == "namespace"))
6000 {
6001 unput(';');
6002 yyextra->current->reset();
6004 if (yyextra->insideObjC)
6005 {
6007 yyextra->insideObjC =
FALSE;
6008 }
6009 if (yyextra->isTypedef)
6010 {
6011 yyextra->current->type.prepend("typedef");
6012 }
6013 BEGIN( FindMembers );
6014 }
6015 }
6016<CompoundName>{SCOPENAME}/{BN}*"(" {
6017 yyextra->current->name = yytext ;
6019 if (yyextra->insideCpp && yyextra->current->name=="alignas")
6020 {
6021 yyextra->lastAlignAsContext = YY_START;
6022 BEGIN( AlignAs );
6023 }
6024 else
6025 {
6026 if (yyextra->current->spec.isProtocol())
6027 {
6028 yyextra->current->name += "-p";
6029 }
6030 BEGIN( ClassVar );
6031 }
6032 }
6033<AlignAs>"(" { yyextra->roundCount=0;
6034 BEGIN( AlignAsEnd );
6035 }
6036<AlignAs>\n { lineCount(yyscanner); }
6037<AlignAs>.
6038<AlignAsEnd>"(" { yyextra->roundCount++; }
6039<AlignAsEnd>")" { if (--yyextra->roundCount<0)
6040 {
6041 BEGIN( yyextra->lastAlignAsContext );
6042 }
6043 }
6044<AlignAsEnd>\n { lineCount(yyscanner); }
6045<AlignAsEnd>.
6046<ConceptName>{ID} {
6047 yyextra->current->name = yytext ;
6048 }
6049<ConceptName>"=" {
6050 yyextra->current->bodyLine = yyextra->yyLineNr;
6051 yyextra->current->bodyColumn = yyextra->yyColNr;
6052 yyextra->current->initializer.str(std::string());
6053 yyextra->lastInitializerContext = FindMembers;
6054 yyextra->initBracketCount=0;
6055 BEGIN(ReadInitializer);
6056 }
6057<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
6058
6059 yyextra->current->reset();
6061 }
6062<CompoundName>{SCOPENAME} {
6063 yyextra->current->name = yytext ;
6066 if (yyextra->current->spec.isProtocol())
6067 {
6068 yyextra->current->name += "-p";
6069 }
6070 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6071 {
6072 unput('{');
6073 }
6074 BEGIN( ClassVar );
6075 }
6076<CompoundName>{CSSCOPENAME} { // C# style scope
6077 yyextra->current->name =
substitute(yytext,
".",
"::");
6079 BEGIN( ClassVar );
6080 }
6081<ClassVar>{SCOPENAME}{BNopt}/"(" {
6082 if (yyextra->insideIDL &&
qstrncmp(yytext,
"switch",6)==0 && !
isId(yytext[6]))
6083 {
6084
6085 yyextra->roundCount=0;
6086 BEGIN(SkipUnionSwitch);
6087 }
6088 else
6089 {
6091 yyextra->yyBegColNr=yyextra->yyColNr;
6092 yyextra->yyBegLineNr=yyextra->yyLineNr;
6093 yyextra->current->name = yytext;
6094 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6096 BEGIN( FindMembers );
6097 }
6098 }
6099<ClassVar>"," {
6100 if (yyextra->isTypedef)
6101 {
6102
6103 unput(',');
6104 yyextra->current->type.prepend("typedef ");
6105 BEGIN(FindMembers);
6106 }
6107 else
6108 {
6109
6110 }
6111 }
6112<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6113 if (yyextra->insideCli)
6114 {
6115 if (yytext[0]=='s')
6116 yyextra->current->spec.setSealedClass(true);
6117 else
6118 yyextra->current->spec.setAbstractClass(true);
6119 BEGIN( ClassVar );
6120 }
6121 else
6122 {
6123 REJECT;
6124 }
6125 }
6126<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6127 yyextra->yyBegColNr=yyextra->yyColNr;
6128 yyextra->yyBegLineNr=yyextra->yyLineNr;
6131 if (yyextra->current->section.isEnum())
6132 {
6133 yyextra->current->section = EntryType::makeVariable() ;
6134 }
6135 yyextra->current->type += ' ' ;
6136 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...
6138
6140 {
6141 BEGIN( Operator );
6142 }
6143 }
6144<ClassVar>{ID} {
6145 yyextra->yyBegColNr=yyextra->yyColNr;
6146 yyextra->yyBegLineNr=yyextra->yyLineNr;
6148 if (yyextra->insideIDL &&
qstrcmp(yytext,
"switch")==0)
6149 {
6150
6151 yyextra->roundCount=0;
6152 BEGIN(SkipUnionSwitch);
6153 }
6154 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
qstrcmp(yytext,
"implements")==0 ||
qstrcmp(yytext,
"extends")==0))
6155 {
6156 yyextra->current->type.clear();
6159 yyextra->baseName.clear();
6160 BEGIN( BasesProt ) ;
6161 }
6162 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
6163 {
6164 yyextra->current->typeConstr.clear();
6165 yyextra->current->typeConstr.push_back(
Argument());
6166 yyextra->lastCSConstraint = YY_START;
6167 BEGIN( CSConstraintName );
6168 }
6169 else if (yyextra->insideCli &&
qstrcmp(yytext,
"abstract")==0)
6170 {
6171 yyextra->current->spec.setAbstract(true);
6172 }
6173 else if (yyextra->insideCli &&
qstrcmp(yytext,
"sealed")==0)
6174 {
6175 yyextra->current->spec.setSealed(true);
6176 }
6177 else if (
qstrcmp(yytext,
"final")==0)
6178 {
6179 yyextra->current->spec.setFinal(true);
6180 }
6181 else
6182 {
6183 if (yyextra->current->section.isEnum())
6184 {
6185 yyextra->current->section = EntryType::makeVariable() ;
6186 }
6187 yyextra->current->type += ' ' ;
6188 yyextra->current->type += yyextra->current->name ;
6189 yyextra->current->name = yytext ;
6190
6192 {
6193 BEGIN( Operator );
6194 }
6195 }
6196 }
6197<ClassVar>[(\[] {
6198 if (yyextra->insideObjC && *yytext=='(')
6199 {
6200 yyextra->current->name+='(';
6201
6202
6203 yyextra->current->spec.setCategory(true);
6204
6205 BEGIN( ClassCategory );
6206 }
6207 else
6208 {
6209
6210 unput(*yytext);
6211 BEGIN( FindMembers );
6212 }
6213 }
6214<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
6215<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
6216 yyextra->fullArgString.clear();
6217 yyextra->lastCopyArgChar='#';
6218 yyextra->lastCommentInArgContext=YY_START;
6219 if (yytext[1]=='/')
6220 BEGIN( CopyArgCommentLine );
6221 else
6222 BEGIN( CopyArgComment );
6223 }
6224<CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
6225 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6226 }
6227<CSConstraintType>"=>" { // end of type constraint reached
6228
6230 unput('>');
6231 unput('=');
6232 BEGIN( yyextra->lastCSConstraint );
6233 }
6234<CSConstraintType>"{" { // end of type constraint reached
6235
6237 unput('{');
6238 BEGIN( yyextra->lastCSConstraint );
6239 }
6240<CSConstraintType,CSConstraintName>";" {
6242 unput(';');
6243 BEGIN( yyextra->lastCSConstraint );
6244 }
6245<CSConstraintName>":" {
6246 BEGIN( CSConstraintType );
6247 }
6248<CSConstraintName>{ID} {
6249
6250 yyextra->current->typeConstr.back().name=yytext;
6251 }
6252<CSConstraintType>"where" { // another constraint for a different param
6253 yyextra->current->typeConstr.push_back(
Argument());
6254 BEGIN( CSConstraintName );
6255 }
6256<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6257 if (yyextra->current->typeConstr.back().type.isEmpty())
6258
6259 {
6260 yyextra->current->typeConstr.back().type=yytext;
6261 }
6262 else
6263 {
6264 QCString name = yyextra->current->typeConstr.back().name;
6265 yyextra->current->typeConstr.push_back(
Argument());
6266 yyextra->current->typeConstr.back().name=name;
6267 yyextra->current->typeConstr.back().type=yytext;
6268 }
6269 }
6270<CSConstraintName,CSConstraintType>\n {
6272 }
6273<CSConstraintName,CSConstraintType>. {
6274 }
6275<ClassCategory>{ID} {
6276 yyextra->current->name+=yytext;
6277 }
6278<ClassCategory>")"/{BN}*"{" {
6279 yyextra->current->name+=')';
6280 BEGIN( ClassVar );
6281 }
6282<ClassCategory>")"/{BN}*"<" {
6283 yyextra->current->name+=')';
6284 BEGIN( ObjCProtocolList );
6285 }
6286<ClassCategory>")" {
6287 yyextra->current->name+=')';
6288 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6289 {
6290 unput('{');
6291 }
6292 else
6293 {
6294 unput('}');
6295 unput('{');
6296 }
6297 BEGIN( ClassVar );
6298 }
6299<ClassVar>":" {
6300 if (yyextra->current->section.isVariable())
6301 {
6302 yyextra->current->bitfields+=":";
6303 yyextra->current->args.clear();
6304 BEGIN(BitFields);
6305 }
6306 else if (yyextra->current->section.isEnum())
6307
6308 {
6309 yyextra->current->args.clear();
6310 BEGIN(EnumBaseType);
6311 }
6312 else
6313 {
6314 yyextra->current->type.clear();
6315 if (yyextra->current->spec.isInterface() ||
6316 yyextra->current->spec.isStruct() ||
6317 yyextra->current->spec.isRef() ||
6318 yyextra->current->spec.isValue() ||
6319 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6320 )
6321 {
6323 }
6324 else
6325 {
6327 }
6329 yyextra->baseName.clear();
6330 BEGIN( BasesProt ) ;
6331 }
6332 }
6333<ClassVar>[;=*&] {
6334 if (yyextra->isTypedef)
6335 {
6336 yyextra->current->type.prepend("typedef");
6337 }
6338 if ((yytext[0]=='*' || yytext[0]=='&') && yyextra->current->section.isEnum())
6339 {
6340 yyextra->current->section = EntryType::makeVariable() ;
6341 }
6342 if (yytext[0]==';' && yyextra->current->section.isEnum())
6343 {
6344 yyextra->current->reset();
6346 }
6347 else
6348 {
6349 unput(*yytext);
6350 }
6351 BEGIN( FindMembers );
6352 }
6353<Bases,ClassVar>{CPPC}"/"/[^/] {
6354 if (!yyextra->insideObjC)
6355 {
6356 REJECT;
6357 }
6358 else
6359 {
6361 yyextra->current->program << yytext;
6362 yyextra->current->fileName = yyextra->fileName ;
6363 yyextra->current->startLine = yyextra->yyLineNr ;
6364 yyextra->current->startColumn = yyextra->yyColNr;
6365 yyextra->curlyCount=0;
6366 BEGIN( ReadBodyIntf );
6367 }
6368 }
6369<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6370<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6371<Bases,ClassVar>{CPPC}"!" |
6372<Bases,ClassVar>[\-+]{BN}* {
6373 if (!yyextra->insideObjC)
6374 {
6375 REJECT;
6376 }
6377 else
6378 {
6380 yyextra->current->program << yytext;
6381 yyextra->current->fileName = yyextra->fileName ;
6382 yyextra->current->startLine = yyextra->yyLineNr ;
6383 yyextra->current->startColumn = yyextra->yyColNr;
6384 yyextra->curlyCount=0;
6385 BEGIN( ReadBodyIntf );
6386 }
6387 }
6388<CompoundName,ClassVar>{B}*"{"{B}* {
6389 yyextra->current->program.str(std::string());
6390 yyextra->current->fileName = yyextra->fileName ;
6391 yyextra->current->bodyLine = yyextra->yyLineNr;
6392 yyextra->current->bodyColumn = yyextra->yyColNr;
6394 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef)
6395 {
6396 if (yyextra->current->section.isNamespace())
6397 {
6399 {
6400 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6401 }
6402 else
6403 {
6405 }
6406 }
6407 else
6408 {
6410 }
6411 }
6412 yyextra->curlyCount=0;
6413 if (yyextra->current_root &&
6414 !yyextra->current_root->spec.isInterface() &&
6415 (yyextra->current->spec.isInterface() ||
6416 yyextra->current->spec.isProtocol() ||
6417 yyextra->current->spec.isCategory() ||
6418 yyextra->current->section.isObjcImpl()
6419 ) &&
6420 yyextra->insideObjC
6421 )
6422 {
6423 BEGIN( ReadBodyIntf );
6424 }
6425 else if (yyextra->current->section.isNamespace())
6426 {
6427 BEGIN( ReadNSBody );
6428 }
6429 else
6430 {
6431 BEGIN( ReadBody ) ;
6432 }
6433 }
QCString stripPath(const QCString &s)
6434<BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6435<BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6436<BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6437<BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6438<BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6439<BasesProt>{BN} { lineCount(yyscanner); }
6440<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6441<Bases>"decltype"{BN}*"(" {
6443 yyextra->roundCount=0;
6444 yyextra->lastSkipRoundContext=YY_START;
6445 BEGIN(SkipRound);
6446 }
6447<Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
6448 if (!yyextra->insidePHP)
6449 {
6450 REJECT;
6451 }
6452 else
6453 {
6457 yyextra->baseName += bn;
6458 yyextra->current->args += ' ';
6459 yyextra->current->args += yytext;
6460 }
6461 }
6462<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6466 {
6467
6468 yyextra->current->typeConstr.clear();
6469 yyextra->current->typeConstr.push_back(
Argument());
6470 yyextra->lastCSConstraint = YY_START;
6471 BEGIN( CSConstraintName );
6472 }
6473 else
6474 {
6475 yyextra->baseName+=yytext;
6476 yyextra->current->args += ' ';
6477 yyextra->current->args += yytext;
6478 }
6479 }
6480<Bases>{BN}*{ID}("."{ID})* { // Java style class
6482 yyextra->baseName += name;
6483 yyextra->current->args += ' ';
6484 yyextra->current->args += name;
6485 }
6486<ClassVar,Bases>\n/{BN}*[^{, \t\n] {
6487 if (!yyextra->insideObjC)
6488 {
6489 REJECT;
6490 }
6491 else
6492 {
6494 unput('{');
6495 }
6496 }
6497<ClassVar,Bases>"@end" { // empty ObjC interface
6498 unput('d');
6499 unput('n');
6500 unput('e');
6501 unput('@');
6502 unput('}');
6503 unput('{');
6504 }
6505<ClassVar>"<" { yyextra->current->name += *yytext;
6506 yyextra->sharpCount=1;
6507 yyextra->roundCount=0;
6508 yyextra->lastSkipSharpContext = YY_START;
6509 yyextra->specName = &yyextra->current->name;
6510 BEGIN ( Specialization );
6511 }
6512<Bases>{BN}*"<" {
6514 yyextra->sharpCount=1;
6515 yyextra->roundCount=0;
6516 yyextra->lastSkipSharpContext = YY_START;
6517 if (yyextra->insideObjC)
6518 {
6519 unput(',');
6520 }
6521 else
6522 {
6523
6524
6525
6526
6527 yyextra->templateStr = yytext;
6528 yyextra->specName = &yyextra->templateStr;
6529 BEGIN ( Specialization );
6530 }
6531 }
6532<Specialization>"<" { *yyextra->specName += *yytext;
6533 if (yyextra->roundCount==0) yyextra->sharpCount++;
6534 }
6535<Specialization>">" {
6536 *yyextra->specName += *yytext;
6537 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6538 {
6540 BEGIN(yyextra->lastSkipSharpContext);
6541 }
6542 }
6543<Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6544<Specialization>"<<" { *yyextra->specName += yytext; }
6545<Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6546 unput('>');
6547 unput(' ');
6548 unput('>');
6549 }
6550<Specialization>">>" {
6551 if (yyextra->insideCS)
6552 {
6553 REJECT;
6554 }
6555 else
6556
6557
6558
6559
6560 {
6561 if (yyextra->roundCount>0)
6562 {
6563 *yyextra->specName += yytext;
6564 }
6565 else
6566 {
6567 unput('>');
6568 unput(' ');
6569 unput('>');
6570 }
6571 }
6572 }
6573<Specialization>"typename"{BN}+ { lineCount(yyscanner); }
6574<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
6575<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
6576
6577<Specialization>"\\\\" { *yyextra->specName += *yytext;}
6578<Specialization>"\\'" { *yyextra->specName += *yytext;}
6579<Specialization>"\\\"" { *yyextra->specName += *yytext;}
6580<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
6581<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
6582<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
6583<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
6584<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6585<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
6586<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6587<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
6588
6589<Specialization>. {
6590 *yyextra->specName += *yytext;
6591 }
6592<SkipRound>"(" { ++yyextra->roundCount; }
6593<SkipRound>")" { if (--yyextra->roundCount<0)
6594 BEGIN ( yyextra->lastSkipRoundContext );
6595 }
6596<SkipRound>\" {
6597 yyextra->lastStringContext=SkipRound;
6598 BEGIN(SkipString);
6599 }
6600<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
6601 if (yyextra->insideProtocolList)
6602 {
6603 yyextra->baseName+="-p";
6604 }
6605 else
6606 {
6607 yyextra->current->args += ',' ;
6608 }
6610 if (!yyextra->baseName.isEmpty())
6611 {
6612 yyextra->current->extends.emplace_back(
6613 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6614 );
6615 }
6616 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
6617 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
6618 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
6619 {
6621 }
6622 else
6623 {
6625 }
6627 yyextra->baseName.clear();
6628 if (*yytext=='>')
6629 {
6630 yyextra->insideProtocolList=
FALSE;
6631 if (yyleng==1)
6632 {
6633 unput('{');
6634 }
6635 else
6636 {
6637 yyless(1);
6638 }
6639 }
6640 else
6641 {
6642 if (*yytext==',' && yyextra->insideObjC)
6643 {
6644 yyextra->insideProtocolList=
TRUE;
6645 }
6646 BEGIN(BasesProt);
6647 }
6648 }
6649<Bases>{B}*"{"{B}* {
6650 yyextra->current->program.str(std::string());
6651 yyextra->current->fileName = yyextra->fileName ;
6652 yyextra->current->bodyLine = yyextra->yyLineNr;
6653 yyextra->current->bodyColumn = yyextra->yyColNr;
6655 if (!yyextra->baseName.isEmpty())
6656 yyextra->current->extends.emplace_back(
6657 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6658 );
6659 yyextra->curlyCount=0;
6660 if (yyextra->insideObjC)
6661 {
6662 BEGIN( ReadBodyIntf );
6663 }
6664 else
6665 {
6666 BEGIN( ReadBody ) ;
6667 }
6668 }
6669<SkipUnionSwitch>{B}*"(" {
6670 yyextra->roundCount++;
6671 }
6672<SkipUnionSwitch>")" {
6673 if (--yyextra->roundCount==0)
6674 {
6675 BEGIN(ClassVar);
6676 }
6677 }
6678<SkipUnionSwitch>\n { lineCount(yyscanner); }
6679<SkipUnionSwitch>.
6680<Comment>{BN}+ { yyextra->current->program << yytext ;
6682 }
6683<Comment>{CCS} { yyextra->current->program << yytext ; }
6684<Comment>{CPPC} { yyextra->current->program << yytext ; }
6685<Comment>{CMD}("code"|"verbatim"|"iliteral") {
6686 if (yyextra->doxygenComment) yyextra->insideCode=
TRUE;
6687 yyextra->current->program << yytext ;
6688 }
6689<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
6690 if (yyextra->doxygenComment) yyextra->insideCode=
FALSE;
6691 yyextra->current->program << yytext ;
6692 }
6693<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
6694<Comment>{CCE} { yyextra->current->program << yytext ;
6695 if (!yyextra->insideCode)
6696 {
6697 yyextra->doxygenComment=false;
6698 BEGIN( yyextra->lastContext );
6699 }
6700 }
6701<Comment>. { yyextra->current->program << *yytext ; }
6702
6703<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
6704
6705 if (!yyextra->current->doc.isEmpty())
6706 {
6707 yyextra->current->doc+="\n\n";
6708 }
6709 else
6710 {
6711 yyextra->current->docLine = yyextra->yyLineNr;
6712 yyextra->current->docFile = yyextra->fileName;
6713 }
6714
6715 yyextra->lastDocContext = YY_START;
6716 if (yyextra->current_root->section.isScope())
6717 {
6718 yyextra->current->inside = yyextra->current_root->name+"::";
6719 }
6720 yyextra->docBlockContext = YY_START;
6721 yyextra->docBlockInBody = YY_START==SkipCurly;
6723
6726 yyextra->docBlock.str(indent.
str());
6727
6728 if (yyextra->docBlockAutoBrief)
6729 {
6730 yyextra->current->briefLine = yyextra->yyLineNr;
6731 yyextra->current->briefFile = yyextra->fileName;
6732 }
6734 BEGIN( DocBlock );
6735 }
6736<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
6739
6740 if( javadocBanner )
6741 {
6742 yyextra->lastDocContext = YY_START;
6743
6744
6745 if (yyextra->current_root->section.isScope())
6746 {
6747 yyextra->current->inside = yyextra->current_root->name+"::";
6748 }
6749 yyextra->current->docLine = yyextra->yyLineNr;
6750 yyextra->current->docFile = yyextra->fileName;
6751 yyextra->docBlockContext = YY_START;
6752 yyextra->docBlockInBody = YY_START==SkipCurly;
6754 yyextra->docBlockAutoBrief = javadocAutoBrief;
6755
6758 yyextra->docBlock.str(indent.
str());
6759
6760 if (yyextra->docBlockAutoBrief)
6761 {
6762 yyextra->current->briefLine = yyextra->yyLineNr;
6763 yyextra->current->briefFile = yyextra->fileName;
6764 }
6766 BEGIN( DocBlock );
6767 }
6768 else
6769 {
6770 yyextra->current->program << yytext ;
6771 yyextra->lastContext = YY_START ;
6772 yyextra->doxygenComment=true;
6773 BEGIN( Comment ) ;
6774 }
6775 }
6776<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6778 yyextra->yyColNr=1;
6779 REJECT;
6780 }
6781<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6782 yyextra->lastDocContext = YY_START;
6783
6784
6785 if (yyextra->current_root->section.isScope())
6786 {
6787 yyextra->current->inside = yyextra->current_root->name+"::";
6788 }
6789 yyextra->current->docLine = yyextra->yyLineNr;
6790 yyextra->current->docFile = yyextra->fileName;
6791 yyextra->docBlockContext = YY_START;
6792 yyextra->docBlockInBody = YY_START==SkipCurly;
6794 yyextra->docBlockAutoBrief = javadocAutoBrief;
6795
6798 yyextra->docBlock.str(indent.
str());
6799
6800 if (yyextra->docBlockAutoBrief)
6801 {
6802 yyextra->current->briefLine = yyextra->yyLineNr;
6803 yyextra->current->briefFile = yyextra->fileName;
6804 }
6806 BEGIN( DocBlock );
6807 }
6808<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
6809 yyextra->lastDocContext = YY_START;
6810 if (yyextra->current_root->section.isScope())
6811 {
6812 yyextra->current->inside = yyextra->current_root->name+"::";
6813 }
6814 yyextra->docBlockContext = YY_START;
6815 yyextra->docBlockInBody = YY_START==SkipCurly;
6816 yyextra->docBlockAutoBrief =
FALSE;
6817
6820 yyextra->docBlock.str(indent.
str());
6821
6823 BEGIN( DocLine );
6824 }
6825<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
6826 yyextra->lastDocContext = YY_START;
6827 if (yyextra->current_root->section.isScope())
6828 {
6829 yyextra->current->inside = yyextra->current_root->name+"::";
6830 }
6831 yyextra->docBlockContext = YY_START;
6832 yyextra->docBlockInBody = YY_START==SkipCurly;
6833 yyextra->docBlockAutoBrief =
FALSE;
6836 yyextra->docBlock.str(indent.
str());
6838 BEGIN( DocLine );
6839 }
6840<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
6842 yyextra->externLinkage=
TRUE;
6843 }
6844<FindMembers>"{" {
6845 if (yyextra->externLinkage)
6846 {
6847 yyextra->externLinkage=
FALSE;
6848 }
6849 else if (yyextra->insideCS &&
6850 !yyextra->current->name.isEmpty() &&
6851 !yyextra->current->type.isEmpty())
6852 {
6854 {
6856 }
6858 {
6860 }
6861 else
6862 {
6864 }
6865 yyextra->current->bodyLine = yyextra->yyLineNr;
6866 yyextra->current->bodyColumn = yyextra->yyColNr;
6867 yyextra->curlyCount=0;
6868 BEGIN( CSAccessorDecl );
6869 }
6870 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
6871 {
6872
6873
6874 yyextra->current->exception = " {";
6875 BEGIN(UNOIDLAttributeBlock);
6876 }
6877 else
6878 {
6879 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
6880 yyextra->current->name.isEmpty()
6881 )
6882 {
6883
6884 yyextra->needsSemi =
FALSE;
6885 if (yyextra->current->isStatic)
6886 {
6887 yyextra->current->name="[static initializer]";
6888 yyextra->current->type.clear();
6889 }
6890 else
6891 {
6892 yyextra->current->name="[instance initializer]";
6893 }
6894 unput(*yytext);
6895 BEGIN( SFunction );
6896 }
6897 else
6898 {
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909 yyextra->current->bodyLine = yyextra->yyLineNr;
6910 yyextra->current->bodyColumn = yyextra->yyColNr;
6911 yyextra->current->initializer.str(yytext);
6912 yyextra->lastInitializerContext = YY_START;
6913 yyextra->initBracketCount=1;
6914 BEGIN(ReadInitializer);
6915 }
6916 }
6917 }
6918<CSAccessorDecl>"{" { yyextra->curlyCount++; }
6919<CSAccessorDecl>"}"{B}*"=" {
6920
6921 if (yyextra->curlyCount != 0) REJECT;
6922 yyextra->current->initializer.str("=");
6923 yyextra->current->endBodyLine=yyextra->yyLineNr;
6924 yyextra->lastInitializerContext = FindMembers;
6925 BEGIN(ReadInitializer);
6926 }
6927<CSAccessorDecl>"}" {
6928 if (yyextra->curlyCount)
6929 {
6930 yyextra->curlyCount--;
6931 }
6932 else
6933 {
6936
6937 yyextra->current->endBodyLine=yyextra->yyLineNr;
6938 unput(';');
6939 BEGIN(FindMembers);
6940 }
6941 }
6942<CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(true); }
6943<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(true); }
6944<CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(true); }
6945<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(true); }
6946<CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(true); }
6947<CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(true); }
6948<CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(true); }
6949<CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(true); }
6950<CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(true); }
6951<CSAccessorDecl>"\"" { BEGIN(CSString);}
6952<CSAccessorDecl>"." {}
6953<CSAccessorDecl>\n { lineCount(yyscanner); }
6954<CSString>"\"" { BEGIN(CSAccessorDecl);}
6955<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
6956<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
6957<CSString>\n { lineCount(yyscanner); }
6958<CSString>"." {}
6959
6960
6961
6962<SliceSequence>{SCOPENAME} {
6963 if (yyextra->current->spec.isLocal())
6964 {
6965 yyextra->current->type = "local ";
6966 }
6967 yyextra->current->type += "sequence<";
6968 yyextra->current->type += yytext;
6969 yyextra->current->type += ">";
6970 }
6971
6972<SliceSequence>{BN}*">"{BN}* {
6974 BEGIN(SliceSequenceName);
6975 }
6976
6977<SliceSequenceName>{ID}{BN}* {
6979 yyextra->current->name = yytext ;
6980 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6981 }
6982
6983<SliceSequenceName>";" {
6984 yyextra->current->section = EntryType::makeVariable();
6985 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6987 BEGIN(FindMembers);
6988 }
6989
6990<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
6992 if (yyextra->current->spec.isLocal())
6993 {
6994 yyextra->current->type = "local ";
6995 }
6996 yyextra->current->type += "dictionary<";
6997 yyextra->current->type += yytext;
6998 yyextra->current->type += ">";
6999 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7000 }
7001
7002<SliceDictionary>{BN}*">"{BN}* {
7004 BEGIN(SliceDictionaryName);
7005 }
7006
7007<SliceDictionaryName>{ID}{BN}* {
7009 yyextra->current->name = yytext ;
7010 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7011 }
7012
7013<SliceDictionaryName>";" {
7014 yyextra->current->section = EntryType::makeVariable();
7015 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7017 BEGIN(FindMembers);
7018 }
7019
7020
7021
7022
7023
7024
7025<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
7026 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
7027 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7029 }
7030<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
7031 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7032 BEGIN( yyextra->docBlockContext );
7033 }
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
7034<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
7035 yyextra->docBlock << yytext;
7036 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7037 BEGIN( yyextra->docBlockContext );
7038 }
7039<DocLine>{NONLopt}/"\n" { // whole line
7040 yyextra->docBlock << yytext;
7041 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7042 BEGIN( yyextra->docBlockContext );
7043 }
7044
7045
7046
7047<DocBlock>"*"*{CCE} { // end of comment block
7049 BEGIN(yyextra->docBlockContext);
7050 }
7051<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7054 yyextra->docBlock << "\\ilinebr " << indent;
7055 }
7056<DocBlock>^{B}*"*"+/[^/] {
7059 yyextra->docBlock << indent;
7060 }
7061<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
7064 yyextra->docBlock << indent;
7065 }
7066<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
7067 }
7068<DocBlock>{CPPC} { // slashes in the middle of a comment block
7069 yyextra->docBlock << yytext;
7070 }
7071<DocBlock>{CCS} { // start of a new comment in the
7072
7073 yyextra->docBlock << yytext;
7074 }
7075<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
7076 yyextra->docBlock << yytext;
7077 }
7078<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7079 yyextra->docBlock << yytext;
7080 char blockName[] = "f$";
7081 char c = yytext[2];
7082 if (c=='[') blockName[1]=']';
7083 else if (c=='{') blockName[1]='}';
7084 else if (c=='(') blockName[1]=')';
7086 BEGIN(DocCopyBlock);
7087 }
static void startVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7088<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7089 yyextra->fileName = &yytext[6];
7090 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7091 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7092 yyextra->docBlock << yytext;
7093 }
7094<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7095 yyextra->fileName = &yytext[6];
7096 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7097 yyextra->docBlock << yytext;
7098 }
7099<DocBlock>{CMD}"iline"{LINENR}{B} {
7100 bool ok = false;
7102 if (!ok)
7103 {
7104 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '%s' for iline command",yytext);
7105 }
7106 else
7107 {
7108 yyextra->yyLineNr = nr;
7109 }
7110 yyextra->docBlock << yytext;
7111 }
7112<DocBlock>{B}*"<"{PRE}">" {
7113 yyextra->docBlock << yytext;
7115 BEGIN(DocCopyBlock);
7116 }
7117<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7118 yyextra->docBlock << yytext;
7120 BEGIN(DocCopyBlock);
7121 }
7122<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7123 yyextra->docBlock << yytext;
7125 BEGIN(DocCopyBlock);
7126 }
7127<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7129 yyextra->docBlock << "\\ilinebr ";
7130 yyextra->docBlock << pat;
7132 BEGIN(DocCopyBlock);
7133 }
7134<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7136 yyextra->docBlock << pat;
7138 BEGIN(DocCopyBlock);
7139 }
7140<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7141<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7142<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7144 yyextra->docBlock << "\\ilinebr ";
7145 yyextra->docBlock << pat;
7147 BEGIN(DocCopyBlock);
7148 }
7149<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7150<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7151<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7153 yyextra->docBlock << pat;
7155 BEGIN(DocCopyBlock);
7156 }
7157<DocBlock>{B}*"<"{CODE}">" {
7158 if (yyextra->insideCS)
7159 {
7160 yyextra->docBlock << yytext;
7162 BEGIN(DocCopyBlock);
7163 }
7164 else
7165 {
7166 REJECT;
7167 }
7168 }
7169<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
7170 yyextra->docBlock << yytext;
7171 }
7172<DocBlock>\n { // newline
7174 yyextra->docBlock << *yytext;
7175 }
7176<DocBlock>. { // command block
7177 yyextra->docBlock << *yytext;
7178 }
7179
7180
7181
7182<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
7184 {
7185 BEGIN(DocBlock);
7186 }
7187 yyextra->docBlock << yytext;
7188 }
static bool endVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7189<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
7191 {
7192 BEGIN(DocBlock);
7193 }
7194 yyextra->docBlock << yytext;
7195 }
7196<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7198 {
7199 BEGIN(DocBlock);
7200 }
7201 yyextra->docBlock << yytext;
7202 }
7203<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
7205 {
7206 BEGIN(DocBlock);
7207 }
7208 yyextra->docBlock << yytext;
7209 }
7210<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
7211 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7212 {
7213 REJECT;
7214 }
7215 else
7216 {
7219 yyextra->docBlock << indent;
7220 }
7221 }
7222<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
7223 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7224 {
7227 yyextra->docBlock << indent;
7228 }
7229 else
7230 {
7231 REJECT;
7232 }
7233 }
7234<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
7235 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7236 {
7239 yyextra->docBlock << indent+"*";
7240 }
7241 else
7242 {
7243 REJECT;
7244 }
7245 }
7246<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
7247 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7248 {
7250 if (yyextra->nestedComment>0)
7251 {
7253 yyextra->docBlock << indent+"*";
7254 }
7255 else
7256 {
7258 yyextra->docBlock << indent;
7259 }
7260 }
7261 else
7262 {
7263 REJECT;
7264 }
7265 }
7266<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7269 {
7270 BEGIN(DocBlock);
7271 }
7272 yyextra->docBlock << pat;
7273 }
7274<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7277 {
7278 BEGIN(DocBlock);
7279 }
7280 yyextra->docBlock << pat;
7281 }
7282<DocCopyBlock>[^<@/\*\]~"\$\\\n]+ { // any character that is not special
7283 yyextra->docBlock << yytext;
7284 }
7285<DocCopyBlock>\" {
7286 yyextra->docBlock << yytext;
7287 if (yyextra->docBlockName=="code" || yyextra->docBlockName=="iliteral")
7288
7289
7290 {
7291 yyextra->lastStringContext=YY_START;
7292 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7293 yyextra->stopAtInvalidString=true;
7294 BEGIN(CopyGString);
7295 }
7296 }
7297<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7298 if (yytext[1]=='*')
7299 {
7300 yyextra->nestedComment++;
7301 }
7302 else if (yytext[0]=='*' && yyextra->nestedComment>0)
7303 {
7304 yyextra->nestedComment--;
7305 }
7306 yyextra->docBlock << yytext;
7307 }
7308<DocCopyBlock>\n { // newline
7309 yyextra->docBlock << *yytext;
7311 }
7312<DocCopyBlock>. { // any other character
7313 yyextra->docBlock << *yytext;
7314 }
7315<DocCopyBlock><<EOF>> {
7316 warn(yyextra->fileName,yyextra->yyLineNr,
7317 "reached end of file while inside a '%s' block!"
7318 " The command that should end the block seems to be missing!",
7319 qPrint(yyextra->docBlockName));
7321 }
7322
7323
7324
7325
7326<Prototype>"operator"{B}*"("{B}*")" {
7327 yyextra->current->name+=yytext;
7328 }
7329<Prototype>"(" {
7330 yyextra->current->args+=*yytext;
7331 yyextra->currentArgumentContext = PrototypeQual;
7332 yyextra->fullArgString = yyextra->current->args;
7333 yyextra->copyArgString = &yyextra->current->args;
7334 BEGIN( ReadFuncArgType ) ;
7335 }
7336<Prototype>"("({ID}"::")*({B}*[&*])+ {
7337 if (yyextra->insidePHP)
7338 {
7339 REJECT;
7340 }
7341 else
7342 {
7343 yyextra->current->type+=yyextra->current->name+yytext;
7344 yyextra->current->name.clear();
7345 BEGIN( PrototypePtr );
7346 }
7347 }
7348<PrototypePtr>{SCOPENAME} {
7349 yyextra->current->name+=yytext;
7350 }
7351<PrototypePtr>"(" {
7352 yyextra->current->args+=*yytext;
7353 yyextra->currentArgumentContext = PrototypeQual;
7354 yyextra->fullArgString = yyextra->current->args;
7355 yyextra->copyArgString = &yyextra->current->args;
7356 BEGIN( ReadFuncArgType ) ;
7357 }
7358<PrototypePtr>")" {
7359 yyextra->current->type+=')';
7360 BEGIN( Prototype );
7361 }
7362<PrototypePtr>. {
7363 yyextra->current->name+=yytext;
7364 }
7365<PrototypeQual>"{" {
7366 BEGIN( PrototypeSkipLine);
7367 }
7368<PrototypeQual>{B}*"const"{B}* {
7369 yyextra->current->args += " const ";
7370 yyextra->current->argList.setConstSpecifier(
TRUE);
7371 }
7372<PrototypeQual>{B}*"volatile"{B}* {
7373 yyextra->current->args += " volatile ";
7374 yyextra->current->argList.setVolatileSpecifier(
TRUE);
7375 }
7376<PrototypeQual>{B}*"="{B}*"0"{B}* {
7377 yyextra->current->args += " = 0";
7379 yyextra->current->argList.setPureSpecifier(
TRUE);
7380 }
7381<PrototypeQual>"throw"{B}*"(" {
7382 yyextra->current->exception = "throw(";
7383 BEGIN(PrototypeExc);
7384 }
7385<PrototypeExc>")" {
7386 yyextra->current->exception += ')';
7387 BEGIN(PrototypeQual);
7388 }
7389<PrototypeExc>. {
7390 yyextra->current->exception += *yytext;
7391 }
7392<PrototypeQual>. {
7393 yyextra->current->args += *yytext;
7394 }
7395<Prototype>. {
7396 yyextra->current->name += *yytext;
7397 }
7398<PrototypeSkipLine>. {
7399 }
7400
7401
7402
7403
7404<SkipCxxComment>.*"\\\n" { // line continuation
7405 if (yyextra->insideCS)
7406 {
7407 REJECT;
7408 }
7409 else
7410 {
7412 }
7413 }
7414<SkipCxxComment>{ANYopt}/\n {
7415 BEGIN( yyextra->lastCContext ) ;
7416 }
7417<SkipComment>[^\*\n]+
7418
7419
7420
7421<*>"[[" { // C++11 attribute
7422 if (!yyextra->insideCpp) REJECT;
7423 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7424 yyextra->lastC11AttributeContext = YY_START;
7425 BEGIN( SkipC11Attribute );
7426 }
7427
7428<*>\n { lineCount(yyscanner); }
7429<*>\" {
7430 if (yyextra->insideIDL && yyextra->insideCppQuote)
7431 {
7432 BEGIN(EndCppQuote);
7433 }
7434 else if (yyextra->insidePHP)
7435 {
7436 yyextra->lastStringContext=YY_START;
7437 BEGIN(SkipString);
7438 }
7439 }
7440<*>^{B}*"#" {
7441 if (!yyextra->insidePHP)
7442 {
7443 yyextra->lastCPPContext = YY_START;
7444 BEGIN( SkipCPP ) ;
7445 }
7446 else
7447 {
7448 yyextra->lastCContext = YY_START ;
7449 BEGIN( SkipCxxComment ) ;
7450 }
7451 }
7452<*>"#" {
7453 if (!yyextra->insidePHP)
7454 REJECT;
7455 yyextra->lastCContext = YY_START ;
7456 BEGIN( SkipCxxComment ) ;
7457 }
7458<*>\' {
7459 if (yyextra->insidePHP)
7460 {
7461 yyextra->lastStringContext=YY_START;
7462 BEGIN(SkipPHPString);
7463 }
7464 }
7465<*>\? {
7466 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
7467 {
7468 if (yyextra->current->type.isEmpty())
7469 {
7470 if (yyextra->current->name.isEmpty())
7471 yyextra->current->name="?";
7472 else
7473 yyextra->current->name+="?";
7474 }
7475 else
7476 {
7477 yyextra->current->type+="?";
7478 }
7479 }
7480 }
7481<*>"}" { yyextra->exported=false; }
7482<*>.
7483<SkipComment>{CPPC}|{CCS}
7484<*>{CCS} { yyextra->lastCContext = YY_START ;
7485 BEGIN( SkipComment ) ;
7486 }
7487<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
7488<*>{CPPC} {
7489 yyextra->lastCContext = YY_START ;
7490 BEGIN( SkipCxxComment ) ;
7491 }
7492<<EOF>> {
7493 if (yyextra->insideCS && yyextra->fakeNS)
7494 {
7495 yyextra->fakeNS--;
7496 unput('}');
7497 BEGIN ( ReadNSBody);
7498 }
7499 else
7500 {
7502 }
7503 }
7504%%