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