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