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