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}*"explicit"{BN}+ { if (yyextra->insideJava) REJECT;
1330 yyextra->current->spec.setExplicit(true);
1332 }
1333<FindMembers>{B}*"local"{BN}+ { if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1334 yyextra->current->spec.setLocal(true);
1336 }
1337<FindMembers>{B}*"@required"{BN}+ { // Objective C 2.0 protocol required section
1338 yyextra->current->spec.setOptional(false).setRequired(true);
1340 }
1341<FindMembers>{B}*"@optional"{BN}+ { // Objective C 2.0 protocol optional section
1342 yyextra->current->spec.setRequired(false).setOptional(true);
1344 }
1345
1346<FindMembers>{B}*"import"{BN}+ { // IDL import keyword
1347 BEGIN( NextSemi );
1348 }
1349 */
1350<FindMembers>{B}*"typename"{BN}+ { lineCount(yyscanner); }
1351<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] { if (yyextra->insideJava) REJECT;
1352 yyextra->isTypedef=
FALSE;
1353 yyextra->current->section = EntryType::makeNamespace();
1354 yyextra->current->type = "namespace" ;
1355 yyextra->current->fileName = yyextra->fileName;
1356 yyextra->current->startLine = yyextra->yyLineNr;
1357 yyextra->current->startColumn = yyextra->yyColNr;
1358 yyextra->current->bodyLine = yyextra->yyLineNr;
1359 yyextra->current->bodyColumn = yyextra->yyColNr;
1361 if (yyextra->insidePHP)
1362 {
1363 BEGIN( PackageName );
1364 }
1365 else
1366 {
1367 BEGIN( CompoundName );
1368 }
1369 }
1370<FindMembers>{B}*"module"{BN}+ {
1372 if (yyextra->insideIDL || yyextra->insideSlice)
1373 {
1374 yyextra->isTypedef=
FALSE;
1375 yyextra->current->section = EntryType::makeNamespace();
1376 yyextra->current->type = "module" ;
1377 yyextra->current->fileName = yyextra->fileName;
1378 yyextra->current->startLine = yyextra->yyLineNr;
1379 yyextra->current->startColumn = yyextra->yyColNr;
1380 yyextra->current->bodyLine = yyextra->yyLineNr;
1381 yyextra->current->bodyColumn = yyextra->yyColNr;
1382 BEGIN( CompoundName );
1383 }
1384 else if (yyextra->insideD)
1385 {
1387 BEGIN(PackageName);
1388 }
1389 else
1390 {
1393 }
1394 }
1395<FindMembers>{B}*"library"{BN}+ {
1397 if (yyextra->insideIDL)
1398 {
1399 yyextra->isTypedef=
FALSE;
1400 yyextra->current->section = EntryType::makeNamespace();
1401 yyextra->current->type = "library" ;
1402 yyextra->current->fileName = yyextra->fileName;
1403 yyextra->current->startLine = yyextra->yyLineNr;
1404 yyextra->current->startColumn = yyextra->yyColNr;
1405 yyextra->current->bodyLine = yyextra->yyLineNr;
1406 yyextra->current->bodyColumn = yyextra->yyColNr;
1407 BEGIN( CompoundName );
1408 }
1409 else
1410 {
1413 }
1414 }
1415<FindMembers>{B}*"constants"{BN}+ { // UNO IDL constant group
1417 if (yyextra->insideIDL)
1418 {
1419 yyextra->isTypedef=
FALSE;
1420 yyextra->current->section = EntryType::makeNamespace();
1421 yyextra->current->type = "constants";
1422 yyextra->current->fileName = yyextra->fileName;
1423 yyextra->current->startLine = yyextra->yyLineNr;
1424 yyextra->current->startColumn = yyextra->yyColNr;
1425 yyextra->current->bodyLine = yyextra->yyLineNr;
1426 yyextra->current->bodyColumn = yyextra->yyColNr;
1427 BEGIN( CompoundName );
1428 }
1429 else
1430 {
1433 }
1434 }
1435<FindMembers>{BN}*("service"){BN}+ { // UNO IDL service
1437 if (yyextra->insideIDL)
1438 {
1439 yyextra->isTypedef=
FALSE;
1440 yyextra->current->section = EntryType::makeClass();
1443
1444 setOptional(spec.isOptional()).setPublished(spec.isPublished());
1446 yyextra->current->type += " service " ;
1447 yyextra->current->fileName = yyextra->fileName;
1448 yyextra->current->startLine = yyextra->yyLineNr;
1449 yyextra->current->bodyLine = yyextra->yyLineNr;
1450 yyextra->current->bodyColumn = yyextra->yyColNr;
1451 BEGIN( CompoundName );
1452 }
1453 else
1454 {
1457 }
1458 }
Wrapper class for a number of boolean properties.
1459<FindMembers>{BN}*("singleton"){BN}+ { // UNO IDL singleton
1461 if (yyextra->insideIDL)
1462 {
1463 yyextra->isTypedef=
FALSE;
1464 yyextra->current->section = EntryType::makeClass();
1466 yyextra->current->spec =
TypeSpecifier().setSingleton(
true).
1467 setPublished(spec.isPublished());
1469 yyextra->current->type += " singleton " ;
1470 yyextra->current->fileName = yyextra->fileName;
1471 yyextra->current->startLine = yyextra->yyLineNr;
1472 yyextra->current->bodyLine = yyextra->yyLineNr;
1473 yyextra->current->bodyColumn = yyextra->yyColNr;
1474 BEGIN( CompoundName );
1475 }
1476 else
1477 {
1480 }
1481 }
1482<FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba/UNO IDL/Java/Slice interface
1484 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1485 {
1486 yyextra->isTypedef=
FALSE;
1487 yyextra->current->section = EntryType::makeClass();
1489 yyextra->current->spec =
TypeSpecifier().setInterface(
true).
1490
1491 setOptional(spec.isOptional()).
1492 setPublished(spec.isPublished()).
1493 setLocal(spec.isLocal());
1495 yyextra->current->type += " interface" ;
1496 yyextra->current->fileName = yyextra->fileName;
1497 yyextra->current->startLine = yyextra->yyLineNr;
1498 yyextra->current->startColumn = yyextra->yyColNr;
1499 yyextra->current->bodyLine = yyextra->yyLineNr;
1500 yyextra->current->bodyColumn = yyextra->yyColNr;
1502 BEGIN( CompoundName );
1503 }
1504 else
1505 {
1508 }
1509 }
static void setJavaProtection(yyscan_t yyscanner)
1510<FindMembers>{B}*"@implementation"{BN}+ { // Objective-C class implementation
1512 yyextra->isTypedef=
FALSE;
1513 yyextra->current->section = EntryType::makeObjcImpl();
1514 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1515 yyextra->insideObjC =
TRUE;
1516 yyextra->current->protection = yyextra->protection = Protection::Public ;
1518 yyextra->current->type += " implementation" ;
1519 yyextra->current->fileName = yyextra->fileName;
1520 yyextra->current->startLine = yyextra->yyLineNr;
1521 yyextra->current->bodyLine = yyextra->yyLineNr;
1522 yyextra->current->bodyColumn = yyextra->yyColNr;
1523 BEGIN( CompoundName );
1524 }
1525<FindMembers>{B}*"@interface"{BN}+ { // Objective-C class interface, or Java attribute
1527 yyextra->isTypedef=
FALSE;
1528 yyextra->current->section = EntryType::makeClass();
1529 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1530 if (!yyextra->insideJava)
1531 {
1532 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1533 yyextra->insideObjC =
TRUE;
1534 }
1535 yyextra->current->protection = yyextra->protection = Protection::Public ;
1537 yyextra->current->type += " interface" ;
1538 yyextra->current->fileName = yyextra->fileName;
1539 yyextra->current->startLine = yyextra->yyLineNr;
1540 yyextra->current->startColumn = yyextra->yyColNr;
1541 yyextra->current->bodyLine = yyextra->yyLineNr;
1542 yyextra->current->bodyColumn = yyextra->yyColNr;
1543 BEGIN( CompoundName );
1544 }
1545<FindMembers>{B}*"@protocol"{BN}+ { // Objective-C protocol definition
1547 yyextra->isTypedef=
FALSE;
1548 yyextra->current->section = EntryType::makeClass();
1550 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1551 yyextra->insideObjC =
TRUE;
1552 yyextra->current->protection = yyextra->protection = Protection::Public ;
1554 yyextra->current->type += " protocol" ;
1555 yyextra->current->fileName = yyextra->fileName;
1556 yyextra->current->startLine = yyextra->yyLineNr;
1557 yyextra->current->startColumn = yyextra->yyColNr;
1558 yyextra->current->bodyLine = yyextra->yyLineNr;
1559 yyextra->current->bodyColumn = yyextra->yyColNr;
1560 BEGIN( CompoundName );
1561 }
1562<FindMembers>{B}*"exception"{BN}+ { // Corba IDL/Slice exception
1563 if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1564 yyextra->isTypedef=
FALSE;
1565 yyextra->current->section = EntryType::makeClass();
1567
1568 yyextra->current->spec =
TypeSpecifier().setException(
true).
1569 setPublished(spec.isPublished()).setLocal(spec.isLocal());
1571 yyextra->current->type += " exception" ;
1572 yyextra->current->fileName = yyextra->fileName;
1573 yyextra->current->startLine = yyextra->yyLineNr;
1574 yyextra->current->startColumn = yyextra->yyColNr;
1575 yyextra->current->bodyLine = yyextra->yyLineNr;
1576 yyextra->current->bodyColumn = yyextra->yyColNr;
1578 BEGIN( CompoundName );
1579 }
1580<FindMembers>"@class" | // for Objective C class declarations
1581<FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1582<FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1584 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1585 bool isConst=decl.
find(
"const")!=-1;
1586 bool isVolatile=decl.
find(
"volatile")!=-1;
1587 yyextra->current->section = EntryType::makeClass();
1589 if (yyextra->insidePHP && yyextra->current->spec.isAbstract())
1590 {
1591
1592 yyextra->current->spec.setAbstract(false).setAbstractClass(true);
1593 }
1594 if (yyextra->insideSlice && yyextra->current->spec.isLocal())
1595 {
1596 yyextra->current->spec.setLocal(true);
1597 }
1598 if (isConst)
1599 {
1600 yyextra->current->type += " const";
1601 }
1602 else if (isVolatile)
1603 {
1604 yyextra->current->type += " volatile";
1605 }
1606 yyextra->current->type += " class" ;
1607 yyextra->current->fileName = yyextra->fileName;
1608 yyextra->current->startLine = yyextra->yyLineNr;
1609 yyextra->current->startColumn = yyextra->yyColNr;
1610 yyextra->current->bodyLine = yyextra->yyLineNr;
1611 yyextra->current->bodyColumn = yyextra->yyColNr;
1612 if (yytext[0]=='@')
1613 {
1614 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1615 yyextra->insideObjC =
TRUE;
1616 }
1618 if (yytext[yyleng-1]=='{') unput('{');
1619 BEGIN( CompoundName ) ;
1620 }
1621<FindMembers>{B}*"value class{" | // C++/CLI extension
1622<FindMembers>{B}*"value class"{BN}+ {
1623 yyextra->isTypedef=
FALSE;
1624 yyextra->current->section = EntryType::makeClass();
1627 yyextra->current->type += " value class" ;
1628 yyextra->current->fileName = yyextra->fileName;
1629 yyextra->current->startLine = yyextra->yyLineNr;
1630 yyextra->current->startColumn = yyextra->yyColNr;
1631 yyextra->current->bodyLine = yyextra->yyLineNr;
1632 yyextra->current->bodyColumn = yyextra->yyColNr;
1634 if (yytext[yyleng-1]=='{') unput('{');
1635 BEGIN( CompoundName ) ;
1636 }
1637<FindMembers>{B}*"ref class{" | // C++/CLI extension
1638<FindMembers>{B}*"ref class"{BN}+ {
1639 yyextra->isTypedef=
FALSE;
1640 yyextra->current->section = EntryType::makeClass();
1643 yyextra->current->type += " ref class" ;
1644 yyextra->current->fileName = yyextra->fileName;
1645 yyextra->current->startLine = yyextra->yyLineNr;
1646 yyextra->current->startColumn = yyextra->yyColNr;
1647 yyextra->current->bodyLine = yyextra->yyLineNr;
1648 yyextra->current->bodyColumn = yyextra->yyColNr;
1650 if (yytext[yyleng-1]=='{') unput('{');
1651 BEGIN( CompoundName ) ;
1652 }
1653<FindMembers>{B}*"interface class{" | // C++/CLI extension
1654<FindMembers>{B}*"interface class"{BN}+ {
1655 yyextra->isTypedef=
FALSE;
1656 yyextra->current->section = EntryType::makeClass();
1657 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1659 yyextra->current->type += " interface class" ;
1660 yyextra->current->fileName = yyextra->fileName;
1661 yyextra->current->startLine = yyextra->yyLineNr;
1662 yyextra->current->startColumn = yyextra->yyColNr;
1663 yyextra->current->bodyLine = yyextra->yyLineNr;
1664 yyextra->current->bodyColumn = yyextra->yyColNr;
1666 if (yytext[yyleng-1]=='{') unput('{');
1667 BEGIN( CompoundName ) ;
1668 }
1669<FindMembers>{B}*"coclass"{BN}+ {
1670 if (yyextra->insideIDL)
1671 {
1672 yyextra->isTypedef=
FALSE;
1673 yyextra->current->section = EntryType::makeClass();
1675 yyextra->current->type += " coclass" ;
1676 yyextra->current->fileName = yyextra->fileName;
1677 yyextra->current->startLine = yyextra->yyLineNr;
1678 yyextra->current->startColumn = yyextra->yyColNr;
1679 yyextra->current->bodyLine = yyextra->yyLineNr;
1680 yyextra->current->bodyColumn = yyextra->yyColNr;
1682 BEGIN( CompoundName ) ;
1683 }
1684 else
1685 {
1687 yyextra->current->name = yytext;
1688 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1690 }
1691 }
1692<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1693<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1694 if (yyextra->insideJava) REJECT;
1696 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1697 bool isConst=decl.
find(
"const")!=-1;
1698 bool isVolatile=decl.
find(
"volatile")!=-1;
1699 yyextra->current->section = EntryType::makeClass() ;
1702
1703 setPublished(spec.isPublished()).
1704 setInline(spec.isInline()).
1705 setLocal(spec.isLocal());
1706
1707
1709 if (isConst)
1710 {
1711 yyextra->current->type += " const";
1712 }
1713 else if (isVolatile)
1714 {
1715 yyextra->current->type += " volatile";
1716 }
1717 yyextra->current->type += " struct" ;
1718 yyextra->current->fileName = yyextra->fileName;
1719 yyextra->current->startLine = yyextra->yyLineNr;
1720 yyextra->current->startColumn = yyextra->yyColNr;
1721 yyextra->current->bodyLine = yyextra->yyLineNr;
1722 yyextra->current->bodyColumn = yyextra->yyColNr;
1724 if (yytext[yyleng-1]=='{') unput('{');
1725 BEGIN( CompoundName ) ;
1726 }
1727<FindMembers>{B}*"value struct{" | // C++/CLI extension
1728<FindMembers>{B}*"value struct"{BN}+ {
1729 yyextra->isTypedef=
FALSE;
1730 yyextra->current->section = EntryType::makeClass();
1731 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1733 yyextra->current->type += " value struct" ;
1734 yyextra->current->fileName = yyextra->fileName;
1735 yyextra->current->startLine = yyextra->yyLineNr;
1736 yyextra->current->startColumn = yyextra->yyColNr;
1737 yyextra->current->bodyLine = yyextra->yyLineNr;
1738 yyextra->current->bodyColumn = yyextra->yyColNr;
1740 if (yytext[yyleng-1]=='{') unput('{');
1741 BEGIN( CompoundName ) ;
1742 }
1743<FindMembers>{B}*"ref struct{" | // C++/CLI extension
1744<FindMembers>{B}*"ref struct"{BN}+ {
1745 yyextra->isTypedef=
FALSE;
1746 yyextra->current->section = EntryType::makeClass();
1747 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1749 yyextra->current->type += " ref struct" ;
1750 yyextra->current->fileName = yyextra->fileName;
1751 yyextra->current->startLine = yyextra->yyLineNr;
1752 yyextra->current->startColumn = yyextra->yyColNr;
1753 yyextra->current->bodyLine = yyextra->yyLineNr;
1754 yyextra->current->bodyColumn = yyextra->yyColNr;
1756 if (yytext[yyleng-1]=='{') unput('{');
1757 BEGIN( CompoundName ) ;
1758 }
1759<FindMembers>{B}*"interface struct{" | // C++/CLI extension
1760<FindMembers>{B}*"interface struct"{BN}+ {
1761 yyextra->isTypedef=
FALSE;
1762 yyextra->current->section = EntryType::makeClass();
1763 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1765 yyextra->current->type += " interface struct";
1766 yyextra->current->fileName = yyextra->fileName;
1767 yyextra->current->startLine = yyextra->yyLineNr;
1768 yyextra->current->startColumn = yyextra->yyColNr;
1769 yyextra->current->bodyLine = yyextra->yyLineNr;
1770 yyextra->current->bodyColumn = yyextra->yyColNr;
1772 if (yytext[yyleng-1]=='{') unput('{');
1773 BEGIN( CompoundName ) ;
1774 }
1775<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1776<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1777 if (yyextra->insideJava) REJECT;
1779 yyextra->isTypedef=decl.
find(
"typedef")!=-1;
1780 bool isConst=decl.
find(
"const")!=-1;
1781 bool isVolatile=decl.
find(
"volatile")!=-1;
1782 yyextra->current->section = EntryType::makeClass();
1784
1785
1787 if (isConst)
1788 {
1789 yyextra->current->type += " const";
1790 }
1791 else if (isVolatile)
1792 {
1793 yyextra->current->type += " volatile";
1794 }
1795 yyextra->current->type += " union" ;
1796 yyextra->current->fileName = yyextra->fileName;
1797 yyextra->current->startLine = yyextra->yyLineNr;
1798 yyextra->current->startColumn = yyextra->yyColNr;
1799 yyextra->current->bodyLine = yyextra->yyLineNr;
1800 yyextra->current->bodyColumn = yyextra->yyColNr;
1802 if (yytext[yyleng-1]=='{') unput('{');
1803 BEGIN( CompoundName ) ;
1804 }
1805<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1806<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum
1808 yyextra->isTypedef = text.
find(
"typedef")!=-1;
1809 bool isStrongEnum = text.
find(
"class")!=-1 || yyextra->insideCS;
1810 bool isEnumSytruct = text.
find(
"struct")!=-1;
1811 if (yyextra->insideJava)
1812 {
1813 yyextra->current->section = EntryType::makeClass();
1816 }
1817 else
1818 {
1819 yyextra->current->section = EntryType::makeEnum() ;
1820 }
1822 yyextra->current->type += " enum";
1823 if (isStrongEnum)
1824 {
1825 yyextra->current->spec.setStrong(true);
1826 }
1827 if (isEnumSytruct)
1828 {
1829 yyextra->current->spec.setStrong(true).setEnumStruct(true);
1830 }
1831 yyextra->current->fileName = yyextra->fileName;
1832 yyextra->current->startLine = yyextra->yyLineNr;
1833 yyextra->current->startColumn = yyextra->yyColNr;
1834 yyextra->current->bodyLine = yyextra->yyLineNr;
1835 yyextra->current->bodyColumn = yyextra->yyColNr;
1837 if (yytext[yyleng-1]=='{') unput('{');
1838 BEGIN( CompoundName ) ;
1839 }
1840<FindMembers>{B}*"concept"{BN}+ { // C++20 concept
1841 if (yyextra->insideJava) REJECT;
1842 yyextra->isTypedef=
FALSE;
1843 yyextra->current->section = EntryType::makeConcept();
1845 yyextra->current->type += " concept";
1846 yyextra->current->fileName = yyextra->fileName;
1847 yyextra->current->startLine = yyextra->yyLineNr;
1848 yyextra->current->startColumn = yyextra->yyColNr;
1849 yyextra->current->bodyLine = yyextra->yyLineNr;
1850 yyextra->current->bodyColumn = yyextra->yyColNr;
1852 BEGIN( ConceptName ) ;
1853 }
1854<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" { // A::operator()<int>(int arg)
1856 yyextra->current->name += "()";
1857 BEGIN( FindMembers );
1858 }
1859<Operator>"("{BN}*")"{BNopt}/"(" {
1861 yyextra->current->name += yytext ;
1862 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1863 BEGIN( FindMembers ) ;
1864 }
1865<Operator>";" { // can occur when importing members
1866 unput(';');
1867 BEGIN( FindMembers ) ;
1868 }
1869<Operator>[^(] {
1871 yyextra->current->name += *yytext ;
1872 }
1873<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" { /* skip guided templ specifiers */
1874 if (!yyextra->current->type.startsWith("friend "))
1875 {
1876 yyextra->current->name += yytext;
1877 }
1878 }
1879<Operator>"(" {
1880 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1881 unput(*yytext);
1882 BEGIN( FindMembers ) ;
1883 }
1884<FindMembers>("template"|"generic")({BN}*)"<"/[>]? { // generic is a C++/CLI extension
1887 yyextra->current->tArgLists.
push_back(al);
1888 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1889 yyextra->templateStr="<";
1890 yyextra->fullArgString = yyextra->templateStr;
1891 yyextra->copyArgString = &yyextra->templateStr;
1892 yyextra->currentArgumentContext = FindMembers;
1893 BEGIN( ReadTempArgs );
1894 }
void push_back(const Argument &a)
1895<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
1896 if (yyextra->insideJava) REJECT;
1898 BEGIN( NSAliasName );
1899 }
1900<NSAliasName>{ID} {
1901 yyextra->aliasName = yytext;
1902 BEGIN( NSAliasArg );
1903 }
1904<NSAliasArg>({ID}"::")*{ID} {
1905
1906 std::string ctx = yyextra->current_root->name.str();
1907 if (ctx.empty())
1908 {
1910 }
1911 else
1912 {
1914 }
1915 }
static NamespaceAliasInfoMap namespaceAliasMap
1916<NSAliasArg>";" {
1917 BEGIN( FindMembers );
1918 }
1919<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1921 yyextra->aliasName=yytext;
1922 BEGIN(PHPUseAs);
1923 }
1924<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1927
1928 yyextra->current->fileName = yyextra->fileName;
1929
1930 yyextra->current->section = EntryType::makeUsingDecl();
1931 yyextra->current_root->copyToSubEntry(yyextra->current);
1932
1933 yyextra->current->section = EntryType::makeUsingDir();
1934 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1936 yyextra->aliasName.clear();
1937 }
QCString removeRedundantWhiteSpace(const QCString &s)
1938<PHPUseAs>{BN}+"as"{BN}+ {
1940 }
1941<PHPUseAs>{PHPUSEKW} {
1942 }
1943<PHPUseAs>{ID} {
1944
1945 if (!yyextra->aliasName.isEmpty())
1946 {
1949 }
1950 yyextra->aliasName.clear();
1951 }
const std::string & str() const
1952<PHPUse,PHPUseAs>[,;] {
1953 if (*yytext==',')
1954 {
1955 BEGIN(PHPUse);
1956 }
1957 else
1958 {
1959 BEGIN(FindMembers);
1960 }
1961 }
1962<JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
1966 yyextra->current->fileName = yyextra->fileName;
1967 bool ambig = false;
1969 if (incFd)
1970 {
1972 }
1973 yyextra->current->section = EntryType::makeUsingDir();
1974 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1976 BEGIN(Using);
1977 }
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)
1978<JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
1982 yyextra->current->fileName = yyextra->fileName;
1983 bool ambig = false;
1986 if (fromFd)
1987 {
1989 }
1990 if (toFd && fromFd)
1991 {
1993 }
1994 if (yyextra->insideD)
1995 {
1996 yyextra->current->section = EntryType::makeUsingDir();
1997 }
1998 else
1999 {
2000
2001 yyextra->current->section = EntryType::makeUsingDecl();
2002 }
2003 yyextra->previous = yyextra->current;
2004 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2006 BEGIN(Using);
2007 }
virtual void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual const QCString & docName() const =0
2008<IDLImport>"\""[^"]*"\"" {
2009 QCString fileName(&yytext[1],yyleng-2);
2010 bool ambig = false;
2013 if (fromFd)
2014 {
2016 }
2017 if (toFd && fromFd)
2018 {
2020 }
2021 }
2022<IDLImport>";" {
2023 BEGIN(FindMembers);
2024 }
2025<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2026 if (yyextra->insideJava) REJECT;
2027 yyextra->current->startLine=yyextra->yyLineNr;
2028 yyextra->current->startColumn = yyextra->yyColNr;
2030 BEGIN(Using);
2031 }
2032<Using>"namespace"{BN}+ { lineCount(yyscanner); BEGIN(UsingDirective); }
2033<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2035 yyextra->current->name=yytext;
2036 yyextra->current->fileName = yyextra->fileName;
2037 yyextra->current->section = EntryType::makeUsingDecl();
2038 yyextra->current->startLine = yyextra->yyLineNr;
2039 yyextra->previous = yyextra->current;
2040 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2042 if (yyextra->insideCS)
2043
2044
2045
2046 {
2047 yyextra->current->name=yytext;
2048 yyextra->current->fileName = yyextra->fileName;
2049 yyextra->current->startLine = yyextra->yyLineNr;
2050 yyextra->current->startColumn = yyextra->yyColNr;
2051 yyextra->current->section = EntryType::makeUsingDir();
2052 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2054 }
2055 BEGIN(Using);
2056 }
2057<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" { // C++11 style using alias
2059 yyextra->current->fileName = yyextra->fileName;
2060 yyextra->current->section = EntryType::makeUsingDecl();
2061 yyextra->current->startLine = yyextra->yyLineNr;
2062 yyextra->current->bodyLine = yyextra->yyLineNr;
2063 yyextra->current->bodyColumn = yyextra->yyColNr;
2064 yyextra->lastInitializerContext = UsingAlias;
2065 yyextra->sharpCount=0;
2066 yyextra->initBracketCount=0;
2068 BEGIN(ReadInitializer);
2069 }
2070<UsingAlias>";" {
2071 yyextra->current->section = EntryType::makeVariable();
2073 init.stripPrefix(
"class ");
2074 init.stripPrefix(
"struct ");
2076 yyextra->current->type =
"typedef "+
init;
2077 yyextra->current->args.clear();
2078 yyextra->current->spec.setAlias(true);
2079 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2081 BEGIN(FindMembers);
2082 }
2083<UsingAlias>. {
2084 yyextra->current->initializer << yytext;
2085 }
2086<UsingAlias>\n {
2087 yyextra->current->initializer << yytext;
2089 }
2090<UsingDirective>{SCOPENAME} { yyextra->current->name=removeRedundantWhiteSpace(yytext);
2091 yyextra->current->fileName = yyextra->fileName;
2092 yyextra->current->section = EntryType::makeUsingDir();
2093 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2095 BEGIN(Using);
2096 }
2097<Using>";" { BEGIN(FindMembers); }
2098<FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl
2102 }
2103<FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
2105 if (yyextra->insideCpp && name=="import") REJECT;
2106 yyextra->roundCount=0;
2107 yyextra->sharpCount=0;
2110 yyextra->current->name=name;
2111
2112
2114 BEGIN( Operator );
2115 else
2116 BEGIN( EndTemplate );
2117 }
static bool nameIsOperator(QCString &name)
2118<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2119 yyextra->sharpCount=0;
2120 yyextra->roundCount=0;
2123
2124
2126 BEGIN( Operator );
2127 else
2128 BEGIN( EndTemplate );
2129 }
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...
2130<EndTemplate>"<<<" {
2131 if (!yyextra->insidePHP)
2132 {
2133 REJECT;
2134 }
2135 else
2136 {
2137 yyextra->lastHereDocContext = YY_START;
2138 BEGIN(HereDoc);
2139 }
2140 }
2141<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2142 yyextra->current->name+=yytext;
2143
2144 }
2145<EndTemplate>"<" {
2146 if (yyextra->roundCount==0)
2147 {
2148
2149 yyextra->sharpCount++;
2150 }
2151 yyextra->current->name+=yytext;
2152 }
2153<ClassTemplSpec,EndTemplate>">=" {
2154 yyextra->current->name+=yytext;
2155 }
2156<ClassTemplSpec,EndTemplate>(">>") {
2157 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2158 {
2159 unput('>');
2160 unput(' ');
2161 unput('>');
2162 }
2163 else
2164 {
2165 yyextra->current->name+=yytext;
2166 }
2167
2168 }
2169<EndTemplate>">" {
2170 yyextra->current->name+='>';
2171
2172 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2173 {
2174 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2175
2176 BEGIN(FindMembers);
2177 }
2178 }
2179<EndTemplate>">"{BN}*"(" {
2181 yyextra->current->name+='>';
2182
2183 if (yyextra->roundCount==0)
2184 {
2185 --yyextra->sharpCount;
2186 }
2187 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2188 {
2189 yyextra->current->bodyLine = yyextra->yyLineNr;
2190 yyextra->current->bodyColumn = yyextra->yyColNr;
2191 yyextra->current->args = "(";
2192 yyextra->currentArgumentContext = FuncQual;
2193 yyextra->fullArgString = yyextra->current->args;
2194 yyextra->copyArgString = &yyextra->current->args;
2195
2196 BEGIN( ReadFuncArgType ) ;
2197 }
2198 else
2199 {
2200 yyextra->current->name+="(";
2201 yyextra->roundCount++;
2202 }
2203 }
2204<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
2206 yyextra->current->name+='>';
2207 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2208 {
2209 BEGIN(FindMembers);
2210 }
2211 }
2212<EndTemplate>">"{BNopt}/"::" {
2214 yyextra->current->name+='>';
2215
2216 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2217 {
2218 BEGIN(FindMemberName);
2219 }
2220 }
2221<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2222 yyextra->roundCount++;
2223 }
2224<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2225 if (yyextra->roundCount>0) yyextra->roundCount--;
2226 }
2227<EndTemplate>. {
2228 yyextra->current->name+=*yytext;
2229
2230 }
2231<FindMembers>"define"{BN}*"("{BN}*["'] {
2232 if (yyextra->insidePHP)
2233 {
2234 yyextra->current->bodyLine = yyextra->yyLineNr;
2235 yyextra->current->bodyColumn = yyextra->yyColNr;
2236 BEGIN( DefinePHP );
2237 }
2238 else
2239 REJECT;
2240 }
2241<CopyHereDoc>{ID} { // PHP heredoc
2242 yyextra->delimiter = yytext;
2243 *yyextra->pCopyHereDocGString << yytext;
2244 BEGIN(CopyHereDocEnd);
2245 }
2246<CopyHereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2247 yyextra->delimiter = &yytext[1];
2248 *yyextra->pCopyHereDocGString << yytext;
2249 BEGIN(CopyHereDocEnd);
2250 }
2251<CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
2252 yyextra->delimiter = &yytext[1];
2253 *yyextra->pCopyHereDocGString << yytext;
2254 BEGIN(CopyHereDocEnd);
2255 }
2256<HereDoc>{ID} { // PHP heredoc
2257 yyextra->delimiter = yytext;
2258 BEGIN(HereDocEnd);
2259 }
2260<HereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2261 yyextra->delimiter = &yytext[1];
2262 BEGIN(HereDocEnd);
2263 }
2264<HereDoc>"'"{ID}/"'" { // PHP nowdoc
2265 yyextra->delimiter = &yytext[1];
2266 BEGIN(HereDocEnd);
2267 }
2268<HereDocEnd>^{ID} { // id at start of the line could mark the end of the block
2269 if (yyextra->delimiter==yytext)
2270 {
2271 BEGIN(yyextra->lastHereDocContext);
2272 }
2273 }
2274<HereDocEnd>. { }
2275<CopyHereDocEnd>^{Bopt}{ID} { // id at start of the line could mark the end of the block
2276 *yyextra->pCopyHereDocGString << yytext;
2278 {
2279 BEGIN(yyextra->lastHereDocContext);
2280 }
2281 }
2282<CopyHereDocEnd>\n {
2284 *yyextra->pCopyHereDocGString << yytext;
2285 }
2286<CopyHereDocEnd>{ID} {
2287 *yyextra->pCopyHereDocGString << yytext;
2288 }
2289<CopyHereDocEnd>. {
2290 *yyextra->pCopyHereDocGString << yytext;
2291 }
2292<FindMembers>"Q_OBJECT"|"Q_GADGET" { // Qt object / gadget macro
2293 }
2294<FindMembers>"Q_PROPERTY" { // Qt property declaration
2295 yyextra->yyBegLineNr = yyextra->yyLineNr;
2296 yyextra->yyBegColNr = yyextra->yyColNr;
2297 yyextra->current->protection = Protection::Public ;
2298 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2299 yyextra->current->type.clear();
2300 BEGIN(QtPropType);
2301 }
2302<QtPropType>"(" { // start of property arguments
2303 }
2304<QtPropAttr>")" { // end of property arguments
2305 unput(';');
2306 BEGIN(FindMembers);
2307 }
2308<QtPropType>{B}+ {
2309 yyextra->current->name+=yytext;
2310 }
2311<QtPropType>"*" {
2312 yyextra->current->type+= yyextra->current->name;
2313 yyextra->current->type+= yytext;
2314 yyextra->current->name="";
2315 }
2316<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2317 yyextra->current->type+= yyextra->current->name;
2318 yyextra->current->name=yytext;
2319 }
2320<QtPropType,QtPropAttr>{B}+"READ"{B}+ {
2321 yyextra->current->spec.setReadable(true);
2322 BEGIN(QtPropRead);
2323 }
2324<QtPropType,QtPropAttr>{B}+"WRITE"{B}+ {
2325 yyextra->current->spec.setWritable(true);
2326 BEGIN(QtPropWrite);
2327 }
2328<QtPropType,QtPropAttr>{B}+"MEMBER"{B}+{ID} | // member property => not supported yet
2329<QtPropType,QtPropAttr>{B}+"RESET"{B}+{ID} | // reset method => not supported yet
2330<QtPropType,QtPropAttr>{B}+"SCRIPTABLE"{B}+{ID} | // scriptable property => not supported yet
2331<QtPropType,QtPropAttr>{B}+"DESIGNABLE"{B}+{ID} | // designable property => not supported yet
2332<QtPropType,QtPropAttr>{B}+"NOTIFY"{B}+{ID} | // notify property => not supported yet
2333<QtPropType,QtPropAttr>{B}+"REVISION"{B}+{ID} | // revision property => not supported yet
2334<QtPropType,QtPropAttr>{B}+"STORED"{B}+{ID} | // stored property => not supported yet
2335<QtPropType,QtPropAttr>{B}+"USER"{B}+{ID} | // user property => not supported yet
2336<QtPropType,QtPropAttr>{B}+"CONSTANT"{B} | // constant property => not supported yet
2337<QtPropType,QtPropAttr>{B}+"FINAL"{B} { // final property => not supported yet
2338 BEGIN(QtPropAttr);
2339 }
2340<QtPropRead>{ID} {
2341 yyextra->current->read = yytext;
2342 BEGIN(QtPropAttr);
2343 }
2344<QtPropWrite>{ID} {
2345 yyextra->current->write = yytext;
2346 BEGIN(QtPropAttr);
2347 }
2348<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2349 yyextra->current->name=yytext;
2351 BEGIN(FindMembers);
2352 }
2353<FindMembers>"requires" { // C++20 requires clause
2354 if (yyextra->insideJava) REJECT;
2355 yyextra->current->req.clear();
2356 yyextra->requiresContext = YY_START;
2357 BEGIN(RequiresClause);
2358 }
2359<RequiresClause>"requires"{BN}*/"{" { // requires requires { ... }
2360 if (yyextra->insideJava) REJECT;
2362 yyextra->current->req+=yytext;
2363 BEGIN( RequiresExpression ) ;
2364 }
2365<RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
2366 if (yyextra->insideJava) REJECT;
2368 yyextra->current->req+=yytext;
2369 yyextra->lastRoundContext=RequiresExpression;
2370 yyextra->pCopyRoundString=&yyextra->current->req;
2371 yyextra->roundCount=0;
2372 BEGIN( CopyRound ) ;
2373 }
2374<RequiresExpression>"{" {
2375 yyextra->current->req+=yytext;
2376 yyextra->lastCurlyContext=RequiresClause;
2377 yyextra->pCopyCurlyString=&yyextra->current->req;
2378 yyextra->curlyCount=0;
2379 BEGIN( CopyCurly ) ;
2380 }
2381<RequiresExpression>\n {
2382 yyextra->current->req+=' ';
2384 }
2385<RequiresExpression>. {
2386 yyextra->current->req+=yytext;
2387 }
2388<RequiresClause>"(" { // requires "(A && B)"
2389 yyextra->current->req+=yytext;
2390 yyextra->lastRoundContext=RequiresClause;
2391 yyextra->pCopyRoundString=&yyextra->current->req;
2392 yyextra->roundCount=0;
2393 BEGIN( CopyRound ) ;
2394 }
2395<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" { // "requires func(x)"
2397 {
2399 yyextra->current->req+=yytext;
2400 yyextra->lastRoundContext=RequiresClause;
2401 yyextra->pCopyRoundString=&yyextra->current->req;
2402 yyextra->roundCount=0;
2403 BEGIN( CopyRound );
2404 }
2405 else
2406 {
2407 REJECT;
2408 }
2409 }
static bool startOfRequiresExpression(const QCString &req)
2410<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
2412 {
2414 yyextra->current->req+=yytext;
2415 yyextra->lastSharpContext=RequiresClause;
2416 yyextra->pCopySharpString=&yyextra->current->req;
2417 yyextra->sharpCount=0;
2418 BEGIN( CopySharp );
2419 }
2420 else
2421 {
2422 REJECT
2423 }
2424 }
2425<RequiresClause>{NOTopt}{SCOPENAME} { // something like "requires true" or "requires !my::value"
2427 {
2429 yyextra->current->req=yytext;
2430 BEGIN(yyextra->requiresContext);
2431 }
2432 else
2433 {
2434 REJECT;
2435 }
2436 }
2437<RequiresClause>{NOTopt}"::"{ID} {
2439 yyextra->current->req+=yytext;
2440 }
2441<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) { // "requires A || B" or "requires A && B"
2443 yyextra->current->req+=yytext;
2444 }
2445<RequiresClause>{BN}+ {
2446 yyextra->current->req+=' ';
2448 }
2449<RequiresClause>. {
2450 unput(*yytext);
2451 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2452 BEGIN(yyextra->requiresContext);
2453 }
2454<FindMembers,FindMemberName>{SCOPENAME} {
2456 yyextra->yyBegColNr=yyextra->yyColNr;
2457 yyextra->yyBegLineNr=yyextra->yyLineNr;
2459 if (yyextra->insideIDL && yyleng==9 &&
qstrcmp(yytext,
"cpp_quote")==0)
2460 {
2461 BEGIN(CppQuote);
2462 }
2463 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
qstrcmp(yytext,
"import")==0)
2464 {
2465 if (yyextra->insideIDL)
2466 BEGIN(IDLImport);
2467 else
2468 BEGIN(JavaImport);
2469 }
2470 else if (yyextra->insidePHP &&
qstrcmp(yytext,
"use")==0)
2471 {
2472 BEGIN(PHPUse);
2473 }
2474 else if (yyextra->insideJava &&
qstrcmp(yytext,
"package")==0)
2475 {
2477 BEGIN(PackageName);
2478 }
2479 else if (yyextra->insideIDL &&
qstrcmp(yytext,
"case")==0)
2480 {
2481 BEGIN(IDLUnionCase);
2482 }
2483 else if (yyextra->insideTryBlock &&
qstrcmp(yytext,
"catch")==0)
2484 {
2485 yyextra->insideTryBlock=
FALSE;
2486 BEGIN(TryFunctionBlock);
2487 }
2488 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"alignas")==0)
2489 {
2490 yyextra->lastAlignAsContext = YY_START;
2491 BEGIN(AlignAs);
2492 }
2493 else if (yyextra->insideJS &&
qstrcmp(yytext,
"var")==0)
2494 {
2495 yyextra->current->type="var";
2496 }
2497 else if (yyextra->insideJS &&
qstrcmp(yytext,
"function")==0)
2498 {
2499 yyextra->current->type="function";
2500 }
2501 else if (yyextra->insideCS &&
qstrcmp(yytext,
"this")==0)
2502 {
2503
2505 yyextra->current->name="this";
2506 BEGIN(CSIndexer);
2507 }
2508 else if (yyextra->insideCpp && (
qstrcmp(yytext,
"static_assert")==0 ||
qstrcmp(yytext,
"_Static_assert")==0))
2509 {
2510
2511 BEGIN(StaticAssert);
2512 }
2513 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"decltype")==0)
2514 {
2515
2517 if (!yyextra->current->type.isEmpty()) yyextra->current->type+=' ';
2518 yyextra->current->type+=yytext;
2519 BEGIN(DeclType);
2520 }
2521 else if (yyextra->insideSlice &&
qstrcmp(yytext,
"optional")==0)
2522 {
2523 if (yyextra->current->type.isEmpty())
2524 {
2525 yyextra->current->type = "optional";
2526 }
2527 else
2528 {
2529 yyextra->current->type += " optional";
2530 }
2531 yyextra->lastModifierContext = YY_START;
2532 BEGIN(SliceOptional);
2533 }
2534 else
2535 {
2536 if (YY_START==FindMembers)
2537 {
2539 }
2540 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2541 if (javaLike &&
qstrcmp(yytext,
"public")==0)
2542 {
2543 yyextra->current->protection = Protection::Public;
2544 }
2545 else if (javaLike &&
qstrcmp(yytext,
"protected")==0)
2546 {
2547 yyextra->current->protection = Protection::Protected;
2548 }
2549 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
qstrcmp(yytext,
"internal")==0)
2550 {
2551 yyextra->current->protection = Protection::Package;
2552 }
2553 else if (javaLike &&
qstrcmp(yytext,
"private")==0)
2554 {
2555 yyextra->current->protection = Protection::Private;
2556 }
2557 else if (javaLike &&
qstrcmp(yytext,
"static")==0)
2558 {
2559 if (YY_START==FindMembers)
2560 yyextra->current->name = yytext;
2561 else
2562 yyextra->current->name += yytext;
2563 yyextra->current->isStatic =
TRUE;
2564 }
2565 else
2566 {
2567 if (YY_START==FindMembers)
2568 yyextra->current->name = yytext;
2569 else
2570 yyextra->current->name += yytext;
2571 if (yyextra->current->name.startsWith("static "))
2572 {
2573 yyextra->current->isStatic =
TRUE;
2574 yyextra->current->name= yyextra->current->name.mid(7);
2575 }
2576 else if (yyextra->current->name.startsWith("inline "))
2577 {
2578 if (yyextra->current->type.isEmpty())
2579 {
2580 yyextra->current->type="inline";
2581 }
2582 else
2583 {
2584 yyextra->current->type+="inline ";
2585 }
2586 yyextra->current->name= yyextra->current->name.mid(7);
2587 }
2588 else if (yyextra->current->name.startsWith("constexpr "))
2589 {
2590 if (yyextra->current->type.isEmpty())
2591 {
2592 yyextra->current->type="constexpr";
2593 }
2594 else
2595 {
2596 yyextra->current->type+="constexpr ";
2597 }
2598 yyextra->current->name=yyextra->current->name.mid(10);
2599 }
2600 else if (yyextra->current->name.startsWith("consteval "))
2601 {
2602 if (yyextra->current->type.isEmpty())
2603 {
2604 yyextra->current->type="consteval";
2605 }
2606 else
2607 {
2608 yyextra->current->type+="consteval ";
2609 }
2610 yyextra->current->name=yyextra->current->name.mid(10);
2611 }
2612 else if (yyextra->current->name.startsWith("constinit "))
2613 {
2614 if (yyextra->current->type.isEmpty())
2615 {
2616 yyextra->current->type="constinit";
2617 }
2618 else
2619 {
2620 yyextra->current->type+="constinit ";
2621 }
2622 yyextra->current->name=yyextra->current->name.mid(10);
2623 }
2624 else if (yyextra->current->name.startsWith("const "))
2625 {
2626 if (yyextra->current->type.isEmpty())
2627 {
2628 yyextra->current->type="const";
2629 }
2630 else
2631 {
2632 yyextra->current->type+="const ";
2633 }
2634 yyextra->current->name=yyextra->current->name.mid(6);
2635 }
2636 else if (yyextra->current->name.startsWith("volatile "))
2637 {
2638 if (yyextra->current->type.isEmpty())
2639 {
2640 yyextra->current->type="volatile";
2641 }
2642 else
2643 {
2644 yyextra->current->type+="volatile ";
2645 }
2646 yyextra->current->name=yyextra->current->name.mid(9);
2647 }
2648 else if (yyextra->current->name.startsWith("typedef "))
2649 {
2650 if (yyextra->current->type.isEmpty())
2651 {
2652 yyextra->current->type="typedef";
2653 }
2654 else
2655 {
2656 yyextra->current->type+="typedef ";
2657 }
2658 yyextra->current->name=yyextra->current->name.mid(8);
2659 }
2660 }
2663 {
2664 BEGIN( Operator );
2665 }
2666 else
2667 {
2668 yyextra->externLinkage=
FALSE;
2669 BEGIN(FindMembers);
2670 }
2671 }
2672 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2673 }
2674<StaticAssert>"(" {
2675 yyextra->lastSkipRoundContext = FindMembers;
2676 yyextra->roundCount=0;
2677 BEGIN(SkipRound);
2678 }
2679<StaticAssert>{BN}+ { lineCount(yyscanner); }
2680<StaticAssert>. { // variable with static_assert as name?
2681 unput(*yytext);
2682 BEGIN(FindMembers);
2683 }
2684<DeclType>"(" {
2685 yyextra->current->type+=yytext;
2686 yyextra->lastRoundContext=FindMembers;
2687 yyextra->pCopyRoundString=&yyextra->current->type;
2688 yyextra->roundCount=0;
2689 BEGIN(CopyRound);
2690 }
2691<DeclType>{BN}+ { lineCount(yyscanner); }
2692<DeclType>. {
2693 unput(*yytext);
2694 BEGIN(FindMembers);
2695 }
2696<CSIndexer>"["[^\n\]]*"]" {
2698 BEGIN(FindMembers);
2699 }
2700<FindMembers>[0-9]{ID} { // some number where we did not expect one
2701 }
2702<FindMembers>"." {
2703 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2704 {
2705 yyextra->current->name+=".";
2706 }
2707 }
2708<FindMembers>"::" {
2709 yyextra->current->name+=yytext;
2710 }
2711<CppQuote>"("{B}*"\"" {
2712 yyextra->insideCppQuote=
TRUE;
2713 BEGIN(FindMembers);
2714 }
2715<IDLUnionCase>"::"
2716<IDLUnionCase>":" { BEGIN(FindMembers); }
2717<IDLUnionCase>\n { lineCount(yyscanner); }
2718<IDLUnionCase>.
2719<TryFunctionBlock>\n { lineCount(yyscanner); }
2720<TryFunctionBlock>"{" {
2721 yyextra->curlyCount=0;
2722 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2723 BEGIN( SkipCurly );
2724 }
2725<TryFunctionBlock>.
2726<TryFunctionBlockEnd>{BN}*"catch" { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
2727 }
2728<TryFunctionBlockEnd>\n { unput(*yytext); // rule added to fix bug id 601138
2729 BEGIN( FindMembers );
2730 }
2731<TryFunctionBlockEnd>. { unput(*yytext);
2732 BEGIN( FindMembers );
2733 }
2734<EndCppQuote>")" {
2735 yyextra->insideCppQuote=
FALSE;
2736 BEGIN(FindMembers);
2737 }
2738<FindMembers,FindFields>{B}*"#" { if (yyextra->insidePHP)
2739 REJECT;
2740 yyextra->lastCPPContext = YY_START;
2741 BEGIN( SkipCPP ) ;
2742 }
2743<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2744<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2745 if (yyextra->insidePHP)
2746 REJECT;
2747 yyextra->current->bodyLine = yyextra->yyLineNr;
2748 yyextra->current->bodyColumn = yyextra->yyColNr;
2749 yyextra->current->fileName = yyextra->fileName;
2750 yyextra->current->startLine = yyextra->yyLineNr;
2751 yyextra->current->startColumn = yyextra->yyColNr;
2752 yyextra->current->type.clear();
2753 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2754 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2755 yyextra->current->section = EntryType::makeDefine();
2756 yyextra->lastDefineContext = YY_START;
2757 BEGIN( SDefine );
2758 }
2759<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
2760 yyextra->yyLineNr = atoi(&yytext[1]);
2761
2762 yyextra->lastPreLineCtrlContext = YY_START;
2763 if (YY_START==ReadBody ||
2764 YY_START==ReadNSBody ||
2765 YY_START==ReadBodyIntf)
2766 {
2767 yyextra->current->program << yytext;
2768 }
2769 BEGIN( PreLineCtrl );
2770 }
2771<PreLineCtrl>"\""[^\n\"]*"\"" {
2773 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2774 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2775 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2776 {
2777 yyextra->current->program << yytext;
2778 }
2779 }
static QCString stripQuotes(const char *s)
2780<PreLineCtrl>. {
2781 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2782 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2783 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2784 {
2785 yyextra->current->program << yytext;
2786 }
2787 }
2788<PreLineCtrl>\n {
2789 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2790 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2791 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2792 {
2793 yyextra->current->program << yytext;
2794 }
2796 BEGIN( yyextra->lastPreLineCtrlContext );
2797 }
2798<SkipCPP>.
2799<SkipCPP>\\[\r]*"\n"[\r]* { lineCount(yyscanner); }
2800<SkipCPP>[\r]*\n[\r]* { lineCount(yyscanner);
2801 BEGIN( yyextra->lastCPPContext) ;
2802 }
2803<SDefine>{ID}{B}*"(" {
2804 yyextra->current->name = yytext;
2805 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2806 yyextra->current->args = "(";
2807 yyextra->current->bodyLine = yyextra->yyLineNr;
2808 yyextra->current->bodyColumn = yyextra->yyColNr;
2809 yyextra->currentArgumentContext = DefineEnd;
2810 yyextra->fullArgString=yyextra->current->args;
2811 yyextra->copyArgString=&yyextra->current->args;
2812 BEGIN( ReadFuncArgType ) ;
2813 }
2814
2815<DefineArg>")" {
2816
2817 yyextra->current->args += ')';
2818 BEGIN( DefineEnd );
2819 }
2820<DefineArg>. {
2821 yyextra->current->args += *yytext;
2822 }
2823 */
2824<SDefine>{ID} {
2825
2827 yyextra->current->bodyLine = yyextra->yyLineNr;
2828 yyextra->current->bodyColumn = yyextra->yyColNr;
2829 yyextra->current->name = yytext;
2830 BEGIN(DefineEnd);
2831 }
2832<DefineEnd><<EOF>> |
2833<DefineEnd>\n {
2834
2836 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2838 BEGIN(yyextra->lastDefineContext);
2839 }
2840<DefinePHPEnd>";" {
2841
2842 yyextra->current->fileName = yyextra->fileName;
2843 yyextra->current->startLine = yyextra->yyLineNr;
2844 yyextra->current->startColumn = yyextra->yyColNr;
2845 yyextra->current->type.clear();
2846 yyextra->current->type = "const";
2850 yyextra->current->initializer.str(
init.str());
2851 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2852 yyextra->current->section = EntryType::makeVariable();
2853 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2855 BEGIN(FindMembers);
2856 }
2857<DefinePHPEnd>.
2858<DefineEnd>\\[\r]?\n {
2860 yyextra->current->endBodyLine = yyextra->yyLineNr;
2861 }
2862<DefineEnd>\" {
2863 if (yyextra->insideIDL && yyextra->insideCppQuote)
2864 {
2865 BEGIN(EndCppQuote);
2866 }
2867 else
2868 {
2869 yyextra->lastStringContext=DefineEnd;
2870 BEGIN(SkipString);
2871 }
2872 }
2873<DefineEnd>.
2874<DefinePHP>{ID}["']{BN}*","{BN}* {
2875 yyextra->current->name = yytext;
2876 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2877 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2878 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
2879 yyextra->current->bodyLine = yyextra->yyLineNr;
2880 yyextra->current->bodyColumn = yyextra->yyColNr;
2881 yyextra->lastRoundContext = DefinePHPEnd;
2882 yyextra->pCopyRoundGString = &yyextra->current->initializer;
2883 yyextra->roundCount = 0;
2884 BEGIN( GCopyRound );
2885 }
2886
2887<FindMembers>[\^%] { // ^ and % are C++/CLI extensions
2888 if (yyextra->insideCli)
2889 {
2891 yyextra->current->name = yytext ;
2892 }
2893 else
2894 {
2895 REJECT;
2896 }
2897 }
2898<FindMembers>[*&]+ {
2899 yyextra->current->name += yytext ;
2901 }
2902<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
2903 if (yyextra->current->bodyLine==-1)
2904 {
2905 yyextra->current->bodyLine=yyextra->yyLineNr;
2906 yyextra->current->bodyColumn = yyextra->yyColNr;
2907 }
2908 yyextra->docBlockContext = YY_START;
2909 yyextra->docBlockInBody =
FALSE;
2910 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2912
2915 yyextra->docBlock.str(indent.
str());
2916
void fill(char c, int len=-1)
Fills a string with a predefined character.
static int computeIndent(const char *s, int startIndent)
2918
2919 yyextra->docBlockTerm = ';';
2920 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2921 {
2922 yyextra->current->bitfields = ":"+yyextra->current->args;
2923 yyextra->current->args.clear();
2924 yyextra->current->section = EntryType::makeVariable();
2925 }
2926 if (yytext[yyleng-3]=='/')
2927 {
2929 BEGIN( DocLine );
2930 }
2931 else
2932 {
2934 BEGIN( DocBlock );
2935 }
2936 }
static void startCommentBlock(yyscan_t yyscanner, bool)
2937<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
2938 yyextra->docBlockContext = YY_START;
2939 yyextra->docBlockInBody =
FALSE;
2940 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2942
2945 yyextra->docBlock.str(indent.
str());
2947
2948 yyextra->docBlockTerm = ',';
2949 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
2950 {
2951 yyextra->current->bitfields = ":"+yyextra->current->args;
2952 yyextra->current->args.clear();
2953 yyextra->current->section = EntryType::makeVariable();
2954 }
2955 if (yytext[yyleng-3]=='/')
2956 {
2958 BEGIN( DocLine );
2959 }
2960 else
2961 {
2963 BEGIN( DocBlock );
2964 }
2965 }
2966<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
2967 if (yyextra->current->bodyLine==-1)
2968 {
2969 yyextra->current->bodyLine=yyextra->yyLineNr;
2970 yyextra->current->bodyColumn = yyextra->yyColNr;
2971 }
2972 yyextra->docBlockContext = YY_START;
2973 yyextra->docBlockInBody =
FALSE;
2974 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2978 yyextra->docBlock.str(indent.
str());
2980
2981 yyextra->docBlockTerm = 0;
2982 if (yytext[yyleng-3]=='/')
2983 {
2985 BEGIN( DocLine );
2986 }
2987 else
2988 {
2990 BEGIN( DocBlock );
2991 }
2992 }
2993
2994<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
2995
2996 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
2997 {
2998
2999 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3000 }
3001 else
3002 {
3003
3004 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3005 }
3006
3008 if (yytext[1]=='/')
3009 {
3010 if (yytext[2]=='!' || yytext[2]=='/')
3011 {
3012 yyextra->docBlockContext = YY_START;
3013 yyextra->docBlockInBody =
FALSE;
3014 yyextra->docBlockAutoBrief =
FALSE;
3015 yyextra->docBlock.str(std::string());
3016 yyextra->docBlockTerm = 0;
3018 BEGIN(DocLine);
3019 }
3020 else
3021 {
3022 yyextra->lastCContext=YY_START;
3023 BEGIN(SkipCxxComment);
3024 }
3025 }
3026 else
3027 {
3028 if (yytext[2]=='!' || yytext[2]=='*')
3029 {
3030 yyextra->docBlockContext = YY_START;
3031 yyextra->docBlockInBody =
FALSE;
3032 yyextra->docBlock.str(std::string());
3033 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3035 yyextra->docBlockTerm = 0;
3037 BEGIN(DocBlock);
3038 }
3039 else
3040 {
3041 yyextra->lastCContext=YY_START;
3042 BEGIN(SkipComment);
3043 }
3044 }
3045 }
3046<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3047 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3048 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3050 }
3051<FindMembers>"=>" {
3052 if (!yyextra->insideCS) REJECT;
3053 yyextra->current->bodyLine = yyextra->yyLineNr;
3054 yyextra->current->bodyColumn = yyextra->yyColNr;
3055 yyextra->current->initializer.str(yytext);
3056 yyextra->lastInitializerContext = YY_START;
3057 yyextra->sharpCount=0;
3058 yyextra->initBracketCount=0;
3059 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3060 yyextra->current->spec.setGettable(true);
3061 BEGIN(ReadInitializerPtr);
3062 }
3063<FindMembers>"=" { // in PHP code this could also be due to "<?="
3064 yyextra->current->bodyLine = yyextra->yyLineNr;
3065 yyextra->current->bodyColumn = yyextra->yyColNr;
3066 yyextra->current->initializer.str(yytext);
3067 yyextra->lastInitializerContext = YY_START;
3068 yyextra->sharpCount=0;
3069 yyextra->initBracketCount=0;
3070 BEGIN(ReadInitializer);
3071 }
3072<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3074 yyextra->current->exception += " ";
3076 }
3077<UNOIDLAttributeBlock>"}" {
3078 yyextra->current->exception += " }";
3079 BEGIN(FindMembers);
3080 }
3081
3082<ReadInitializer,ReadInitializerPtr>"(" {
3083 yyextra->lastRoundContext=YY_START;
3084 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3085 yyextra->roundCount=0;
3086 yyextra->current->initializer << *yytext;
3087 BEGIN(GCopyRound);
3088 }
3089<ReadInitializer,ReadInitializerPtr>"[" {
3090 if (!yyextra->insidePHP) REJECT;
3091 yyextra->lastSquareContext=YY_START;
3092 yyextra->pCopySquareGString=&yyextra->current->initializer;
3093 yyextra->squareCount=0;
3094 yyextra->current->initializer << *yytext;
3095 BEGIN(GCopySquare);
3096 }
3097<ReadInitializer,ReadInitializerPtr>"{" {
3098 yyextra->lastCurlyContext=YY_START;
3099 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3100 yyextra->curlyCount=0;
3101 yyextra->current->initializer << *yytext;
3102 BEGIN(GCopyCurly);
3103 }
3104<ReadInitializer,ReadInitializerPtr>[;,] {
3105
3106 if (*yytext==';' && yyextra->current_root->spec.isEnum())
3107 {
3108 yyextra->current->fileName = yyextra->fileName;
3109 yyextra->current->startLine = yyextra->yyLineNr;
3110 yyextra->current->startColumn = yyextra->yyColNr;
3111 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3112 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3113 yyextra->current->section = EntryType::makeVariable();
3114 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3116 BEGIN(FindMembers);
3117 }
3118 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3119 {
3120 unput(*yytext);
3121 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3122 BEGIN(yyextra->lastInitializerContext);
3123 }
3124 else if (*yytext==',' && yyextra->initBracketCount==0)
3125 {
3126 unput(*yytext);
3127 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3128 BEGIN(yyextra->lastInitializerContext);
3129 }
3130 else
3131 {
3132 yyextra->current->initializer << *yytext;
3133 }
3134 }
3135<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
3136 if (!yyextra->insideCpp)
3137 {
3138 REJECT;
3139 }
3140 else
3141 {
3142 yyextra->current->initializer << yytext;
3144 yyextra->lastRawStringContext = YY_START;
3145 yyextra->pCopyRawGString = &yyextra->current->initializer;
3146 BEGIN(RawGString);
3147
3148 }
3149 }
QCString extractBeginRawStringDelimiter(const char *rawStart)
3150<RawGString>{RAWEND} {
3152 {
3153 *yyextra->pCopyRawGString << yytext;
3154 BEGIN(yyextra->lastRawStringContext);
3155 }
3156 else
3157 {
3158 REJECT;
3159 }
3160 }
QCString extractEndRawStringDelimiter(const char *rawEnd)
3161<RawGString>[^)\n]+ {
3162 *yyextra->pCopyRawGString << yytext;
3163 }
3164<RawGString>. {
3165 *yyextra->pCopyRawGString << yytext;
3166 }
3167<RawGString>\n {
3168 *yyextra->pCopyRawGString << yytext;
3170 }
3171<RawString>{RAWEND} {
3172 *yyextra->pCopyRawString+=yytext;
3173 yyextra->fullArgString+=yytext;
3175 {
3176 BEGIN(yyextra->lastRawStringContext);
3177 }
3178 }
3179<RawString>[^)]+ {
3180 *yyextra->pCopyRawString += yytext;
3181 yyextra->fullArgString+=yytext;
3182 }
3183<RawString>. {
3184 *yyextra->pCopyRawString += yytext;
3185 yyextra->fullArgString+=yytext;
3186 }
3187<RawString>\n {
3188 *yyextra->pCopyRawString += yytext;
3189 yyextra->fullArgString+=yytext;
3191 }
3192<ReadInitializer,ReadInitializerPtr>\" {
3193 if (yyextra->insideIDL && yyextra->insideCppQuote)
3194 {
3195 BEGIN(EndCppQuote);
3196 }
3197 else
3198 {
3199 yyextra->lastStringContext=YY_START;
3200 yyextra->current->initializer << yytext;
3201 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3202 yyextra->stopAtInvalidString=false;
3203 BEGIN(CopyGString);
3204 }
3205 }
3206<ReadInitializer,ReadInitializerPtr>"->" {
3207 yyextra->current->initializer << yytext;
3208 }
3209<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3210 yyextra->current->initializer << yytext;
3211 }
3212<ReadInitializer,ReadInitializerPtr>(">>") {
3213 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3214 {
3215
3216 yyextra->initBracketCount-=2;
3217 yyextra->sharpCount-=2;
3218 }
3219 yyextra->current->initializer << yytext;
3220 }
3221<ReadInitializer,ReadInitializerPtr>(">=") {
3222 yyextra->current->initializer << yytext;
3223 }
3224<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3225 yyextra->initBracketCount++;
3226 yyextra->sharpCount++;
3227 yyextra->current->initializer << *yytext;
3228 }
3229<ReadInitializer,ReadInitializerPtr>[>\]})] {
3230 yyextra->initBracketCount--;
3231 yyextra->sharpCount--;
3232 if (*yytext=='}')
3233 {
3234 yyextra->current->endBodyLine=yyextra->yyLineNr;
3235 }
3236 yyextra->current->initializer << *yytext;
3237 }
3238<ReadInitializer,ReadInitializerPtr>\' {
3239 if (yyextra->insidePHP)
3240 {
3241 yyextra->current->initializer << yytext;
3242 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3243 yyextra->lastStringContext=YY_START;
3244 BEGIN(CopyPHPGString);
3245 }
3246 else
3247 {
3248 yyextra->current->initializer << yytext;
3249 }
3250 }
3251<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3252 if (yyextra->insidePHP)
3253 {
3254 REJECT;
3255 }
3256 else
3257 {
3258 yyextra->current->initializer << yytext;
3259 }
3260 }
3261<ReadInitializer,ReadInitializerPtr>\n {
3262 yyextra->current->initializer << *yytext;
3264 }
3265<ReadInitializer,ReadInitializerPtr>"@\"" {
3266
3267 yyextra->current->initializer << yytext;
3268 if (!yyextra->insideCS && !yyextra->insideObjC)
3269 {
3270 REJECT;
3271 }
3272 else
3273 {
3274
3275 yyextra->lastSkipVerbStringContext=YY_START;
3276 yyextra->pSkipVerbString=&yyextra->current->initializer;
3277 BEGIN(SkipVerbString);
3278 }
3279 }
3280<SkipVerbString>[^\n"\\]+ {
3281 *yyextra->pSkipVerbString << yytext;
3282 }
3283<SkipVerbString>"\\\\" { // escaped backslash
3284 if (yyextra->insideCS) REJECT
3285 *yyextra->pSkipVerbString << yytext;
3286 }
3287<SkipVerbString>"\\\"" { // backslash escaped quote
3288 if (yyextra->insideCS) REJECT
3289 *yyextra->pSkipVerbString << yytext;
3290 }
3291<SkipVerbString>"\"\"" { // quote escape
3292 *yyextra->pSkipVerbString << yytext;
3293 }
3294<SkipVerbString>"\"" {
3295 *yyextra->pSkipVerbString << *yytext;
3296 BEGIN(yyextra->lastSkipVerbStringContext);
3297 }
3298<SkipVerbString>\n {
3299 *yyextra->pSkipVerbString << *yytext;
3301 }
3302<SkipVerbString>. {
3303 *yyextra->pSkipVerbString << *yytext;
3304 }
3305<ReadInitializer,ReadInitializerPtr>"?>" {
3306 if (yyextra->insidePHP)
3307 BEGIN( FindMembersPHP );
3308 else
3309 yyextra->current->initializer << yytext;
3310 }
3311<ReadInitializer,ReadInitializerPtr>. {
3312 yyextra->current->initializer << *yytext;
3313 }
3314
3315
3316<CopyString,CopyPHPString>\\. {
3317 *yyextra->pCopyQuotedString+=yytext;
3318 }
3319<CopyString>\" {
3320 *yyextra->pCopyQuotedString+=*yytext;
3321 BEGIN( yyextra->lastStringContext );
3322 }
3323<CopyPHPString>\' {
3324 *yyextra->pCopyQuotedString+=*yytext;
3325 BEGIN( yyextra->lastStringContext );
3326 }
3327<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3328 *yyextra->pCopyQuotedString+=yytext;
3329 }
3330<CopyString,CopyPHPString>\n {
3331 *yyextra->pCopyQuotedString+=*yytext;
3333 }
3334<CopyString,CopyPHPString>. {
3335 *yyextra->pCopyQuotedString+=*yytext;
3336 }
3337
3338
3339<CopyGString,CopyPHPGString>\\. {
3340 *yyextra->pCopyQuotedGString << yytext;
3341 }
3342<CopyGString>\" {
3343 *yyextra->pCopyQuotedGString << *yytext;
3344 BEGIN( yyextra->lastStringContext );
3345 }
3346<CopyPHPGString>\' {
3347 *yyextra->pCopyQuotedGString << *yytext;
3348 BEGIN( yyextra->lastStringContext );
3349 }
3350<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3351 *yyextra->pCopyQuotedGString << yytext;
3352 BEGIN( yyextra->lastStringContext );
3353 }
3354<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3355 *yyextra->pCopyQuotedGString << yytext;
3356 }
3357<CopyGString,CopyPHPGString>\n {
3358 *yyextra->pCopyQuotedGString << *yytext;
3359 if (yyextra->stopAtInvalidString)
3360 {
3361 BEGIN( yyextra->lastStringContext );
3362 }
3363 else
3364 {
3366 }
3367 }
3368<CopyGString,CopyPHPGString>. {
3369 *yyextra->pCopyQuotedGString << *yytext;
3370 }
3371
3372
3373<CopyRound>\" {
3374 *yyextra->pCopyRoundString += *yytext;
3375 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3376 yyextra->lastStringContext=YY_START;
3377 BEGIN(CopyString);
3378 }
3379<CopyRound>"(" {
3380 *yyextra->pCopyRoundString += *yytext;
3381 yyextra->roundCount++;
3382 }
3383<CopyRound>")" {
3384 *yyextra->pCopyRoundString += *yytext;
3385 if (--yyextra->roundCount<0)
3386 BEGIN(yyextra->lastRoundContext);
3387 }
3388<CopyRound>\n {
3390 *yyextra->pCopyRoundString += *yytext;
3391 }
3392<CopyRound>\' {
3393 if (yyextra->insidePHP)
3394 {
3395 yyextra->current->initializer << yytext;
3396 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3397 yyextra->lastStringContext=YY_START;
3398 BEGIN(CopyPHPString);
3399 }
3400 else
3401 {
3402 *yyextra->pCopyRoundString += yytext;
3403 }
3404 }
3405<CopyRound>{CHARLIT} {
3406 if (yyextra->insidePHP)
3407 {
3408 REJECT;
3409 }
3410 else
3411 {
3412 *yyextra->pCopyRoundString+=yytext;
3413 }
3414 }
3415<CopyRound>[^"'()\n,]+ {
3416 *yyextra->pCopyRoundString+=yytext;
3417 }
3418<CopyRound>. {
3419 *yyextra->pCopyRoundString+=*yytext;
3420 }
3421
3422
3423<CopySharp>\" {
3424 *yyextra->pCopySharpString += *yytext;
3425 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3426 yyextra->lastStringContext=YY_START;
3427 BEGIN(CopyString);
3428 }
3429<CopySharp>"<" {
3430 *yyextra->pCopySharpString += *yytext;
3431 yyextra->sharpCount++;
3432 }
3433<CopySharp>">" {
3434 *yyextra->pCopySharpString += *yytext;
3435 if (--yyextra->sharpCount<0)
3436 {
3437 BEGIN(yyextra->lastSharpContext);
3438 }
3439 }
3440<CopySharp>\n {
3442 *yyextra->pCopySharpString += *yytext;
3443 }
3444<CopySharp>\' {
3445 if (yyextra->insidePHP)
3446 {
3447 yyextra->current->initializer << yytext;
3448 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3449 yyextra->lastStringContext=YY_START;
3450 BEGIN(CopyPHPString);
3451 }
3452 else
3453 {
3454 *yyextra->pCopySharpString += yytext;
3455 }
3456 }
3457<CopySharp>{CHARLIT} {
3458 if (yyextra->insidePHP)
3459 {
3460 REJECT;
3461 }
3462 else
3463 {
3464 *yyextra->pCopySharpString+=yytext;
3465 }
3466 }
3467<CopySharp>[^"'<>\n,]+ {
3468 *yyextra->pCopySharpString+=yytext;
3469 }
3470<CopySharp>. {
3471 *yyextra->pCopySharpString+=*yytext;
3472 }
3473
3474
3475
3476<GCopyRound>\" {
3477 *yyextra->pCopyRoundGString << *yytext;
3478 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3479 yyextra->lastStringContext=YY_START;
3480 BEGIN(CopyGString);
3481 }
3482<GCopyRound>"(" {
3483 *yyextra->pCopyRoundGString << *yytext;
3484 yyextra->roundCount++;
3485 }
3486<GCopyRound>")" {
3487 *yyextra->pCopyRoundGString << *yytext;
3488 if (--yyextra->roundCount<0)
3489 BEGIN(yyextra->lastRoundContext);
3490 }
3491<GCopyRound>\n {
3493 *yyextra->pCopyRoundGString << *yytext;
3494 }
3495<GCopyRound>\' {
3496 if (yyextra->insidePHP)
3497 {
3498 yyextra->current->initializer << yytext;
3499 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3500 yyextra->lastStringContext=YY_START;
3501 BEGIN(CopyPHPGString);
3502 }
3503 else
3504 {
3505 *yyextra->pCopyRoundGString << yytext;
3506 }
3507 }
3508<GCopyRound>{CHARLIT} {
3509 if (yyextra->insidePHP)
3510 {
3511 REJECT;
3512 }
3513 else
3514 {
3515 *yyextra->pCopyRoundGString << yytext;
3516 }
3517 }
3518<GCopyRound>"@\"" {
3519 if (!yyextra->insideCS) REJECT;
3520 *yyextra->pCopyRoundGString << yytext;
3521 yyextra->lastSkipVerbStringContext=YY_START;
3522 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3523 BEGIN(SkipVerbString);
3524 }
3525<GCopyRound>[^"'()\n\/,R]+ { // R because of raw string start
3526 *yyextra->pCopyRoundGString << yytext;
3527 }
3528<GCopyRound>{RAWBEGIN} {
3529 *yyextra->pCopyRoundGString << yytext;
3531 yyextra->lastRawStringContext = YY_START;
3532 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3533 BEGIN(RawGString);
3534 }
3535<GCopyRound>. {
3536 *yyextra->pCopyRoundGString << *yytext;
3537 }
3538
3539
3540<GCopySquare>\" {
3541 *yyextra->pCopySquareGString << *yytext;
3542 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3543 yyextra->lastStringContext=YY_START;
3544 BEGIN(CopyGString);
3545 }
3546<GCopySquare>\' {
3547 *yyextra->pCopySquareGString << *yytext;
3548 if (yyextra->insidePHP)
3549 {
3550 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3551 yyextra->lastStringContext=YY_START;
3552 BEGIN(CopyPHPGString);
3553 }
3554 }
3555<GCopySquare>"[" {
3556 *yyextra->pCopySquareGString << *yytext;
3557 yyextra->squareCount++;
3558 }
3559<GCopySquare>"]" {
3560 *yyextra->pCopySquareGString << *yytext;
3561 if (--yyextra->squareCount<0)
3562 BEGIN(yyextra->lastSquareContext);
3563 }
3564<GCopySquare>\n {
3566 *yyextra->pCopySquareGString << *yytext;
3567 }
3568<GCopySquare>\' {
3569 if (yyextra->insidePHP)
3570 {
3571 yyextra->current->initializer << yytext;
3572 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3573 yyextra->lastStringContext=YY_START;
3574 BEGIN(CopyPHPGString);
3575 }
3576 else
3577 {
3578 *yyextra->pCopySquareGString << yytext;
3579 }
3580 }
3581<GCopySquare>{CHARLIT} {
3582 if (yyextra->insidePHP)
3583 {
3584 REJECT;
3585 }
3586 else
3587 {
3588 *yyextra->pCopySquareGString << yytext;
3589 }
3590 }
3591<GCopySquare>[^"'\[\]\n\/,]+ {
3592 *yyextra->pCopySquareGString << yytext;
3593 }
3594<GCopySquare>. {
3595 *yyextra->pCopySquareGString << *yytext;
3596 }
3597
3598
3599<CopyCurly>\" {
3600 *yyextra->pCopyCurlyString += *yytext;
3601 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3602 yyextra->lastStringContext=YY_START;
3603 BEGIN(CopyString);
3604 }
3605<CopyCurly>\' {
3606 *yyextra->pCopyCurlyString += *yytext;
3607 if (yyextra->insidePHP)
3608 {
3609 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3610 yyextra->lastStringContext=YY_START;
3611 BEGIN(CopyPHPString);
3612 }
3613 }
3614<CopyCurly>"{" {
3615 *yyextra->pCopyCurlyString += *yytext;
3616 yyextra->curlyCount++;
3617 }
3618<CopyCurly>"}" {
3619 *yyextra->pCopyCurlyString += *yytext;
3620 if (--yyextra->curlyCount<0)
3621 BEGIN(yyextra->lastCurlyContext);
3622 }
3623<CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3624 {
3625 REJECT;
3626 }
3627 else
3628 {
3629 *yyextra->pCopyCurlyString += yytext;
3630 }
3631 }
3632<CopyCurly>[^"'{}\/\n,]+ {
3633 *yyextra->pCopyCurlyString += yytext;
3634 }
3635<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3636<CopyCurly>\n {
3638 *yyextra->pCopyCurlyString += *yytext;
3639 }
3640<CopyCurly>. {
3641 *yyextra->pCopyCurlyString += *yytext;
3642 }
3643
3644
3645<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3646 }
3647<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3649 int s = line.
find(
' ');
3650 int e = line.
find(
'"',s);
3651 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3652 if (yytext[yyleng-1]=='\n')
3653 {
3655 yyextra->column=0;
3656 }
3657 }
int toInt(bool *ok=nullptr, int base=10) const
3658<GCopyCurly>\" {
3659 *yyextra->pCopyCurlyGString << *yytext;
3660 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3661 yyextra->lastStringContext=YY_START;
3662 BEGIN(CopyGString);
3663 }
3664<GCopyCurly>\' {
3665 *yyextra->pCopyCurlyGString << *yytext;
3666 if (yyextra->insidePHP)
3667 {
3668 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3669 yyextra->lastStringContext=YY_START;
3670 BEGIN(CopyPHPGString);
3671 }
3672 }
3673<GCopyCurly>"{" {
3674 *yyextra->pCopyCurlyGString << *yytext;
3675 yyextra->curlyCount++;
3676 }
3677<GCopyCurly>"}" {
3678 *yyextra->pCopyCurlyGString << *yytext;
3679 if (--yyextra->curlyCount<0)
3680 {
3681 yyextra->current->endBodyLine = yyextra->yyLineNr;
3682 BEGIN(yyextra->lastCurlyContext);
3683 }
3684 }
3685<GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3686 {
3687 REJECT;
3688 }
3689 else
3690 {
3691 *yyextra->pCopyCurlyGString << yytext;
3692 }
3693 }
3694<GCopyCurly>[^"'{}\/\n,]+ {
3695 *yyextra->pCopyCurlyGString << yytext;
3696 }
3697<GCopyCurly>[,]+ {
3698 *yyextra->pCopyCurlyGString << yytext;
3699 }
3700<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3701<GCopyCurly>\n {
3703 *yyextra->pCopyCurlyGString << *yytext;
3704 }
3705<GCopyCurly>. {
3706 *yyextra->pCopyCurlyGString << *yytext;
3707 }
3708
3709
3710
3711
3712<FindMembers>":" {
3713 if (yyextra->current->type.isEmpty() &&
3714 yyextra->current->name=="enum")
3715 {
3716 yyextra->current->section = EntryType::makeEnum();
3717 yyextra->current->name.clear();
3718 yyextra->current->args.clear();
3719 BEGIN(EnumBaseType);
3720 }
3721 else
3722 {
3723 if (yyextra->current->type.isEmpty())
3724 {
3726 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
3727 }
3728 BEGIN(BitFields);
3729 yyextra->current->bitfields+=":";
3730 }
3731 }
3732<BitFields>. {
3733 yyextra->current->bitfields+=*yytext;
3734 }
3735<EnumBaseType>. {
3736 yyextra->current->args+=*yytext;
3737 }
3738<EnumBaseType>\n {
3740 yyextra->current->args+=' ';
3741 }
3742<FindMembers>[;,] {
3743 QCString oldType = yyextra->current->type;
3744 if (yyextra->current->bodyLine==-1)
3745 {
3746 yyextra->current->bodyLine = yyextra->yyLineNr;
3747 yyextra->current->bodyColumn = yyextra->yyColNr;
3748 }
3749 if ( yyextra->insidePHP && yyextra->current->type.startsWith("var"))
3750 {
3751 yyextra->current->type = yyextra->current->type.mid(3);
3752 }
3753 if (yyextra->isTypedef && !yyextra->current->type.startsWith("typedef "))
3754 {
3755 yyextra->current->type.prepend("typedef ");
3756 }
3757 bool isStatic = yyextra->current->isStatic;
3758 Protection prot = yyextra->current->protection;
3759 bool isConcept = yyextra->current->section.isConcept();
3760 bool isModule = yyextra->current->section.isModuleDoc();
3761 if (isConcept)
3762 {
3763 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3765 }
3766 else if (isModule)
3767 {
3768 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3770 }
3771 else if (!yyextra->current->name.isEmpty() && !yyextra->current->section.isEnum())
3772 {
3773 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
3775 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
3776 if (yyextra->current->section.isClass())
3777 {
3779 }
3780 yyextra->current->section = EntryType::makeVariable() ;
3781 yyextra->current->fileName = yyextra->fileName;
3782 yyextra->current->startLine = yyextra->yyBegLineNr;
3783 yyextra->current->startColumn = yyextra->yyBegColNr;
3784 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3786 }
3787 if ( *yytext == ',')
3788 {
3789 yyextra->current->isStatic = isStatic;
3790 yyextra->current->protection = prot;
3791 yyextra->current->name.clear();
3792 yyextra->current->args.clear();
3793 yyextra->current->brief.clear();
3794 yyextra->current->doc.clear();
3795 yyextra->current->initializer.str(std::string());
3796 yyextra->current->bitfields.clear();
3798 }
3799 else
3800 {
3801 yyextra->mtype = MethodTypes::Method;
3802 yyextra->virt = Specifier::Normal;
3803 yyextra->current->bodyLine = -1;
3804 yyextra->current->bodyColumn = 1;
3805 yyextra->current->groups.clear();
3807 }
3808 }
static QCString stripFuncPtr(const QCString &type)
3809
3810<FindMembers>"[" {
3811 if (yyextra->insideSlice)
3812 {
3813 yyextra->squareCount=1;
3814 yyextra->lastSquareContext = YY_START;
3815 yyextra->current->metaData += "[";
3816 BEGIN( SliceMetadata );
3817 }
3818 else if (!yyextra->insideCS &&
3819 (yyextra->current->name.isEmpty() ||
3820 yyextra->current->name=="typedef"
3821 )
3822 )
3823 {
3824 yyextra->squareCount=1;
3825 yyextra->lastSquareContext = YY_START;
3826 yyextra->idlAttr.clear();
3827 yyextra->idlProp.clear();
3828 yyextra->current->mtype = yyextra->mtype;
3829
3831 yyextra->current->mtype == MethodTypes::Property)
3832 {
3833 yyextra->odlProp = true;
3834 yyextra->current->spec.setGettable(true).setSettable(true);
3835 }
3836
3837 BEGIN( IDLAttribute );
3838 }
3839 else if (yyextra->insideCS &&
3840 yyextra->current->name.isEmpty())
3841 {
3842 yyextra->squareCount=1;
3843 yyextra->lastSquareContext = YY_START;
3844
3845
3846 yyextra->current->args.clear();
3847 BEGIN( SkipSquare );
3848 }
3849 else
3850 {
3851 yyextra->current->args += yytext ;
3852 yyextra->squareCount=1;
3853 yyextra->externLinkage=
FALSE;
3854 BEGIN( Array ) ;
3855 }
3856 }
3857<SliceMetadata>"[" { // Global metadata.
3858 yyextra->squareCount++;
3859 yyextra->current->metaData += "[";
3860 }
3861<SliceMetadata>{BN}* {
3863 }
3864<SliceMetadata>\"[^\"]*\" {
3865 yyextra->current->metaData += yytext;
3866 }
3867<SliceMetadata>"," {
3868 yyextra->current->metaData += yytext;
3869 }
3870<SliceMetadata>"]" {
3871 yyextra->current->metaData += yytext;
3872 if (--yyextra->squareCount<=0)
3873 {
3874 BEGIN (yyextra->lastSquareContext);
3875 }
3876 }
3877<SliceOptional>"(" {
3878 yyextra->current->type += "(";
3879 yyextra->roundCount++;
3880 }
3881<SliceOptional>[0-9]+ {
3882 yyextra->current->type += yytext;
3883 }
3884<SliceOptional>")" {
3885 yyextra->current->type += ")";
3886 if(--yyextra->roundCount<=0)
3887 {
3888 BEGIN (yyextra->lastModifierContext);
3889 }
3890 }
3891<IDLAttribute>"]" {
3892
3893 if (--yyextra->squareCount<=0)
3894 {
3896 if (yyextra->current->mtype == MethodTypes::Property)
3897 BEGIN( IDLPropName );
3898 else
3899 BEGIN( yyextra->lastSquareContext );
3900 }
3901 }
3902<IDLAttribute>"propput" {
3904 {
3905 yyextra->current->mtype = MethodTypes::Property;
3906 }
3907 yyextra->current->spec.setSettable(true);
3908 }
3909<IDLAttribute>"propget" {
3911 {
3912 yyextra->current->mtype = MethodTypes::Property;
3913 }
3914 yyextra->current->spec.setGettable(true);
3915 }
3916<IDLAttribute>"property" { // UNO IDL property
3917 yyextra->current->spec.setProperty(true);
3918 }
3919<IDLAttribute>"attribute" { // UNO IDL attribute
3920 yyextra->current->spec.setAttribute(true);
3921 }
3922<IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
3923 yyextra->current->spec.setOptional(true);
3924 }
3925<IDLAttribute>"readonly" { // on UNO IDL attribute or property
3927 {
3928 yyextra->current->spec.setSettable(false);
3929 }
3930 else
3931 {
3932 yyextra->current->spec.setReadonly(true);
3933 }
3934 }
3935<IDLAttribute>"bound" { // on UNO IDL attribute or property
3936 yyextra->current->spec.setBound(true);
3937 }
3938<IDLAttribute>"removable" { // on UNO IDL property
3939 yyextra->current->spec.setRemovable(true);
3940 }
3941<IDLAttribute>"constrained" { // on UNO IDL property
3942 yyextra->current->spec.setConstrained(true);
3943 }
3944<IDLAttribute>"transient" { // on UNO IDL property
3945 yyextra->current->spec.setTransient(true);
3946 }
3947<IDLAttribute>"maybevoid" { // on UNO IDL property
3948 yyextra->current->spec.setMaybeVoid(true);
3949 }
3950<IDLAttribute>"maybedefault" { // on UNO IDL property
3951 yyextra->current->spec.setMaybeDefault(true);
3952 }
3953<IDLAttribute>"maybeambiguous" { // on UNO IDL property
3954 yyextra->current->spec.setMaybeAmbiguous(true);
3955 }
3956<IDLAttribute>. {
3957 }
3958<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
3959
3960
3961 if (yyextra->odlProp)
3962 {
3963 yyextra->idlProp = yytext;
3964 }
3965 }
3966<IDLPropName>{ID}{BN}*"(" {
3967 yyextra->current->name = yytext;
3968 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3969 yyextra->current->startLine = yyextra->yyLineNr;
3970 yyextra->current->startColumn = yyextra->yyColNr;
3971 BEGIN( IDLProp );
3972 }
3973<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
3974 if (yyextra->odlProp)
3975 {
3976 yyextra->idlProp += yytext;
3977 }
3978 }
3979<IDLPropName>{ID}{BNopt}/";" {
3980 if (yyextra->odlProp)
3981 {
3982 yyextra->current->name = yytext;
3983 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
3984 yyextra->odlProp = false;
3985
3986 BEGIN( IDLProp );
3987 }
3988 }
3989<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
3990 yyextra->idlAttr = yytext;
3991 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
3992 }
3993<IDLProp>{ID} { // property type
3994 yyextra->idlProp = yytext;
3995 }
3996<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
3997 if (yyextra->current->args.isEmpty())
3998 yyextra->current->args = "(";
3999 else
4000 yyextra->current->args += ", ";
4001 yyextra->current->args += yyextra->idlAttr;
4002 yyextra->current->args += " ";
4003 yyextra->current->args += yyextra->idlProp;
4004 yyextra->current->args += " ";
4005 yyextra->current->args += yytext;
4006 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4007 yyextra->idlProp.clear();
4008 yyextra->idlAttr.clear();
4009 BEGIN( IDLProp );
4010 }
4011<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4012
4013 }
4014<IDLProp>";" {
4015 yyextra->current->fileName = yyextra->fileName;
4016 yyextra->current->type = yyextra->idlProp;
4017 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4018 if (!yyextra->current->args.isEmpty())
4019 yyextra->current->args += ")";
4020 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4021 yyextra->current->section = EntryType::makeVariable();
4022 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4024 BEGIN( FindMembers );
4025 }
4026<IDLProp>. { // spaces, *, or other stuff
4027
4028 }
4029<Array>"]" { yyextra->current->args += *yytext ;
4030 if (--yyextra->squareCount<=0)
4031 BEGIN( FindMembers ) ;
4032 }
4033<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4034 if (--yyextra->squareCount<=0)
4035 BEGIN( SFunction ) ;
4036 }
4037<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4038 yyextra->squareCount++;
4039 }
4040<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4041<SkipSquare>"[" { yyextra->squareCount++; }
4042<SkipSquare>"]" {
4043 if (--yyextra->squareCount<=0)
4044 BEGIN( yyextra->lastSquareContext );
4045 }
4046<SkipSquare>\" {
4047 yyextra->lastStringContext=YY_START;
4048 BEGIN( SkipString );
4049 }
4050<SkipSquare>[^\n\[\]\"]+
4051<FindMembers>"<" { addType(yyscanner);
4052 yyextra->current->type += yytext ;
4053 BEGIN( Sharp ) ;
4054 }
4055<Sharp>">" { yyextra->current->type += *yytext ;
4056 if (--yyextra->sharpCount<=0)
4057 BEGIN( FindMembers ) ;
4058 }
4059<Sharp>"<" { yyextra->current->type += *yytext ;
4060 yyextra->sharpCount++;
4061 }
4062<Sharp>{BN}+ {
4063 yyextra->current->type += ' ';
4065 }
4066<Sharp>. { yyextra->current->type += *yytext ; }
4067<FindFields>{ID} {
4069 yyextra->current->bodyLine = yyextra->yyLineNr;
4070 yyextra->current->bodyColumn = yyextra->yyColNr;
4071 yyextra->current->name = yytext;
4072 }
4073<FindFields>[({] {
4074
4075 unput(*yytext);
4076 yyextra->lastInitializerContext = YY_START;
4077 yyextra->sharpCount=0;
4078 yyextra->initBracketCount=0;
4079 yyextra->current->initializer.str("=");
4080 BEGIN(ReadInitializer);
4081 }
4082<FindFields>"=" {
4083 yyextra->lastInitializerContext = YY_START;
4084 yyextra->sharpCount=0;
4085 yyextra->initBracketCount=0;
4086 yyextra->current->initializer.str(yytext);
4087 BEGIN(ReadInitializer);
4088 }
4089<FindFields>";" {
4090 if (yyextra->insideJava)
4091 {
4092 if (!yyextra->current->name.isEmpty())
4093 {
4094 yyextra->current->fileName = yyextra->fileName;
4095 yyextra->current->startLine = yyextra->yyLineNr;
4096 yyextra->current->startColumn = yyextra->yyColNr;
4097 if (!yyextra->current_root->spec.isEnum())
4098 {
4099 yyextra->current->type = "@";
4100 }
4101 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4102 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4103 yyextra->current->section = EntryType::makeVariable();
4104 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4106 }
4107
4108 BEGIN( FindMembers );
4109 }
4110 else
4111 {
4112 REJECT;
4113 }
4114 }
4115<FindFields>"," {
4116
4117
4118
4119 if (!yyextra->current->name.isEmpty())
4120 {
4121 yyextra->current->fileName = yyextra->fileName;
4122 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4123 {
4124 yyextra->current->startLine = yyextra->current->bodyLine;
4125 yyextra->current->startColumn = yyextra->current->bodyColumn;
4126 }
4127 else
4128 {
4129 yyextra->current->startLine = yyextra->yyLineNr;
4130 yyextra->current->startColumn = yyextra->yyColNr;
4131 }
4132 if (!yyextra->current_root->spec.isEnum())
4133 {
4134 yyextra->current->type = "@";
4135 }
4136 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4137 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4138 yyextra->current->section = EntryType::makeVariable();
4139
4140 if (!yyextra->insideCS && !yyextra->insideJava &&
4141 !yyextra->current_root->spec.isStrong())
4142
4143
4144 {
4145
4146
4147
4148 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4149 }
4150 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4152 }
4153 else
4154 {
4155 yyextra->current->reset();
4157 }
4158 }
4159<FindFields>"[" { // attribute list in IDL
4160 yyextra->squareCount=1;
4161 yyextra->lastSquareContext = YY_START;
4162 BEGIN(SkipSquare);
4163 }
4164<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; } // R because of raw string start
4165<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4166<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
4167 REJECT;
4168
4169 yyextra->current->program << yytext ;
4170 }
4171
4172<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
4173 yyextra->current->program << yytext ;
4174 yyextra->pSkipInterpString = &yyextra->current->program;
4175 yyextra->lastSkipInterpStringContext=YY_START;
4176 BEGIN( SkipInterpString );
4177 }
4178<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})* {
4179 *yyextra->pSkipInterpString << yytext;
4180 }
4181<SkipInterpString>\" {
4182 *yyextra->pSkipInterpString << *yytext;
4183 BEGIN( yyextra->lastSkipInterpStringContext );
4184 }
4185
4186<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$@\" { if (!yyextra->insideCS) REJECT
4187 yyextra->current->program << yytext ;
4188 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4189 yyextra->lastSkipInterpVerbStringContext=YY_START;
4190 BEGIN( SkipInterpVerbString );
4191 }
4192<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4193 *yyextra->pSkipInterpVerbString << yytext;
4194 }
4195<SkipInterpString>"{"[^}]*"}" {
4196 *yyextra->pSkipInterpString << yytext;
4197 }
4198<SkipInterpVerbString>"{"[^}]*"}" {
4199 *yyextra->pSkipInterpVerbString << yytext;
4200 }
4201<SkipInterpVerbString>\" {
4202 *yyextra->pSkipInterpVerbString << *yytext;
4203 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4204 }
4205<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4206<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4207 yyextra->pSkipVerbString = &yyextra->current->program;
4208 yyextra->lastSkipVerbStringContext=YY_START;
4209 BEGIN( SkipVerbString );
4210 }
4211<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
4212 {
4213 yyextra->current->program << yytext ;
4214 yyextra->pCopyHereDocGString = &yyextra->current->program;
4215 yyextra->lastHereDocContext=YY_START;
4216 BEGIN( CopyHereDoc );
4217 }
4218 else
4219 {
4220 REJECT;
4221 }
4222 }
4223<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4224 yyextra->current->program << yytext;
4226 yyextra->lastRawStringContext = YY_START;
4227 yyextra->pCopyRawGString = &yyextra->current->program;
4228 BEGIN(RawGString);
4229 }
4230<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4231 yyextra->pCopyQuotedGString = &yyextra->current->program;
4232 yyextra->lastStringContext=YY_START;
4233 yyextra->stopAtInvalidString=false;
4234 BEGIN( CopyGString );
4235 }
4236<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=true; REJECT;}
4237<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4238 yyextra->lastContext = YY_START ;
4239 BEGIN( Comment ) ;
4240 }
4241<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4242 ++yyextra->yyLineNr ;
4243 yyextra->lastContext = YY_START ;
4244 BEGIN( Comment ) ;
4245 }
4246<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4247 if (!yyextra->insidePHP)
4248 {
4249 yyextra->current->program << yytext;
4250 }
4251 else
4252 {
4253 yyextra->current->program << yytext;
4254 yyextra->pCopyQuotedGString = &yyextra->current->program;
4255 yyextra->lastStringContext=YY_START;
4256 BEGIN(CopyPHPGString);
4257 }
4258 }
4259<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4260 if (yyextra->insidePHP)
4261 {
4262 REJECT;
4263
4264 }
4265 else
4266 {
4267 yyextra->current->program << yytext;
4268 }
4269 }
4270<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4271 ++yyextra->curlyCount ;
4272 }
4273<ReadBodyIntf>"}" {
4274 yyextra->current->program << yytext ;
4275 --yyextra->curlyCount ;
4276 }
4277<ReadBody,ReadNSBody>"}" {
4278 if ( yyextra->curlyCount>0 )
4279 {
4280 yyextra->current->program << yytext ;
4281 --yyextra->curlyCount ;
4282 }
4283 else
4284 {
4285 yyextra->current->endBodyLine = yyextra->yyLineNr;
4286 std::shared_ptr<Entry> original_root = yyextra->current_root;
4287 if (yyextra->current->section.isNamespace() && yyextra->current->type == "namespace")
4288 {
4289 int split_point;
4290
4291 QCString doc = yyextra->current->doc;
4292 int docLine = yyextra->current->docLine;
4293 QCString docFile = yyextra->current->docFile;
4294 QCString brief = yyextra->current->brief;
4295 int briefLine = yyextra->current->briefLine;
4296 QCString briefFile = yyextra->current->briefFile;
4297
4298 yyextra->current->doc = "";
4299 yyextra->current->docLine = 0;
4300 yyextra->current->docFile = "";
4301 yyextra->current->brief = "";
4302 yyextra->current->briefLine = 0;
4303 yyextra->current->briefFile = "";
4304 while ((split_point = yyextra->current->name.find("::")) != -1)
4305 {
4306 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4307 yyextra->current->program.str(std::string());
4308 new_current->name = yyextra->current->name.mid(split_point + 2);
4309 yyextra->current->name = yyextra->current->name.left(split_point);
4310 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
4311
4312 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4313 yyextra->current_root = yyextra->current;
4314 yyextra->current = new_current;
4315 }
4316
4317 yyextra->current->doc = doc;
4318 yyextra->current->docLine = docLine;
4319 yyextra->current->docFile = docFile;
4320 yyextra->current->brief = brief;
4321 yyextra->current->briefLine = briefLine;
4322 yyextra->current->briefFile = briefFile;
4323 }
4324 QCString &cn = yyextra->current->name;
4325 QCString rn = yyextra->current_root->name;
4326
4328 {
4330 }
4331 if (yyextra->isTypedef && cn.
isEmpty())
4332 {
4333
4334 BEGIN( TypedefName );
4335 }
4336 else
4337 {
4338 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4339 {
4340 yyextra->current->program << ',';
4341 }
4342
4344
4345 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4346 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4347
4348 if (yyextra->insideObjC &&
4349 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4350 )
4351 {
4352 BEGIN( ReadBodyIntf ) ;
4353 }
4354 else
4355 {
4356 yyextra->memspecEntry = yyextra->current;
4357 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4358 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4359 if (yyextra->current->section.isNamespace() ||
4360 yyextra->current->spec.isInterface() ||
4361 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4362 yyextra->insideSlice
4363 )
4364 {
4365 yyextra->current->reset();
4366 yyextra->current_root = std::move(original_root);
4368 yyextra->memspecEntry.reset();
4369 BEGIN( FindMembers ) ;
4370 }
4371 else
4372 {
4373 static const reg::Ex re(R
"(@\d+$)");
4374 if (!yyextra->isTypedef && yyextra->memspecEntry &&
4375 !
reg::search(yyextra->memspecEntry->name.str(),re))
4376 {
4377
4378 yyextra->current->doc.clear();
4379 yyextra->current->brief.clear();
4380 }
4381 BEGIN( MemberSpec ) ;
4382 }
4383 }
4384 }
4385 }
4386 }
static void prependScope(yyscan_t yyscanner)
4387<ReadBody>"}"{BN}+"typedef"{BN}+ {
4389 if ( yyextra->curlyCount>0 )
4390 {
4391 yyextra->current->program << yytext ;
4392 --yyextra->curlyCount ;
4393 }
4394 else
4395 {
4396 yyextra->isTypedef =
TRUE;
4397 yyextra->current->endBodyLine = yyextra->yyLineNr;
4398 QCString &cn = yyextra->current->name;
4399 QCString rn = yyextra->current_root->name;
4401 {
4403 }
4404 BEGIN( TypedefName );
4405 }
4406 }
4407<TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
4409 yyextra->current->type.prepend(yytext);
4410 }
4411<TypedefName>{ID} {
4412 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4413 {
4414 yyextra->current->program << ",";
4415 }
4416 yyextra->current->name=yytext;
4418 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4419 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4420
4421 if (!yyextra->firstTypedefEntry)
4422 {
4423 yyextra->firstTypedefEntry = yyextra->current;
4424 }
4425 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4427 yyextra->isTypedef=
TRUE;
4428 BEGIN(MemberSpecSkip);
4429 }
4430<TypedefName>";" { /* typedef of anonymous type */
4432 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4433 {
4434 yyextra->current->program << ',';
4435 }
4436
4437 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4438 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4439 yyextra->memspecEntry = yyextra->current;
4440 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4442 unput(';');
4443 BEGIN( MemberSpec ) ;
4444 }
QCString generateAnonymousAnchor(const QCString &fileName, int count)
4445<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4447 int i=0,l=(int)yyleng,j;
4448 while (i<l && (!
isId(yytext[i]))) i++;
4450 j=yyextra->msName.
find(
"[");
4451 if (j!=-1)
4452 {
4453 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4454 yyextra->msName=yyextra->msName.left(j);
4455 }
QCString right(size_t len) const
4457
4458
4459 if (yyextra->firstTypedefEntry)
4460 {
4461 if (yyextra->firstTypedefEntry->spec.isStruct())
4462 {
4463 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4464 }
4465 else if (yyextra->firstTypedefEntry->spec.isUnion())
4466 {
4467 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4468 }
4469 else if (yyextra->firstTypedefEntry->section.isEnum())
4470 {
4471 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4472 }
4473 else
4474 {
4475 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4476 }
4477 }
4478 }
4479<MemberSpec>"(" { // function with struct return type
4481 yyextra->current->name = yyextra->msName;
4483 unput('(');
4484 BEGIN(FindMembers);
4485 }
4486<MemberSpec>[,;] {
4487 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4488 {
4489
4490
4491
4492
4493 const Entry *p=yyextra->current.get();
4494 while (p)
4495 {
4496
4498 {
4499
4501 int pi = (i==-1) ? 0 : i+2;
4503 {
4504
4505
4507 break;
4508 }
4509 }
4510
4511 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4512 }
4513 }
4514
4515 if (!yyextra->msName.isEmpty()
4516 )
4517 {
4519
4520
4521 if (typedefHidesStruct &&
4522 yyextra->isTypedef &&
4523 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4524 yyextra->msType.stripWhiteSpace().isEmpty() &&
4525 yyextra->memspecEntry)
4526 {
4527 yyextra->memspecEntry->name=yyextra->msName;
4528 }
4529 else
4530 {
4531 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4532 varEntry->lang = yyextra->language;
4533 varEntry->protection = yyextra->current->protection ;
4534 varEntry->mtype = yyextra->current->mtype;
4535 varEntry->virt = yyextra->current->virt;
4536 varEntry->isStatic = yyextra->current->isStatic;
4537 varEntry->section = EntryType::makeVariable();
4538 varEntry->name = yyextra->msName.stripWhiteSpace();
4539 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4540 varEntry->args = yyextra->msArgs;
4541 if (yyextra->isTypedef)
4542 {
4543 varEntry->type.prepend("typedef ");
4544
4545 }
4546 if (typedefHidesStruct &&
4547 yyextra->isTypedef &&
4548 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4549 yyextra->memspecEntry
4550 )
4551 {
4552 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4553 }
4554 else
4555 {
4556 varEntry->type+=yyextra->current->name+yyextra->msType;
4557 }
4558 varEntry->fileName = yyextra->fileName;
4559 varEntry->startLine = yyextra->yyLineNr;
4560 varEntry->startColumn = yyextra->yyColNr;
4561 varEntry->doc = yyextra->current->doc;
4562 varEntry->brief = yyextra->current->brief;
4563 varEntry->mGrpId = yyextra->current->mGrpId;
4564 varEntry->initializer.str(yyextra->current->initializer.str());
4565 varEntry->groups = yyextra->current->groups;
4566 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
4567
4568
4569
4570
4571 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4572 }
4573 }
4574 if (*yytext==';')
4575 {
4576 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && yyextra->current->section.isCompound())
4577 {
4578 if (!yyextra->current->doc.isEmpty())
4579 {
4580 yyextra->memspecEntry->doc += yyextra->current->doc;
4581 }
4582 if (!yyextra->current->brief.isEmpty())
4583 {
4584 yyextra->memspecEntry->brief += yyextra->current->brief;
4585 }
4586 }
4587 yyextra->msType.clear();
4588 yyextra->msName.clear();
4589 yyextra->msArgs.clear();
4590 yyextra->isTypedef=
FALSE;
4591 yyextra->firstTypedefEntry.reset();
4592 yyextra->memspecEntry.reset();
4593 yyextra->current->reset();
4595 BEGIN( FindMembers );
4596 }
4597 else
4598 {
4599 yyextra->current->doc.clear();
4600 yyextra->current->brief.clear();
4601 }
4602
4603 }
4604<MemberSpec>"=" {
4605 yyextra->lastInitializerContext=YY_START;
4606 yyextra->sharpCount=0;
4607 yyextra->initBracketCount=0;
4608 yyextra->current->initializer.str(yytext);
4609 BEGIN(ReadInitializer);
4610
4611 }
4612
4613<MemberSpecSkip>"{" {
4614 yyextra->curlyCount=0;
4615 yyextra->lastCurlyContext = MemberSpecSkip;
4616 yyextra->previous = yyextra->current;
4617 BEGIN(SkipCurly);
4618 }
4619 */
4620<MemberSpecSkip>"," { BEGIN(MemberSpec); }
4621<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4622<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4624 }
4625<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4626 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4628 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
4629 yyextra->insideObjC=
FALSE;
4630 BEGIN( FindMembers );
4631 }
4632<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
4633<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
4634
4635<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
4636<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
4637 if (yyextra->insidePHP)
4638 {
4639 REJECT
4640 }
4641 else
4642 {
4643 yyextra->current->bodyLine = yyextra->yyLineNr;
4644 yyextra->current->bodyColumn = yyextra->yyColNr;
4647 yyextra->funcPtrType=yytext;
4648 yyextra->roundCount=0;
4649
4650 BEGIN( FuncPtr );
4651 }
4652 }
4653<FuncPtr>{SCOPENAME} {
4654 yyextra->current->name = yytext;
4656 {
4657 BEGIN( FuncPtrOperator );
4658 }
4659 else
4660 {
4661 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
4662 {
4663 yyextra->funcPtrType += yyextra->current->name;
4664 }
4665 else
4666 {
4667 BEGIN( EndFuncPtr );
4668 }
4669 }
4670 }
4671<FuncPtr>. {
4672
4673 }
4674<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
4675 yyextra->current->name += yytext;
4676 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
4678 }
4679<FuncPtrOperator>\n {
4681 yyextra->current->name += *yytext;
4682 }
4683<FuncPtrOperator>"(" {
4684 unput(*yytext);
4685 BEGIN( EndFuncPtr );
4686 }
4687<FuncPtrOperator>. {
4688 yyextra->current->name += *yytext;
4689 }
4690<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
4692 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4693 BEGIN(FindMembers);
4694 }
4695<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
4697 if (yyextra->funcPtrType!="(")
4698 {
4699 yyextra->current->type+=yyextra->funcPtrType+")";
4700 }
4701 BEGIN(FindMembers);
4702 }
4703<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
4705 yyextra->current->type+=yyextra->funcPtrType;
4706 yyextra->current->args += ")";
4707 BEGIN(FindMembers);
4708 }
4709<EndFuncPtr>"(" { // a function returning a function or
4710
4711 yyextra->current->args += *yytext ;
4712
4713
4714 yyextra->current->bodyLine = yyextra->yyLineNr;
4715 yyextra->current->bodyColumn = yyextra->yyColNr;
4716 yyextra->currentArgumentContext = FuncFuncEnd;
4717 yyextra->fullArgString=yyextra->current->args;
4718 yyextra->copyArgString=&yyextra->current->args;
4719 BEGIN( ReadFuncArgType ) ;
4720 }
4721<EndFuncPtr>"["[^\n\]]*"]" {
4722 yyextra->funcPtrType+=yytext;
4723 }
4724<EndFuncPtr>")" {
4725 BEGIN(FindMembers);
4726 }
4727<FuncFunc>"(" {
4728 yyextra->current->args += *yytext ;
4729 ++yyextra->roundCount;
4730 }
4731<FuncFunc>")" {
4732 yyextra->current->args += *yytext ;
4733 if ( yyextra->roundCount )
4734 --yyextra->roundCount;
4735 else
4736 {
4737 BEGIN(FuncFuncEnd);
4738 }
4739 }
4740<FuncFuncEnd>")"{BN}*"(" {
4742 yyextra->current->type+=yyextra->funcPtrType+")(";
4743 BEGIN(FuncFuncType);
4744 }
4745<FuncFuncEnd>")"{BNopt}/[;{] {
4747 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4748 BEGIN(SFunction);
4749 }
4750<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
4752 yyextra->current->type+=yyextra->funcPtrType;
4753 yyextra->current->args+=")";
4754 BEGIN(FuncFuncArray);
4755 }
4756<FuncFuncEnd>. {
4757 yyextra->current->args += *yytext;
4758 }
4759<FuncFuncType>"(" {
4760 yyextra->current->type += *yytext;
4761 yyextra->roundCount++;
4762 }
4763<FuncFuncType>")" {
4764 yyextra->current->type += *yytext;
4765 if (yyextra->roundCount)
4766 --yyextra->roundCount;
4767 else
4768 BEGIN(SFunction);
4769 }
4770<FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
4771<FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
4772<FuncFuncType>. {
4773 yyextra->current->type += *yytext;
4774 }
4775<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
4776 if (yyextra->current->type.startsWith("typedef") &&
4777 yyextra->current->bodyLine==-1)
4778
4779 {
4780 yyextra->current->bodyLine = yyextra->yyLineNr;
4781 yyextra->current->bodyColumn = yyextra->yyColNr;
4782 BEGIN( GetCallType );
4783 }
4784 else if (!yyextra->current->name.isEmpty())
4785 {
4786 yyextra->current->args = yytext;
4787 yyextra->current->bodyLine = yyextra->yyLineNr;
4788 yyextra->current->bodyColumn = yyextra->yyColNr;
4789 yyextra->currentArgumentContext = FuncQual;
4790 yyextra->fullArgString=yyextra->current->args;
4791 yyextra->copyArgString=&yyextra->current->args;
4792 BEGIN( ReadFuncArgType ) ;
4793
4794 }
4795 }
4796<GetCallType>{BN}*{ID}{BN}*"*" {
4799 yyextra->funcPtrType="(";
4800 yyextra->funcPtrType+=yytext;
4801 yyextra->roundCount=0;
4802 BEGIN( FuncPtr );
4803 }
4804<FindMembers>"(" {
4805 if (!yyextra->current->name.isEmpty())
4806 {
4807 yyextra->current->args = yytext;
4808 yyextra->current->bodyLine = yyextra->yyLineNr;
4809 yyextra->current->bodyColumn = yyextra->yyColNr;
4810 yyextra->currentArgumentContext = FuncQual;
4811 yyextra->fullArgString=yyextra->current->args;
4812 yyextra->copyArgString=&yyextra->current->args;
4813 BEGIN( ReadFuncArgType ) ;
4814
4815 }
4816 }
4817
4818<FindMembers>"("{BN}*("void"{BN}*)?")" {
4820 yyextra->current->args = "()";
4821 BEGIN( FuncQual );
4822 }
4823 */
4824
4825
4826
4827<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
4828 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
4829 else yyextra->fullArgString+=yytext;
4830 }
4831<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
4832 yyextra->fullArgString+=yytext;
4833 }
4834<CopyArgRound>[^\/\n\)\(\"\']+ {
4835 *yyextra->copyArgString+=yytext;
4836 yyextra->fullArgString+=yytext;
4837 }
4838<CopyArgSquare>[^\/\n\]\[\"\']+ {
4839 *yyextra->copyArgString+=yytext;
4840 yyextra->fullArgString+=yytext;
4841 }
4842<ReadFuncArgType,ReadTempArgs>{BN}* {
4843 *yyextra->copyArgString+=" ";
4844 yyextra->fullArgString+=" ";
4846 }
4847<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
4849 yyextra->lastRawStringContext = YY_START;
4850 yyextra->pCopyRawString = yyextra->copyArgString;
4851 *yyextra->pCopyRawString+=yytext;
4852 yyextra->fullArgString+=yytext;
4853 BEGIN(RawString);
4854 }
4855<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
4856 *yyextra->copyArgString+=*yytext;
4857 yyextra->fullArgString+=*yytext;
4858 yyextra->lastCopyArgStringContext = YY_START;
4859 BEGIN( CopyArgString );
4860 }
4861<ReadFuncArgType>"[" {
4862 if (!yyextra->insidePHP) REJECT;
4863 *yyextra->copyArgString+=*yytext;
4864 yyextra->fullArgString+=*yytext;
4865 yyextra->argSquareCount=0;
4866 yyextra->lastCopyArgContext = YY_START;
4867 BEGIN( CopyArgSquare );
4868 }
4869<ReadFuncArgType,ReadTempArgs>"(" {
4870 *yyextra->copyArgString+=*yytext;
4871 yyextra->fullArgString+=*yytext;
4872 yyextra->argRoundCount=0;
4873 yyextra->lastCopyArgContext = YY_START;
4874 BEGIN( CopyArgRound );
4875 }
4876<ReadFuncArgType>")" {
4877 *yyextra->copyArgString+=*yytext;
4878 yyextra->fullArgString+=*yytext;
4880 if (yyextra->insideJS)
4881 {
4883 }
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)
4885
4886
4887
4888
4889
4890
4891 yyextra->docBackup = yyextra->current->doc;
4892 yyextra->briefBackup = yyextra->current->brief;
4893
4894 BEGIN( yyextra->currentArgumentContext );
4895 }
4896
4897<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
4898 if (yyextra->currentArgumentContext==DefineEnd)
4899 {
4900
4901
4902 int i;for (i=(int)yyleng-1;i>=0;i--)
4903 {
4904 unput(yytext[i]);
4905 }
4908 BEGIN( yyextra->currentArgumentContext );
4909 }
4910 else
4911 {
4912
4913
4914 yyextra->fullArgString+=yytext;
4915 yyextra->lastCopyArgChar=0;
4916 yyextra->lastCommentInArgContext=YY_START;
4917 if (yytext[1]=='/')
4918 BEGIN( CopyArgCommentLine );
4919 else
4920 BEGIN( CopyArgComment );
4921 }
4922 }
4923
4924<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
4925<ReadFuncArgType,ReadTempArgs>{CCS} {
4926 yyextra->lastCContext = YY_START;
4927 BEGIN( SkipComment );
4928 }
4929<ReadFuncArgType,ReadTempArgs>{CPPC} {
4930 yyextra->lastCContext = YY_START;
4931 BEGIN( SkipCxxComment );
4932 }
4933
4934<ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
4935 REJECT;
4936 *yyextra->copyArgString+=yytext;
4937 yyextra->fullArgString+=yytext;
4938 }
4939<ReadFuncArgType,ReadTempArgs>"#" {
4940 if (!yyextra->insidePHP)
4941 REJECT;
4942 yyextra->lastCContext = YY_START;
4943 BEGIN( SkipCxxComment );
4944 }
4945 */
4946
4947<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
4949 if (yyextra->currentArgumentContext==DefineEnd)
4950 {
4951
4952
4953 int i;for (i=(int)yyleng-1;i>0;i--)
4954 {
4955 unput(yytext[i]);
4956 }
4957 *yyextra->copyArgString+=*yytext;
4958 yyextra->fullArgString+=*yytext;
4961 BEGIN( yyextra->currentArgumentContext );
4962 }
4963 else
4964 {
4965
4966
4967 yyextra->lastCopyArgChar=*yytext;
4970 yyextra->lastCommentInArgContext=YY_START;
4971 yyextra->fullArgString+=text;
4972 if (text.
find(
"//")!=-1)
4973 BEGIN( CopyArgCommentLine );
4974 else
4975 BEGIN( CopyArgComment );
4976 }
4977 }
4978<CopyArgComment>^{B}*"*"+/{BN}+
4979<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
4980<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
4981 if (yyextra->lastCopyArgChar!=0)
4982 unput(yyextra->lastCopyArgChar);
4983 BEGIN( yyextra->lastCommentInArgContext );
4984 }
4985<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
4987 if (yyextra->lastCopyArgChar!=0)
4988 unput(yyextra->lastCopyArgChar);
4989 BEGIN( yyextra->lastCommentInArgContext );
4990 }
4991<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
4992 yyextra->docBlockName="uml";
4993 yyextra->fullArgString+=yytext;
4994 BEGIN(CopyArgVerbatim);
4995 }
4996<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!)
4997 yyextra->docBlockName=&yytext[1];
4998 yyextra->fullArgString+=yytext;
4999 BEGIN(CopyArgVerbatim);
5000 }
5001<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5002 yyextra->docBlockName=&yytext[1];
5003 if (yyextra->docBlockName.at(1)=='[')
5004 {
5005 yyextra->docBlockName.at(1)=']';
5006 }
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 yyextra->fullArgString+=yytext;
5016 BEGIN(CopyArgVerbatim);
5017 }
5018<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] { // end of verbatim block
5019 yyextra->fullArgString+=yytext;
5020 if (&yytext[4]==yyextra->docBlockName)
5021 {
5022 yyextra->docBlockName="";
5023 BEGIN(CopyArgCommentLine);
5024 }
5025 }
5026<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") { // end of verbatim block
5027 yyextra->fullArgString+=yytext;
5028 if (yyextra->docBlockName==&yytext[1])
5029 {
5030 yyextra->docBlockName="";
5031 BEGIN(CopyArgCommentLine);
5032 }
5033 }
5034<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5035<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5036<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
5037<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5038<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5039 warn(yyextra->fileName,yyextra->yyLineNr,
5040 "Ignoring {:c}brief command inside argument documentation",*yytext
5041 );
5042 yyextra->fullArgString+=' ';
5043 }
5044<ReadTempArgs>"<" {
5045 *yyextra->copyArgString+=*yytext;
5046 yyextra->fullArgString+=*yytext;
5047 yyextra->argSharpCount=1;
5048 BEGIN( CopyArgSharp );
5049 }
5050<ReadTempArgs>">" {
5051 *yyextra->copyArgString+=*yytext;
5052 yyextra->fullArgString+=*yytext;
5053
5054 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5056 BEGIN( yyextra->currentArgumentContext );
5057 }
5058<CopyArgRound>"(" {
5059 yyextra->argRoundCount++;
5060 *yyextra->copyArgString+=*yytext;
5061 yyextra->fullArgString+=*yytext;
5062 }
5063<CopyArgRound>")" {
5064 *yyextra->copyArgString+=*yytext;
5065 yyextra->fullArgString+=*yytext;
5066 if (yyextra->argRoundCount>0)
5067 yyextra->argRoundCount--;
5068 else
5069 BEGIN( yyextra->lastCopyArgContext );
5070 }
5071<CopyArgSquare>"[" {
5072 yyextra->argSquareCount++;
5073 *yyextra->copyArgString+=*yytext;
5074 yyextra->fullArgString+=*yytext;
5075 }
5076<CopyArgSquare>"]" {
5077 *yyextra->copyArgString+=*yytext;
5078 yyextra->fullArgString+=*yytext;
5079 if (yyextra->argSquareCount>0)
5080 yyextra->argSquareCount--;
5081 else
5082 BEGIN( yyextra->lastCopyArgContext );
5083 }
5084<CopyArgSharp>"(" {
5085 *yyextra->copyArgString+=*yytext;
5086 yyextra->fullArgString+=*yytext;
5087 yyextra->argRoundCount=0;
5088 yyextra->lastCopyArgContext = YY_START;
5089 BEGIN( CopyArgRound );
5090 }
5091<CopyArgSharp>"<" {
5092 yyextra->argSharpCount++;
5093
5094 *yyextra->copyArgString+=*yytext;
5095 yyextra->fullArgString+=*yytext;
5096 }
5097<CopyArgSharp>">" {
5098 *yyextra->copyArgString+=*yytext;
5099 yyextra->fullArgString+=*yytext;
5100 yyextra->argSharpCount--;
5101 if (yyextra->argSharpCount>0)
5102 {
5103
5104 }
5105 else
5106 {
5107 BEGIN( ReadTempArgs );
5108
5109 }
5110 }
5111<CopyArgString,CopyArgPHPString>\\. {
5112 *yyextra->copyArgString+=yytext;
5113 yyextra->fullArgString+=yytext;
5114 }
5115<CopyArgString>\" {
5116 *yyextra->copyArgString+=*yytext;
5117 yyextra->fullArgString+=*yytext;
5118 BEGIN( yyextra->lastCopyArgStringContext );
5119 }
5120<CopyArgPHPString>\' {
5121 *yyextra->copyArgString+=*yytext;
5122 yyextra->fullArgString+=*yytext;
5123 BEGIN( yyextra->lastCopyArgStringContext );
5124 }
5125<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5126 if (yyextra->insidePHP)
5127 {
5128 REJECT;
5129 }
5130 else
5131 {
5132 *yyextra->copyArgString+=yytext;
5133 yyextra->fullArgString+=yytext;
5134 }
5135 }
5136<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5137 *yyextra->copyArgString+=yytext;
5138 yyextra->fullArgString+=yytext;
5139 if (yyextra->insidePHP)
5140 {
5141 yyextra->lastCopyArgStringContext=YY_START;
5142 BEGIN(SkipPHPString);
5143 }
5144 }
5145<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5146 *yyextra->copyArgString+=yytext;
5147 yyextra->fullArgString+=yytext;
5148 }
5149<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5151 *yyextra->copyArgString+=*yytext;
5152 yyextra->fullArgString+=*yytext;
5153 }
5154<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5155 *yyextra->copyArgString+=yytext;
5156 yyextra->fullArgString+=yytext;
5157 }
5158<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5159 *yyextra->copyArgString+=*yytext;
5160 yyextra->fullArgString+=*yytext;
5161 }
5162
5163
5164
5165
5166
5167
5168<FuncRound>"(" { yyextra->current->args += *yytext ;
5169 ++yyextra->roundCount ;
5170 }
5171<FuncRound>")" { yyextra->current->args += *yytext ;
5172 if ( yyextra->roundCount )
5173 --yyextra->roundCount ;
5174 else
5175 BEGIN( FuncQual ) ;
5176 }
5177
5178<FuncQual>"#" { if (yyextra->insidePHP)
5179 REJECT;
5180 yyextra->lastCPPContext = YY_START;
5181 BEGIN(SkipCPP);
5182 }
5183 */
5184<FuncQual>[{:;,] {
5185 if (
qstrcmp(yytext,
";")==0 &&
5186 ((yyextra->insideJS || yyextra->insidePHP) &&
5188 {
5189 yyextra->current->reset();
5191 BEGIN( FindMembers );
5192 }
5193 else
5194 {
5195 unput(*yytext); BEGIN( SFunction );
5196 }
5197 }
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
5198<FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
5200 yyextra->current->virt = Specifier::Pure;
5201 yyextra->current->args += " override ";
5202 }
5203<FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
5205 yyextra->current->spec.setOverride(true);
5206 yyextra->current->args += " override ";
5207 BEGIN(FuncQual);
5208 }
5209<FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
5211 yyextra->current->spec.setFinal(true);
5212 yyextra->current->args += " final ";
5213 BEGIN(FuncQual);
5214 }
5215<FuncQual>{BN}*"sealed"{BN}* { // sealed member function
5217 yyextra->current->spec.setSealed(true);
5218 yyextra->current->args += " sealed ";
5219 }
5220<FuncQual>{BN}*"new"{BN}* { // new member function
5222 yyextra->current->spec.setNew(true);
5223 yyextra->current->args += " new ";
5224 }
5225<FuncQual>{BN}*"const"{BN}* { // const member function
5227 yyextra->current->args += " const ";
5228 yyextra->current->argList.setConstSpecifier(
TRUE);
5229 }
5230<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
5232 yyextra->current->args += " volatile ";
5233 yyextra->current->argList.setVolatileSpecifier(
TRUE);
5234 }
5235<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
5237 yyextra->current->args += " noexcept ";
5238 yyextra->current->spec.setNoExcept(true);
5239 }
5240<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* { // noexcept(false) expression
5242 yyextra->current->args += " noexcept(false)";
5243 }
5244<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
5246 yyextra->current->args += " noexcept(";
5247 yyextra->current->spec.setNoExcept(true);
5248 yyextra->lastRoundContext=FuncQual;
5249 yyextra->pCopyRoundString=&yyextra->current->args;
5250 yyextra->roundCount=0;
5251 BEGIN(CopyRound);
5252 }
5253<FuncQual>{BN}*"&" {
5254 yyextra->current->args += " &";
5256 }
5257<FuncQual>{BN}*"&&" {
5258 yyextra->current->args += " &&";
5260 }
5261
5262<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
5264 yyextra->current->args += " = 0";
5265 yyextra->current->virt = Specifier::Pure;
5266 yyextra->current->argList.setPureSpecifier(
TRUE);
5267 BEGIN(FuncQual);
5268 }
5269<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
5271 yyextra->current->args += " = delete";
5272 yyextra->current->spec.setDelete(true);
5273 yyextra->current->argList.setIsDeleted(
TRUE);
5274 BEGIN(FuncQual);
5275 }
5276<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
5278 yyextra->current->args += " = default";
5279 yyextra->current->spec.setDefault(true);
5280 BEGIN(FuncQual);
5281 }
5282<FuncQual>{BN}*"->"{BN}* {
5284 yyextra->current->argList.setTrailingReturnType(" -> ");
5285 yyextra->current->args += " -> ";
5286 yyextra->roundCount=0;
5287 BEGIN(TrailingReturn);
5288 }
5289<TrailingReturn>[{;] {
5290 if (yyextra->roundCount>0) REJECT;
5291 unput(*yytext);
5292 BEGIN(FuncQual);
5293 }
5294<TrailingReturn>"requires"{BN}+ {
5295 if (yyextra->insideJava) REJECT;
5296 yyextra->requiresContext = FuncQual;
5297 yyextra->current->req+=' ';
5298 BEGIN(RequiresClause);
5299 }
5300<TrailingReturn>"(" {
5301 yyextra->roundCount++;
5302 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5303 yyextra->current->args+=yytext;
5304 }
5305<TrailingReturn>")" {
5306 if (yyextra->roundCount>0)
5307 {
5308 yyextra->roundCount--;
5309 }
5310 else
5311 {
5312 warn(yyextra->fileName,yyextra->yyLineNr,
5313 "Found ')' without opening '(' for trailing return type '{})...'",
5314 yyextra->current->argList.trailingReturnType());
5315 }
5316 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5317 yyextra->current->args+=yytext;
5318 }
5319<TrailingReturn>. {
5320 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5321 yyextra->current->args+=yytext;
5322 }
5323<TrailingReturn>\n {
5325 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
5326 yyextra->current->args+=' ';
5327 }
5328<FuncRound,FuncFunc>{BN}*","{BN}* {
5330 yyextra->current->args += ", " ;
5331 }
5332<FuncQual,FuncRound,FuncFunc>{BN}+ {
5334 yyextra->current->args += ' ' ;
5335 }
5336<SFunction,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
5337 REJECT;
5338 yyextra->lastCPPContext = YY_START;
5339 BEGIN(SkipCPP);
5340 }
5341<FuncQual>"=" {
5342 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5343 {
5344 BEGIN(CliOverride);
5345 }
5346 else
5347 {
5348
5349 yyextra->lastInitializerContext=YY_START;
5350 yyextra->sharpCount=0;
5351 yyextra->initBracketCount=0;
5352 yyextra->current->initializer.str(yytext);
5353 BEGIN(ReadInitializer);
5354 }
5355 }
5356<CliOverride>{ID} {
5357 }
5358<CliOverride>"{" {
5359 unput(*yytext);
5360 BEGIN(FuncQual);
5361 }
5362<CliOverride>\n {
5364 }
5365<CliOverride>. {
5366 }
5367<FuncQual>{ID} {
5368 if (yyextra->insideCpp &&
qstrcmp(yytext,
"requires")==0)
5369 {
5370
5371 yyextra->requiresContext = YY_START;
5372 yyextra->current->req+=' ';
5373 BEGIN(RequiresClause);
5374 }
5375 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
5376 {
5377
5378 yyextra->current->typeConstr.clear();
5379 yyextra->current->typeConstr.push_back(
Argument());
5380 yyextra->lastCSConstraint = YY_START;
5381 BEGIN( CSConstraintName );
5382 }
5384 {
5385 yyextra->current->args = yytext;
5386 yyextra->oldStyleArgType.clear();
5387 BEGIN(OldStyleArgs);
5388 }
5389 else
5390 {
5391 yyextra->current->args += yytext;
5392 }
5393 }
static bool checkForKnRstyleC(yyscan_t yyscanner)
5394<OldStyleArgs>[,;] {
5397 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5399 if (yyextra->current->doc!=yyextra->docBackup)
5400 {
5401 doc=yyextra->current->doc;
5402 yyextra->current->doc=yyextra->docBackup;
5403 }
5404 if (yyextra->current->brief!=yyextra->briefBackup)
5405 {
5406 brief=yyextra->current->brief;
5407 yyextra->current->brief=yyextra->briefBackup;
5408 }
5409 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5410 oldStyleArgName,brief,doc);
5411 yyextra->current->args.clear();
5412 if (*yytext==';') yyextra->oldStyleArgType.clear();
5413 }
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)
5414<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5415<OldStyleArgs>"{" {
5416 if (yyextra->current->argList.empty())
5417 {
5418 yyextra->current->argList.setNoParameters(
TRUE);
5419 }
5421 unput('{');
5422 BEGIN(FuncQual);
5423 }
5424<OldStyleArgs>. { yyextra->current->args += *yytext; }
5425<FuncQual,FuncRound,FuncFunc>\" {
5426 if (yyextra->insideIDL && yyextra->insideCppQuote)
5427 {
5428 BEGIN(EndCppQuote);
5429 }
5430 else
5431 {
5432 yyextra->current->args += *yytext;
5433 }
5434 }
5435<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5436<FuncQual>{BN}*"try:" |
5437<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
5438 yyextra->insideTryBlock=
TRUE;
5440 if (yytext[yyleng-1]==':')
5441 {
5442 unput(':');
5443 BEGIN( SFunction );
5444 }
5445 }
5446<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
5447 yyextra->current->exception = " throw (" ;
5448 yyextra->roundCount=0;
5450 BEGIN( ExcpRound ) ;
5451 }
5452<FuncQual>{BN}*"raises"{BN}*"(" {
5453 yyextra->current->exception = " raises (" ;
5455 yyextra->roundCount=0;
5456 BEGIN( ExcpRound ) ;
5457 }
5458<FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
5459 yyextra->current->exception = " throws " ;
5461 BEGIN( ExcpList );
5462 }
5463<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5464 ++yyextra->roundCount ;
5465 }
5466<ExcpRound>")" { yyextra->current->exception += *yytext ;
5467 if ( yyextra->roundCount )
5468 --yyextra->roundCount ;
5469 else
5470 BEGIN( FuncQual ) ;
5471 }
5472<ExcpRound>. {
5473 yyextra->current->exception += *yytext;
5474 }
5475<ExcpList>"{" {
5476 unput('{'); BEGIN( FuncQual );
5477 }
5478<ExcpList>";" {
5479 unput(';'); BEGIN( FuncQual );
5480 }
5481<ExcpList>"\n" {
5482 yyextra->current->exception += ' ';
5484 }
5485<ExcpList>. {
5486 yyextra->current->exception += *yytext;
5487 }
5488<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5489 yyextra->current->name = yyextra->current->args ;
5490 yyextra->current->args = yytext ;
5491 yyextra->roundCount=0;
5492 BEGIN( FuncRound ) ;
5493 }
5494<SFunction>":" {
5495 if (!yyextra->insidePHP) BEGIN(SkipInits);
5496 }
5497<SFunction>[;{,] {
5501 yyextra->current->fileName = yyextra->fileName;
5502 yyextra->current->startLine = yyextra->yyBegLineNr;
5503 yyextra->current->startColumn = yyextra->yyBegColNr;
5504 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5506 std::string type = yyextra->current->type.str();
5507 int ti=-1;
5509 {
5510 ti = (int)
match.position();
5511 }
5512 if (ti!=-1)
5513 {
5514 int di = yyextra->current->type.find("decltype(");
5515 if (di!=-1 && di<ti)
5516 {
5517 ti=-1;
5518 }
5519 }
5520 int ts=yyextra->current->type.find('<');
5521 int te=yyextra->current->type.findRev('>');
5522
5523
5524 bool startsWithTypedef = yyextra->current->type.startsWith("typedef ");
5525 bool isFunction = ti==-1 ||
5526 (ts!=-1 && ts<te && ts<ti && ti<te);
5527 bool isVariable = !yyextra->current->type.isEmpty() &&
5528 (!isFunction || startsWithTypedef);
5529
5530
5531
5532
5533 if (*yytext!=';' || yyextra->current_root->section.isCompound())
5534 {
5535 if (isVariable)
5536 {
5537
5538 if (yyextra->isTypedef && !startsWithTypedef)
5539 {
5540 yyextra->current->type.prepend("typedef ");
5541 }
5542 yyextra->current->section = EntryType::makeVariable() ;
5543 }
5544 else
5545 {
5546
5547 yyextra->current->section = EntryType::makeFunction() ;
5548 yyextra->current->proto = *yytext==';';
5549 }
5550 }
5551 else
5552 {
5553
5554 if (isVariable)
5555 {
5556 if (yyextra->isTypedef && !startsWithTypedef)
5557 {
5558 yyextra->current->type.prepend("typedef ");
5559 }
5560
5561 yyextra->current->section = EntryType::makeVariable();
5562 }
5563 else
5564 {
5565
5566 yyextra->current->section = EntryType::makeFunction();
5567 yyextra->current->proto =
TRUE;
5568 }
5569 }
5570
5571 if ( yyextra->insidePHP)
5572 {
5574 {
5575 yyextra->current->spec.setFinal(true);
5576 }
5578 {
5579 yyextra->current->spec.setAbstract(true);
5580 }
5581 }
5582 if ( yyextra->insidePHP && !
containsWord(yyextra->current->type,
"function"))
5583 {
5585 if ( *yytext == '{' )
5586 {
5587 yyextra->lastCurlyContext = FindMembers;
5588 yyextra->curlyCount=0;
5589 BEGIN( SkipCurly );
5590 }
5591 else
5592 {
5593 BEGIN( FindMembers );
5594 }
5595 }
5596 else
5597 {
5598 if ( yyextra->insidePHP)
5599 {
5601 }
5602 yyextra->previous = yyextra->current;
5603 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5605
5606 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
5607 {
5608 yyextra->current->spec.setOptional(true).setRequired(true);
5609 }
5610 yyextra->lastCurlyContext = FindMembers;
5611 if ( *yytext == ',' )
5612 {
5613 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
5614 }
5615 if ( *yytext == '{' )
5616 {
5617 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
5618 {
5619 yyextra->previous->spec.setInline(true);
5620 }
5621
5622 yyextra->curlyCount=0;
5623 BEGIN( SkipCurly ) ;
5624 }
5625 else
5626 {
5627 if (!yyextra->previous->section.isVariable())
5628 yyextra->previous->bodyLine=-1;
5629 BEGIN( FindMembers ) ;
5630 }
5631 }
5632 }
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
5633<SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
5635 yyextra->curlyCount=1;
5636 BEGIN(SkipC11Inits);
5637 }
5638<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
5640 yyextra->curlyCount=1;
5641 BEGIN(SkipC11Inits);
5642 }
5643<SkipC11Inits>"{" {
5644 ++yyextra->curlyCount;
5645 }
5646<SkipC11Inits>"}" {
5647 if ( --yyextra->curlyCount<=0 )
5648 {
5649 BEGIN(SkipInits);
5650 }
5651 }
5652<SkipC11Attribute>"]]" {
5653 BEGIN(yyextra->lastC11AttributeContext);
5654 }
5655<SkipInits>"{" { // C++11 style initializer
5656 unput('{');
5657 BEGIN( SFunction );
5658 }
5659<SkipCurly>"{" {
5660
5661 ++yyextra->curlyCount ;
5662 }
5663<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
5664<SkipCurly>"}" {
5665
5666 if( yyextra->curlyCount )
5667 {
5668 --yyextra->curlyCount ;
5669 }
5670 else
5671 {
5672 if (!yyextra->current->sli.empty() && yyextra->previous)
5673 {
5674 yyextra->previous->sli = yyextra->current->sli;
5675 yyextra->current->sli.clear();
5676 }
5677 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5678 BEGIN( yyextra->lastCurlyContext ) ;
5679 }
5680 }
5681<SkipCurly>"}"{BN}*{DCOMM}"<" {
5683 if ( yyextra->curlyCount )
5684 {
5685
5686 --yyextra->curlyCount ;
5687 }
5688 else
5689 {
5690 yyextra->current->endBodyLine=yyextra->yyLineNr;
5691 yyextra->tempEntry = yyextra->current;
5692 yyextra->current = yyextra->previous;
5693
5694 yyextra->docBlockContext = SkipCurlyEndDoc;
5695 yyextra->docBlockInBody =
FALSE;
5696 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5698 yyextra->docBlock.str(std::string());
5699 yyextra->docBlockTerm = '}';
5700 if (yytext[yyleng-3]=='/')
5701 {
5703 BEGIN( DocLine );
5704 }
5705 else
5706 {
5708 BEGIN( DocBlock );
5709 }
5710 }
5711 }
5712<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
5713 yyextra->docBlockContext = SkipCurlyEndDoc;
5714 yyextra->docBlockInBody =
FALSE;
5715 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5717 yyextra->docBlock.str(std::string());
5718 yyextra->docBlockTerm = '}';
5719 if (yytext[yyleng-3]=='/')
5720 {
5722 BEGIN( DocLine );
5723 }
5724 else
5725 {
5727 BEGIN( DocBlock );
5728 }
5729 }
5730<SkipCurlyEndDoc>"}" {
5731
5732 if (yyextra->tempEntry)
5733 {
5734 yyextra->current = yyextra->tempEntry;
5735 yyextra->tempEntry.reset();
5736 }
5737 BEGIN( yyextra->lastCurlyContext );
5738 }
5739<SkipCurly>\" {
5740
5741 yyextra->lastStringContext=SkipCurly;
5742 BEGIN( SkipString );
5743 }
5744<SkipCurly>^{B}*"#" {
5745 if (yyextra->insidePHP)
5746 REJECT;
5747
5748 BEGIN( SkipCurlyCpp );
5749 }
5750<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n {
5752
5753 }
5754<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
5755 if (!yyextra->insidePHP)
5756 {
5757 REJECT;
5758 }
5759 else
5760 {
5761 yyextra->lastHereDocContext = YY_START;
5762 BEGIN(HereDoc);
5763 }
5764 }
5765<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
5767 yyextra->lastRawStringContext = YY_START;
5768 yyextra->dummyRawString.clear();
5769 yyextra->pCopyRawString = &yyextra->dummyRawString;
5770 *yyextra->pCopyRawString += yytext;
5771 BEGIN(RawString);
5772 }
5773<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
5775
5776 }
5777<SkipCurly,SkipCurlyCpp>"\$" {}
5778<SkipCurlyCpp>\n {
5779
5781 yyextra->lastCurlyContext = FindMembers;
5782 BEGIN( SkipCurly );
5783 }
5784<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
5785
5787 }
5788<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CCS} {
5789
5790 yyextra->lastCContext = YY_START;
5791 BEGIN(SkipComment);
5792 }
5793<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CPPC} {
5794
5795 yyextra->lastCContext = YY_START;
5796 BEGIN(SkipCxxComment);
5797 }
5798<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
5799 yyextra->roundCount=0;
5800 yyextra->lastSkipRoundContext=YY_START;
5801 BEGIN(SkipRound);
5802 }
5803<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
5804 yyextra->lastStringContext=YY_START;
5805 BEGIN( SkipString );
5806 }
5807<SkipInits>; {
5808 warn(yyextra->fileName,yyextra->yyLineNr,
5809 "Found ';' while parsing initializer list! "
5810 "(doxygen could be confused by a macro call without semicolon)"
5811 );
5812 BEGIN( FindMembers );
5813 }
5814<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
5815 if (!yyextra->insidePHP)
5816 REJECT;
5817
5818 yyextra->lastCContext = YY_START;
5819 BEGIN(SkipCxxComment);
5820 }
5821<SkipInits,SkipCurly,SkipCurlyCpp>@\" {
5822 if (!yyextra->insideCS) REJECT;
5823
5824
5825 yyextra->lastSkipVerbStringContext=YY_START;
5826 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
5827 yyextra->dummyTextStream.clear();
5828 BEGIN(SkipVerbString);
5829 }
5830<SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} {
5831 if (yyextra->insidePHP) REJECT;
5832 }
5833<SkipInits,SkipCurly,SkipCurlyCpp>\' {
5834 if (yyextra->insidePHP)
5835 {
5836 yyextra->lastStringContext=YY_START;
5837 BEGIN(SkipPHPString);
5838 }
5839 }
5840<SkipC11Attribute>{ID} {
5842 {
5843 yyextra->current->spec.setNoDiscard(true);
5844 }
5845 }
5846<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>. { }
5847<SkipString,SkipPHPString>\\. { }
5848<SkipString>\" {
5849 BEGIN( yyextra->lastStringContext );
5850 }
5851<SkipPHPString>\' {
5852 BEGIN( yyextra->lastStringContext );
5853 }
5854<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
5855<SkipString,SkipPHPString>\n {
5857 }
5858<SkipString>"[[" { }
5859<SkipString,SkipPHPString>. { }
5860<CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
5861 unput(':');
5862 BEGIN(ClassVar);
5863 }
5864<CompoundName>";" {
5865 yyextra->current->section = EntryType::makeEmpty() ;
5866 yyextra->current->type.clear() ;
5867 yyextra->current->name.clear() ;
5868 yyextra->current->args.clear() ;
5869 yyextra->current->argList.clear();
5870 BEGIN( FindMembers ) ;
5871 }
5872<Bases>";" {
5873 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
5874 {
5875
5876
5877 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
5878 {
5880 }
5881 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
5882
5883 if (!yyextra->baseName.isEmpty())
5884 {
5885 yyextra->current->extends.emplace_back(
5886 yyextra->baseName,Protection::Public,Specifier::Normal);
5887 yyextra->baseName.clear();
5888 }
5889 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5891 }
5892 else
5893 {
5894 yyextra->current->section = EntryType::makeEmpty() ;
5895 yyextra->current->type.clear() ;
5896 yyextra->current->name.clear() ;
5897 yyextra->current->args.clear() ;
5898 yyextra->current->argList.clear();
5899 }
5900 BEGIN( FindMembers ) ;
5901 }
5902<CompoundName>{SCOPENAME}/{BN}*"<" {
5903 yyextra->sharpCount = 0;
5904 yyextra->current->name = yytext ;
5906 if (yyextra->current->spec.isProtocol())
5907 {
5908 yyextra->current->name+="-p";
5909 }
5911 yyextra->lastClassTemplSpecContext = ClassVar;
5912 if (yyextra->insideObjC)
5913 {
5914 BEGIN( ObjCProtocolList );
5915 }
5916 else if (yyextra->insideCS)
5917 {
5918
5919 BEGIN( CSGeneric );
5920 }
5921 else
5922 {
5923 yyextra->roundCount=0;
5924 BEGIN( ClassTemplSpec );
5925 }
5926 }
5927<CSGeneric>"<" {
5929
5930
5931 yyextra->current->tArgLists.
push_back(al);
5932 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
5933 yyextra->templateStr="<";
5934 yyextra->current->name += "<";
5935 yyextra->fullArgString = yyextra->templateStr;
5936 yyextra->copyArgString = &yyextra->current->name;
5937
5938 yyextra->currentArgumentContext = ClassVar;
5939 BEGIN( ReadTempArgs );
5940 }
5941<ObjCProtocolList>"<" {
5942 yyextra->insideProtocolList=
TRUE;
5943 BEGIN( Bases );
5944 }
5945<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
5946 yyextra->current->name += yytext;
5948 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
5949 {
5951 if (yyextra->current->spec.isProtocol())
5952 {
5953 unput('{');
5954 BEGIN( ClassVar );
5955 }
5956 else
5957 {
5958 BEGIN( yyextra->lastClassTemplSpecContext );
5959 }
5960 }
5961 }
5962<ClassTemplSpec>"<" {
5963 yyextra->current->name += yytext;
5964 if (yyextra->roundCount==0) yyextra->sharpCount++;
5965 }
5966<ClassTemplSpec>. {
5967 yyextra->current->name += yytext;
5968 }
5969<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" { // forward declaration?
5970 if (yyextra->insideCS && yyextra->current->type == "namespace")
5971 {
5972
5974 yyextra->current->name =
substitute(yytext,
".",
"::");
5975 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5976 yyextra->fakeNS++;
5977 unput('{');
5978 BEGIN( ClassVar );
5979 }
5980 else if (!yyextra->current->tArgLists.empty())
5981 {
5982
5983
5984 yyextra->current->name = yytext;
5985 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5987
5988 QCString rn = yyextra->current_root->name;
5989
5990 if (!yyextra->current->name.isEmpty() && !rn.
isEmpty())
5991 {
5993 }
5994 yyextra->current->spec.setForwardDecl(true);
5995 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5996 }
5997 else if (yyextra->insideIDL &&
5998 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
5999 yyextra->current->spec.isInterface()) ||
6000 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6001 yyextra->current->spec.isService())
6002 )
6003 )
6004 {
6005
6006
6007
6008
6009 yyextra->current->name = yytext;
6010 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6011 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6013
6014 yyextra->current->spec.setInterface(false).setService(false);
6015
6016
6017
6018 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6019 }
6020
6021 if (!(yyextra->insideCS && yyextra->current->type == "namespace"))
6022 {
6023 unput(';');
6024 yyextra->current->reset();
6026 if (yyextra->insideObjC)
6027 {
6028 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6029 yyextra->insideObjC =
FALSE;
6030 }
6031 if (yyextra->isTypedef)
6032 {
6033 yyextra->current->type.prepend("typedef");
6034 }
6035 BEGIN( FindMembers );
6036 }
6037 }
6038<CompoundName>{SCOPENAME}/{BN}*"(" {
6039 yyextra->current->name = yytext ;
6042 if (yyextra->insideCpp && yyextra->current->name=="alignas")
6043 {
6044 yyextra->lastAlignAsContext = YY_START;
6045 BEGIN( AlignAs );
6046 }
6047 else
6048 {
6049 if (yyextra->current->spec.isProtocol())
6050 {
6051 yyextra->current->name += "-p";
6052 }
6053 BEGIN( ClassVar );
6054 }
6055 }
6056<AlignAs>"(" { yyextra->roundCount=0;
6057 BEGIN( AlignAsEnd );
6058 }
6059<AlignAs>\n { lineCount(yyscanner); }
6060<AlignAs>.
6061<AlignAsEnd>"(" { yyextra->roundCount++; }
6062<AlignAsEnd>")" { if (--yyextra->roundCount<0)
6063 {
6064 BEGIN( yyextra->lastAlignAsContext );
6065 }
6066 }
6067<AlignAsEnd>\n { lineCount(yyscanner); }
6068<AlignAsEnd>.
6069<ConceptName>{ID} {
6070 yyextra->current->name = yytext ;
6072 }
6073<ConceptName>"=" {
6074 yyextra->current->bodyLine = yyextra->yyLineNr;
6075 yyextra->current->bodyColumn = yyextra->yyColNr;
6076 yyextra->current->initializer.str(std::string());
6077 yyextra->lastInitializerContext = FindMembers;
6078 yyextra->sharpCount=0;
6079 yyextra->initBracketCount=0;
6080 BEGIN(ReadInitializer);
6081 }
6082<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
6083
6084 yyextra->current->reset();
6086 }
6087<CompoundName>{SCOPENAME} {
6088 yyextra->current->name = yytext ;
6091 if (yyextra->current->spec.isProtocol())
6092 {
6093 yyextra->current->name += "-p";
6094 }
6095 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6096 {
6097 unput('{');
6098 }
6099 BEGIN( ClassVar );
6100 }
6101<CompoundName>{CSSCOPENAME} { // C# style scope
6102 yyextra->current->name =
substitute(yytext,
".",
"::");
6104 BEGIN( ClassVar );
6105 }
6106<ClassVar>{SCOPENAME}{BNopt}/"(" {
6107 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6108 {
6109
6110 yyextra->roundCount=0;
6111 BEGIN(SkipUnionSwitch);
6112 }
6113 else
6114 {
6116 yyextra->yyBegColNr=yyextra->yyColNr;
6117 yyextra->yyBegLineNr=yyextra->yyLineNr;
6118 yyextra->current->name = yytext;
6119 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6122 BEGIN( FindMembers );
6123 }
6124 }
6125<ClassVar>"," {
6126 if (yyextra->isTypedef)
6127 {
6128
6129 unput(',');
6130 yyextra->current->type.prepend("typedef ");
6131 BEGIN(FindMembers);
6132 }
6133 else
6134 {
6135
6136 }
6137 }
6138<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6139 if (yyextra->insideCli)
6140 {
6141 if (yytext[0]=='s')
6142 yyextra->current->spec.setSealedClass(true);
6143 else
6144 yyextra->current->spec.setAbstractClass(true);
6145 BEGIN( ClassVar );
6146 }
6147 else
6148 {
6149 REJECT;
6150 }
6151 }
6152<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6153 yyextra->yyBegColNr=yyextra->yyColNr;
6154 yyextra->yyBegLineNr=yyextra->yyLineNr;
6157 if (yyextra->current->section.isEnum())
6158 {
6159 yyextra->current->section = EntryType::makeVariable() ;
6160 }
6161 yyextra->current->type += ' ' ;
6162 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...
6164
6166 {
6167 BEGIN( Operator );
6168 }
6169 }
6170<ClassVar>{ID} {
6171 yyextra->yyBegColNr=yyextra->yyColNr;
6172 yyextra->yyBegLineNr=yyextra->yyLineNr;
6174 if (yyextra->insideIDL &&
qstrcmp(yytext,
"switch")==0)
6175 {
6176
6177 yyextra->roundCount=0;
6178 BEGIN(SkipUnionSwitch);
6179 }
6180 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
qstrcmp(yytext,
"implements")==0 ||
qstrcmp(yytext,
"extends")==0))
6181 {
6182 yyextra->current->type.clear();
6183 yyextra->baseProt = Protection::Public;
6184 yyextra->baseVirt = Specifier::Normal;
6185 yyextra->baseName.clear();
6186 BEGIN( BasesProt ) ;
6187 }
6188 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
6189 {
6190 yyextra->current->typeConstr.clear();
6191 yyextra->current->typeConstr.push_back(
Argument());
6192 yyextra->lastCSConstraint = YY_START;
6193 BEGIN( CSConstraintName );
6194 }
6195 else if (yyextra->insideCli &&
qstrcmp(yytext,
"abstract")==0)
6196 {
6197 yyextra->current->spec.setAbstract(true);
6198 }
6199 else if (yyextra->insideCli &&
qstrcmp(yytext,
"sealed")==0)
6200 {
6201 yyextra->current->spec.setSealed(true);
6202 }
6203 else if (
qstrcmp(yytext,
"final")==0)
6204 {
6205 yyextra->current->spec.setFinal(true);
6206 }
6207 else
6208 {
6209 if (yyextra->current->section.isEnum())
6210 {
6211 yyextra->current->section = EntryType::makeVariable() ;
6212 }
6213 yyextra->current->type += ' ' ;
6214 yyextra->current->type += yyextra->current->name ;
6215 yyextra->current->name = yytext ;
6216
6218 {
6219 BEGIN( Operator );
6220 }
6221 }
6222 }
6223<ClassVar>[(\[] {
6224 if (yyextra->insideObjC && *yytext=='(')
6225 {
6226 yyextra->current->name+='(';
6227
6228
6229 yyextra->current->spec.setCategory(true);
6230
6231 BEGIN( ClassCategory );
6232 }
6233 else
6234 {
6235
6236 unput(*yytext);
6237 BEGIN( FindMembers );
6238 }
6239 }
6240<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
6241<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
6242 yyextra->fullArgString.clear();
6243 yyextra->lastCopyArgChar='#';
6244 yyextra->lastCommentInArgContext=YY_START;
6245 if (yytext[1]=='/')
6246 BEGIN( CopyArgCommentLine );
6247 else
6248 BEGIN( CopyArgComment );
6249 }
6250<CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
6251 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6252 }
6253<CSConstraintType>"=>" { // end of type constraint reached
6254
6256 unput('>');
6257 unput('=');
6258 BEGIN( yyextra->lastCSConstraint );
6259 }
6260<CSConstraintType>"{" { // end of type constraint reached
6261
6263 unput('{');
6264 BEGIN( yyextra->lastCSConstraint );
6265 }
6266<CSConstraintType,CSConstraintName>";" {
6268 unput(';');
6269 BEGIN( yyextra->lastCSConstraint );
6270 }
6271<CSConstraintName>":" {
6272 BEGIN( CSConstraintType );
6273 }
6274<CSConstraintName>{ID} {
6275
6276 yyextra->current->typeConstr.back().name=yytext;
6277 }
6278<CSConstraintType>"where" { // another constraint for a different param
6279 yyextra->current->typeConstr.push_back(
Argument());
6280 BEGIN( CSConstraintName );
6281 }
6282<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6283 if (yyextra->current->typeConstr.back().type.isEmpty())
6284
6285 {
6286 yyextra->current->typeConstr.back().type=yytext;
6287 }
6288 else
6289 {
6290 QCString name = yyextra->current->typeConstr.back().name;
6291 yyextra->current->typeConstr.push_back(
Argument());
6292 yyextra->current->typeConstr.back().name=name;
6293 yyextra->current->typeConstr.back().type=yytext;
6294 }
6295 }
6296<CSConstraintName,CSConstraintType>\n {
6298 }
6299<CSConstraintName,CSConstraintType>. {
6300 }
6301<ClassCategory>{ID} {
6302 yyextra->current->name+=yytext;
6303 }
6304<ClassCategory>")"/{BN}*"{" {
6305 yyextra->current->name+=')';
6306 BEGIN( ClassVar );
6307 }
6308<ClassCategory>")"/{BN}*"<" {
6309 yyextra->current->name+=')';
6310 BEGIN( ObjCProtocolList );
6311 }
6312<ClassCategory>")" {
6313 yyextra->current->name+=')';
6314 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6315 {
6316 unput('{');
6317 }
6318 else
6319 {
6320 unput('}');
6321 unput('{');
6322 }
6323 BEGIN( ClassVar );
6324 }
6325<ClassVar>":" {
6326 if (yyextra->current->section.isVariable())
6327 {
6328 yyextra->current->bitfields+=":";
6329 yyextra->current->args.clear();
6330 BEGIN(BitFields);
6331 }
6332 else if (yyextra->current->section.isEnum())
6333
6334 {
6335 yyextra->current->args.clear();
6336 BEGIN(EnumBaseType);
6337 }
6338 else
6339 {
6340 yyextra->current->type.clear();
6341 if (yyextra->current->spec.isInterface() ||
6342 yyextra->current->spec.isStruct() ||
6343 yyextra->current->spec.isRef() ||
6344 yyextra->current->spec.isValue() ||
6345 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6346 )
6347 {
6348 yyextra->baseProt = Protection::Public;
6349 }
6350 else
6351 {
6352 yyextra->baseProt = Protection::Private;
6353 }
6354 yyextra->baseVirt = Specifier::Normal;
6355 yyextra->baseName.clear();
6356 BEGIN( BasesProt ) ;
6357 }
6358 }
6359<ClassVar>[;=*&] {
6360 if (yyextra->isTypedef)
6361 {
6362 yyextra->current->type.prepend("typedef");
6363 }
6364 if ((yytext[0]=='*' || yytext[0]=='&') && yyextra->current->section.isEnum())
6365 {
6366 yyextra->current->section = EntryType::makeVariable() ;
6367 }
6368 if (yytext[0]==';' && yyextra->current->section.isEnum())
6369 {
6370 yyextra->current->reset();
6372 }
6373 else
6374 {
6375 unput(*yytext);
6376 }
6377 BEGIN( FindMembers );
6378 }
6379<Bases,ClassVar>{CPPC}"/"/[^/] {
6380 if (!yyextra->insideObjC)
6381 {
6382 REJECT;
6383 }
6384 else
6385 {
6387 yyextra->current->program << yytext;
6388 yyextra->current->fileName = yyextra->fileName ;
6389 yyextra->current->startLine = yyextra->yyLineNr ;
6390 yyextra->current->startColumn = yyextra->yyColNr;
6391 yyextra->curlyCount=0;
6392 BEGIN( ReadBodyIntf );
6393 }
6394 }
6395<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6396<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6397<Bases,ClassVar>{CPPC}"!" |
6398<Bases,ClassVar>[\-+]{BN}* {
6399 if (!yyextra->insideObjC)
6400 {
6401 REJECT;
6402 }
6403 else
6404 {
6406 yyextra->current->program << yytext;
6407 yyextra->current->fileName = yyextra->fileName ;
6408 yyextra->current->startLine = yyextra->yyLineNr ;
6409 yyextra->current->startColumn = yyextra->yyColNr;
6410 yyextra->curlyCount=0;
6411 BEGIN( ReadBodyIntf );
6412 }
6413 }
6414<CompoundName,ClassVar>{B}*"{"{B}* {
6415 yyextra->current->program.str(std::string());
6416 yyextra->current->fileName = yyextra->fileName ;
6417 yyextra->current->bodyLine = yyextra->yyLineNr;
6418 yyextra->current->bodyColumn = yyextra->yyColNr;
6420 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef)
6421 {
6422 if (yyextra->current->section.isNamespace())
6423 {
6425 {
6426 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6427 }
6428 else
6429 {
6431 }
6432 }
6433 else
6434 {
6436 }
6437 }
6438 yyextra->curlyCount=0;
6439 if (yyextra->current_root &&
6440 !yyextra->current_root->spec.isInterface() &&
6441 (yyextra->current->spec.isInterface() ||
6442 yyextra->current->spec.isProtocol() ||
6443 yyextra->current->spec.isCategory() ||
6444 yyextra->current->section.isObjcImpl()
6445 ) &&
6446 yyextra->insideObjC
6447 )
6448 {
6449 BEGIN( ReadBodyIntf );
6450 }
6451 else if (yyextra->current->section.isNamespace())
6452 {
6453 BEGIN( ReadNSBody );
6454 }
6455 else
6456 {
6457 BEGIN( ReadBody ) ;
6458 }
6459 }
QCString stripPath(const QCString &s)
6460<BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6461<BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6462<BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6463<BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6464<BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6465<BasesProt>{BN} { lineCount(yyscanner); }
6466<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6467<Bases>"decltype"{BN}*"(" {
6469 yyextra->roundCount=0;
6470 yyextra->lastSkipRoundContext=YY_START;
6471 BEGIN(SkipRound);
6472 }
6473<Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
6474 if (!yyextra->insidePHP)
6475 {
6476 REJECT;
6477 }
6478 else
6479 {
6483 yyextra->baseName += bn;
6484 yyextra->current->args += ' ';
6485 yyextra->current->args += yytext;
6486 }
6487 }
6488<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6492 {
6493
6494 yyextra->current->typeConstr.clear();
6495 yyextra->current->typeConstr.push_back(
Argument());
6496 yyextra->lastCSConstraint = YY_START;
6497 BEGIN( CSConstraintName );
6498 }
6499 else
6500 {
6501 yyextra->baseName+=yytext;
6502 yyextra->current->args += ' ';
6503 yyextra->current->args += yytext;
6504 }
6505 }
6506<Bases>{BN}*{ID}("."{ID})* { // Java style class
6508 yyextra->baseName += name;
6509 yyextra->current->args += ' ';
6510 yyextra->current->args += name;
6511 }
6512<ClassVar,Bases>\n/{BN}*[^{, \t\n] {
6513 if (!yyextra->insideObjC)
6514 {
6515 REJECT;
6516 }
6517 else
6518 {
6520 unput('{');
6521 }
6522 }
6523<ClassVar,Bases>"@end" { // empty ObjC interface
6524 unput('d');
6525 unput('n');
6526 unput('e');
6527 unput('@');
6528 unput('}');
6529 unput('{');
6530 }
6531<ClassVar>"<" { yyextra->current->name += *yytext;
6532 yyextra->sharpCount=1;
6533 yyextra->roundCount=0;
6534 yyextra->lastSkipSharpContext = YY_START;
6535 yyextra->specName = &yyextra->current->name;
6536 BEGIN ( Specialization );
6537 }
6538<Bases>{BN}*"<" {
6540 yyextra->sharpCount=1;
6541 yyextra->roundCount=0;
6542 yyextra->lastSkipSharpContext = YY_START;
6543 if (yyextra->insideObjC)
6544 {
6545 unput(',');
6546 }
6547 else
6548 {
6549
6550
6551
6552
6553 yyextra->templateStr = yytext;
6554 yyextra->specName = &yyextra->templateStr;
6555 BEGIN ( Specialization );
6556 }
6557 }
6558<Specialization>"<" { *yyextra->specName += *yytext;
6559 if (yyextra->roundCount==0) yyextra->sharpCount++;
6560 }
6561<Specialization>">" {
6562 *yyextra->specName += *yytext;
6563 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6564 {
6566 BEGIN(yyextra->lastSkipSharpContext);
6567 }
6568 }
6569<Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6570<Specialization>"<<" { *yyextra->specName += yytext; }
6571<Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6572 unput('>');
6573 unput(' ');
6574 unput('>');
6575 }
6576<Specialization>">>" {
6577 if (yyextra->insideCS)
6578 {
6579 REJECT;
6580 }
6581 else
6582
6583
6584
6585
6586 {
6587 if (yyextra->roundCount>0)
6588 {
6589 *yyextra->specName += yytext;
6590 }
6591 else
6592 {
6593 unput('>');
6594 unput(' ');
6595 unput('>');
6596 }
6597 }
6598 }
6599<Specialization>"typename"{BN}+ { lineCount(yyscanner); }
6600<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
6601<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
6602
6603<Specialization>"\\\\" { *yyextra->specName += *yytext;}
6604<Specialization>"\\'" { *yyextra->specName += *yytext;}
6605<Specialization>"\\\"" { *yyextra->specName += *yytext;}
6606<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
6607<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
6608<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
6609<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
6610<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6611<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
6612<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6613<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
6614
6615<Specialization>. {
6616 *yyextra->specName += *yytext;
6617 }
6618<SkipRound>"(" { ++yyextra->roundCount; }
6619<SkipRound>")" { if (--yyextra->roundCount<0)
6620 BEGIN ( yyextra->lastSkipRoundContext );
6621 }
6622<SkipRound>\" {
6623 yyextra->lastStringContext=SkipRound;
6624 BEGIN(SkipString);
6625 }
6626<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
6627 if (yyextra->insideProtocolList)
6628 {
6629 yyextra->baseName+="-p";
6630 }
6631 else
6632 {
6633 yyextra->current->args += ',' ;
6634 }
6636 if (!yyextra->baseName.isEmpty())
6637 {
6638 yyextra->current->extends.emplace_back(
6639 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6640 );
6641 }
6642 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
6643 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
6644 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
6645 {
6646 yyextra->baseProt=Protection::Public;
6647 }
6648 else
6649 {
6650 yyextra->baseProt=Protection::Private;
6651 }
6652 yyextra->baseVirt=Specifier::Normal;
6653 yyextra->baseName.clear();
6654 if (*yytext=='>')
6655 {
6656 yyextra->insideProtocolList=
FALSE;
6657 if (yyleng==1)
6658 {
6659 unput('{');
6660 }
6661 else
6662 {
6663 yyless(1);
6664 }
6665 }
6666 else
6667 {
6668 if (*yytext==',' && yyextra->insideObjC)
6669 {
6670 yyextra->insideProtocolList=
TRUE;
6671 }
6672 BEGIN(BasesProt);
6673 }
6674 }
6675<Bases>{B}*"{"{B}* {
6676 yyextra->current->program.str(std::string());
6677 yyextra->current->fileName = yyextra->fileName ;
6678 yyextra->current->bodyLine = yyextra->yyLineNr;
6679 yyextra->current->bodyColumn = yyextra->yyColNr;
6681 if (!yyextra->baseName.isEmpty())
6682 yyextra->current->extends.emplace_back(
6683 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6684 );
6685 yyextra->curlyCount=0;
6686 if (yyextra->insideObjC)
6687 {
6688 BEGIN( ReadBodyIntf );
6689 }
6690 else
6691 {
6692 BEGIN( ReadBody ) ;
6693 }
6694 }
6695<SkipUnionSwitch>{B}*"(" {
6696 yyextra->roundCount++;
6697 }
6698<SkipUnionSwitch>")" {
6699 if (--yyextra->roundCount==0)
6700 {
6701 BEGIN(ClassVar);
6702 }
6703 }
6704<SkipUnionSwitch>\n { lineCount(yyscanner); }
6705<SkipUnionSwitch>.
6706<Comment>{BN}+ { yyextra->current->program << yytext ;
6708 }
6709<Comment>{CCS} { yyextra->current->program << yytext ; }
6710<Comment>{CPPC} { yyextra->current->program << yytext ; }
6711<Comment>{CMD}("code"|"verbatim"|"iliteral") {
6712 if (yyextra->doxygenComment) yyextra->insideCode=
TRUE;
6713 yyextra->current->program << yytext ;
6714 }
6715<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
6716 if (yyextra->doxygenComment) yyextra->insideCode=
FALSE;
6717 yyextra->current->program << yytext ;
6718 }
6719<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
6720<Comment>{CCE} { yyextra->current->program << yytext ;
6721 if (!yyextra->insideCode)
6722 {
6723 yyextra->doxygenComment=false;
6724 BEGIN( yyextra->lastContext );
6725 }
6726 }
6727<Comment>. { yyextra->current->program << *yytext ; }
6728
6729<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
6730
6731 if (!yyextra->current->doc.isEmpty())
6732 {
6733 yyextra->current->doc+="\n\n";
6734 }
6735 else
6736 {
6737 yyextra->current->docLine = yyextra->yyLineNr;
6738 yyextra->current->docFile = yyextra->fileName;
6739 }
6740
6741 yyextra->lastDocContext = YY_START;
6742 if (yyextra->current_root->section.isScope())
6743 {
6744 yyextra->current->inside = yyextra->current_root->name+"::";
6745 }
6746 yyextra->docBlockContext = YY_START;
6747 yyextra->docBlockInBody = YY_START==SkipCurly;
6749
6752 yyextra->docBlock.str(indent.
str());
6753
6754 if (yyextra->docBlockAutoBrief)
6755 {
6756 yyextra->current->briefLine = yyextra->yyLineNr;
6757 yyextra->current->briefFile = yyextra->fileName;
6758 }
6760 BEGIN( DocBlock );
6761 }
6762<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
6765
6766 if( javadocBanner )
6767 {
6768 yyextra->lastDocContext = YY_START;
6769
6770
6771 if (yyextra->current_root->section.isScope())
6772 {
6773 yyextra->current->inside = yyextra->current_root->name+"::";
6774 }
6775 yyextra->current->docLine = yyextra->yyLineNr;
6776 yyextra->current->docFile = yyextra->fileName;
6777 yyextra->docBlockContext = YY_START;
6778 yyextra->docBlockInBody = YY_START==SkipCurly;
6780 yyextra->docBlockAutoBrief = javadocAutoBrief;
6781
6784 yyextra->docBlock.str(indent.
str());
6785
6786 if (yyextra->docBlockAutoBrief)
6787 {
6788 yyextra->current->briefLine = yyextra->yyLineNr;
6789 yyextra->current->briefFile = yyextra->fileName;
6790 }
6792 BEGIN( DocBlock );
6793 }
6794 else
6795 {
6796 yyextra->current->program << yytext ;
6797 yyextra->lastContext = YY_START ;
6798 yyextra->doxygenComment=true;
6799 BEGIN( Comment ) ;
6800 }
6801 }
6802<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6804 yyextra->yyColNr=1;
6805 REJECT;
6806 }
6807<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6808 yyextra->lastDocContext = YY_START;
6809
6810
6811 if (yyextra->current_root->section.isScope())
6812 {
6813 yyextra->current->inside = yyextra->current_root->name+"::";
6814 }
6815 yyextra->current->docLine = yyextra->yyLineNr;
6816 yyextra->current->docFile = yyextra->fileName;
6817 yyextra->docBlockContext = YY_START;
6818 yyextra->docBlockInBody = YY_START==SkipCurly;
6820 yyextra->docBlockAutoBrief = javadocAutoBrief;
6821
6824 yyextra->docBlock.str(indent.
str());
6825
6826 if (yyextra->docBlockAutoBrief)
6827 {
6828 yyextra->current->briefLine = yyextra->yyLineNr;
6829 yyextra->current->briefFile = yyextra->fileName;
6830 }
6832 BEGIN( DocBlock );
6833 }
6834<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
6835 yyextra->lastDocContext = YY_START;
6836 if (yyextra->current_root->section.isScope())
6837 {
6838 yyextra->current->inside = yyextra->current_root->name+"::";
6839 }
6840 yyextra->docBlockContext = YY_START;
6841 yyextra->docBlockInBody = YY_START==SkipCurly;
6842 yyextra->docBlockAutoBrief =
FALSE;
6843
6846 yyextra->docBlock.str(indent.
str());
6847
6849 BEGIN( DocLine );
6850 }
6851<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
6852 yyextra->lastDocContext = YY_START;
6853 if (yyextra->current_root->section.isScope())
6854 {
6855 yyextra->current->inside = yyextra->current_root->name+"::";
6856 }
6857 yyextra->docBlockContext = YY_START;
6858 yyextra->docBlockInBody = YY_START==SkipCurly;
6859 yyextra->docBlockAutoBrief =
FALSE;
6862 yyextra->docBlock.str(indent.
str());
6864 BEGIN( DocLine );
6865 }
6866<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
6868 yyextra->externLinkage=
TRUE;
6869 }
6870<FindMembers>"{" {
6871 if (yyextra->externLinkage)
6872 {
6873 yyextra->externLinkage=
FALSE;
6874 }
6875 else if (yyextra->insideCS &&
6876 !yyextra->current->name.isEmpty() &&
6877 !yyextra->current->type.isEmpty())
6878 {
6879 if (yyextra->current->mtype == MethodTypes::Event)
6880 {
6881 yyextra->mtype = MethodTypes::Event;
6882 }
6884 {
6885 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
6886 }
6887 else
6888 {
6889 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
6890 }
6891 yyextra->current->bodyLine = yyextra->yyLineNr;
6892 yyextra->current->bodyColumn = yyextra->yyColNr;
6893 yyextra->curlyCount=0;
6894 BEGIN( CSAccessorDecl );
6895 }
6896 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
6897 {
6898
6899
6900 yyextra->current->exception = " {";
6901 BEGIN(UNOIDLAttributeBlock);
6902 }
6903 else
6904 {
6905 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
6906 yyextra->current->name.isEmpty()
6907 )
6908 {
6909
6910 yyextra->needsSemi =
FALSE;
6911 if (yyextra->current->isStatic)
6912 {
6913 yyextra->current->name="[static initializer]";
6914 yyextra->current->type.clear();
6915 }
6916 else
6917 {
6918 yyextra->current->name="[instance initializer]";
6919 }
6920 unput(*yytext);
6921 BEGIN( SFunction );
6922 }
6923 else
6924 {
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935 yyextra->current->bodyLine = yyextra->yyLineNr;
6936 yyextra->current->bodyColumn = yyextra->yyColNr;
6937 yyextra->current->initializer.str(yytext);
6938 yyextra->lastInitializerContext = YY_START;
6939 yyextra->sharpCount=0;
6940 yyextra->initBracketCount=1;
6941 BEGIN(ReadInitializer);
6942 }
6943 }
6944 }
6945<CSAccessorDecl>"{" { yyextra->curlyCount++; }
6946<CSAccessorDecl>"}"{B}*"=" {
6947
6948 if (yyextra->curlyCount != 0) REJECT;
6949 yyextra->current->initializer.str("=");
6950 yyextra->current->endBodyLine=yyextra->yyLineNr;
6951 yyextra->lastInitializerContext = FindMembers;
6952 BEGIN(ReadInitializer);
6953 }
6954<CSAccessorDecl>"}" {
6955 if (yyextra->curlyCount)
6956 {
6957 yyextra->curlyCount--;
6958 }
6959 else
6960 {
6961 yyextra->mtype = MethodTypes::Method;
6962 yyextra->virt = Specifier::Normal;
6963
6964 yyextra->current->endBodyLine=yyextra->yyLineNr;
6965 unput(';');
6966 BEGIN(FindMembers);
6967 }
6968 }
6969<CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(true); }
6970<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(true); }
6971<CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(true); }
6972<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(true); }
6973<CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(true); }
6974<CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(true); }
6975<CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(true); }
6976<CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(true); }
6977<CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(true); }
6978<CSAccessorDecl>{CHARLIT} {}
6979<CSAccessorDecl>"\"" { BEGIN(CSString);}
6980<CSAccessorDecl>"." {}
6981<CSAccessorDecl>\n { lineCount(yyscanner); }
6982<CSString>"\"" { BEGIN(CSAccessorDecl);}
6983<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
6984<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
6985<CSString>\n { lineCount(yyscanner); }
6986<CSString>"." {}
6987
6988
6989
6990<SliceSequence>{SCOPENAME} {
6991 if (yyextra->current->spec.isLocal())
6992 {
6993 yyextra->current->type = "local ";
6994 }
6995 yyextra->current->type += "sequence<";
6996 yyextra->current->type += yytext;
6997 yyextra->current->type += ">";
6998 }
6999
7000<SliceSequence>{BN}*">"{BN}* {
7002 BEGIN(SliceSequenceName);
7003 }
7004
7005<SliceSequenceName>{ID}{BN}* {
7007 yyextra->current->name = yytext ;
7008 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7009 }
7010
7011<SliceSequenceName>";" {
7012 yyextra->current->section = EntryType::makeVariable();
7013 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7015 BEGIN(FindMembers);
7016 }
7017
7018<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7020 if (yyextra->current->spec.isLocal())
7021 {
7022 yyextra->current->type = "local ";
7023 }
7024 yyextra->current->type += "dictionary<";
7025 yyextra->current->type += yytext;
7026 yyextra->current->type += ">";
7027 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7028 }
7029
7030<SliceDictionary>{BN}*">"{BN}* {
7032 BEGIN(SliceDictionaryName);
7033 }
7034
7035<SliceDictionaryName>{ID}{BN}* {
7037 yyextra->current->name = yytext ;
7038 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7039 }
7040
7041<SliceDictionaryName>";" {
7042 yyextra->current->section = EntryType::makeVariable();
7043 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7045 BEGIN(FindMembers);
7046 }
7047
7048
7049
7050
7051
7052
7053<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
7054 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
7055 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7057 }
7058<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
7059 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7060 BEGIN( yyextra->docBlockContext );
7061 }
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
7062<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
7063 yyextra->docBlock << yytext;
7064 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7065 BEGIN( yyextra->docBlockContext );
7066 }
7067<DocLine>{NONLopt}/"\n" { // whole line
7068 yyextra->docBlock << yytext;
7069 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7070 BEGIN( yyextra->docBlockContext );
7071 }
7072
7073
7074
7075<DocBlock>"*"*{CCE} { // end of comment block
7077 BEGIN(yyextra->docBlockContext);
7078 }
7079<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7082 yyextra->docBlock << "\\ilinebr " << indent;
7083 }
7084<DocBlock>^{B}*"*"+/[^/] {
7087 yyextra->docBlock << indent;
7088 }
7089<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
7092 yyextra->docBlock << indent;
7093 }
7094<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
7095 }
7096<DocBlock>{CPPC} { // slashes in the middle of a comment block
7097 yyextra->docBlock << yytext;
7098 }
7099<DocBlock>{CCS} { // start of a new comment in the
7100
7101 yyextra->docBlock << yytext;
7102 }
7103<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
7104 yyextra->docBlock << yytext;
7105 }
7106<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7107 yyextra->docBlock << yytext;
7108 char blockName[] = "f$";
7109 char c = yytext[2];
7110 if (c=='[') blockName[1]=']';
7111 else if (c=='{') blockName[1]='}';
7112 else if (c=='(') blockName[1]=')';
7114 BEGIN(DocCopyBlock);
7115 }
static void startVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0, bool codeBlock=false)
7116<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7117 yyextra->fileName = &yytext[6];
7118 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7119 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7120 yyextra->docBlock << yytext;
7121 }
7122<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7123 yyextra->fileName = &yytext[6];
7124 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7125 yyextra->docBlock << yytext;
7126 }
7127<DocBlock>{CMD}"iline"{LINENR}{B} {
7128 bool ok = false;
7130 if (!ok)
7131 {
7132 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7133 }
7134 else
7135 {
7136 yyextra->yyLineNr = nr;
7137 }
7138 yyextra->docBlock << yytext;
7139 }
7140<DocBlock>{B}*"<"{PRE}">" {
7141 yyextra->docBlock << yytext;
7143 BEGIN(DocCopyBlock);
7144 }
7145<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7146 yyextra->docBlock << yytext;
7148 BEGIN(DocCopyBlock);
7149 }
7150<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7151 yyextra->docBlock << yytext;
7153 BEGIN(DocCopyBlock);
7154 }
7155<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7156 yyextra->docBlock << yytext;
7158 BEGIN(DocCopyBlock);
7159 }
7160<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7162 yyextra->docBlock << "\\ilinebr ";
7163 yyextra->docBlock << pat;
7165 BEGIN(DocCopyBlock);
7166 }
7167<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7169 yyextra->docBlock << pat;
7171 BEGIN(DocCopyBlock);
7172 }
7173<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7174<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7175<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7177 yyextra->docBlock << "\\ilinebr ";
7178 yyextra->docBlock << pat;
7180 BEGIN(DocCopyBlock);
7181 }
7182<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7183<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7184<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7186 yyextra->docBlock << pat;
7188 BEGIN(DocCopyBlock);
7189 }
7190<DocBlock>"```" { // skip ``` if not at the start of a line
7191 yyextra->docBlock << "```";
7192 }
7193<DocBlock>"\\`" { // skip escaped backtick
7194 yyextra->docBlock << yytext;
7195 }
7196<DocBlock>"`"{1,2} {
7197 yyextra->docBlock << yytext;
7199 BEGIN(DocCopyBlock);
7200 }
7201<DocBlock>{B}*"<"{CODE}">" {
7202 if (yyextra->insideCS)
7203 {
7204 yyextra->docBlock << yytext;
7206 BEGIN(DocCopyBlock);
7207 }
7208 else
7209 {
7210 REJECT;
7211 }
7212 }
7213<DocBlock>[^@*~`'\/\\\n]+ { // any character that isn't special
7214 yyextra->docBlock << yytext;
7215 }
7216<DocBlock>\n { // newline
7218 yyextra->docBlock << *yytext;
7219 }
7220<DocBlock>. { // command block
7221 yyextra->docBlock << *yytext;
7222 }
7223
7224
7225
7226<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
7228 {
7229 BEGIN(DocBlock);
7230 }
7231 yyextra->docBlock << yytext;
7232 }
static bool endVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7233<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
7235 {
7236 BEGIN(DocBlock);
7237 }
7238 yyextra->docBlock << yytext;
7239 }
7240<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7242 {
7243 BEGIN(DocBlock);
7244 }
7245 yyextra->docBlock << yytext;
7246 }
7247<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
7249 {
7250 BEGIN(DocBlock);
7251 }
7252 yyextra->docBlock << yytext;
7253 }
7254<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
7255 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7256 {
7257 REJECT;
7258 }
7259 else
7260 {
7263 yyextra->docBlock << indent;
7264 }
7265 }
7266<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
7267 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7268 {
7271 yyextra->docBlock << indent;
7272 }
7273 else
7274 {
7275 REJECT;
7276 }
7277 }
7278<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
7279 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7280 {
7283 yyextra->docBlock << indent+"*";
7284 }
7285 else
7286 {
7287 REJECT;
7288 }
7289 }
7290<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
7291 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7292 {
7294 if (yyextra->nestedComment>0)
7295 {
7297 yyextra->docBlock << indent+"*";
7298 }
7299 else
7300 {
7302 yyextra->docBlock << indent;
7303 }
7304 }
7305 else
7306 {
7307 REJECT;
7308 }
7309 }
7310<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7313 {
7314 BEGIN(DocBlock);
7315 }
7316 yyextra->docBlock << pat;
7317 }
7318<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7321 {
7322 BEGIN(DocBlock);
7323 }
7324 yyextra->docBlock << pat;
7325 }
7326<DocCopyBlock>"```" { // backtick + end marker
7327 if (yyextra->docBlockName=="``")
7328 {
7329 yyextra->docBlock << "`";
7331 yyextra->docBlock << "``";
7332 BEGIN(DocBlock);
7333 }
7334 else
7335 {
7336 yyextra->docBlock << yytext;
7337 }
7338 }
7339<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7341 {
7342 BEGIN(DocBlock);
7343 }
7344 yyextra->docBlock << yytext;
7345 }
7346<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7348 {
7349 BEGIN(DocBlock);
7350 }
7351 yyextra->docBlock << yytext;
7352 }
7353<DocCopyBlock>"`"{1,2} {
7355 {
7356 BEGIN(DocBlock);
7357 }
7358 yyextra->docBlock << yytext;
7359 }
7360<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ { // any character that is not special
7361 yyextra->docBlock << yytext;
7362 }
7363<DocCopyBlock>\" {
7364 yyextra->docBlock << yytext;
7365 if (yyextra->docBlockName=="code" || yyextra->docBlockName=="iliteral")
7366
7367
7368 {
7369 yyextra->lastStringContext=YY_START;
7370 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7371 yyextra->stopAtInvalidString=true;
7372 BEGIN(CopyGString);
7373 }
7374 }
7375<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7376 if (yytext[1]=='*')
7377 {
7378 yyextra->nestedComment++;
7379 }
7380 else if (yytext[0]=='*' && yyextra->nestedComment>0)
7381 {
7382 yyextra->nestedComment--;
7383 }
7384 else if (yytext[0]=='*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7385 {
7386 warn(yyextra->fileName,yyextra->yyLineNr,
7387 "Found end of C comment inside a '{}' block without matching start of the comment!"
7388 " Maybe the end marker for the block is missing?",
7389 yyextra->docBlockName);
7390 BEGIN(DocBlock);
7391 }
7392 yyextra->docBlock << yytext;
7393 }
7394<DocCopyBlock>\n { // newline
7395 yyextra->docBlock << *yytext;
7397 }
7398<DocCopyBlock>. { // any other character
7399 yyextra->docBlock << *yytext;
7400 }
7401<DocCopyBlock><<EOF>> {
7402 warn(yyextra->fileName,yyextra->yyLineNr,
7403 "reached end of file while inside a '{}' block!"
7404 " The command that should end the block seems to be missing!",
7405 yyextra->docBlockName);
7407 }
7408
7409
7410
7411
7412<Prototype>"operator"{B}*"("{B}*")" {
7413 yyextra->current->name+=yytext;
7414 }
7415<Prototype>"(" {
7416 yyextra->current->args+=*yytext;
7417 yyextra->currentArgumentContext = PrototypeQual;
7418 yyextra->fullArgString = yyextra->current->args;
7419 yyextra->copyArgString = &yyextra->current->args;
7420 BEGIN( ReadFuncArgType ) ;
7421 }
7422<Prototype>"("({ID}"::")*({B}*[&*])+ {
7423 if (yyextra->insidePHP)
7424 {
7425 REJECT;
7426 }
7427 else
7428 {
7429 yyextra->current->type+=yyextra->current->name+yytext;
7430 yyextra->current->name.clear();
7431 BEGIN( PrototypePtr );
7432 }
7433 }
7434<PrototypePtr>{SCOPENAME} {
7435 yyextra->current->name+=yytext;
7436 }
7437<PrototypePtr>"(" {
7438 yyextra->current->args+=*yytext;
7439 yyextra->currentArgumentContext = PrototypeQual;
7440 yyextra->fullArgString = yyextra->current->args;
7441 yyextra->copyArgString = &yyextra->current->args;
7442 BEGIN( ReadFuncArgType ) ;
7443 }
7444<PrototypePtr>")" {
7445 yyextra->current->type+=')';
7446 BEGIN( Prototype );
7447 }
7448<PrototypePtr>. {
7449 yyextra->current->name+=yytext;
7450 }
7451<PrototypeQual>"{" {
7452 BEGIN( PrototypeSkipLine);
7453 }
7454<PrototypeQual>{B}*"const"{B}* {
7455 yyextra->current->args += " const ";
7456 yyextra->current->argList.setConstSpecifier(
TRUE);
7457 }
7458<PrototypeQual>{B}*"volatile"{B}* {
7459 yyextra->current->args += " volatile ";
7460 yyextra->current->argList.setVolatileSpecifier(
TRUE);
7461 }
7462<PrototypeQual>{B}*"="{B}*"0"{B}* {
7463 yyextra->current->args += " = 0";
7464 yyextra->current->virt = Specifier::Pure;
7465 yyextra->current->argList.setPureSpecifier(
TRUE);
7466 }
7467<PrototypeQual>"throw"{B}*"(" {
7468 yyextra->current->exception = "throw(";
7469 BEGIN(PrototypeExc);
7470 }
7471<PrototypeExc>")" {
7472 yyextra->current->exception += ')';
7473 BEGIN(PrototypeQual);
7474 }
7475<PrototypeExc>. {
7476 yyextra->current->exception += *yytext;
7477 }
7478<PrototypeQual>. {
7479 yyextra->current->args += *yytext;
7480 }
7481<Prototype>. {
7482 yyextra->current->name += *yytext;
7483 }
7484<PrototypeSkipLine>. {
7485 }
7486
7487
7488
7489
7490<SkipCxxComment>.*"\\\n" { // line continuation
7491 if (yyextra->insideCS)
7492 {
7493 REJECT;
7494 }
7495 else
7496 {
7498 }
7499 }
7500<SkipCxxComment>{ANYopt}/\n {
7501 BEGIN( yyextra->lastCContext ) ;
7502 }
7503<SkipComment>[^\*\n]+
7504
7505
7506
7507<*>"[[" { // C++11 attribute
7508 if (!yyextra->insideCpp) REJECT;
7509 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7510 yyextra->lastC11AttributeContext = YY_START;
7511 BEGIN( SkipC11Attribute );
7512 }
7513
7514<*>\n { lineCount(yyscanner); }
7515<*>\" {
7516 if (yyextra->insideIDL && yyextra->insideCppQuote)
7517 {
7518 BEGIN(EndCppQuote);
7519 }
7520 else if (yyextra->insidePHP)
7521 {
7522 yyextra->lastStringContext=YY_START;
7523 BEGIN(SkipString);
7524 }
7525 }
7526<*>^{B}*"#" {
7527 if (!yyextra->insidePHP)
7528 {
7529 yyextra->lastCPPContext = YY_START;
7530 BEGIN( SkipCPP ) ;
7531 }
7532 else
7533 {
7534 yyextra->lastCContext = YY_START ;
7535 BEGIN( SkipCxxComment ) ;
7536 }
7537 }
7538<*>"#" {
7539 if (!yyextra->insidePHP)
7540 REJECT;
7541 yyextra->lastCContext = YY_START ;
7542 BEGIN( SkipCxxComment ) ;
7543 }
7544<*>\' {
7545 if (yyextra->insidePHP)
7546 {
7547 yyextra->lastStringContext=YY_START;
7548 BEGIN(SkipPHPString);
7549 }
7550 }
7551<*>\? {
7552 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
7553 {
7554 if (yyextra->current->type.isEmpty())
7555 {
7556 if (yyextra->current->name.isEmpty())
7557 yyextra->current->name="?";
7558 else
7559 yyextra->current->name+="?";
7560 }
7561 else
7562 {
7563 yyextra->current->type+="?";
7564 }
7565 }
7566 }
7567<*>"}" { yyextra->exported=false; }
7568<*>.
7569<SkipComment>{CPPC}|{CCS}
7570<*>{CCS} { yyextra->lastCContext = YY_START ;
7571 BEGIN( SkipComment ) ;
7572 }
7573<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
7574<*>{CPPC} {
7575 yyextra->lastCContext = YY_START ;
7576 BEGIN( SkipCxxComment ) ;
7577 }
7578<<EOF>> {
7579 if (yyextra->insideCS && yyextra->fakeNS)
7580 {
7581 yyextra->fakeNS--;
7582 unput('}');
7583 BEGIN ( ReadNSBody);
7584 }
7585 else
7586 {
7588 }
7589 }
7590%%