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