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
3098 yyextra->docBlock.
str(indent.
str());
3099
static int computeIndent(const char *s, int startIndent)
3101
3102 yyextra->docBlockTerm = ';';
3103 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3104 {
3105 yyextra->current->bitfields = ":"+yyextra->current->args;
3106 yyextra->current->args.clear();
3107 yyextra->current->section = EntryType::makeVariable();
3108 }
3109 if (yytext[yyleng-3]=='/')
3110 {
3112 BEGIN( DocLine );
3113 }
3114 else
3115 {
3117 BEGIN( DocBlock );
3118 }
3119 }
3120 }
static void startCommentBlock(yyscan_t yyscanner, bool)
3121<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
3122 if (YY_START==ReadInitializer && yyextra->keepComment)
3123 {
3124 REJECT;
3125 }
3126 else
3127 {
3128 yyextra->docBlockContext = YY_START;
3129 yyextra->docBlockInBody =
FALSE;
3130 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3132
3135 yyextra->docBlock.
str(indent.
str());
3137
3138 yyextra->docBlockTerm = ',';
3139 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3140 {
3141 yyextra->current->bitfields = ":"+yyextra->current->args;
3142 yyextra->current->args.clear();
3143 yyextra->current->section = EntryType::makeVariable();
3144 }
3145 if (yytext[yyleng-3]=='/')
3146 {
3148 BEGIN( DocLine );
3149 }
3150 else
3151 {
3153 BEGIN( DocBlock );
3154 }
3155 }
3156 }
3157<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
3158 if (YY_START==ReadInitializer && yyextra->keepComment)
3159 {
3160 REJECT;
3161 }
3162 else
3163 {
3164 if (yyextra->current->bodyLine==-1)
3165 {
3166 yyextra->current->bodyLine=yyextra->yyLineNr;
3167 yyextra->current->bodyColumn = yyextra->yyColNr;
3168 }
3169 yyextra->docBlockContext = YY_START;
3170 yyextra->docBlockInBody =
FALSE;
3171 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3175 yyextra->docBlock.
str(indent.
str());
3177
3178 yyextra->docBlockTerm = 0;
3179 if (yytext[yyleng-3]=='/')
3180 {
3182 BEGIN( DocLine );
3183 }
3184 else
3185 {
3187 BEGIN( DocBlock );
3188 }
3189 }
3190 }
3191
3192<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
3193
3194 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3195 {
3196
3197 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3198 }
3199 else
3200 {
3201
3202 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3203 }
3204
3206 if (yytext[1]=='/')
3207 {
3208 if (yytext[2]=='!' || yytext[2]=='/')
3209 {
3210 yyextra->docBlockContext = YY_START;
3211 yyextra->docBlockInBody =
FALSE;
3212 yyextra->docBlockAutoBrief =
FALSE;
3213 yyextra->docBlock.str(std::string());
3214 yyextra->docBlockTerm = 0;
3216 BEGIN(DocLine);
3217 }
3218 else
3219 {
3220 yyextra->lastCContext=YY_START;
3221 BEGIN(SkipCxxComment);
3222 }
3223 }
3224 else
3225 {
3226 if (yytext[2]=='!' || yytext[2]=='*')
3227 {
3228 yyextra->docBlockContext = YY_START;
3229 yyextra->docBlockInBody =
FALSE;
3230 yyextra->docBlock.str(std::string());
3231 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3233 yyextra->docBlockTerm = 0;
3235 BEGIN(DocBlock);
3236 }
3237 else
3238 {
3239 yyextra->lastCContext=YY_START;
3240 BEGIN(SkipComment);
3241 }
3242 }
3243 }
3244<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3245 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3246 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3248 }
3249<FindMembers>"=>" {
3250 if (!yyextra->insideCS) REJECT;
3251 yyextra->current->bodyLine = yyextra->yyLineNr;
3252 yyextra->current->bodyColumn = yyextra->yyColNr;
3253 yyextra->current->initializer.str(yytext);
3254 yyextra->lastInitializerContext = YY_START;
3255 yyextra->sharpCount=0;
3256 yyextra->initBracketCount=0;
3257 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3258 yyextra->current->spec.setGettable(true);
3259 BEGIN(ReadInitializerPtr);
3260 }
3261<FindMembers>"=" { // in PHP code this could also be due to "<?="
3262 yyextra->current->bodyLine = yyextra->yyLineNr;
3263 yyextra->current->bodyColumn = yyextra->yyColNr;
3264 yyextra->current->initializer.str(" ");
3265 for (int ii = 2 ; ii < yyextra->yyColNr; ii++)
3266 yyextra->current->initializer << " ";
3267 yyextra->current->initializer << "=";
3268 yyextra->lastInitializerContext = YY_START;
3269 yyextra->sharpCount=0;
3270 yyextra->initBracketCount=0;
3271 BEGIN(ReadInitializer);
3272 }
3273<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3275 yyextra->current->exception += " ";
3277 }
3278<UNOIDLAttributeBlock>"}" {
3279 yyextra->current->exception += " }";
3280 BEGIN(FindMembers);
3281 }
3282
3283<ReadInitializer,ReadInitializerPtr>"(" {
3284 yyextra->lastRoundContext=YY_START;
3285 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3286 yyextra->roundCount=0;
3287 yyextra->current->initializer << *yytext;
3288 BEGIN(GCopyRound);
3289 }
3290<ReadInitializer,ReadInitializerPtr>"[" {
3291 if (!yyextra->insidePHP) REJECT;
3292 yyextra->lastSquareContext=YY_START;
3293 yyextra->pCopySquareGString=&yyextra->current->initializer;
3294 yyextra->squareCount=0;
3295 yyextra->current->initializer << *yytext;
3296 BEGIN(GCopySquare);
3297 }
3298<ReadInitializer,ReadInitializerPtr>"{" {
3299 yyextra->lastCurlyContext=YY_START;
3300 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3301 yyextra->curlyCount=0;
3302 yyextra->current->initializer << *yytext;
3303 BEGIN(GCopyCurly);
3304 }
3305<ReadInitializer,ReadInitializerPtr>[;,] {
3306
3307 if (*yytext==';' && yyextra->current_root->spec.isEnum())
3308 {
3309 yyextra->current->fileName = yyextra->fileName;
3310 yyextra->current->startLine = yyextra->yyLineNr;
3311 yyextra->current->startColumn = yyextra->yyColNr;
3312 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3313 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3314 yyextra->current->section = EntryType::makeVariable();
3315 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3317 BEGIN(FindMembers);
3318 }
3319 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3320 {
3321 unput(*yytext);
3322 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3323 BEGIN(yyextra->lastInitializerContext);
3324 }
3325 else if (*yytext==',' && yyextra->initBracketCount==0)
3326 {
3327 unput(*yytext);
3328 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3329 BEGIN(yyextra->lastInitializerContext);
3330 }
3331 else
3332 {
3333 yyextra->current->initializer << *yytext;
3334 }
3335 }
3336<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
3337 if (!yyextra->insideCpp)
3338 {
3339 REJECT;
3340 }
3341 else
3342 {
3343 yyextra->current->initializer << yytext;
3345 yyextra->lastRawStringContext = YY_START;
3346 yyextra->pCopyRawGString = &yyextra->current->initializer;
3347 BEGIN(RawGString);
3348
3349 }
3350 }
QCString extractBeginRawStringDelimiter(const char *rawStart)
3351<ReadInitializer>{CPPC}.* {
3352 if (yyextra->keepComment)
3353 {
3354 yyextra->current->initializer << yytext;
3355 }
3356 else
3357 {
3358 REJECT;
3359 }
3360 }
3361<ReadInitializer>{CCS} {
3362 if (yyextra->keepComment)
3363 {
3364 yyextra->current->initializer << yytext;
3365 BEGIN(InitCopyComment);
3366 }
3367 else
3368 {
3369 REJECT;
3370 }
3371 }
3372<InitCopyComment>{CCE} {
3373 yyextra->current->initializer << yytext;
3374 BEGIN(ReadInitializer);
3375 }
3376<InitCopyComment>\n {
3378 yyextra->current->initializer << yytext;
3379 }
3380<InitCopyComment>. {
3381 yyextra->current->initializer << yytext;
3382 }
3383<InitCopyComment><<EOF>> {
3384 warn(yyextra->fileName,yyextra->yyLineNr,
3385 "reached end of file while inside a C style comment block!");
3387 }
3388<RawGString>{RAWEND} {
3390 {
3391 *yyextra->pCopyRawGString << yytext;
3392 BEGIN(yyextra->lastRawStringContext);
3393 }
3394 else
3395 {
3396 REJECT;
3397 }
3398 }
QCString extractEndRawStringDelimiter(const char *rawEnd)
3399<RawGString>[^)\n]+ {
3400 *yyextra->pCopyRawGString << yytext;
3401 }
3402<RawGString>. {
3403 *yyextra->pCopyRawGString << yytext;
3404 }
3405<RawGString>\n {
3406 *yyextra->pCopyRawGString << yytext;
3408 }
3409<RawString>{RAWEND} {
3410 *yyextra->pCopyRawString+=yytext;
3411 yyextra->fullArgString+=yytext;
3413 {
3414 BEGIN(yyextra->lastRawStringContext);
3415 }
3416 }
3417<RawString>[^)]+ {
3418 *yyextra->pCopyRawString += yytext;
3419 yyextra->fullArgString+=yytext;
3420 }
3421<RawString>. {
3422 *yyextra->pCopyRawString += yytext;
3423 yyextra->fullArgString+=yytext;
3424 }
3425<RawString>\n {
3426 *yyextra->pCopyRawString += yytext;
3427 yyextra->fullArgString+=yytext;
3429 }
3430<ReadInitializer,ReadInitializerPtr>\" {
3431 if (yyextra->insideIDL && yyextra->insideCppQuote)
3432 {
3433 BEGIN(EndCppQuote);
3434 }
3435 else
3436 {
3437 yyextra->lastStringContext=YY_START;
3438 yyextra->current->initializer << yytext;
3439 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3440 yyextra->stopAtInvalidString=false;
3441 BEGIN(CopyGString);
3442 }
3443 }
3444<ReadInitializer,ReadInitializerPtr>"->" {
3445 yyextra->current->initializer << yytext;
3446 }
3447<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3448 yyextra->current->initializer << yytext;
3449 }
3450<ReadInitializer,ReadInitializerPtr>(">>") {
3451 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3452 {
3453
3454 yyextra->initBracketCount-=2;
3455 yyextra->sharpCount-=2;
3456 }
3457 yyextra->current->initializer << yytext;
3458 }
3459<ReadInitializer,ReadInitializerPtr>(">=") {
3460 yyextra->current->initializer << yytext;
3461 }
3462<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3463 yyextra->initBracketCount++;
3464 yyextra->sharpCount++;
3465 yyextra->current->initializer << *yytext;
3466 }
3467<ReadInitializer,ReadInitializerPtr>[>\]})] {
3468 yyextra->initBracketCount--;
3469 yyextra->sharpCount--;
3470 if (*yytext=='}')
3471 {
3472 yyextra->current->endBodyLine=yyextra->yyLineNr;
3473 }
3474 yyextra->current->initializer << *yytext;
3475 }
3476<ReadInitializer,ReadInitializerPtr>\' {
3477 if (yyextra->insidePHP)
3478 {
3479 yyextra->current->initializer << yytext;
3480 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3481 yyextra->lastStringContext=YY_START;
3482 BEGIN(CopyPHPGString);
3483 }
3484 else
3485 {
3486 yyextra->current->initializer << yytext;
3487 }
3488 }
3489<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3490 if (yyextra->insidePHP)
3491 {
3492 REJECT;
3493 }
3494 else
3495 {
3496 yyextra->current->initializer << yytext;
3497 }
3498 }
3499<ReadInitializer,ReadInitializerPtr>\n {
3500 yyextra->current->initializer << *yytext;
3502 }
3503<ReadInitializer,ReadInitializerPtr>"@\"" {
3504
3505 yyextra->current->initializer << yytext;
3506 if (!yyextra->insideCS && !yyextra->insideObjC)
3507 {
3508 REJECT;
3509 }
3510 else
3511 {
3512
3513 yyextra->lastSkipVerbStringContext=YY_START;
3514 yyextra->pSkipVerbString=&yyextra->current->initializer;
3515 BEGIN(SkipVerbString);
3516 }
3517 }
3518<SkipVerbString>[^\n"\\]+ {
3519 *yyextra->pSkipVerbString << yytext;
3520 }
3521<SkipVerbString>"\\\\" { // escaped backslash
3522 if (yyextra->insideCS) REJECT
3523 *yyextra->pSkipVerbString << yytext;
3524 }
3525<SkipVerbString>"\\\"" { // backslash escaped quote
3526 if (yyextra->insideCS) REJECT
3527 *yyextra->pSkipVerbString << yytext;
3528 }
3529<SkipVerbString>"\"\"" { // quote escape
3530 *yyextra->pSkipVerbString << yytext;
3531 }
3532<SkipVerbString>"\"" {
3533 *yyextra->pSkipVerbString << *yytext;
3534 BEGIN(yyextra->lastSkipVerbStringContext);
3535 }
3536<SkipVerbString>\n {
3537 *yyextra->pSkipVerbString << *yytext;
3539 }
3540<SkipVerbString>. {
3541 *yyextra->pSkipVerbString << *yytext;
3542 }
3543<ReadInitializer,ReadInitializerPtr>"?>" {
3544 if (yyextra->insidePHP)
3545 BEGIN( FindMembersPHP );
3546 else
3547 yyextra->current->initializer << yytext;
3548 }
3549<ReadInitializer,ReadInitializerPtr>. {
3550 yyextra->current->initializer << *yytext;
3551 }
3552
3553
3554<CopyString,CopyPHPString>\\. {
3555 *yyextra->pCopyQuotedString+=yytext;
3556 }
3557<CopyString>\" {
3558 *yyextra->pCopyQuotedString+=*yytext;
3559 BEGIN( yyextra->lastStringContext );
3560 }
3561<CopyPHPString>\' {
3562 *yyextra->pCopyQuotedString+=*yytext;
3563 BEGIN( yyextra->lastStringContext );
3564 }
3565<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3566 *yyextra->pCopyQuotedString+=yytext;
3567 }
3568<CopyString,CopyPHPString>\n {
3569 *yyextra->pCopyQuotedString+=*yytext;
3571 }
3572<CopyString,CopyPHPString>. {
3573 *yyextra->pCopyQuotedString+=*yytext;
3574 }
3575
3576
3577<CopyGString,CopyPHPGString>\\. {
3578 *yyextra->pCopyQuotedGString << yytext;
3579 }
3580<CopyGString>\" {
3581 *yyextra->pCopyQuotedGString << *yytext;
3582 BEGIN( yyextra->lastStringContext );
3583 }
3584<CopyPHPGString>\' {
3585 *yyextra->pCopyQuotedGString << *yytext;
3586 BEGIN( yyextra->lastStringContext );
3587 }
3588<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3589 *yyextra->pCopyQuotedGString << yytext;
3590 BEGIN( yyextra->lastStringContext );
3591 }
3592<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3593 *yyextra->pCopyQuotedGString << yytext;
3594 }
3595<CopyGString,CopyPHPGString>\n {
3596 *yyextra->pCopyQuotedGString << *yytext;
3597 if (yyextra->stopAtInvalidString)
3598 {
3599 BEGIN( yyextra->lastStringContext );
3600 }
3601 else
3602 {
3604 }
3605 }
3606<CopyGString,CopyPHPGString>. {
3607 *yyextra->pCopyQuotedGString << *yytext;
3608 }
3609
3610
3611<CopyRound>\" {
3612 *yyextra->pCopyRoundString += *yytext;
3613 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3614 yyextra->lastStringContext=YY_START;
3615 BEGIN(CopyString);
3616 }
3617<CopyRound>"(" {
3618 *yyextra->pCopyRoundString += *yytext;
3619 yyextra->roundCount++;
3620 }
3621<CopyRound>")" {
3622 *yyextra->pCopyRoundString += *yytext;
3623 if (--yyextra->roundCount<0)
3624 BEGIN(yyextra->lastRoundContext);
3625 }
3626<CopyRound>\n {
3628 *yyextra->pCopyRoundString += *yytext;
3629 }
3630<CopyRound>\' {
3631 if (yyextra->insidePHP)
3632 {
3633 yyextra->current->initializer << yytext;
3634 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3635 yyextra->lastStringContext=YY_START;
3636 BEGIN(CopyPHPString);
3637 }
3638 else
3639 {
3640 *yyextra->pCopyRoundString += yytext;
3641 }
3642 }
3643<CopyRound>{CHARLIT} {
3644 if (yyextra->insidePHP)
3645 {
3646 REJECT;
3647 }
3648 else
3649 {
3650 *yyextra->pCopyRoundString+=yytext;
3651 }
3652 }
3653<CopyRound>[^"'()\n,]+ {
3654 *yyextra->pCopyRoundString+=yytext;
3655 }
3656<CopyRound>. {
3657 *yyextra->pCopyRoundString+=*yytext;
3658 }
3659
3660
3661<CopySharp>\" {
3662 *yyextra->pCopySharpString += *yytext;
3663 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3664 yyextra->lastStringContext=YY_START;
3665 BEGIN(CopyString);
3666 }
3667<CopySharp>"<" {
3668 *yyextra->pCopySharpString += *yytext;
3669 yyextra->sharpCount++;
3670 }
3671<CopySharp>">" {
3672 *yyextra->pCopySharpString += *yytext;
3673 if (--yyextra->sharpCount<0)
3674 {
3675 BEGIN(yyextra->lastSharpContext);
3676 }
3677 }
3678<CopySharp>\n {
3680 *yyextra->pCopySharpString += *yytext;
3681 }
3682<CopySharp>\' {
3683 if (yyextra->insidePHP)
3684 {
3685 yyextra->current->initializer << yytext;
3686 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3687 yyextra->lastStringContext=YY_START;
3688 BEGIN(CopyPHPString);
3689 }
3690 else
3691 {
3692 *yyextra->pCopySharpString += yytext;
3693 }
3694 }
3695<CopySharp>{CHARLIT} {
3696 if (yyextra->insidePHP)
3697 {
3698 REJECT;
3699 }
3700 else
3701 {
3702 *yyextra->pCopySharpString+=yytext;
3703 }
3704 }
3705<CopySharp>[^"'<>\n,]+ {
3706 *yyextra->pCopySharpString+=yytext;
3707 }
3708<CopySharp>. {
3709 *yyextra->pCopySharpString+=*yytext;
3710 }
3711
3712
3713
3714<GCopyRound>\" {
3715 *yyextra->pCopyRoundGString << *yytext;
3716 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3717 yyextra->lastStringContext=YY_START;
3718 BEGIN(CopyGString);
3719 }
3720<GCopyRound>"(" {
3721 *yyextra->pCopyRoundGString << *yytext;
3722 yyextra->roundCount++;
3723 }
3724<GCopyRound>")" {
3725 *yyextra->pCopyRoundGString << *yytext;
3726 if (--yyextra->roundCount<0)
3727 BEGIN(yyextra->lastRoundContext);
3728 }
3729<GCopyRound>\n {
3731 *yyextra->pCopyRoundGString << *yytext;
3732 }
3733<GCopyRound>\' {
3734 if (yyextra->insidePHP)
3735 {
3736 yyextra->current->initializer << yytext;
3737 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3738 yyextra->lastStringContext=YY_START;
3739 BEGIN(CopyPHPGString);
3740 }
3741 else
3742 {
3743 *yyextra->pCopyRoundGString << yytext;
3744 }
3745 }
3746<GCopyRound>{CHARLIT} {
3747 if (yyextra->insidePHP)
3748 {
3749 REJECT;
3750 }
3751 else
3752 {
3753 *yyextra->pCopyRoundGString << yytext;
3754 }
3755 }
3756<GCopyRound>"@\"" {
3757 if (!yyextra->insideCS) REJECT;
3758 *yyextra->pCopyRoundGString << yytext;
3759 yyextra->lastSkipVerbStringContext=YY_START;
3760 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3761 BEGIN(SkipVerbString);
3762 }
3763<GCopyRound>[^"'()\n\/,R]+ { // R because of raw string start
3764 *yyextra->pCopyRoundGString << yytext;
3765 }
3766<GCopyRound>{RAWBEGIN} {
3767 *yyextra->pCopyRoundGString << yytext;
3769 yyextra->lastRawStringContext = YY_START;
3770 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3771 BEGIN(RawGString);
3772 }
3773<GCopyRound>. {
3774 *yyextra->pCopyRoundGString << *yytext;
3775 }
3776
3777
3778<GCopySquare>\" {
3779 *yyextra->pCopySquareGString << *yytext;
3780 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3781 yyextra->lastStringContext=YY_START;
3782 BEGIN(CopyGString);
3783 }
3784<GCopySquare>\' {
3785 *yyextra->pCopySquareGString << *yytext;
3786 if (yyextra->insidePHP)
3787 {
3788 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3789 yyextra->lastStringContext=YY_START;
3790 BEGIN(CopyPHPGString);
3791 }
3792 }
3793<GCopySquare>"[" {
3794 *yyextra->pCopySquareGString << *yytext;
3795 yyextra->squareCount++;
3796 }
3797<GCopySquare>"]" {
3798 *yyextra->pCopySquareGString << *yytext;
3799 if (--yyextra->squareCount<0)
3800 BEGIN(yyextra->lastSquareContext);
3801 }
3802<GCopySquare>\n {
3804 *yyextra->pCopySquareGString << *yytext;
3805 }
3806<GCopySquare>\' {
3807 if (yyextra->insidePHP)
3808 {
3809 yyextra->current->initializer << yytext;
3810 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3811 yyextra->lastStringContext=YY_START;
3812 BEGIN(CopyPHPGString);
3813 }
3814 else
3815 {
3816 *yyextra->pCopySquareGString << yytext;
3817 }
3818 }
3819<GCopySquare>{CHARLIT} {
3820 if (yyextra->insidePHP)
3821 {
3822 REJECT;
3823 }
3824 else
3825 {
3826 *yyextra->pCopySquareGString << yytext;
3827 }
3828 }
3829<GCopySquare>[^"'\[\]\n\/,]+ {
3830 *yyextra->pCopySquareGString << yytext;
3831 }
3832<GCopySquare>. {
3833 *yyextra->pCopySquareGString << *yytext;
3834 }
3835
3836
3837<CopyCurly>\" {
3838 *yyextra->pCopyCurlyString += *yytext;
3839 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3840 yyextra->lastStringContext=YY_START;
3841 yyextra->keepComment=false;
3842 BEGIN(CopyString);
3843 }
3844<CopyCurly>\' {
3845 *yyextra->pCopyCurlyString += *yytext;
3846 if (yyextra->insidePHP)
3847 {
3848 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3849 yyextra->lastStringContext=YY_START;
3850 yyextra->keepComment=false;
3851 BEGIN(CopyPHPString);
3852 }
3853 }
3854<CopyCurly>"{" {
3855 *yyextra->pCopyCurlyString += *yytext;
3856 yyextra->curlyCount++;
3857 }
3858<CopyCurly>"}" {
3859 *yyextra->pCopyCurlyString += *yytext;
3860 if (--yyextra->curlyCount<0)
3861 {
3862 yyextra->keepComment=false;
3863 BEGIN(yyextra->lastCurlyContext);
3864 }
3865 }
3866<CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3867 {
3868 REJECT;
3869 }
3870 else
3871 {
3872 *yyextra->pCopyCurlyString += yytext;
3873 }
3874 }
3875<CopyCurly>[^"'{}\/\n,]+ {
3876 *yyextra->pCopyCurlyString += yytext;
3877 }
3878<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3879<CopyCurly>\n {
3881 *yyextra->pCopyCurlyString += *yytext;
3882 }
3883<CopyCurly>. {
3884 *yyextra->pCopyCurlyString += *yytext;
3885 }
3886<CopyCurly>{CPPC}[^\n]* {
3887 if (yyextra->keepComment)
3888 {
3889 *yyextra->pCopyCurlyString += yytext;
3890 }
3891 else
3892 {
3893 REJECT;
3894 }
3895 }
3896<CopyCurly>{CCS} {
3897 if (yyextra->keepComment)
3898 {
3899 *yyextra->pCopyCurlyString += yytext;
3900 BEGIN(CopyComment);
3901 }
3902 else
3903 {
3904 REJECT;
3905 }
3906 }
3907<CopyComment>{CCE} {
3908 *yyextra->pCopyCurlyString += yytext;
3909 BEGIN(CopyCurly);
3910 }
3911<CopyComment>\n {
3913 *yyextra->pCopyCurlyString += *yytext;
3914 }
3915<CopyComment>. {
3916 *yyextra->pCopyCurlyString += *yytext;
3917 }
3918<CopyComment><<EOF>> {
3919 warn(yyextra->fileName,yyextra->yyLineNr,
3920 "reached end of file while inside a C style comment block!");
3922 }
3923
3924
3925<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3926 }
3927<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3929 int s = line.
find(
' ');
3930 int e = line.
find(
'"',s);
3931 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3932 if (yytext[yyleng-1]=='\n')
3933 {
3935 yyextra->column=0;
3936 }
3937 }
int toInt(bool *ok=nullptr, int base=10) const
3938<GCopyCurly>\" {
3939 *yyextra->pCopyCurlyGString << *yytext;
3940 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3941 yyextra->lastStringContext=YY_START;
3942 yyextra->keepComment = false;
3943 BEGIN(CopyGString);
3944 }
3945<GCopyCurly>\' {
3946 *yyextra->pCopyCurlyGString << *yytext;
3947 if (yyextra->insidePHP)
3948 {
3949 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3950 yyextra->lastStringContext=YY_START;
3951 yyextra->keepComment = false;
3952 BEGIN(CopyPHPGString);
3953 }
3954 }
3955<GCopyCurly>"{" {
3956 *yyextra->pCopyCurlyGString << *yytext;
3957 yyextra->curlyCount++;
3958 }
3959<GCopyCurly>"}" {
3960 *yyextra->pCopyCurlyGString << *yytext;
3961 if (--yyextra->curlyCount<0)
3962 {
3963 yyextra->current->endBodyLine = yyextra->yyLineNr;
3964 yyextra->keepComment = false;
3965 BEGIN(yyextra->lastCurlyContext);
3966 }
3967 }
3968<GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3969 {
3970 REJECT;
3971 }
3972 else
3973 {
3974 *yyextra->pCopyCurlyGString << yytext;
3975 }
3976 }
3977<GCopyCurly>[^"'{}\/\n,]+ {
3978 *yyextra->pCopyCurlyGString << yytext;
3979 }
3980<GCopyCurly>[,]+ {
3981 *yyextra->pCopyCurlyGString << yytext;
3982 }
3983<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3984<GCopyCurly>\n {
3986 *yyextra->pCopyCurlyGString << *yytext;
3987 }
3988<GCopyCurly>. {
3989 *yyextra->pCopyCurlyGString << *yytext;
3990 }
3991<GCopyCurly>{CPPC}[^\n]* {
3992 if (yyextra->keepComment)
3993 {
3994 *yyextra->pCopyCurlyGString << yytext;
3995 }
3996 else
3997 {
3998 REJECT;
3999 }
4000 }
4001<GCopyCurly>{CCS} {
4002 if (yyextra->keepComment)
4003 {
4004 *yyextra->pCopyCurlyGString << yytext;
4005 BEGIN(GCopyComment);
4006 }
4007 else
4008 {
4009 REJECT;
4010 }
4011 }
4012<GCopyComment>{CCE} {
4013 *yyextra->pCopyCurlyGString << yytext;
4014 BEGIN(GCopyCurly);
4015 }
4016<GCopyComment>\n {
4018 *yyextra->pCopyCurlyGString << *yytext;
4019 }
4020<GCopyComment>. {
4021 *yyextra->pCopyCurlyGString << *yytext;
4022 }
4023<GCopyComment><<EOF>> {
4024 warn(yyextra->fileName,yyextra->yyLineNr,
4025 "reached end of file while inside a C style comment block!");
4027 }
4028
4029
4030
4031
4032<FindMembers>":" {
4033 if (yyextra->current->type.isEmpty() &&
4034 yyextra->current->name=="enum")
4035 {
4036 yyextra->current->section = EntryType::makeEnum();
4037 yyextra->current->name.clear();
4038 yyextra->current->args.clear();
4039 BEGIN(EnumBaseType);
4040 }
4041 else
4042 {
4043 if (yyextra->current->type.isEmpty())
4044 {
4046 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
4047 }
4048 BEGIN(BitFields);
4049 yyextra->current->bitfields+=":";
4050 }
4051 }
4052<BitFields>. {
4053 yyextra->current->bitfields+=*yytext;
4054 }
4055<EnumBaseType>. {
4056 yyextra->current->args+=*yytext;
4057 }
4058<EnumBaseType>\n {
4060 yyextra->current->args+=' ';
4061 }
4062<FindMembers>[;,] {
4063 QCString oldType = yyextra->current->type;
4064 if (yyextra->current->bodyLine==-1)
4065 {
4066 yyextra->current->bodyLine = yyextra->yyLineNr;
4067 yyextra->current->bodyColumn = yyextra->yyColNr;
4068 }
4069 if ( yyextra->insidePHP && yyextra->current->type.startsWith("var"))
4070 {
4071 yyextra->current->type = yyextra->current->type.mid(3);
4072 }
4073 if (yyextra->isTypedef && !yyextra->current->type.startsWith("typedef "))
4074 {
4075 yyextra->current->type.prepend("typedef ");
4076 }
4077 bool isStatic = yyextra->current->isStatic;
4078 Protection prot = yyextra->current->protection;
4079 bool isConcept = yyextra->current->section.isConcept();
4080 bool isModule = yyextra->current->section.isModuleDoc();
4081 if (isConcept)
4082 {
4083 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4085 }
4086 else if (isModule)
4087 {
4088 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4090 }
4091 else if (!yyextra->current->name.isEmpty() && !yyextra->current->section.isEnum())
4092 {
4093 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
4095 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
4096 if (yyextra->current->section.isClass())
4097 {
4099 }
4100 yyextra->current->section = EntryType::makeVariable() ;
4101 yyextra->current->fileName = yyextra->fileName;
4102 yyextra->current->startLine = yyextra->yyBegLineNr;
4103 yyextra->current->startColumn = yyextra->yyBegColNr;
4104 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4106 }
4107 if ( *yytext == ',')
4108 {
4109 yyextra->current->isStatic = isStatic;
4110 yyextra->current->protection = prot;
4111 yyextra->current->name.clear();
4112 yyextra->current->args.clear();
4113 yyextra->current->brief.clear();
4114 yyextra->current->doc.clear();
4115 yyextra->current->initializer.str(std::string());
4116 yyextra->current->bitfields.clear();
4118 }
4119 else
4120 {
4121 yyextra->mtype = MethodTypes::Method;
4122 yyextra->virt = Specifier::Normal;
4123 yyextra->current->bodyLine = -1;
4124 yyextra->current->bodyColumn = 1;
4125 yyextra->current->groups.clear();
4127 }
4128 }
static QCString stripFuncPtr(const QCString &type)
4129
4130<FindMembers>"[" {
4131 if (yyextra->insideSlice)
4132 {
4133 yyextra->squareCount=1;
4134 yyextra->lastSquareContext = YY_START;
4135 yyextra->current->metaData += "[";
4136 BEGIN( SliceMetadata );
4137 }
4138 else if (!yyextra->insideCS &&
4139 (yyextra->current->name.isEmpty() ||
4140 yyextra->current->name=="typedef"
4141 )
4142 )
4143 {
4144 yyextra->squareCount=1;
4145 yyextra->lastSquareContext = YY_START;
4146 yyextra->idlAttr.clear();
4147 yyextra->idlProp.clear();
4148 yyextra->current->mtype = yyextra->mtype;
4149
4151 yyextra->current->mtype == MethodTypes::Property)
4152 {
4153 yyextra->odlProp = true;
4154 yyextra->current->spec.setGettable(true).setSettable(true);
4155 }
4156
4157 BEGIN( IDLAttribute );
4158 }
4159 else if (yyextra->insideCS &&
4160 yyextra->current->name.isEmpty())
4161 {
4162 yyextra->squareCount=1;
4163 yyextra->lastSquareContext = YY_START;
4164
4165
4166 yyextra->current->args.clear();
4167 BEGIN( SkipSquare );
4168 }
4169 else
4170 {
4171 yyextra->current->args += yytext ;
4172 yyextra->squareCount=1;
4173 yyextra->externLinkage=
FALSE;
4174 BEGIN( Array ) ;
4175 }
4176 }
4177<SliceMetadata>"[" { // Global metadata.
4178 yyextra->squareCount++;
4179 yyextra->current->metaData += "[";
4180 }
4181<SliceMetadata>{BN}* {
4183 }
4184<SliceMetadata>\"[^\"]*\" {
4185 yyextra->current->metaData += yytext;
4186 }
4187<SliceMetadata>"," {
4188 yyextra->current->metaData += yytext;
4189 }
4190<SliceMetadata>"]" {
4191 yyextra->current->metaData += yytext;
4192 if (--yyextra->squareCount<=0)
4193 {
4194 BEGIN (yyextra->lastSquareContext);
4195 }
4196 }
4197<SliceOptional>"(" {
4198 yyextra->current->type += "(";
4199 yyextra->roundCount++;
4200 }
4201<SliceOptional>[0-9]+ {
4202 yyextra->current->type += yytext;
4203 }
4204<SliceOptional>")" {
4205 yyextra->current->type += ")";
4206 if(--yyextra->roundCount<=0)
4207 {
4208 BEGIN (yyextra->lastModifierContext);
4209 }
4210 }
4211<IDLAttribute>"]" {
4212
4213 if (--yyextra->squareCount<=0)
4214 {
4216 if (yyextra->current->mtype == MethodTypes::Property)
4217 BEGIN( IDLPropName );
4218 else
4219 BEGIN( yyextra->lastSquareContext );
4220 }
4221 }
4222<IDLAttribute>"propput" {
4224 {
4225 yyextra->current->mtype = MethodTypes::Property;
4226 }
4227 yyextra->current->spec.setSettable(true);
4228 }
4229<IDLAttribute>"propget" {
4231 {
4232 yyextra->current->mtype = MethodTypes::Property;
4233 }
4234 yyextra->current->spec.setGettable(true);
4235 }
4236<IDLAttribute>"property" { // UNO IDL property
4237 yyextra->current->spec.setProperty(true);
4238 }
4239<IDLAttribute>"attribute" { // UNO IDL attribute
4240 yyextra->current->spec.setAttribute(true);
4241 }
4242<IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
4243 yyextra->current->spec.setOptional(true);
4244 }
4245<IDLAttribute>"readonly" { // on UNO IDL attribute or property
4247 {
4248 yyextra->current->spec.setSettable(false);
4249 }
4250 else
4251 {
4252 yyextra->current->spec.setReadonly(true);
4253 }
4254 }
4255<IDLAttribute>"bound" { // on UNO IDL attribute or property
4256 yyextra->current->spec.setBound(true);
4257 }
4258<IDLAttribute>"removable" { // on UNO IDL property
4259 yyextra->current->spec.setRemovable(true);
4260 }
4261<IDLAttribute>"constrained" { // on UNO IDL property
4262 yyextra->current->spec.setConstrained(true);
4263 }
4264<IDLAttribute>"transient" { // on UNO IDL property
4265 yyextra->current->spec.setTransient(true);
4266 }
4267<IDLAttribute>"maybevoid" { // on UNO IDL property
4268 yyextra->current->spec.setMaybeVoid(true);
4269 }
4270<IDLAttribute>"maybedefault" { // on UNO IDL property
4271 yyextra->current->spec.setMaybeDefault(true);
4272 }
4273<IDLAttribute>"maybeambiguous" { // on UNO IDL property
4274 yyextra->current->spec.setMaybeAmbiguous(true);
4275 }
4276<IDLAttribute>. {
4277 }
4278<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
4279
4280
4281 if (yyextra->odlProp)
4282 {
4283 yyextra->idlProp = yytext;
4284 }
4285 }
4286<IDLPropName>{ID}{BN}*"(" {
4287 yyextra->current->name = yytext;
4288 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
4289 yyextra->current->startLine = yyextra->yyLineNr;
4290 yyextra->current->startColumn = yyextra->yyColNr;
4291 BEGIN( IDLProp );
4292 }
4293<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
4294 if (yyextra->odlProp)
4295 {
4296 yyextra->idlProp += yytext;
4297 }
4298 }
4299<IDLPropName>{ID}{BNopt}/";" {
4300 if (yyextra->odlProp)
4301 {
4302 yyextra->current->name = yytext;
4303 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
4304 yyextra->odlProp = false;
4305
4306 BEGIN( IDLProp );
4307 }
4308 }
4309<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
4310 yyextra->idlAttr = yytext;
4311 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
4312 }
4313<IDLProp>{ID} { // property type
4314 yyextra->idlProp = yytext;
4315 }
4316<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
4317 if (yyextra->current->args.isEmpty())
4318 yyextra->current->args = "(";
4319 else
4320 yyextra->current->args += ", ";
4321 yyextra->current->args += yyextra->idlAttr;
4322 yyextra->current->args += " ";
4323 yyextra->current->args += yyextra->idlProp;
4324 yyextra->current->args += " ";
4325 yyextra->current->args += yytext;
4326 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4327 yyextra->idlProp.clear();
4328 yyextra->idlAttr.clear();
4329 BEGIN( IDLProp );
4330 }
4331<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4332
4333 }
4334<IDLProp>";" {
4335 yyextra->current->fileName = yyextra->fileName;
4336 yyextra->current->type = yyextra->idlProp;
4337 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4338 if (!yyextra->current->args.isEmpty())
4339 yyextra->current->args += ")";
4340 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4341 yyextra->current->section = EntryType::makeVariable();
4342 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4344 BEGIN( FindMembers );
4345 }
4346<IDLProp>. { // spaces, *, or other stuff
4347
4348 }
4349<Array>"]" { yyextra->current->args += *yytext ;
4350 if (--yyextra->squareCount<=0)
4351 BEGIN( FindMembers ) ;
4352 }
4353<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4354 if (--yyextra->squareCount<=0)
4355 BEGIN( SFunction ) ;
4356 }
4357<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4358 yyextra->squareCount++;
4359 }
4360<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4361<SkipSquare>"[" { yyextra->squareCount++; }
4362<SkipSquare>"]" {
4363 if (--yyextra->squareCount<=0)
4364 BEGIN( yyextra->lastSquareContext );
4365 }
4366<SkipSquare>\" {
4367 yyextra->lastStringContext=YY_START;
4368 BEGIN( SkipString );
4369 }
4370<SkipSquare>[^\n\[\]\"]+
4371<FindMembers>"<" { addType(yyscanner);
4372 yyextra->current->type += yytext ;
4373 BEGIN( Sharp ) ;
4374 }
4375<Sharp>">" { yyextra->current->type += *yytext ;
4376 if (--yyextra->sharpCount<=0)
4377 BEGIN( FindMembers ) ;
4378 }
4379<Sharp>"<" { yyextra->current->type += *yytext ;
4380 yyextra->sharpCount++;
4381 }
4382<Sharp>{BN}+ {
4383 yyextra->current->type += ' ';
4385 }
4386<Sharp>. { yyextra->current->type += *yytext ; }
4387<FindFields>{ID} {
4389 yyextra->current->bodyLine = yyextra->yyLineNr;
4390 yyextra->current->bodyColumn = yyextra->yyColNr;
4391 yyextra->current->name = yytext;
4392 }
4393<FindFields>[({] {
4394
4395 unput(*yytext);
4396 yyextra->lastInitializerContext = YY_START;
4397 yyextra->sharpCount=0;
4398 yyextra->initBracketCount=0;
4399 yyextra->current->initializer.str("=");
4400 BEGIN(ReadInitializer);
4401 }
4402<FindFields>"=" {
4403 yyextra->lastInitializerContext = YY_START;
4404 yyextra->sharpCount=0;
4405 yyextra->initBracketCount=0;
4406 yyextra->current->initializer.str(yytext);
4407 BEGIN(ReadInitializer);
4408 }
4409<FindFields>";" {
4410 if (yyextra->insideJava)
4411 {
4412 if (!yyextra->current->name.isEmpty())
4413 {
4414 yyextra->current->fileName = yyextra->fileName;
4415 yyextra->current->startLine = yyextra->yyLineNr;
4416 yyextra->current->startColumn = yyextra->yyColNr;
4417 if (!yyextra->current_root->spec.isEnum())
4418 {
4419 yyextra->current->type = "@";
4420 }
4421 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4422 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4423 yyextra->current->section = EntryType::makeVariable();
4424 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4426 }
4427
4428 BEGIN( FindMembers );
4429 }
4430 else
4431 {
4432 REJECT;
4433 }
4434 }
4435<FindFields>"," {
4436
4437
4438
4439 if (!yyextra->current->name.isEmpty())
4440 {
4441 yyextra->current->fileName = yyextra->fileName;
4442 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4443 {
4444 yyextra->current->startLine = yyextra->current->bodyLine;
4445 yyextra->current->startColumn = yyextra->current->bodyColumn;
4446 }
4447 else
4448 {
4449 yyextra->current->startLine = yyextra->yyLineNr;
4450 yyextra->current->startColumn = yyextra->yyColNr;
4451 }
4452 if (!yyextra->current_root->spec.isEnum())
4453 {
4454 yyextra->current->type = "@";
4455 }
4456 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4457 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4458 yyextra->current->section = EntryType::makeVariable();
4459
4460 if (!yyextra->insideCS && !yyextra->insideJava &&
4461 !yyextra->current_root->spec.isStrong())
4462
4463
4464 {
4465
4466
4467
4468 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4469 }
4470 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4472 }
4473 else
4474 {
4475 yyextra->current->reset();
4477 }
4478 }
4479<FindFields>"[" { // attribute list in IDL
4480 yyextra->squareCount=1;
4481 yyextra->lastSquareContext = YY_START;
4482 BEGIN(SkipSquare);
4483 }
4484<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; } // R because of raw string start
4485<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4486<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
4487 REJECT;
4488
4489 yyextra->current->program << yytext ;
4490 }
4491
4492<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
4493 yyextra->current->program << yytext ;
4494 yyextra->pSkipInterpString = &yyextra->current->program;
4495 yyextra->lastSkipInterpStringContext=YY_START;
4496 yyextra->strCurlyCount = 0;
4497 BEGIN( SkipInterpString );
4498 }
4499<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})* {
4500 *yyextra->pSkipInterpString << yytext;
4501 }
4502<SkipInterpString>"{" {
4503 *yyextra->pSkipInterpString << *yytext;
4504 yyextra->strCurlyCount++;
4505 }
4506<SkipInterpString>"}" {
4507 *yyextra->pSkipInterpString << *yytext;
4508 yyextra->strCurlyCount--;
4509 }
4510<SkipInterpString>\" {
4511 *yyextra->pSkipInterpString << *yytext;
4512 if (yyextra->strCurlyCount==0)
4513 {
4514 BEGIN( yyextra->lastSkipInterpStringContext );
4515 }
4516 }
4517<SkipInterpString>. {
4518 *yyextra->pSkipInterpString << *yytext;
4519 }
4520
4521<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$@\" { if (!yyextra->insideCS) REJECT
4522 yyextra->current->program << yytext ;
4523 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4524 yyextra->lastSkipInterpVerbStringContext=YY_START;
4525 yyextra->strCurlyCount = 0;
4526 BEGIN( SkipInterpVerbString );
4527 }
4528<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4529 *yyextra->pSkipInterpVerbString << yytext;
4530 }
4531<SkipInterpVerbString>"{" {
4532 *yyextra->pSkipInterpVerbString << *yytext;
4533 yyextra->strCurlyCount++;
4534 }
4535<SkipInterpVerbString>"}" {
4536 *yyextra->pSkipInterpVerbString << *yytext;
4537 yyextra->strCurlyCount--;
4538 }
4539<SkipInterpVerbString>\" {
4540 *yyextra->pSkipInterpVerbString << *yytext;
4541 if (yyextra->strCurlyCount==0)
4542 {
4543 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4544 }
4545 }
4546<SkipInterpVerbString>. {
4547 *yyextra->pSkipInterpVerbString << *yytext;
4548 }
4549<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4550<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4551 yyextra->pSkipVerbString = &yyextra->current->program;
4552 yyextra->lastSkipVerbStringContext=YY_START;
4553 BEGIN( SkipVerbString );
4554 }
4555<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
4556 {
4557 yyextra->current->program << yytext ;
4558 yyextra->pCopyHereDocGString = &yyextra->current->program;
4559 yyextra->lastHereDocContext=YY_START;
4560 BEGIN( CopyHereDoc );
4561 }
4562 else
4563 {
4564 REJECT;
4565 }
4566 }
4567<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4568 yyextra->current->program << yytext;
4570 yyextra->lastRawStringContext = YY_START;
4571 yyextra->pCopyRawGString = &yyextra->current->program;
4572 BEGIN(RawGString);
4573 }
4574<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4575 yyextra->pCopyQuotedGString = &yyextra->current->program;
4576 yyextra->lastStringContext=YY_START;
4577 yyextra->stopAtInvalidString=false;
4578 BEGIN( CopyGString );
4579 }
4580<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=true; REJECT;}
4581<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4582 yyextra->lastContext = YY_START ;
4583 BEGIN( Comment ) ;
4584 }
4585<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4586 ++yyextra->yyLineNr ;
4587 yyextra->lastContext = YY_START ;
4588 BEGIN( Comment ) ;
4589 }
4590<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4591 if (!yyextra->insidePHP)
4592 {
4593 yyextra->current->program << yytext;
4594 }
4595 else
4596 {
4597 yyextra->current->program << yytext;
4598 yyextra->pCopyQuotedGString = &yyextra->current->program;
4599 yyextra->lastStringContext=YY_START;
4600 BEGIN(CopyPHPGString);
4601 }
4602 }
4603<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4604 if (yyextra->insidePHP)
4605 {
4606 REJECT;
4607
4608 }
4609 else
4610 {
4611 yyextra->current->program << yytext;
4612 }
4613 }
4614<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4615 ++yyextra->curlyCount ;
4616 }
4617<ReadBodyIntf>"}" {
4618 yyextra->current->program << yytext ;
4619 --yyextra->curlyCount ;
4620 }
4621<ReadBody,ReadNSBody>"}" {
4622 if ( yyextra->curlyCount>0 )
4623 {
4624 yyextra->current->program << yytext ;
4625 --yyextra->curlyCount ;
4626 }
4627 else
4628 {
4629 yyextra->current->endBodyLine = yyextra->yyLineNr;
4630 std::shared_ptr<Entry> original_root = yyextra->current_root;
4631 if (yyextra->current->section.isNamespace() && yyextra->current->type == "namespace")
4632 {
4633
4634 int split_point;
4635
4636 QCString doc = yyextra->current->doc;
4637 int docLine = yyextra->current->docLine;
4638 QCString docFile = yyextra->current->docFile;
4639 QCString brief = yyextra->current->brief;
4640 int briefLine = yyextra->current->briefLine;
4641 QCString briefFile = yyextra->current->briefFile;
4642 auto groups = yyextra->current->groups;
4643 auto anchors = yyextra->current->anchors;
4644 auto sli = yyextra->current->sli;
4645 auto rqli = yyextra->current->rqli;
4646
4647 yyextra->current->doc = "";
4648 yyextra->current->docLine = 0;
4649 yyextra->current->docFile = "";
4650 yyextra->current->brief = "";
4651 yyextra->current->briefLine = 0;
4652 yyextra->current->briefFile = "";
4653 yyextra->current->groups.
clear();
4654 yyextra->current->anchors.clear();
4655 yyextra->current->sli.clear();
4656 yyextra->current->rqli.clear();
4657 while ((split_point = yyextra->current->name.find("::")) != -1)
4658 {
4659 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4660 yyextra->current->program.str(std::string());
4661 new_current->name = yyextra->current->name.mid(split_point + 2);
4662 yyextra->current->name = yyextra->current->name.left(split_point);
4663 if (yyextra->current->name.startsWith("inline "))
4664 {
4665 yyextra->current->name = yyextra->current->name.mid(7);
4666 yyextra->current->spec.setInline(true);
4667 }
4668 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
4669
4670 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4671 yyextra->current_root = yyextra->current;
4672 yyextra->current = new_current;
4673 }
4674
4675 yyextra->current->doc = doc;
4676 yyextra->current->docLine = docLine;
4677 yyextra->current->docFile = docFile;
4678 yyextra->current->brief = brief;
4679 yyextra->current->briefLine = briefLine;
4680 yyextra->current->briefFile = briefFile;
4681 yyextra->current->groups = groups;
4682 yyextra->current->anchors = anchors;
4683 yyextra->current->sli = sli;
4684 yyextra->current->rqli = rqli;
4685 }
4686 QCString &cn = yyextra->current->name;
4688 {
4690 yyextra->current->spec.setInline(true);
4691 }
4692 QCString rn = yyextra->current_root->name;
4693
4695 {
4697 }
4698 if (yyextra->isTypedef && cn.
isEmpty())
4699 {
4700
4701 BEGIN( TypedefName );
4702 }
4703 else
4704 {
4705 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4706 {
4707 yyextra->current->program << ',';
4708 }
4709
4711
4712 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4713 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4714
4715 if (yyextra->insideObjC &&
4716 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4717 )
4718 {
4719 BEGIN( ReadBodyIntf ) ;
4720 }
4721 else
4722 {
4723 yyextra->memspecEntry = yyextra->current;
4724 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4725 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4726 if (yyextra->current->section.isNamespace() ||
4727 yyextra->current->spec.isInterface() ||
4728 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4729 yyextra->insideSlice
4730 )
4731 {
4732 yyextra->current->reset();
4733 yyextra->current_root = std::move(original_root);
4735 yyextra->memspecEntry.reset();
4736 BEGIN( FindMembers ) ;
4737 }
4738 else
4739 {
4740 static const reg::Ex re(R
"(@\d+$)");
4741 if (!yyextra->isTypedef && yyextra->memspecEntry &&
4742 !
reg::search(yyextra->memspecEntry->name.str(),re))
4743 {
4744
4745 yyextra->current->doc.clear();
4746 yyextra->current->brief.clear();
4747 }
4748 BEGIN( MemberSpec ) ;
4749 }
4750 }
4751 }
4752 }
4753 }
bool startsWith(const char *s) const
static void prependScope(yyscan_t yyscanner)
4754<ReadBody>"}"{BN}+"typedef"{BN}+ {
4756 if ( yyextra->curlyCount>0 )
4757 {
4758 yyextra->current->program << yytext ;
4759 --yyextra->curlyCount ;
4760 }
4761 else
4762 {
4763 yyextra->isTypedef =
TRUE;
4764 yyextra->current->endBodyLine = yyextra->yyLineNr;
4765 QCString &cn = yyextra->current->name;
4766 QCString rn = yyextra->current_root->name;
4768 {
4770 }
4771 BEGIN( TypedefName );
4772 }
4773 }
4774<TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
4776 yyextra->current->type.prepend(yytext);
4777 }
4778<TypedefName>{ID} {
4779 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4780 {
4781 yyextra->current->program << ",";
4782 }
4783 yyextra->current->name=yytext;
4785 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4786 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4787
4788 if (!yyextra->firstTypedefEntry)
4789 {
4790 yyextra->firstTypedefEntry = yyextra->current;
4791 }
4792 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4794 yyextra->isTypedef=
TRUE;
4795 BEGIN(MemberSpecSkip);
4796 }
4797<TypedefName>";" { /* typedef of anonymous type */
4799 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4800 {
4801 yyextra->current->program << ',';
4802 }
4803
4804 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4805 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4806 yyextra->memspecEntry = yyextra->current;
4807 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4809 unput(';');
4810 BEGIN( MemberSpec ) ;
4811 }
QCString generateAnonymousAnchor(const QCString &fileName, int count)
4812<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4814 int i=0,l=(int)yyleng,j;
4815 while (i<l && (!
isId(yytext[i]))) i++;
4817 j=yyextra->msName.
find(
"[");
4818 if (j!=-1)
4819 {
4820 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4821 yyextra->msName=yyextra->msName.left(j);
4822 }
QCString right(size_t len) const
4824
4825
4826 if (yyextra->firstTypedefEntry)
4827 {
4828 if (yyextra->firstTypedefEntry->spec.isStruct())
4829 {
4830 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4831 }
4832 else if (yyextra->firstTypedefEntry->spec.isUnion())
4833 {
4834 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4835 }
4836 else if (yyextra->firstTypedefEntry->section.isEnum())
4837 {
4838 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4839 }
4840 else
4841 {
4842 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4843 }
4844 }
4845 }
4846<MemberSpec>"(" { // function with struct return type
4848 yyextra->current->name = yyextra->msName;
4850 unput('(');
4851 BEGIN(FindMembers);
4852 }
4853<MemberSpec>[,;] {
4854 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4855 {
4856
4857
4858
4859
4860 const Entry *p=yyextra->current.get();
4861 while (p)
4862 {
4863
4865 {
4866
4868 int pi = (i==-1) ? 0 : i+2;
4870 {
4871
4872
4874 break;
4875 }
4876 }
4877
4878 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4879 }
4880 }
4881
4882 if (!yyextra->msName.isEmpty()
4883 )
4884 {
4886
4887
4888 if (typedefHidesStruct &&
4889 yyextra->isTypedef &&
4890 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4891 yyextra->msType.stripWhiteSpace().isEmpty() &&
4892 yyextra->memspecEntry)
4893 {
4894 yyextra->memspecEntry->name=yyextra->msName;
4895 }
4896 else
4897 {
4898 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4899 varEntry->lang = yyextra->language;
4900 varEntry->protection = yyextra->current->protection ;
4901 varEntry->mtype = yyextra->current->mtype;
4902 varEntry->virt = yyextra->current->virt;
4903 varEntry->isStatic = yyextra->current->isStatic;
4904 varEntry->section = EntryType::makeVariable();
4905 varEntry->name = yyextra->msName.stripWhiteSpace();
4906 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4907 varEntry->args = yyextra->msArgs;
4908 if (yyextra->isTypedef)
4909 {
4910 varEntry->type.prepend("typedef ");
4911
4912 }
4913 if (typedefHidesStruct &&
4914 yyextra->isTypedef &&
4915 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4916 yyextra->memspecEntry
4917 )
4918 {
4919 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4920 }
4921 else
4922 {
4923 varEntry->type+=yyextra->current->name+yyextra->msType;
4924 }
4925 varEntry->fileName = yyextra->fileName;
4926 varEntry->startLine = yyextra->yyLineNr;
4927 varEntry->startColumn = yyextra->yyColNr;
4928 varEntry->doc = yyextra->current->doc;
4929 varEntry->brief = yyextra->current->brief;
4930 varEntry->mGrpId = yyextra->current->mGrpId;
4931 varEntry->initializer.str(yyextra->current->initializer.str());
4932 varEntry->groups = yyextra->current->groups;
4933 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
4934
4935
4936
4937
4938 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4939 }
4940 }
4941 if (*yytext==';')
4942 {
4943 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && yyextra->current->section.isCompound())
4944 {
4945 if (!yyextra->current->doc.isEmpty())
4946 {
4947 yyextra->memspecEntry->doc += yyextra->current->doc;
4948 }
4949 if (!yyextra->current->brief.isEmpty())
4950 {
4951 yyextra->memspecEntry->brief += yyextra->current->brief;
4952 }
4953 }
4954 yyextra->msType.clear();
4955 yyextra->msName.clear();
4956 yyextra->msArgs.clear();
4957 yyextra->isTypedef=
FALSE;
4958 yyextra->firstTypedefEntry.reset();
4959 yyextra->memspecEntry.reset();
4960 yyextra->current->reset();
4962 BEGIN( FindMembers );
4963 }
4964 else
4965 {
4966 yyextra->current->doc.clear();
4967 yyextra->current->brief.clear();
4968 }
4969
4970 }
4971<MemberSpec>"=" {
4972 yyextra->lastInitializerContext=YY_START;
4973 yyextra->sharpCount=0;
4974 yyextra->initBracketCount=0;
4975 yyextra->current->initializer.str(yytext);
4976 BEGIN(ReadInitializer);
4977
4978 }
4979
4980<MemberSpecSkip>"{" {
4981 yyextra->curlyCount=0;
4982 yyextra->lastCurlyContext = MemberSpecSkip;
4983 yyextra->previous = yyextra->current;
4984 BEGIN(SkipCurly);
4985 }
4986 */
4987<MemberSpecSkip>"," { BEGIN(MemberSpec); }
4988<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4989<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4991 }
4992<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4993 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4995 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
4996 yyextra->insideObjC=
FALSE;
4997 BEGIN( FindMembers );
4998 }
4999<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
5000<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
5001
5002<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
5003<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
5004 if (yyextra->insidePHP)
5005 {
5006 REJECT
5007 }
5008 else
5009 {
5010 yyextra->current->bodyLine = yyextra->yyLineNr;
5011 yyextra->current->bodyColumn = yyextra->yyColNr;
5014 yyextra->funcPtrType=yytext;
5015 yyextra->roundCount=0;
5016
5017 BEGIN( FuncPtr );
5018 }
5019 }
5020<FuncPtr>{SCOPENAME} {
5021 yyextra->current->name = yytext;
5023 {
5024 BEGIN( FuncPtrOperator );
5025 }
5026 else
5027 {
5028 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
5029 {
5030 yyextra->funcPtrType += yyextra->current->name;
5031 }
5032 else
5033 {
5034 BEGIN( EndFuncPtr );
5035 }
5036 }
5037 }
5038<FuncPtr>. {
5039
5040 }
5041<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
5042 yyextra->current->name += yytext;
5043 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
5045 }
5046<FuncPtrOperator>\n {
5048 yyextra->current->name += *yytext;
5049 }
5050<FuncPtrOperator>"(" {
5051 unput(*yytext);
5052 BEGIN( EndFuncPtr );
5053 }
5054<FuncPtrOperator>. {
5055 yyextra->current->name += *yytext;
5056 }
5057<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
5059 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5060 BEGIN(FindMembers);
5061 }
5062<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
5064 if (yyextra->funcPtrType!="(")
5065 {
5066 yyextra->current->type+=yyextra->funcPtrType+")";
5067 }
5068 BEGIN(FindMembers);
5069 }
5070<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
5072 yyextra->current->type+=yyextra->funcPtrType;
5073 yyextra->current->args += ")";
5074 BEGIN(FindMembers);
5075 }
5076<EndFuncPtr>"(" { // a function returning a function or
5077
5078 yyextra->current->args += *yytext ;
5079
5080
5081 yyextra->current->bodyLine = yyextra->yyLineNr;
5082 yyextra->current->bodyColumn = yyextra->yyColNr;
5083 yyextra->currentArgumentContext = FuncFuncEnd;
5084 yyextra->fullArgString=yyextra->current->args;
5085 yyextra->copyArgString=&yyextra->current->args;
5086 BEGIN( ReadFuncArgType ) ;
5087 }
5088<EndFuncPtr>"["[^\n\]]*"]" {
5089 yyextra->funcPtrType+=yytext;
5090 }
5091<EndFuncPtr>")" {
5092 BEGIN(FindMembers);
5093 }
5094<FuncFunc>"(" {
5095 yyextra->current->args += *yytext ;
5096 ++yyextra->roundCount;
5097 }
5098<FuncFunc>")" {
5099 yyextra->current->args += *yytext ;
5100 if ( yyextra->roundCount )
5101 --yyextra->roundCount;
5102 else
5103 {
5104 BEGIN(FuncFuncEnd);
5105 }
5106 }
5107<FuncFuncEnd>")"{BN}*"(" {
5109 yyextra->current->type+=yyextra->funcPtrType+")(";
5110 BEGIN(FuncFuncType);
5111 }
5112<FuncFuncEnd>")"{BNopt}/[;{] {
5114 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5115 BEGIN(SFunction);
5116 }
5117<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
5119 yyextra->current->type+=yyextra->funcPtrType;
5120 yyextra->current->args+=")";
5121 BEGIN(FuncFuncArray);
5122 }
5123<FuncFuncEnd>. {
5124 yyextra->current->args += *yytext;
5125 }
5126<FuncFuncType>"(" {
5127 yyextra->current->type += *yytext;
5128 yyextra->roundCount++;
5129 }
5130<FuncFuncType>")" {
5131 yyextra->current->type += *yytext;
5132 if (yyextra->roundCount)
5133 --yyextra->roundCount;
5134 else
5135 BEGIN(SFunction);
5136 }
5137<FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
5138<FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
5139<FuncFuncType>. {
5140 yyextra->current->type += *yytext;
5141 }
5142<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
5143 if (yyextra->current->type.startsWith("typedef") &&
5144 yyextra->current->bodyLine==-1)
5145
5146 {
5147 yyextra->current->bodyLine = yyextra->yyLineNr;
5148 yyextra->current->bodyColumn = yyextra->yyColNr;
5149 BEGIN( GetCallType );
5150 }
5151 else if (!yyextra->current->name.isEmpty())
5152 {
5153 yyextra->current->args = yytext;
5154 yyextra->current->bodyLine = yyextra->yyLineNr;
5155 yyextra->current->bodyColumn = yyextra->yyColNr;
5156 yyextra->currentArgumentContext = FuncQual;
5157 yyextra->fullArgString=yyextra->current->args;
5158 yyextra->copyArgString=&yyextra->current->args;
5159 BEGIN( ReadFuncArgType ) ;
5160
5161 }
5162 }
5163<GetCallType>{BN}*{ID}{BN}*"*" {
5166 yyextra->funcPtrType="(";
5167 yyextra->funcPtrType+=yytext;
5168 yyextra->roundCount=0;
5169 BEGIN( FuncPtr );
5170 }
5171<FindMembers>"(" {
5172 if (!yyextra->current->name.isEmpty())
5173 {
5174 yyextra->current->args = yytext;
5175 yyextra->current->bodyLine = yyextra->yyLineNr;
5176 yyextra->current->bodyColumn = yyextra->yyColNr;
5177 yyextra->currentArgumentContext = FuncQual;
5178 yyextra->fullArgString=yyextra->current->args;
5179 yyextra->copyArgString=&yyextra->current->args;
5180 BEGIN( ReadFuncArgType ) ;
5181
5182 }
5183 }
5184
5185
5186
5187<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
5188 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
5189 else yyextra->fullArgString+=yytext;
5190 }
5191<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
5192 yyextra->fullArgString+=yytext;
5193 }
5194<CopyArgRound>[^\/\n\)\(\"\']+ {
5195 *yyextra->copyArgString+=yytext;
5196 yyextra->fullArgString+=yytext;
5197 }
5198<CopyArgSquare>[^\/\n\]\[\"\']+ {
5199 *yyextra->copyArgString+=yytext;
5200 yyextra->fullArgString+=yytext;
5201 }
5202<ReadFuncArgType,ReadTempArgs>{BN}* {
5203 *yyextra->copyArgString+=" ";
5204 yyextra->fullArgString+=" ";
5206 }
5207<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
5209 yyextra->lastRawStringContext = YY_START;
5210 yyextra->pCopyRawString = yyextra->copyArgString;
5211 *yyextra->pCopyRawString+=yytext;
5212 yyextra->fullArgString+=yytext;
5213 BEGIN(RawString);
5214 }
5215<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
5216 *yyextra->copyArgString+=*yytext;
5217 yyextra->fullArgString+=*yytext;
5218 yyextra->lastCopyArgStringContext = YY_START;
5219 BEGIN( CopyArgString );
5220 }
5221<ReadFuncArgType>"[" {
5222 if (!yyextra->insidePHP) REJECT;
5223 *yyextra->copyArgString+=*yytext;
5224 yyextra->fullArgString+=*yytext;
5225 yyextra->argSquareCount=0;
5226 yyextra->lastCopyArgContext = YY_START;
5227 BEGIN( CopyArgSquare );
5228 }
5229<ReadFuncArgType,ReadTempArgs>"(" {
5230 *yyextra->copyArgString+=*yytext;
5231 yyextra->fullArgString+=*yytext;
5232 yyextra->argRoundCount=0;
5233 yyextra->lastCopyArgContext = YY_START;
5234 BEGIN( CopyArgRound );
5235 }
5236<ReadFuncArgType>")" {
5237 *yyextra->copyArgString+=*yytext;
5238 yyextra->fullArgString+=*yytext;
5240 if (yyextra->insideJS)
5241 {
5243 }
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)
5245
5246
5247
5248
5249
5250
5251 yyextra->docBackup = yyextra->current->doc;
5252 yyextra->briefBackup = yyextra->current->brief;
5253
5254 BEGIN( yyextra->currentArgumentContext );
5255 }
5256
5257<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
5258 if (yyextra->currentArgumentContext==DefineEnd)
5259 {
5260
5261
5262 int i;for (i=(int)yyleng-1;i>=0;i--)
5263 {
5264 unput(yytext[i]);
5265 }
5268 BEGIN( yyextra->currentArgumentContext );
5269 }
5270 else
5271 {
5272
5273
5274 yyextra->fullArgString+=yytext;
5275 yyextra->lastCopyArgChar=0;
5276 yyextra->lastCommentInArgContext=YY_START;
5277 if (yytext[1]=='/')
5278 BEGIN( CopyArgCommentLine );
5279 else
5280 BEGIN( CopyArgComment );
5281 }
5282 }
5283
5284<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
5285<ReadFuncArgType,ReadTempArgs>{CCS} {
5286 yyextra->lastCContext = YY_START;
5287 BEGIN( SkipComment );
5288 }
5289<ReadFuncArgType,ReadTempArgs>{CPPC} {
5290 yyextra->lastCContext = YY_START;
5291 BEGIN( SkipCxxComment );
5292 }
5293
5294<ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
5295 REJECT;
5296 *yyextra->copyArgString+=yytext;
5297 yyextra->fullArgString+=yytext;
5298 }
5299<ReadFuncArgType,ReadTempArgs>"#" {
5300 if (!yyextra->insidePHP)
5301 REJECT;
5302 yyextra->lastCContext = YY_START;
5303 BEGIN( SkipCxxComment );
5304 }
5305 */
5306
5307<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
5309 if (yyextra->currentArgumentContext==DefineEnd)
5310 {
5311
5312
5313 int i;for (i=(int)yyleng-1;i>0;i--)
5314 {
5315 unput(yytext[i]);
5316 }
5317 *yyextra->copyArgString+=*yytext;
5318 yyextra->fullArgString+=*yytext;
5321 BEGIN( yyextra->currentArgumentContext );
5322 }
5323 else
5324 {
5325
5326
5327 yyextra->lastCopyArgChar=*yytext;
5330 yyextra->lastCommentInArgContext=YY_START;
5331 yyextra->fullArgString+=text;
5332 if (text.
find(
"//")!=-1)
5333 BEGIN( CopyArgCommentLine );
5334 else
5335 BEGIN( CopyArgComment );
5336 }
5337 }
5338<CopyArgComment>^{B}*"*"+/{BN}+
5339<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
5340<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
5341 if (yyextra->lastCopyArgChar!=0)
5342 unput(yyextra->lastCopyArgChar);
5343 BEGIN( yyextra->lastCommentInArgContext );
5344 }
5345<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
5347 if (yyextra->lastCopyArgChar!=0)
5348 unput(yyextra->lastCopyArgChar);
5349 BEGIN( yyextra->lastCommentInArgContext );
5350 }
5351<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
5352 yyextra->docBlockName="uml";
5353 yyextra->fullArgString+=yytext;
5354 BEGIN(CopyArgVerbatim);
5355 }
5356<CopyArgCommentLine>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
5357 yyextra->docBlockName=&yytext[1];
5358 yyextra->fullArgString+=yytext;
5359 BEGIN(CopyArgVerbatim);
5360 }
5361<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5362 yyextra->docBlockName=&yytext[1];
5363 if (yyextra->docBlockName.at(1)=='[')
5364 {
5365 yyextra->docBlockName.at(1)=']';
5366 }
5367 if (yyextra->docBlockName.at(1)=='{')
5368 {
5369 yyextra->docBlockName.at(1)='}';
5370 }
5371 if (yyextra->docBlockName.at(1)=='(')
5372 {
5373 yyextra->docBlockName.at(1)=')';
5374 }
5375 yyextra->fullArgString+=yytext;
5376 BEGIN(CopyArgVerbatim);
5377 }
5378<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] { // end of verbatim block
5379 yyextra->fullArgString+=yytext;
5380 if (&yytext[4]==yyextra->docBlockName)
5381 {
5382 yyextra->docBlockName="";
5383 BEGIN(CopyArgCommentLine);
5384 }
5385 }
5386<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") { // end of verbatim block
5387 yyextra->fullArgString+=yytext;
5388 if (yyextra->docBlockName==&yytext[1])
5389 {
5390 yyextra->docBlockName="";
5391 BEGIN(CopyArgCommentLine);
5392 }
5393 }
5394<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5395<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5396<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
5397<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5398<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5399 warn(yyextra->fileName,yyextra->yyLineNr,
5400 "Ignoring {:c}brief command inside argument documentation",*yytext
5401 );
5402 yyextra->fullArgString+=' ';
5403 }
5404<ReadTempArgs>"<" {
5405 *yyextra->copyArgString+=*yytext;
5406 yyextra->fullArgString+=*yytext;
5407 yyextra->argSharpCount=1;
5408 BEGIN( CopyArgSharp );
5409 }
5410<ReadTempArgs>">" {
5411 *yyextra->copyArgString+=*yytext;
5412 yyextra->fullArgString+=*yytext;
5413
5414 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5416 BEGIN( yyextra->currentArgumentContext );
5417 }
5418<CopyArgRound>"(" {
5419 yyextra->argRoundCount++;
5420 *yyextra->copyArgString+=*yytext;
5421 yyextra->fullArgString+=*yytext;
5422 }
5423<CopyArgRound>")" {
5424 *yyextra->copyArgString+=*yytext;
5425 yyextra->fullArgString+=*yytext;
5426 if (yyextra->argRoundCount>0)
5427 yyextra->argRoundCount--;
5428 else
5429 BEGIN( yyextra->lastCopyArgContext );
5430 }
5431<CopyArgSquare>"[" {
5432 yyextra->argSquareCount++;
5433 *yyextra->copyArgString+=*yytext;
5434 yyextra->fullArgString+=*yytext;
5435 }
5436<CopyArgSquare>"]" {
5437 *yyextra->copyArgString+=*yytext;
5438 yyextra->fullArgString+=*yytext;
5439 if (yyextra->argSquareCount>0)
5440 yyextra->argSquareCount--;
5441 else
5442 BEGIN( yyextra->lastCopyArgContext );
5443 }
5444<CopyArgSharp>"(" {
5445 *yyextra->copyArgString+=*yytext;
5446 yyextra->fullArgString+=*yytext;
5447 yyextra->argRoundCount=0;
5448 yyextra->lastCopyArgContext = YY_START;
5449 BEGIN( CopyArgRound );
5450 }
5451<CopyArgSharp>"<" {
5452 yyextra->argSharpCount++;
5453
5454 *yyextra->copyArgString+=*yytext;
5455 yyextra->fullArgString+=*yytext;
5456 }
5457<CopyArgSharp>">" {
5458 *yyextra->copyArgString+=*yytext;
5459 yyextra->fullArgString+=*yytext;
5460 yyextra->argSharpCount--;
5461 if (yyextra->argSharpCount>0)
5462 {
5463
5464 }
5465 else
5466 {
5467 BEGIN( ReadTempArgs );
5468
5469 }
5470 }
5471<CopyArgString,CopyArgPHPString>\\. {
5472 *yyextra->copyArgString+=yytext;
5473 yyextra->fullArgString+=yytext;
5474 }
5475<CopyArgString>\" {
5476 *yyextra->copyArgString+=*yytext;
5477 yyextra->fullArgString+=*yytext;
5478 BEGIN( yyextra->lastCopyArgStringContext );
5479 }
5480<CopyArgPHPString>\' {
5481 *yyextra->copyArgString+=*yytext;
5482 yyextra->fullArgString+=*yytext;
5483 BEGIN( yyextra->lastCopyArgStringContext );
5484 }
5485<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5486 if (yyextra->insidePHP)
5487 {
5488 REJECT;
5489 }
5490 else
5491 {
5492 *yyextra->copyArgString+=yytext;
5493 yyextra->fullArgString+=yytext;
5494 }
5495 }
5496<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5497 *yyextra->copyArgString+=yytext;
5498 yyextra->fullArgString+=yytext;
5499 if (yyextra->insidePHP)
5500 {
5501 yyextra->lastCopyArgStringContext=YY_START;
5502 BEGIN(CopyArgPHPString);
5503 }
5504 }
5505<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5506 *yyextra->copyArgString+=yytext;
5507 yyextra->fullArgString+=yytext;
5508 }
5509<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5511 *yyextra->copyArgString+=*yytext;
5512 yyextra->fullArgString+=*yytext;
5513 }
5514<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5515 *yyextra->copyArgString+=yytext;
5516 yyextra->fullArgString+=yytext;
5517 }
5518<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5519 *yyextra->copyArgString+=*yytext;
5520 yyextra->fullArgString+=*yytext;
5521 }
5522
5523
5524
5525
5526
5527
5528<FuncRound>"(" { yyextra->current->args += *yytext ;
5529 ++yyextra->roundCount ;
5530 }
5531<FuncRound>")" { yyextra->current->args += *yytext ;
5532 if ( yyextra->roundCount )
5533 --yyextra->roundCount ;
5534 else
5535 BEGIN( FuncQual ) ;
5536 }
5537
5538<FuncQual>"#" { if (yyextra->insidePHP)
5539 REJECT;
5540 yyextra->lastCPPContext = YY_START;
5541 BEGIN(SkipCPP);
5542 }
5543 */
5544<FuncQual>[{:;,] {
5545 if (
qstrcmp(yytext,
";")==0 &&
5546 ((yyextra->insideJS || yyextra->insidePHP) &&
5548 {
5549 yyextra->current->reset();
5551 BEGIN( FindMembers );
5552 }
5553 else
5554 {
5555 unput(*yytext); BEGIN( SFunction );
5556 }
5557 }
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
5558<FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
5560 yyextra->current->virt = Specifier::Pure;
5561 yyextra->current->args += " override ";
5562 }
5563<FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
5565 yyextra->current->spec.setOverride(true);
5566 yyextra->current->args += " override ";
5567 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5568 BEGIN(FuncQual);
5569 }
5570<FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
5572 yyextra->current->spec.setFinal(true);
5573 yyextra->current->args += " final ";
5574 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5575 BEGIN(FuncQual);
5576 }
5577<FuncQual>{BN}*"sealed"{BN}* { // sealed member function
5579 yyextra->current->spec.setSealed(true);
5580 yyextra->current->args += " sealed ";
5581 }
5582<FuncQual>{BN}*"new"{BN}* { // new member function
5584 yyextra->current->spec.setNew(true);
5585 yyextra->current->args += " new ";
5586 }
5587<FuncQual>{BN}*"const"{BN}* { // const member function
5589 yyextra->current->args += " const ";
5590 yyextra->current->argList.setConstSpecifier(
TRUE);
5591 }
5592<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
5594 yyextra->current->args += " volatile ";
5595 yyextra->current->argList.setVolatileSpecifier(
TRUE);
5596 }
5597<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
5599 yyextra->current->args += " noexcept ";
5600 yyextra->current->spec.setNoExcept(true);
5601 }
5602<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* { // noexcept(false) expression
5604 yyextra->current->args += " noexcept(false)";
5605 }
5606<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
5608 yyextra->current->args += " noexcept(";
5609 yyextra->current->spec.setNoExcept(true);
5610 yyextra->lastRoundContext=FuncQual;
5611 yyextra->pCopyRoundString=&yyextra->current->args;
5612 yyextra->roundCount=0;
5613 BEGIN(CopyRound);
5614 }
5615<FuncQual>{BN}*"&" {
5616 yyextra->current->args += " &";
5618 }
5619<FuncQual>{BN}*"&&" {
5620 yyextra->current->args += " &&";
5622 }
5623
5624<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
5626 yyextra->current->args += " = 0";
5627 yyextra->current->virt = Specifier::Pure;
5628 yyextra->current->argList.setPureSpecifier(
TRUE);
5629 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5630 BEGIN(FuncQual);
5631 }
5632<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
5634 yyextra->current->args += " = delete";
5635 yyextra->current->spec.setDelete(true);
5636 yyextra->current->argList.setIsDeleted(
TRUE);
5637 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5638 BEGIN(FuncQual);
5639 }
5640<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
5642 yyextra->current->args += " = default";
5643 yyextra->current->spec.setDefault(true);
5644 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5645 BEGIN(FuncQual);
5646 }
5647<FuncQual>{BN}*"->"{BN}* {
5649 yyextra->current->argList.setTrailingReturnType(" -> ");
5650 yyextra->current->args += " -> ";
5651 yyextra->roundCount=0;
5652 BEGIN(TrailingReturn);
5653 }
5654<TrailingReturn>[{;] {
5655 if (yyextra->roundCount>0) REJECT;
5656 unput(*yytext);
5657 yyextra->current->argList.finishTrailingReturnType();
5658 BEGIN(FuncQual);
5659 }
5660<TrailingReturn>"requires"{BN}+ {
5661 if (yyextra->insideJava) REJECT;
5662 yyextra->requiresContext = FuncQual;
5663 yyextra->current->req+=' ';
5664 yyextra->current->argList.finishTrailingReturnType();
5665 BEGIN(RequiresClause);
5666 }
5667<TrailingReturn>"(" {
5668 yyextra->roundCount++;
5669 yyextra->current->argList.appendTrailingReturnType(yytext);
5670 yyextra->current->args+=yytext;
5671 }
5672<TrailingReturn>")" {
5673 if (yyextra->roundCount>0)
5674 {
5675 yyextra->roundCount--;
5676 }
5677 else
5678 {
5679 warn(yyextra->fileName,yyextra->yyLineNr,
5680 "Found ')' without opening '(' for trailing return type '{})...'",
5681 yyextra->current->argList.trailingReturnType());
5682 }
5683 yyextra->current->argList.appendTrailingReturnType(yytext);
5684 yyextra->current->args+=yytext;
5685 }
5686<TrailingReturn>. {
5687 yyextra->current->argList.appendTrailingReturnType(yytext);
5688 yyextra->current->args+=yytext;
5689 }
5690<TrailingReturn>\n {
5692 yyextra->current->argList.appendTrailingReturnType(yytext);
5693 yyextra->current->args+=' ';
5694 }
5695<FuncRound,FuncFunc>{BN}*","{BN}* {
5697 yyextra->current->args += ", " ;
5698 }
5699<FuncQual,FuncRound,FuncFunc>{BN}+ {
5701 yyextra->current->args += ' ' ;
5702 }
5703<SFunction,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
5704 REJECT;
5705 yyextra->lastCPPContext = YY_START;
5706 BEGIN(SkipCPP);
5707 }
5708<FuncQual>"=>" {
5709 if (!yyextra->insideCS)
5710 REJECT;
5711
5712 unput('=');
5713 BEGIN(SFunction);
5714 }
5715<FuncQual>"=" {
5716 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5717 {
5718 BEGIN(CliOverride);
5719 }
5720 else
5721 {
5722
5723 yyextra->lastInitializerContext=YY_START;
5724 yyextra->sharpCount=0;
5725 yyextra->initBracketCount=0;
5726 yyextra->current->initializer.str(yytext);
5727 BEGIN(ReadInitializer);
5728 }
5729 }
5730<ReadExpressionBody>";" {
5731 if (!yyextra->current->sli.empty() && yyextra->previous)
5732 {
5733 yyextra->previous->sli = yyextra->current->sli;
5734 yyextra->current->sli.clear();
5735 }
5736 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5737 BEGIN(FindMembers);
5738 }
5739<CliOverride>{ID} {
5740 }
5741<CliOverride>"{" {
5742 unput(*yytext);
5743 BEGIN(FuncQual);
5744 }
5745<CliOverride>\n {
5747 }
5748<CliOverride>. {
5749 }
5750<FuncQual>{ID} {
5751 if (yyextra->insideCpp &&
qstrcmp(yytext,
"requires")==0)
5752 {
5753
5754 yyextra->requiresContext = YY_START;
5755 if (!yyextra->current->req.isEmpty())
5756 {
5757 yyextra->current->req+=" && ";
5758 }
5759 BEGIN(RequiresClause);
5760 }
5761 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
5762 {
5763
5764 yyextra->current->typeConstr.clear();
5765 yyextra->current->typeConstr.push_back(
Argument());
5766 yyextra->lastCSConstraint = YY_START;
5767 BEGIN( CSConstraintName );
5768 }
5770 {
5771 yyextra->current->args = yytext;
5772 yyextra->oldStyleArgType.clear();
5773 BEGIN(OldStyleArgs);
5774 }
5775 else
5776 {
5777 yyextra->current->args += yytext;
5778 }
5779 }
static bool checkForKnRstyleC(yyscan_t yyscanner)
5780<OldStyleArgs>[,;] {
5783 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5785 if (yyextra->current->doc!=yyextra->docBackup)
5786 {
5787 doc=yyextra->current->doc;
5788 yyextra->current->doc=yyextra->docBackup;
5789 }
5790 if (yyextra->current->brief!=yyextra->briefBackup)
5791 {
5792 brief=yyextra->current->brief;
5793 yyextra->current->brief=yyextra->briefBackup;
5794 }
5795 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5796 oldStyleArgName,brief,doc);
5797 yyextra->current->args.clear();
5798 if (*yytext==';') yyextra->oldStyleArgType.clear();
5799 }
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)
5800<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5801<OldStyleArgs>"{" {
5802 if (yyextra->current->argList.empty())
5803 {
5804 yyextra->current->argList.setNoParameters(
TRUE);
5805 }
5807 unput('{');
5808 BEGIN(FuncQual);
5809 }
5810<OldStyleArgs>. { yyextra->current->args += *yytext; }
5811<FuncQual,FuncRound,FuncFunc>\" {
5812 if (yyextra->insideIDL && yyextra->insideCppQuote)
5813 {
5814 BEGIN(EndCppQuote);
5815 }
5816 else
5817 {
5818 yyextra->current->args += *yytext;
5819 }
5820 }
5821<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5822<FuncQual>{BN}*"try:" |
5823<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
5824 yyextra->insideTryBlock=
TRUE;
5826 if (yytext[yyleng-1]==':')
5827 {
5828 unput(':');
5829 BEGIN( SFunction );
5830 }
5831 }
5832<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
5833 yyextra->current->exception = " throw (" ;
5834 yyextra->roundCount=0;
5836 BEGIN( ExcpRound ) ;
5837 }
5838<FuncQual>{BN}*"raises"{BN}*"(" {
5839 yyextra->current->exception = " raises (" ;
5841 yyextra->roundCount=0;
5842 BEGIN( ExcpRound ) ;
5843 }
5844<FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
5845 yyextra->current->exception = " throws " ;
5847 BEGIN( ExcpList );
5848 }
5849<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5850 ++yyextra->roundCount ;
5851 }
5852<ExcpRound>")" { yyextra->current->exception += *yytext ;
5853 if ( yyextra->roundCount )
5854 --yyextra->roundCount ;
5855 else
5856 BEGIN( FuncQual ) ;
5857 }
5858<ExcpRound>. {
5859 yyextra->current->exception += *yytext;
5860 }
5861<ExcpList>"{" {
5862 unput('{'); BEGIN( FuncQual );
5863 }
5864<ExcpList>";" {
5865 unput(';'); BEGIN( FuncQual );
5866 }
5867<ExcpList>"\n" {
5868 yyextra->current->exception += ' ';
5870 }
5871<ExcpList>. {
5872 yyextra->current->exception += *yytext;
5873 }
5874<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5875 yyextra->current->name = yyextra->current->args ;
5876 yyextra->current->args = yytext ;
5877 yyextra->roundCount=0;
5878 BEGIN( FuncRound ) ;
5879 }
5880<SFunction>":" {
5881 if (!yyextra->insidePHP) BEGIN(SkipInits);
5882 }
5883<SFunction>[=;{,] {
5887 yyextra->current->fileName = yyextra->fileName;
5888 yyextra->current->startLine = yyextra->yyBegLineNr;
5889 yyextra->current->startColumn = yyextra->yyBegColNr;
5890 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5892 std::string type = yyextra->current->type.str();
5893 int ti=-1;
5895 {
5896 ti = (int)
match.position();
5897 }
5898 if (ti!=-1)
5899 {
5900 int di = yyextra->current->type.find("decltype(");
5901 if (di!=-1 && di<ti)
5902 {
5903 ti=-1;
5904 }
5905 }
5906 int ts=yyextra->current->type.find('<');
5907 int te=yyextra->current->type.findRev('>');
5908
5909
5910 bool startsWithTypedef = yyextra->current->type.startsWith("typedef ");
5911 bool isFunction = ti==-1 ||
5912 (ts!=-1 && ts<te && ts<ti && ti<te);
5913 bool isVariable = !yyextra->current->type.isEmpty() &&
5914 (!isFunction || startsWithTypedef);
5915
5916
5917
5918
5919 if (*yytext!=';' || yyextra->current_root->section.isCompound())
5920 {
5921 if (isVariable)
5922 {
5923
5924 if (yyextra->isTypedef && !startsWithTypedef)
5925 {
5926 yyextra->current->type.prepend("typedef ");
5927 }
5928 yyextra->current->section = EntryType::makeVariable() ;
5929 }
5930 else
5931 {
5932
5933 yyextra->current->section = EntryType::makeFunction() ;
5934 yyextra->current->proto = *yytext==';';
5935 }
5936 }
5937 else
5938 {
5939
5940 if (isVariable)
5941 {
5942 if (yyextra->isTypedef && !startsWithTypedef)
5943 {
5944 yyextra->current->type.prepend("typedef ");
5945 }
5946
5947 yyextra->current->section = EntryType::makeVariable();
5948 }
5949 else
5950 {
5951
5952 yyextra->current->section = EntryType::makeFunction();
5953 yyextra->current->proto =
TRUE;
5954 }
5955 }
5956
5957 if ( yyextra->insidePHP)
5958 {
5960 {
5961 yyextra->current->spec.setFinal(true);
5962 }
5964 {
5965 yyextra->current->spec.setAbstract(true);
5966 }
5967 }
5968 if ( yyextra->insidePHP && !
containsWord(yyextra->current->type,
"function"))
5969 {
5971 if ( *yytext == '{' )
5972 {
5973 yyextra->lastCurlyContext = FindMembers;
5974 yyextra->curlyCount=0;
5975 BEGIN( SkipCurly );
5976 }
5977 else
5978 {
5979 BEGIN( FindMembers );
5980 }
5981 }
5982 else
5983 {
5984 if ( yyextra->insidePHP)
5985 {
5987 }
5988 yyextra->previous = yyextra->current;
5989 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5991
5992 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
5993 {
5994 yyextra->current->spec.setOptional(true).setRequired(true);
5995 }
5996 yyextra->lastCurlyContext = FindMembers;
5997 if ( *yytext == ',' )
5998 {
5999 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
6000 }
6001 if ( *yytext == '{' )
6002 {
6003 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
6004 {
6005 yyextra->previous->spec.setInline(true);
6006 }
6007 yyextra->curlyCount=0;
6008 BEGIN( SkipCurly ) ;
6009 }
6010 else if ( *yytext == '=' )
6011 {
6012 yyextra->previous->spec.setInline(true);
6013 yyextra->curlyCount=0;
6014 BEGIN( ReadExpressionBody );
6015 }
6016 else
6017 {
6018 if (!yyextra->previous->section.isVariable())
6019 yyextra->previous->bodyLine=-1;
6020 BEGIN( FindMembers ) ;
6021 }
6022 }
6023 }
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
6024<SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
6026 yyextra->curlyCount=1;
6027 BEGIN(SkipC11Inits);
6028 }
6029<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
6031 yyextra->curlyCount=1;
6032 BEGIN(SkipC11Inits);
6033 }
6034<SkipC11Inits>"{" {
6035 ++yyextra->curlyCount;
6036 }
6037<SkipC11Inits>"}" {
6038 if ( --yyextra->curlyCount<=0 )
6039 {
6040 BEGIN(SkipInits);
6041 }
6042 }
6043<SkipC11Attribute>"]]" {
6044 BEGIN(yyextra->lastC11AttributeContext);
6045 }
6046<SkipInits>"{" { // C++11 style initializer
6047 unput('{');
6048 BEGIN( SFunction );
6049 }
6050<SkipCurly>"{" {
6051
6052 ++yyextra->curlyCount ;
6053 }
6054<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
6055<SkipCurly>"}" {
6056
6057 if( yyextra->curlyCount )
6058 {
6059 --yyextra->curlyCount ;
6060 }
6061 else
6062 {
6063 if (!yyextra->current->sli.empty() && yyextra->previous)
6064 {
6065 yyextra->previous->sli = yyextra->current->sli;
6066 yyextra->current->sli.clear();
6067 }
6068 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
6069 BEGIN( yyextra->lastCurlyContext ) ;
6070 }
6071 }
6072<SkipCurly>"}"{BN}*{DCOMM}"<" {
6074 if ( yyextra->curlyCount )
6075 {
6076
6077 --yyextra->curlyCount ;
6078 }
6079 else
6080 {
6081 yyextra->current->endBodyLine=yyextra->yyLineNr;
6082 yyextra->tempEntry = yyextra->current;
6083 yyextra->current = yyextra->previous;
6084
6085 yyextra->docBlockContext = SkipCurlyEndDoc;
6086 yyextra->docBlockInBody =
FALSE;
6087 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6089 yyextra->docBlock.str(std::string());
6090 yyextra->docBlockTerm = '}';
6091 if (yytext[yyleng-3]=='/')
6092 {
6094 BEGIN( DocLine );
6095 }
6096 else
6097 {
6099 BEGIN( DocBlock );
6100 }
6101 }
6102 }
6103<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
6104 yyextra->docBlockContext = SkipCurlyEndDoc;
6105 yyextra->docBlockInBody =
FALSE;
6106 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6108 yyextra->docBlock.str(std::string());
6109 yyextra->docBlockTerm = '}';
6110 if (yytext[yyleng-3]=='/')
6111 {
6113 BEGIN( DocLine );
6114 }
6115 else
6116 {
6118 BEGIN( DocBlock );
6119 }
6120 }
6121<SkipCurlyEndDoc>"}" {
6122
6123 if (yyextra->tempEntry)
6124 {
6125 yyextra->current = yyextra->tempEntry;
6126 yyextra->tempEntry.reset();
6127 }
6128 BEGIN( yyextra->lastCurlyContext );
6129 }
6130<SkipCurly,ReadExpressionBody>\" {
6131
6132 yyextra->lastStringContext=YY_START;
6133 BEGIN( SkipString );
6134 }
6135<SkipCurly>^{B}*"#" {
6136 if (yyextra->insidePHP)
6137 REJECT;
6138
6139 BEGIN( SkipCurlyCpp );
6140 }
6141<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute,ReadExpressionBody>\n {
6143
6144 }
6145<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
6146 if (!yyextra->insidePHP)
6147 {
6148 REJECT;
6149 }
6150 else
6151 {
6152 yyextra->lastHereDocContext = YY_START;
6153 BEGIN(HereDoc);
6154 }
6155 }
6156<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
6158 yyextra->lastRawStringContext = YY_START;
6159 yyextra->dummyRawString.clear();
6160 yyextra->pCopyRawString = &yyextra->dummyRawString;
6161 *yyextra->pCopyRawString += yytext;
6162 BEGIN(RawString);
6163 }
6164<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
6166
6167 }
6168<SkipCurly,SkipCurlyCpp>"\$" {}
6169<SkipCurlyCpp>\n {
6170
6172 yyextra->lastCurlyContext = FindMembers;
6173 BEGIN( SkipCurly );
6174 }
6175<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
6176
6178 }
6179<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>{CCS} {
6180
6181 yyextra->lastCContext = YY_START;
6182 BEGIN(SkipComment);
6183 }
6184<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>{CPPC} {
6185
6186 yyextra->lastCContext = YY_START;
6187 BEGIN(SkipCxxComment);
6188 }
6189<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
6190 yyextra->roundCount=0;
6191 yyextra->lastSkipRoundContext=YY_START;
6192 BEGIN(SkipRound);
6193 }
6194<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
6195 yyextra->lastStringContext=YY_START;
6196 BEGIN( SkipString );
6197 }
6198<SkipInits>; {
6199 warn(yyextra->fileName,yyextra->yyLineNr,
6200 "Found ';' while parsing initializer list! "
6201 "(doxygen could be confused by a macro call without semicolon)"
6202 );
6203 BEGIN( FindMembers );
6204 }
6205<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
6206 if (!yyextra->insidePHP)
6207 REJECT;
6208
6209 yyextra->lastCContext = YY_START;
6210 BEGIN(SkipCxxComment);
6211 }
6212<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>@\" {
6213 if (!yyextra->insideCS) REJECT;
6214
6215
6216 yyextra->lastSkipVerbStringContext=YY_START;
6217 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
6218 yyextra->dummyTextStream.clear();
6219 BEGIN(SkipVerbString);
6220 }
6221<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>{CHARLIT} {
6222 if (yyextra->insidePHP) REJECT;
6223 }
6224<SkipInits,SkipCurly,SkipCurlyCpp>\' {
6225 if (yyextra->insidePHP)
6226 {
6227 yyextra->lastStringContext=YY_START;
6228 BEGIN(SkipPHPString);
6229 }
6230 }
6231<SkipC11Attribute>{ID} {
6233 {
6234 yyextra->current->spec.setNoDiscard(true);
6235 }
6236 }
6237<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>. { }
6238<SkipString,SkipPHPString>\\. { }
6239<SkipString>\" {
6240 BEGIN( yyextra->lastStringContext );
6241 }
6242<SkipPHPString>\' {
6243 BEGIN( yyextra->lastStringContext );
6244 }
6245<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
6246<SkipString,SkipPHPString>\n {
6248 }
6249<SkipString>"[[" { }
6250<SkipString,SkipPHPString>. { }
6251<CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
6252 unput(':');
6253 BEGIN(ClassVar);
6254 }
6255<CompoundName>";" {
6256 yyextra->current->section = EntryType::makeEmpty() ;
6257 yyextra->current->type.clear() ;
6258 yyextra->current->name.clear() ;
6259 yyextra->current->args.clear() ;
6260 yyextra->current->argList.clear();
6261 BEGIN( FindMembers ) ;
6262 }
6263<Bases>";" {
6264 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
6265 {
6266
6267
6268 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
6269 {
6271 }
6272 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6273
6274 if (!yyextra->baseName.isEmpty())
6275 {
6276 yyextra->current->extends.emplace_back(
6277 yyextra->baseName,Protection::Public,Specifier::Normal);
6278 yyextra->baseName.clear();
6279 }
6280 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
6282 }
6283 else
6284 {
6285 yyextra->current->section = EntryType::makeEmpty() ;
6286 yyextra->current->type.clear() ;
6287 yyextra->current->name.clear() ;
6288 yyextra->current->args.clear() ;
6289 yyextra->current->argList.clear();
6290 }
6291 BEGIN( FindMembers ) ;
6292 }
6293<CompoundName>{SCOPENAME}/{BN}*"<" {
6294 yyextra->sharpCount = 0;
6295 yyextra->current->name = yytext ;
6297 if (yyextra->current->spec.isProtocol())
6298 {
6299 yyextra->current->name+="-p";
6300 }
6302 yyextra->lastClassTemplSpecContext = ClassVar;
6303 if (yyextra->insideObjC)
6304 {
6305 BEGIN( ObjCProtocolList );
6306 }
6307 else if (yyextra->insideCS)
6308 {
6309
6310 BEGIN( CSGeneric );
6311 }
6312 else
6313 {
6314 yyextra->roundCount=0;
6315 BEGIN( ClassTemplSpec );
6316 }
6317 }
6318<CSGeneric>"<" {
6320
6321
6322 yyextra->current->tArgLists.
push_back(al);
6323 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
6324 yyextra->templateStr="<";
6325 yyextra->current->name += "<";
6326 yyextra->fullArgString = yyextra->templateStr;
6327 yyextra->copyArgString = &yyextra->current->name;
6328
6329 yyextra->currentArgumentContext = ClassVar;
6330 BEGIN( ReadTempArgs );
6331 }
6332<ObjCProtocolList>"<" {
6333 yyextra->insideProtocolList=
TRUE;
6334 BEGIN( Bases );
6335 }
6336<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
6337 yyextra->current->name += yytext;
6339 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6340 {
6342 if (yyextra->current->spec.isProtocol())
6343 {
6344 unput('{');
6345 BEGIN( ClassVar );
6346 }
6347 else
6348 {
6349 BEGIN( yyextra->lastClassTemplSpecContext );
6350 }
6351 }
6352 }
6353<ClassTemplSpec>"<" {
6354 yyextra->current->name += yytext;
6355 if (yyextra->roundCount==0) yyextra->sharpCount++;
6356 }
6357<ClassTemplSpec>. {
6358 yyextra->current->name += yytext;
6359 }
6360<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" { // forward declaration?
6361 if (yyextra->insideCS && yyextra->current->type == "namespace")
6362 {
6363
6365 yyextra->current->name =
substitute(yytext,
".",
"::");
6366 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6367 yyextra->fakeNS++;
6368 unput('{');
6369 BEGIN( ClassVar );
6370 }
6371 else if (!yyextra->current->tArgLists.empty())
6372 {
6373
6374
6375 yyextra->current->name = yytext;
6376 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6378
6379 QCString rn = yyextra->current_root->name;
6380
6381 if (!yyextra->current->name.isEmpty() && !rn.
isEmpty())
6382 {
6384 }
6385 yyextra->current->spec.setForwardDecl(true);
6386 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6387 }
6388 else if (yyextra->insideIDL &&
6389 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6390 yyextra->current->spec.isInterface()) ||
6391 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6392 yyextra->current->spec.isService())
6393 )
6394 )
6395 {
6396
6397
6398
6399
6400 yyextra->current->name = yytext;
6401 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6402 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6404
6405 yyextra->current->spec.setInterface(false).setService(false);
6406
6407
6408
6409 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6410 }
6411
6412 if (!(yyextra->insideCS && yyextra->current->type == "namespace"))
6413 {
6414 unput(';');
6415 yyextra->current->reset();
6417 if (yyextra->insideObjC)
6418 {
6419 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6420 yyextra->insideObjC =
FALSE;
6421 }
6422 if (yyextra->isTypedef)
6423 {
6424 yyextra->current->type.prepend("typedef");
6425 }
6426 BEGIN( FindMembers );
6427 }
6428 }
6429<CompoundName>{SCOPENAME}/{BN}*"(" {
6430 yyextra->current->name = yytext ;
6433 if (yyextra->insideCpp && yyextra->current->name=="alignas")
6434 {
6435 yyextra->lastAlignAsContext = YY_START;
6436 BEGIN( AlignAs );
6437 }
6438 else
6439 {
6440 if (yyextra->current->spec.isProtocol())
6441 {
6442 yyextra->current->name += "-p";
6443 }
6444 BEGIN( ClassVar );
6445 }
6446 }
6447<AlignAs>"(" { yyextra->roundCount=0;
6448 BEGIN( AlignAsEnd );
6449 }
6450<AlignAs>\n { lineCount(yyscanner); }
6451<AlignAs>.
6452<AlignAsEnd>"(" { yyextra->roundCount++; }
6453<AlignAsEnd>")" { if (--yyextra->roundCount<0)
6454 {
6455 BEGIN( yyextra->lastAlignAsContext );
6456 }
6457 }
6458<AlignAsEnd>\n { lineCount(yyscanner); }
6459<AlignAsEnd>.
6460<ConceptName>{ID} {
6461 yyextra->current->name = yytext ;
6463 }
6464<ConceptName>"=" {
6465 yyextra->current->bodyLine = yyextra->yyLineNr;
6466 yyextra->current->bodyColumn = yyextra->yyColNr;
6467 yyextra->current->initializer.str(std::string());
6468 yyextra->lastInitializerContext = FindMembers;
6469 yyextra->sharpCount=0;
6470 yyextra->initBracketCount=0;
6471 BEGIN(ReadInitializer);
6472 }
6473<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
6474
6475 yyextra->current->reset();
6477 }
6478<CompoundName>{SCOPENAME} {
6479 yyextra->current->name = yytext ;
6482 if (yyextra->current->spec.isProtocol())
6483 {
6484 yyextra->current->name += "-p";
6485 }
6486 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6487 {
6488 unput('{');
6489 }
6490 BEGIN( ClassVar );
6491 }
6492<CompoundName>({ID}{BN}*"::"{BN}*)+("inline"{BN}+({ID}{BN}*"::"{BN}*)*)+{ID} { // C++20 style nested inline namespace syntax
6493 if (yyextra->current->section.isNamespace())
6494 {
6498 BEGIN( ClassVar );
6499 }
6500 else
6501 {
6502 REJECT;
6503 }
6504 }
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
6505<CompoundName>{CSSCOPENAME} { // C# style scope
6506 yyextra->current->name =
substitute(yytext,
".",
"::");
6508 BEGIN( ClassVar );
6509 }
6510<ClassVar>{SCOPENAME}{BNopt}/"(" {
6511 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6512 {
6513
6514 yyextra->roundCount=0;
6515 BEGIN(SkipUnionSwitch);
6516 }
6517 else
6518 {
6520 yyextra->yyBegColNr=yyextra->yyColNr;
6521 yyextra->yyBegLineNr=yyextra->yyLineNr;
6522 yyextra->current->name = yytext;
6523 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6526 BEGIN( FindMembers );
6527 }
6528 }
6529<ClassVar>"," {
6530 if (yyextra->isTypedef)
6531 {
6532
6533 unput(',');
6534 yyextra->current->type.prepend("typedef ");
6535 BEGIN(FindMembers);
6536 }
6537 else
6538 {
6539
6540 }
6541 }
6542<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6543 if (yyextra->insideCli)
6544 {
6545 if (yytext[0]=='s')
6546 yyextra->current->spec.setSealedClass(true);
6547 else
6548 yyextra->current->spec.setAbstractClass(true);
6549 BEGIN( ClassVar );
6550 }
6551 else
6552 {
6553 REJECT;
6554 }
6555 }
6556<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6557 yyextra->yyBegColNr=yyextra->yyColNr;
6558 yyextra->yyBegLineNr=yyextra->yyLineNr;
6561 if (yyextra->current->section.isEnum())
6562 {
6563 yyextra->current->section = EntryType::makeVariable() ;
6564 }
6565 yyextra->current->type += ' ' ;
6566 yyextra->current->type += yyextra->current->name ;
6568
6570 {
6571 BEGIN( Operator );
6572 }
6573 }
6574<ClassVar>{ID} {
6575 yyextra->yyBegColNr=yyextra->yyColNr;
6576 yyextra->yyBegLineNr=yyextra->yyLineNr;
6578 if (yyextra->insideIDL &&
qstrcmp(yytext,
"switch")==0)
6579 {
6580
6581 yyextra->roundCount=0;
6582 BEGIN(SkipUnionSwitch);
6583 }
6584 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
qstrcmp(yytext,
"implements")==0 ||
qstrcmp(yytext,
"extends")==0))
6585 {
6586 yyextra->current->type.clear();
6587 yyextra->baseProt = Protection::Public;
6588 yyextra->baseVirt = Specifier::Normal;
6589 yyextra->baseName.clear();
6590 BEGIN( BasesProt ) ;
6591 }
6592 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
6593 {
6594 yyextra->current->typeConstr.clear();
6595 yyextra->current->typeConstr.push_back(
Argument());
6596 yyextra->lastCSConstraint = YY_START;
6597 BEGIN( CSConstraintName );
6598 }
6599 else if (yyextra->insideCli &&
qstrcmp(yytext,
"abstract")==0)
6600 {
6601 yyextra->current->spec.setAbstract(true);
6602 }
6603 else if (yyextra->insideCli &&
qstrcmp(yytext,
"sealed")==0)
6604 {
6605 yyextra->current->spec.setSealed(true);
6606 }
6607 else if (
qstrcmp(yytext,
"final")==0)
6608 {
6609 yyextra->current->spec.setFinal(true);
6610 }
6611 else
6612 {
6613 if (yyextra->current->section.isEnum())
6614 {
6615 yyextra->current->section = EntryType::makeVariable() ;
6616 }
6617 yyextra->current->type += ' ' ;
6618 yyextra->current->type += yyextra->current->name ;
6619 yyextra->current->name = yytext ;
6620
6622 {
6623 BEGIN( Operator );
6624 }
6625 }
6626 }
6627<ClassVar>[(\[] {
6628 if (yyextra->insideObjC && *yytext=='(')
6629 {
6630 yyextra->current->name+='(';
6631 yyextra->current->spec.setCategory(true);
6632 BEGIN( ClassCategory );
6633 }
6634 else if (yyextra->insideCS && *yytext=='(')
6635 {
6636 yyextra->current->args=yytext;
6637 yyextra->currentArgumentContext = ClassVar;
6638 yyextra->fullArgString = yyextra->current->args;
6639 yyextra->copyArgString = &yyextra->current->args;
6640 BEGIN( ReadFuncArgType ) ;
6641 }
6642 else
6643 {
6644
6645 unput(*yytext);
6646 BEGIN( FindMembers );
6647 }
6648 }
6649<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
6650<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
6651 yyextra->fullArgString.clear();
6652 yyextra->lastCopyArgChar='#';
6653 yyextra->lastCommentInArgContext=YY_START;
6654 if (yytext[1]=='/')
6655 BEGIN( CopyArgCommentLine );
6656 else
6657 BEGIN( CopyArgComment );
6658 }
6659<CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
6660 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6661 }
6662<CSConstraintType>"=>" { // end of type constraint reached
6663
6665 unput('>');
6666 unput('=');
6667 BEGIN( yyextra->lastCSConstraint );
6668 }
6669<CSConstraintType>"{" { // end of type constraint reached
6670
6672 unput('{');
6673 BEGIN( yyextra->lastCSConstraint );
6674 }
6675<CSConstraintType,CSConstraintName>";" {
6677 unput(';');
6678 BEGIN( yyextra->lastCSConstraint );
6679 }
6680<CSConstraintName>":" {
6681 BEGIN( CSConstraintType );
6682 }
6683<CSConstraintName>{ID} {
6684
6685 yyextra->current->typeConstr.back().name=yytext;
6686 }
6687<CSConstraintType>"where" { // another constraint for a different param
6688 yyextra->current->typeConstr.push_back(
Argument());
6689 BEGIN( CSConstraintName );
6690 }
6691<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6692 if (yyextra->current->typeConstr.back().type.isEmpty())
6693
6694 {
6695 yyextra->current->typeConstr.back().type=yytext;
6696 }
6697 else
6698 {
6699 QCString name = yyextra->current->typeConstr.back().name;
6700 yyextra->current->typeConstr.push_back(
Argument());
6701 yyextra->current->typeConstr.back().name=name;
6702 yyextra->current->typeConstr.back().type=yytext;
6703 }
6704 }
6705<CSConstraintName,CSConstraintType>\n {
6707 }
6708<CSConstraintName,CSConstraintType>. {
6709 }
6710<ClassCategory>{ID} {
6711 yyextra->current->name+=yytext;
6712 }
6713<ClassCategory>")"/{BN}*"{" {
6714 yyextra->current->name+=')';
6715 BEGIN( ClassVar );
6716 }
6717<ClassCategory>")"/{BN}*"<" {
6718 yyextra->current->name+=')';
6719 BEGIN( ObjCProtocolList );
6720 }
6721<ClassCategory>")" {
6722 yyextra->current->name+=')';
6723 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6724 {
6725 unput('{');
6726 }
6727 else
6728 {
6729 unput('}');
6730 unput('{');
6731 }
6732 BEGIN( ClassVar );
6733 }
6734<ClassVar>":" {
6735 if (yyextra->current->section.isVariable())
6736 {
6737 yyextra->current->bitfields+=":";
6738 yyextra->current->args.clear();
6739 BEGIN(BitFields);
6740 }
6741 else if (yyextra->current->section.isEnum())
6742
6743 {
6744 yyextra->current->args.clear();
6745 BEGIN(EnumBaseType);
6746 }
6747 else
6748 {
6749 yyextra->current->type.clear();
6750 if (yyextra->current->spec.isInterface() ||
6751 yyextra->current->spec.isStruct() ||
6752 yyextra->current->spec.isRef() ||
6753 yyextra->current->spec.isValue() ||
6754 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6755 )
6756 {
6757 yyextra->baseProt = Protection::Public;
6758 }
6759 else
6760 {
6761 yyextra->baseProt = Protection::Private;
6762 }
6763 yyextra->baseVirt = Specifier::Normal;
6764 yyextra->baseName.clear();
6765 BEGIN( BasesProt ) ;
6766 }
6767 }
6768<ClassVar>[;=*&] {
6769 if (yyextra->isTypedef)
6770 {
6771 yyextra->current->type.prepend("typedef");
6772 }
6773 if ((yytext[0]=='*' || yytext[0]=='&') && yyextra->current->section.isEnum())
6774 {
6775 yyextra->current->section = EntryType::makeVariable() ;
6776 }
6777 if (yytext[0]==';' && yyextra->current->section.isEnum())
6778 {
6779 yyextra->current->reset();
6781 }
6782 else
6783 {
6784 unput(*yytext);
6785 }
6786 BEGIN( FindMembers );
6787 }
6788<Bases,ClassVar>{CPPC}"/"/[^/] {
6789 if (!yyextra->insideObjC)
6790 {
6791 REJECT;
6792 }
6793 else
6794 {
6796 yyextra->current->program << yytext;
6797 yyextra->current->fileName = yyextra->fileName ;
6798 yyextra->current->startLine = yyextra->yyLineNr ;
6799 yyextra->current->startColumn = yyextra->yyColNr;
6800 yyextra->curlyCount=0;
6801 BEGIN( ReadBodyIntf );
6802 }
6803 }
6804<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6805<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6806<Bases,ClassVar>{CPPC}"!" |
6807<Bases,ClassVar>[\-+]{BN}* {
6808 if (!yyextra->insideObjC)
6809 {
6810 REJECT;
6811 }
6812 else
6813 {
6815 yyextra->current->program << yytext;
6816 yyextra->current->fileName = yyextra->fileName ;
6817 yyextra->current->startLine = yyextra->yyLineNr ;
6818 yyextra->current->startColumn = yyextra->yyColNr;
6819 yyextra->curlyCount=0;
6820 BEGIN( ReadBodyIntf );
6821 }
6822 }
6823<CompoundName,ClassVar>{B}*"{"{B}* {
6824 yyextra->current->program.str(std::string());
6825 yyextra->current->fileName = yyextra->fileName ;
6826 yyextra->current->bodyLine = yyextra->yyLineNr;
6827 yyextra->current->bodyColumn = yyextra->yyColNr;
6829 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef)
6830 {
6831 if (yyextra->current->section.isNamespace())
6832 {
6834 {
6835 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6836 }
6837 else
6838 {
6840 }
6841 }
6842 else
6843 {
6845 }
6846 }
6847 yyextra->curlyCount=0;
6848 if (yyextra->current_root &&
6849 !yyextra->current_root->spec.isInterface() &&
6850 (yyextra->current->spec.isInterface() ||
6851 yyextra->current->spec.isProtocol() ||
6852 yyextra->current->spec.isCategory() ||
6853 yyextra->current->section.isObjcImpl()
6854 ) &&
6855 yyextra->insideObjC
6856 )
6857 {
6858 BEGIN( ReadBodyIntf );
6859 }
6860 else if (yyextra->current->section.isNamespace())
6861 {
6862 BEGIN( ReadNSBody );
6863 }
6864 else
6865 {
6866 BEGIN( ReadBody ) ;
6867 }
6868 }
QCString stripPath(const QCString &s)
6869<BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6870<BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6871<BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6872<BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6873<BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6874<BasesProt>{BN} { lineCount(yyscanner); }
6875<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6876<Bases>"decltype"{BN}*"(" {
6878 yyextra->roundCount=0;
6879 yyextra->lastSkipRoundContext=YY_START;
6880 BEGIN(SkipRound);
6881 }
6882<Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
6883 if (!yyextra->insidePHP)
6884 {
6885 REJECT;
6886 }
6887 else
6888 {
6892 yyextra->baseName += bn;
6893 yyextra->current->args += ' ';
6894 yyextra->current->args += yytext;
6895 }
6896 }
6897<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6901 {
6902
6903 yyextra->current->typeConstr.clear();
6904 yyextra->current->typeConstr.push_back(
Argument());
6905 yyextra->lastCSConstraint = YY_START;
6906 BEGIN( CSConstraintName );
6907 }
6908 else
6909 {
6910 yyextra->baseName+=yytext;
6911 yyextra->current->args += ' ';
6912 yyextra->current->args += yytext;
6913 }
6914 }
6915<Bases>{BN}*{ID}("."{ID})* { // Java style class
6917 yyextra->baseName += name;
6918 yyextra->current->args += ' ';
6919 yyextra->current->args += name;
6920 }
6921<ClassVar,Bases>\n/{BN}*[^{, \t\n:] {
6922 if (!yyextra->insideObjC)
6923 {
6924 REJECT;
6925 }
6926 else
6927 {
6929 unput('{');
6930 }
6931 }
6932<ClassVar,Bases>"@end" { // empty ObjC interface
6933 unput('d');
6934 unput('n');
6935 unput('e');
6936 unput('@');
6937 unput('}');
6938 unput('{');
6939 }
6940<ClassVar>"<" { yyextra->current->name += *yytext;
6941 yyextra->sharpCount=1;
6942 yyextra->roundCount=0;
6943 yyextra->lastSkipSharpContext = YY_START;
6944 yyextra->specName = &yyextra->current->name;
6945 BEGIN ( Specialization );
6946 }
6947<Bases>{BN}*"<" {
6949 yyextra->sharpCount=1;
6950 yyextra->roundCount=0;
6951 yyextra->lastSkipSharpContext = YY_START;
6952 if (yyextra->insideObjC)
6953 {
6954 unput(',');
6955 }
6956 else
6957 {
6958
6959
6960
6961
6962 yyextra->templateStr = yytext;
6963 yyextra->specName = &yyextra->templateStr;
6964 BEGIN ( Specialization );
6965 }
6966 }
6967<Specialization>"<" { *yyextra->specName += *yytext;
6968 if (yyextra->roundCount==0) yyextra->sharpCount++;
6969 }
6970<Specialization>">" {
6971 *yyextra->specName += *yytext;
6972 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6973 {
6975 BEGIN(yyextra->lastSkipSharpContext);
6976 }
6977 }
6978<Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6979<Specialization>"<<" { *yyextra->specName += yytext; }
6980<Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6981 unput('>');
6982 unput(' ');
6983 unput('>');
6984 }
6985<Specialization>">>" {
6986 if (yyextra->insideCS)
6987 {
6988 REJECT;
6989 }
6990 else
6991
6992
6993
6994
6995 {
6996 if (yyextra->roundCount>0)
6997 {
6998 *yyextra->specName += yytext;
6999 }
7000 else
7001 {
7002 unput('>');
7003 unput(' ');
7004 unput('>');
7005 }
7006 }
7007 }
7008<Specialization>"typename"{BN}+ { lineCount(yyscanner); }
7009<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
7010<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
7011
7012<Specialization>"\\\\" { *yyextra->specName += *yytext;}
7013<Specialization>"\\'" { *yyextra->specName += *yytext;}
7014<Specialization>"\\\"" { *yyextra->specName += *yytext;}
7015<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
7016<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
7017<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
7018<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
7019<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7020<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
7021<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7022<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
7023
7024<Specialization>. {
7025 *yyextra->specName += *yytext;
7026 }
7027<SkipRound>"(" { ++yyextra->roundCount; }
7028<SkipRound>")" { if (--yyextra->roundCount<0)
7029 BEGIN ( yyextra->lastSkipRoundContext );
7030 }
7031<SkipRound>\" {
7032 yyextra->lastStringContext=SkipRound;
7033 BEGIN(SkipString);
7034 }
7035<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
7036 if (yyextra->insideProtocolList)
7037 {
7038 yyextra->baseName+="-p";
7039 }
7040 else
7041 {
7042 yyextra->current->args += ',' ;
7043 }
7045 if (!yyextra->baseName.isEmpty())
7046 {
7047 yyextra->current->extends.emplace_back(
7048 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7049 );
7050 }
7051 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
7052 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
7053 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
7054 {
7055 yyextra->baseProt=Protection::Public;
7056 }
7057 else
7058 {
7059 yyextra->baseProt=Protection::Private;
7060 }
7061 yyextra->baseVirt=Specifier::Normal;
7062 yyextra->baseName.clear();
7063 if (*yytext=='>')
7064 {
7065 yyextra->insideProtocolList=
FALSE;
7066 if (yyleng==1)
7067 {
7068 if (yyextra->insideObjC && !yyextra->current->spec.isProtocol())
7069 {
7070 BEGIN(ClassVar);
7071 }
7072 else
7073 {
7074 unput('{');
7075 }
7076 }
7077 else
7078 {
7079 yyless(1);
7080 }
7081 }
7082 else
7083 {
7084 if (*yytext==',' && yyextra->insideObjC)
7085 {
7086 yyextra->insideProtocolList=
TRUE;
7087 }
7088 BEGIN(BasesProt);
7089 }
7090 }
7091<Bases>{B}*"{"{B}* {
7092 yyextra->current->program.str(std::string());
7093 yyextra->current->fileName = yyextra->fileName ;
7094 yyextra->current->bodyLine = yyextra->yyLineNr;
7095 yyextra->current->bodyColumn = yyextra->yyColNr;
7097 if (!yyextra->baseName.isEmpty())
7098 {
7099 yyextra->current->extends.emplace_back(
7100 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7101 );
7102 yyextra->baseName.clear();
7103 }
7104 yyextra->curlyCount=0;
7105 if (yyextra->insideObjC)
7106 {
7107 BEGIN( ReadBodyIntf );
7108 }
7109 else
7110 {
7111 BEGIN( ReadBody ) ;
7112 }
7113 }
7114<SkipUnionSwitch>{B}*"(" {
7115 yyextra->roundCount++;
7116 }
7117<SkipUnionSwitch>")" {
7118 if (--yyextra->roundCount==0)
7119 {
7120 BEGIN(ClassVar);
7121 }
7122 }
7123<SkipUnionSwitch>\n { lineCount(yyscanner); }
7124<SkipUnionSwitch>.
7125<Comment>{BN}+ { yyextra->current->program << yytext ;
7127 }
7128<Comment>{CCS} { yyextra->current->program << yytext ; }
7129<Comment>{CPPC} { yyextra->current->program << yytext ; }
7130<Comment>{CMD}("code"|"verbatim"|"iliteral") {
7131 if (yyextra->doxygenComment) yyextra->insideCode=
TRUE;
7132 yyextra->current->program << yytext ;
7133 }
7134<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
7135 if (yyextra->doxygenComment) yyextra->insideCode=
FALSE;
7136 yyextra->current->program << yytext ;
7137 }
7138<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
7139<Comment>{CCE} { yyextra->current->program << yytext ;
7140 if (!yyextra->insideCode)
7141 {
7142 yyextra->doxygenComment=false;
7143 BEGIN( yyextra->lastContext );
7144 }
7145 }
7146<Comment>. { yyextra->current->program << *yytext ; }
7147
7148<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,ReadExpressionBody,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
7149
7150 if (!yyextra->current->doc.isEmpty())
7151 {
7152 yyextra->current->doc+="\n\n";
7153 }
7154 else
7155 {
7156 yyextra->current->docLine = yyextra->yyLineNr;
7157 yyextra->current->docFile = yyextra->fileName;
7158 }
7159
7160 yyextra->lastDocContext = YY_START;
7161 if (yyextra->current_root->section.isScope())
7162 {
7163 yyextra->current->inside = yyextra->current_root->name+"::";
7164 }
7165 yyextra->docBlockContext = YY_START;
7166 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7168
7171 yyextra->docBlock.
str(indent.
str());
7172
7173 if (yyextra->docBlockAutoBrief)
7174 {
7175 yyextra->current->briefLine = yyextra->yyLineNr;
7176 yyextra->current->briefFile = yyextra->fileName;
7177 }
7179 BEGIN( DocBlock );
7180 }
7181<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,ReadExpressionBody,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
7184
7185 if( javadocBanner )
7186 {
7187 yyextra->lastDocContext = YY_START;
7188
7189
7190 if (yyextra->current_root->section.isScope())
7191 {
7192 yyextra->current->inside = yyextra->current_root->name+"::";
7193 }
7194 yyextra->current->docLine = yyextra->yyLineNr;
7195 yyextra->current->docFile = yyextra->fileName;
7196 yyextra->docBlockContext = YY_START;
7197 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7199 yyextra->docBlockAutoBrief = javadocAutoBrief;
7200
7203 yyextra->docBlock.
str(indent.
str());
7204
7205 if (yyextra->docBlockAutoBrief)
7206 {
7207 yyextra->current->briefLine = yyextra->yyLineNr;
7208 yyextra->current->briefFile = yyextra->fileName;
7209 }
7211 BEGIN( DocBlock );
7212 }
7213 else
7214 {
7215 yyextra->current->program << yytext ;
7216 yyextra->lastContext = YY_START ;
7217 yyextra->doxygenComment=true;
7218 BEGIN( Comment ) ;
7219 }
7220 }
7221<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,ReadExpressionBody,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7223 yyextra->yyColNr=1;
7224 REJECT;
7225 }
7226<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,ReadExpressionBody,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7227 yyextra->lastDocContext = YY_START;
7228
7229
7230 if (yyextra->current_root->section.isScope())
7231 {
7232 yyextra->current->inside = yyextra->current_root->name+"::";
7233 }
7234 yyextra->current->docLine = yyextra->yyLineNr;
7235 yyextra->current->docFile = yyextra->fileName;
7236 yyextra->docBlockContext = YY_START;
7237 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7239 yyextra->docBlockAutoBrief = javadocAutoBrief;
7240
7243 yyextra->docBlock.
str(indent.
str());
7244
7245 if (yyextra->docBlockAutoBrief)
7246 {
7247 yyextra->current->briefLine = yyextra->yyLineNr;
7248 yyextra->current->briefFile = yyextra->fileName;
7249 }
7251 BEGIN( DocBlock );
7252 }
7253<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
7254 yyextra->lastDocContext = YY_START;
7255 if (yyextra->current_root->section.isScope())
7256 {
7257 yyextra->current->inside = yyextra->current_root->name+"::";
7258 }
7259 yyextra->docBlockContext = YY_START;
7260 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7261 yyextra->docBlockAutoBrief =
FALSE;
7262
7265 yyextra->docBlock.
str(indent.
str());
7266
7268 BEGIN( DocLine );
7269 }
7270<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
7271 yyextra->lastDocContext = YY_START;
7272 if (yyextra->current_root->section.isScope())
7273 {
7274 yyextra->current->inside = yyextra->current_root->name+"::";
7275 }
7276 yyextra->docBlockContext = YY_START;
7277 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7278 yyextra->docBlockAutoBrief =
FALSE;
7281 yyextra->docBlock.
str(indent.
str());
7283 BEGIN( DocLine );
7284 }
7285<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
7287 yyextra->externLinkage=
TRUE;
7288 }
7289<FindMembers>"{" {
7290 if (yyextra->externLinkage)
7291 {
7292 yyextra->externLinkage=
FALSE;
7293 }
7294 else if (yyextra->insideCS &&
7295 !yyextra->current->name.isEmpty() &&
7296 !yyextra->current->type.isEmpty())
7297 {
7298 if (yyextra->current->mtype == MethodTypes::Event)
7299 {
7300 yyextra->mtype = MethodTypes::Event;
7301 }
7303 {
7304 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
7305 }
7306 else
7307 {
7308 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
7309 }
7310 yyextra->current->bodyLine = yyextra->yyLineNr;
7311 yyextra->current->bodyColumn = yyextra->yyColNr;
7312 yyextra->curlyCount=0;
7313 BEGIN( CSAccessorDecl );
7314 }
7315 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
7316 {
7317
7318
7319 yyextra->current->exception = " {";
7320 BEGIN(UNOIDLAttributeBlock);
7321 }
7322 else
7323 {
7324 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
7325 yyextra->current->name.isEmpty()
7326 )
7327 {
7328
7329 yyextra->needsSemi =
FALSE;
7330 if (yyextra->current->isStatic)
7331 {
7332 yyextra->current->name="[static initializer]";
7333 yyextra->current->type.clear();
7334 }
7335 else
7336 {
7337 yyextra->current->name="[instance initializer]";
7338 }
7339 unput(*yytext);
7340 BEGIN( SFunction );
7341 }
7342 else
7343 {
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354 yyextra->current->bodyLine = yyextra->yyLineNr;
7355 yyextra->current->bodyColumn = yyextra->yyColNr;
7356 yyextra->current->initializer.str(yytext);
7357 yyextra->lastInitializerContext = YY_START;
7358 yyextra->sharpCount=0;
7359 yyextra->initBracketCount=1;
7360 BEGIN(ReadInitializer);
7361 }
7362 }
7363 }
7364<CSAccessorDecl>"{" { yyextra->curlyCount++; }
7365<CSAccessorDecl>"}"{B}*"=" {
7366
7367 if (yyextra->curlyCount != 0) REJECT;
7368 yyextra->current->initializer.str("=");
7369 yyextra->current->endBodyLine=yyextra->yyLineNr;
7370 yyextra->lastInitializerContext = FindMembers;
7371 BEGIN(ReadInitializer);
7372 }
7373<CSAccessorDecl>"}" {
7374 if (yyextra->curlyCount)
7375 {
7376 yyextra->curlyCount--;
7377 }
7378 else
7379 {
7380 yyextra->mtype = MethodTypes::Method;
7381 yyextra->virt = Specifier::Normal;
7382
7383 yyextra->current->endBodyLine=yyextra->yyLineNr;
7384 unput(';');
7385 BEGIN(FindMembers);
7386 }
7387 }
7388<CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(true); }
7389<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(true); }
7390<CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(true); }
7391<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(true); }
7392<CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(true); }
7393<CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(true); }
7394<CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(true); }
7395<CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(true); }
7396<CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(true); }
7397<CSAccessorDecl>{CHARLIT} {}
7398<CSAccessorDecl>"\"" { BEGIN(CSString);}
7399<CSAccessorDecl>"." {}
7400<CSAccessorDecl>\n { lineCount(yyscanner); }
7401<CSString>"\"" { BEGIN(CSAccessorDecl);}
7402<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
7403<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
7404<CSString>\n { lineCount(yyscanner); }
7405<CSString>"." {}
7406
7407
7408
7409<SliceSequence>{SCOPENAME} {
7410 if (yyextra->current->spec.isLocal())
7411 {
7412 yyextra->current->type = "local ";
7413 }
7414 yyextra->current->type += "sequence<";
7415 yyextra->current->type += yytext;
7416 yyextra->current->type += ">";
7417 }
7418
7419<SliceSequence>{BN}*">"{BN}* {
7421 BEGIN(SliceSequenceName);
7422 }
7423
7424<SliceSequenceName>{ID}{BN}* {
7426 yyextra->current->name = yytext ;
7427 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7428 }
7429
7430<SliceSequenceName>";" {
7431 yyextra->current->section = EntryType::makeVariable();
7432 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7434 BEGIN(FindMembers);
7435 }
7436
7437<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7439 if (yyextra->current->spec.isLocal())
7440 {
7441 yyextra->current->type = "local ";
7442 }
7443 yyextra->current->type += "dictionary<";
7444 yyextra->current->type += yytext;
7445 yyextra->current->type += ">";
7446 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7447 }
7448
7449<SliceDictionary>{BN}*">"{BN}* {
7451 BEGIN(SliceDictionaryName);
7452 }
7453
7454<SliceDictionaryName>{ID}{BN}* {
7456 yyextra->current->name = yytext ;
7457 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7458 }
7459
7460<SliceDictionaryName>";" {
7461 yyextra->current->section = EntryType::makeVariable();
7462 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7464 BEGIN(FindMembers);
7465 }
7466
7467
7468
7469
7470
7471
7472<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
7473 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
7474 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7476 }
7477<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
7478 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7479 BEGIN( yyextra->docBlockContext );
7480 }
7481<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
7482 yyextra->docBlock << yytext;
7483 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7484 BEGIN( yyextra->docBlockContext );
7485 }
7486<DocLine>{NONLopt}/"\n" { // whole line
7487 yyextra->docBlock << yytext;
7488 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7489 BEGIN( yyextra->docBlockContext );
7490 }
7491
7492
7493
7494<DocBlock>"*"*{CCE} { // end of comment block
7496 BEGIN(yyextra->docBlockContext);
7497 }
7498<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7501 yyextra->docBlock << "\\ilinebr " << indent;
7502 }
7503<DocBlock>^{B}*"*"+/[^/] {
7506 yyextra->docBlock << indent;
7507 }
7508<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
7511 yyextra->docBlock << indent;
7512 }
7513<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
7514 }
7515<DocBlock>{CPPC} { // slashes in the middle of a comment block
7516 yyextra->docBlock << yytext;
7517 }
7518<DocBlock>{CCS} { // start of a new comment in the
7519
7520 yyextra->docBlock << yytext;
7521 }
7522<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
7523 yyextra->docBlock << yytext;
7524 }
7525<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7526 yyextra->docBlock << yytext;
7527 char blockName[] = "f$";
7528 char c = yytext[2];
7529 if (c=='[') blockName[1]=']';
7530 else if (c=='{') blockName[1]='}';
7531 else if (c=='(') blockName[1]=')';
7533 BEGIN(DocCopyBlock);
7534 }
static void startVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0, bool codeBlock=false)
7535<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7536 yyextra->fileName = &yytext[6];
7537 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7538 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7539 yyextra->docBlock << yytext;
7540 }
7541<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7542 yyextra->fileName = &yytext[6];
7543 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7544 yyextra->docBlock << yytext;
7545 }
7546<DocBlock>{CMD}"iline"{LINENR}{B} {
7547 bool ok = false;
7549 if (!ok)
7550 {
7551 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7552 }
7553 else
7554 {
7555 yyextra->yyLineNr = nr;
7556 }
7557 yyextra->docBlock << yytext;
7558 }
7559<DocBlock>{B}*"<"{PRE}">" {
7560 yyextra->docBlock << yytext;
7562 BEGIN(DocCopyBlock);
7563 }
7564<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7565 yyextra->docBlock << yytext;
7567 BEGIN(DocCopyBlock);
7568 }
7569<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7570 yyextra->docBlock << yytext;
7572 BEGIN(DocCopyBlock);
7573 }
7574<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7575 yyextra->docBlock << yytext;
7577 BEGIN(DocCopyBlock);
7578 }
7579<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7581 yyextra->docBlock << "\\ilinebr ";
7582 yyextra->docBlock << pat;
7584 BEGIN(DocCopyBlock);
7585 }
7586<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7588 yyextra->docBlock << pat;
7590 BEGIN(DocCopyBlock);
7591 }
7592<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7593<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7594<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7596 yyextra->docBlock << "\\ilinebr ";
7597 yyextra->docBlock << pat;
7599 BEGIN(DocCopyBlock);
7600 }
7601<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7602<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7603<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7605 yyextra->docBlock << pat;
7607 BEGIN(DocCopyBlock);
7608 }
7609<DocBlock>"```" { // skip ``` if not at the start of a line
7610 yyextra->docBlock << "```";
7611 }
7612<DocBlock>"\\`" { // skip escaped backtick
7613 yyextra->docBlock << yytext;
7614 }
7615<DocBlock>"`"{1,2} {
7616 yyextra->docBlock << yytext;
7618 BEGIN(DocCopyBlock);
7619 }
7620<DocBlock>{B}*"<"{CODE}">" {
7621 if (yyextra->insideCS)
7622 {
7623 yyextra->docBlock << yytext;
7625 BEGIN(DocCopyBlock);
7626 }
7627 else
7628 {
7629 REJECT;
7630 }
7631 }
7632<DocBlock>[^@*~`'\/\\\n]+ { // any character that isn't special
7633 yyextra->docBlock << yytext;
7634 }
7635<DocBlock>\n { // newline
7637 yyextra->docBlock << *yytext;
7638 }
7639<DocBlock>. { // command block
7640 yyextra->docBlock << *yytext;
7641 }
7642
7643
7644
7645<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
7647 {
7648 BEGIN(DocBlock);
7649 }
7650 yyextra->docBlock << yytext;
7651 }
static bool endVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7652<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
7654 {
7655 BEGIN(DocBlock);
7656 }
7657 yyextra->docBlock << yytext;
7658 }
7659<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7661 {
7662 BEGIN(DocBlock);
7663 }
7664 yyextra->docBlock << yytext;
7665 }
7666<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
7668 {
7669 BEGIN(DocBlock);
7670 }
7671 yyextra->docBlock << yytext;
7672 }
7673<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
7674 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7675 {
7676 REJECT;
7677 }
7678 else
7679 {
7682 yyextra->docBlock << indent;
7683 }
7684 }
7685<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
7686 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7687 {
7690 yyextra->docBlock << indent;
7691 }
7692 else
7693 {
7694 REJECT;
7695 }
7696 }
7697<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
7698 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7699 {
7702 yyextra->docBlock << indent+"*";
7703 }
7704 else
7705 {
7706 REJECT;
7707 }
7708 }
7709<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
7710 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7711 {
7713 if (yyextra->nestedComment>0)
7714 {
7716 yyextra->docBlock << indent+"*";
7717 }
7718 else
7719 {
7721 yyextra->docBlock << indent;
7722 }
7723 }
7724 else
7725 {
7726 REJECT;
7727 }
7728 }
7729<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7732 {
7733 BEGIN(DocBlock);
7734 }
7735 yyextra->docBlock << pat;
7736 }
7737<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7740 {
7741 BEGIN(DocBlock);
7742 }
7743 yyextra->docBlock << pat;
7744 }
7745<DocCopyBlock>"```" { // backtick + end marker
7746 if (yyextra->docBlockName=="``")
7747 {
7748 yyextra->docBlock << "`";
7750 yyextra->docBlock << "``";
7751 BEGIN(DocBlock);
7752 }
7753 else
7754 {
7755 yyextra->docBlock << yytext;
7756 }
7757 }
7758<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7760 {
7761 BEGIN(DocBlock);
7762 }
7763 yyextra->docBlock << yytext;
7764 }
7765<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7767 {
7768 BEGIN(DocBlock);
7769 }
7770 yyextra->docBlock << yytext;
7771 }
7772<DocCopyBlock>"`"{1,2} {
7774 {
7775 BEGIN(DocBlock);
7776 }
7777 yyextra->docBlock << yytext;
7778 }
7779<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ { // any character that is not special
7780 yyextra->docBlock << yytext;
7781 }
7782<DocCopyBlock>\" {
7783 yyextra->docBlock << yytext;
7784 if (yyextra->docBlockName=="code" || yyextra->docBlockName=="iliteral")
7785
7786
7787 {
7788 yyextra->lastStringContext=YY_START;
7789 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7790 yyextra->stopAtInvalidString=true;
7791 BEGIN(CopyGString);
7792 }
7793 }
7794<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7795 if (yytext[1]=='*')
7796 {
7797 yyextra->nestedComment++;
7798 }
7799 else if (yytext[0]=='*' && yyextra->nestedComment>0)
7800 {
7801 yyextra->nestedComment--;
7802 }
7803 else if (yytext[0]=='*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7804 {
7805 warn(yyextra->fileName,yyextra->yyLineNr,
7806 "Found end of C comment inside a '{}' block without matching start of the comment!"
7807 " Maybe the end marker for the block is missing?",
7808 yyextra->docBlockName);
7809 BEGIN(DocBlock);
7810 }
7811 yyextra->docBlock << yytext;
7812 }
7813<DocCopyBlock>\n { // newline
7814 yyextra->docBlock << *yytext;
7816 }
7817<DocCopyBlock>. { // any other character
7818 yyextra->docBlock << *yytext;
7819 }
7820<DocCopyBlock><<EOF>> {
7821 warn(yyextra->fileName,yyextra->yyLineNr,
7822 "reached end of file while inside a '{}' block!"
7823 " The command that should end the block seems to be missing!",
7824 yyextra->docBlockName);
7826 }
7827
7828
7829
7830
7831<Prototype>"operator"{B}*"("{B}*")" {
7832 yyextra->current->name+=yytext;
7833 }
7834<Prototype>"(" {
7835 yyextra->current->args+=*yytext;
7836 yyextra->currentArgumentContext = PrototypeQual;
7837 yyextra->fullArgString = yyextra->current->args;
7838 yyextra->copyArgString = &yyextra->current->args;
7839 BEGIN( ReadFuncArgType ) ;
7840 }
7841<Prototype>"("({ID}"::")*({B}*[&*])+ {
7842 if (yyextra->insidePHP)
7843 {
7844 REJECT;
7845 }
7846 else
7847 {
7848 yyextra->current->type+=yyextra->current->name+yytext;
7849 yyextra->current->name.clear();
7850 BEGIN( PrototypePtr );
7851 }
7852 }
7853<PrototypePtr>{SCOPENAME} {
7854 yyextra->current->name+=yytext;
7855 }
7856<PrototypePtr>"(" {
7857 yyextra->current->args+=*yytext;
7858 yyextra->currentArgumentContext = PrototypeQual;
7859 yyextra->fullArgString = yyextra->current->args;
7860 yyextra->copyArgString = &yyextra->current->args;
7861 BEGIN( ReadFuncArgType ) ;
7862 }
7863<PrototypePtr>")" {
7864 yyextra->current->type+=')';
7865 BEGIN( Prototype );
7866 }
7867<PrototypePtr>. {
7868 yyextra->current->name+=yytext;
7869 }
7870<PrototypeQual>"{" {
7871 BEGIN( PrototypeSkipLine);
7872 }
7873<PrototypeQual>{B}*"const"{B}* {
7874 yyextra->current->args += " const ";
7875 yyextra->current->argList.setConstSpecifier(
TRUE);
7876 }
7877<PrototypeQual>{B}*"volatile"{B}* {
7878 yyextra->current->args += " volatile ";
7879 yyextra->current->argList.setVolatileSpecifier(
TRUE);
7880 }
7881<PrototypeQual>{B}*"="{B}*"0"{B}* {
7882 yyextra->current->args += " = 0";
7883 yyextra->current->virt = Specifier::Pure;
7884 yyextra->current->argList.setPureSpecifier(
TRUE);
7885 }
7886<PrototypeQual>"throw"{B}*"(" {
7887 yyextra->current->exception = "throw(";
7888 BEGIN(PrototypeExc);
7889 }
7890<PrototypeExc>")" {
7891 yyextra->current->exception += ')';
7892 BEGIN(PrototypeQual);
7893 }
7894<PrototypeExc>. {
7895 yyextra->current->exception += *yytext;
7896 }
7897<PrototypeQual>. {
7898 yyextra->current->args += *yytext;
7899 }
7900<Prototype>. {
7901 yyextra->current->name += *yytext;
7902 }
7903<PrototypeSkipLine>. {
7904 }
7905
7906
7907
7908
7909<SkipCxxComment>.*"\\\n" { // line continuation
7910 if (yyextra->insideCS)
7911 {
7912 REJECT;
7913 }
7914 else
7915 {
7917 }
7918 }
7919<SkipCxxComment>{ANYopt}/\n {
7920 BEGIN( yyextra->lastCContext ) ;
7921 }
7922<SkipComment>[^\*\n]+
7923
7924
7925
7926<*>"[[" { // C++11 attribute
7927 if (!yyextra->insideCpp) REJECT;
7928 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7929 yyextra->lastC11AttributeContext = YY_START;
7930 BEGIN( SkipC11Attribute );
7931 }
7932
7933<*>\n { lineCount(yyscanner); }
7934<*>\" {
7935 if (yyextra->insideIDL && yyextra->insideCppQuote)
7936 {
7937 BEGIN(EndCppQuote);
7938 }
7939 else if (yyextra->insidePHP)
7940 {
7941 yyextra->lastStringContext=YY_START;
7942 BEGIN(SkipString);
7943 }
7944 }
7945<*>^{B}*"#" {
7946 if (!yyextra->insidePHP)
7947 {
7948 yyextra->lastCPPContext = YY_START;
7949 BEGIN( SkipCPP ) ;
7950 }
7951 else
7952 {
7953 yyextra->lastCContext = YY_START ;
7954 BEGIN( SkipCxxComment ) ;
7955 }
7956 }
7957<*>"#" {
7958 if (!yyextra->insidePHP)
7959 REJECT;
7960 yyextra->lastCContext = YY_START ;
7961 BEGIN( SkipCxxComment ) ;
7962 }
7963<*>\' {
7964 if (yyextra->insidePHP)
7965 {
7966 yyextra->lastStringContext=YY_START;
7967 BEGIN(SkipPHPString);
7968 }
7969 }
7970<*>\? {
7971 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
7972 {
7973 if (yyextra->current->type.isEmpty())
7974 {
7975 if (yyextra->current->name.isEmpty())
7976 yyextra->current->name="?";
7977 else
7978 yyextra->current->name+="?";
7979 }
7980 else
7981 {
7982 yyextra->current->type+="?";
7983 }
7984 }
7985 }
7986<*>"}" { yyextra->exported=false; }
7987<*>.
7988<SkipComment>{CPPC}|{CCS}
7989<*>{CCS} { yyextra->lastCContext = YY_START ;
7990 BEGIN( SkipComment ) ;
7991 }
7992<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
7993<*>{CPPC} {
7994 yyextra->lastCContext = YY_START ;
7995 BEGIN( SkipCxxComment ) ;
7996 }
7997<<EOF>> {
7998 if (yyextra->insideCS && yyextra->fakeNS)
7999 {
8000 yyextra->fakeNS--;
8001 unput('}');
8002 BEGIN ( ReadNSBody);
8003 }
8004 else
8005 {
8007 }
8008 }
8009%%