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