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