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