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