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