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