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