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}/("[["[^\]]*"]]"){BNopt}"(" {
1878 yyextra->current->name += yytext ;
1879 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1880 BEGIN( FindMembers ) ;
1881 }
1882<Operator>"("{BN}*")"{BNopt}/"(" {
1884 yyextra->current->name += yytext ;
1885 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1886 BEGIN( FindMembers ) ;
1887 }
1888<Operator>";" { // can occur when importing members
1889 unput(';');
1890 BEGIN( FindMembers ) ;
1891 }
1892<Operator>[^(] {
1894 yyextra->current->name += *yytext ;
1895 }
1896<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" { /* skip guided templ specifiers */
1897 if (!yyextra->current->type.startsWith("friend "))
1898 {
1899 yyextra->current->name += yytext;
1900 }
1901 }
1902<Operator>"(" {
1903 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1904 unput(*yytext);
1905 BEGIN( FindMembers ) ;
1906 }
1907<FindMembers>("template"|"generic")({BN}*)"<"/[>]? { // generic is a C++/CLI extension
1910 yyextra->current->tArgLists.
push_back(al);
1911 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1912 yyextra->templateStr="<";
1913 yyextra->fullArgString = yyextra->templateStr;
1914 yyextra->copyArgString = &yyextra->templateStr;
1915 yyextra->currentArgumentContext = FindMembers;
1916 BEGIN( ReadTempArgs );
1917 }
void push_back(const Argument &a)
1918<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
1919 if (yyextra->insideJava) REJECT;
1921 BEGIN( NSAliasName );
1922 }
1923<NSAliasName>{ID} {
1924 yyextra->aliasName = yytext;
1925 BEGIN( NSAliasArg );
1926 }
1927<NSAliasArg>({ID}"::")*{ID} {
1928
1929 std::string ctx = yyextra->current_root->name.str();
1930 if (ctx.empty())
1931 {
1933 }
1934 else
1935 {
1937 }
1938 }
static NamespaceAliasInfoMap namespaceAliasMap
1939<NSAliasArg>";" {
1940 BEGIN( FindMembers );
1941 }
1942<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1944 yyextra->aliasName=yytext;
1945 BEGIN(PHPUseAs);
1946 }
1947<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1950
1951 yyextra->current->fileName = yyextra->fileName;
1952
1953 yyextra->current->section = EntryType::makeUsingDecl();
1954 yyextra->current_root->copyToSubEntry(yyextra->current);
1955
1956 yyextra->current->section = EntryType::makeUsingDir();
1957 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1959 yyextra->aliasName.clear();
1960 }
QCString removeRedundantWhiteSpace(const QCString &s)
1961<PHPUseAs>{BN}+"as"{BN}+ {
1963 }
1964<PHPUseAs>{PHPUSEKW} {
1965 }
1966<PHPUseAs>{ID} {
1967
1968 if (!yyextra->aliasName.isEmpty())
1969 {
1972 }
1973 yyextra->aliasName.clear();
1974 }
1975<PHPUse,PHPUseAs>[,;] {
1976 if (*yytext==',')
1977 {
1978 BEGIN(PHPUse);
1979 }
1980 else
1981 {
1982 BEGIN(FindMembers);
1983 }
1984 }
1985<JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
1989 yyextra->current->fileName = yyextra->fileName;
1990 bool ambig = false;
1992 if (incFd)
1993 {
1995 }
1996 yyextra->current->section = EntryType::makeUsingDir();
1997 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1999 BEGIN(Using);
2000 }
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)
2001<JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
2005 yyextra->current->fileName = yyextra->fileName;
2006 bool ambig = false;
2009 if (fromFd)
2010 {
2012 }
2013 if (toFd && fromFd)
2014 {
2016 }
2017 if (yyextra->insideD)
2018 {
2019 yyextra->current->section = EntryType::makeUsingDir();
2020 }
2021 else
2022 {
2023
2024 yyextra->current->section = EntryType::makeUsingDecl();
2025 }
2026 yyextra->previous = yyextra->current;
2027 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2029 BEGIN(Using);
2030 }
virtual void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual const QCString & docName() const =0
2031<IDLImport>"\""[^"]*"\"" {
2032 QCString fileName(&yytext[1],yyleng-2);
2033 bool ambig = false;
2036 if (fromFd)
2037 {
2039 }
2040 if (toFd && fromFd)
2041 {
2043 }
2044 }
2045<IDLImport>";" {
2046 BEGIN(FindMembers);
2047 }
2048<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2049 if (yyextra->insideJava) REJECT;
2050 yyextra->current->startLine=yyextra->yyLineNr;
2051 yyextra->current->startColumn = yyextra->yyColNr;
2053 BEGIN(Using);
2054 }
2055<Using>"namespace"{BN}+ { lineCount(yyscanner); BEGIN(UsingDirective); }
2056<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2058 yyextra->current->name=yytext;
2059 yyextra->current->fileName = yyextra->fileName;
2060 yyextra->current->section = EntryType::makeUsingDecl();
2061 yyextra->current->startLine = yyextra->yyLineNr;
2062 yyextra->previous = yyextra->current;
2063 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2065 if (yyextra->insideCS)
2066
2067
2068
2069 {
2070 yyextra->current->name=yytext;
2071 yyextra->current->fileName = yyextra->fileName;
2072 yyextra->current->startLine = yyextra->yyLineNr;
2073 yyextra->current->startColumn = yyextra->yyColNr;
2074 yyextra->current->section = EntryType::makeUsingDir();
2075 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2077 }
2078 BEGIN(Using);
2079 }
2080<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" { // C++11 style using alias
2082 yyextra->current->fileName = yyextra->fileName;
2083 yyextra->current->section = EntryType::makeUsingDecl();
2084 yyextra->current->startLine = yyextra->yyLineNr;
2085 yyextra->current->bodyLine = yyextra->yyLineNr;
2086 yyextra->current->bodyColumn = yyextra->yyColNr;
2087 yyextra->lastInitializerContext = UsingAlias;
2088 yyextra->sharpCount=0;
2089 yyextra->initBracketCount=0;
2091 BEGIN(ReadInitializer);
2092 }
2093<UsingAlias>";" {
2094 yyextra->current->section = EntryType::makeVariable();
2096 init.stripPrefix(
"class ");
2097 init.stripPrefix(
"struct ");
2099 yyextra->current->type =
"typedef "+
init;
2100 yyextra->current->args.clear();
2101 yyextra->current->spec.setAlias(true);
2102 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2104 BEGIN(FindMembers);
2105 }
2106<UsingAlias>. {
2107 yyextra->current->initializer << yytext;
2108 }
2109<UsingAlias>\n {
2110 yyextra->current->initializer << yytext;
2112 }
2113<UsingDirective>{SCOPENAME} { yyextra->current->name=removeRedundantWhiteSpace(yytext);
2114 yyextra->current->fileName = yyextra->fileName;
2115 yyextra->current->section = EntryType::makeUsingDir();
2116 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2118 BEGIN(Using);
2119 }
2120<Using>";" { BEGIN(FindMembers); }
2121<FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl
2125 }
2126<FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
2128 if (yyextra->insideCpp && name=="import") REJECT;
2129 yyextra->roundCount=0;
2130 yyextra->sharpCount=0;
2133 yyextra->current->name=name;
2134
2135
2137 BEGIN( Operator );
2138 else
2139 BEGIN( EndTemplate );
2140 }
static bool nameIsOperator(QCString &name)
2141<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2142 yyextra->sharpCount=0;
2143 yyextra->roundCount=0;
2146
2147
2149 BEGIN( Operator );
2150 else
2151 BEGIN( EndTemplate );
2152 }
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...
2153<EndTemplate>"<<<" {
2154 if (!yyextra->insidePHP)
2155 {
2156 REJECT;
2157 }
2158 else
2159 {
2160 yyextra->lastHereDocContext = YY_START;
2161 BEGIN(HereDoc);
2162 }
2163 }
2164<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2165 yyextra->current->name+=yytext;
2166
2167 }
2168<EndTemplate>"<" {
2169 if (yyextra->roundCount==0)
2170 {
2171
2172 yyextra->sharpCount++;
2173 }
2174 yyextra->current->name+=yytext;
2175 }
2176<ClassTemplSpec,EndTemplate>">=" {
2177 yyextra->current->name+=yytext;
2178 }
2179<ClassTemplSpec,EndTemplate>(">>") {
2180 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2181 {
2182 unput('>');
2183 unput(' ');
2184 unput('>');
2185 }
2186 else
2187 {
2188 yyextra->current->name+=yytext;
2189 }
2190
2191 }
2192<EndTemplate>">" {
2193 yyextra->current->name+='>';
2194
2195 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2196 {
2197 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2198
2199 BEGIN(FindMembers);
2200 }
2201 }
2202<EndTemplate>">"{BN}*"(" {
2204 yyextra->current->name+='>';
2205
2206 if (yyextra->roundCount==0)
2207 {
2208 --yyextra->sharpCount;
2209 }
2210 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2211 {
2212 yyextra->current->bodyLine = yyextra->yyLineNr;
2213 yyextra->current->bodyColumn = yyextra->yyColNr;
2214 yyextra->current->args = "(";
2215 yyextra->currentArgumentContext = FuncQual;
2216 yyextra->fullArgString = yyextra->current->args;
2217 yyextra->copyArgString = &yyextra->current->args;
2218
2219 BEGIN( ReadFuncArgType ) ;
2220 }
2221 else
2222 {
2223 yyextra->current->name+="(";
2224 yyextra->roundCount++;
2225 }
2226 }
2227<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
2229 yyextra->current->name+='>';
2230 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2231 {
2232 BEGIN(FindMembers);
2233 }
2234 }
2235<EndTemplate>">"{BNopt}/"::" {
2237 yyextra->current->name+='>';
2238
2239 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2240 {
2241 BEGIN(FindMemberName);
2242 }
2243 }
2244<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2245 yyextra->roundCount++;
2246 }
2247<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2248 if (yyextra->roundCount>0) yyextra->roundCount--;
2249 }
2250<EndTemplate>. {
2251 yyextra->current->name+=*yytext;
2252
2253 }
2254<FindMembers>"define"{BN}*"("{BN}*["'] {
2255 if (yyextra->insidePHP)
2256 {
2257 yyextra->current->bodyLine = yyextra->yyLineNr;
2258 yyextra->current->bodyColumn = yyextra->yyColNr;
2259 BEGIN( DefinePHP );
2260 }
2261 else
2262 REJECT;
2263 }
2264<CopyHereDoc>{ID} { // PHP heredoc
2265 yyextra->delimiter = yytext;
2266 *yyextra->pCopyHereDocGString << yytext;
2267 BEGIN(CopyHereDocEnd);
2268 }
2269<CopyHereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2270 yyextra->delimiter = &yytext[1];
2271 *yyextra->pCopyHereDocGString << yytext;
2272 BEGIN(CopyHereDocEnd);
2273 }
2274<CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
2275 yyextra->delimiter = &yytext[1];
2276 *yyextra->pCopyHereDocGString << yytext;
2277 BEGIN(CopyHereDocEnd);
2278 }
2279<HereDoc>{ID} { // PHP heredoc
2280 yyextra->delimiter = yytext;
2281 BEGIN(HereDocEnd);
2282 }
2283<HereDoc>"\""{ID}/"\"" { // PHP quoted heredoc
2284 yyextra->delimiter = &yytext[1];
2285 BEGIN(HereDocEnd);
2286 }
2287<HereDoc>"'"{ID}/"'" { // PHP nowdoc
2288 yyextra->delimiter = &yytext[1];
2289 BEGIN(HereDocEnd);
2290 }
2291<HereDocEnd>^{Bopt}{ID} { // id at start of the line could mark the end of the block
2293 {
2294 BEGIN(yyextra->lastHereDocContext);
2295 }
2296 }
2297<HereDocEnd>. { }
2298<CopyHereDocEnd>^{Bopt}{ID} { // id at start of the line could mark the end of the block
2299 *yyextra->pCopyHereDocGString << yytext;
2301 {
2302 BEGIN(yyextra->lastHereDocContext);
2303 }
2304 }
2305<CopyHereDocEnd>\n {
2307 *yyextra->pCopyHereDocGString << yytext;
2308 }
2309<CopyHereDocEnd>{ID} {
2310 *yyextra->pCopyHereDocGString << yytext;
2311 }
2312<CopyHereDocEnd>. {
2313 *yyextra->pCopyHereDocGString << yytext;
2314 }
2315<FindMembers>"Q_OBJECT"|"Q_GADGET" { // Qt object / gadget macro
2316 }
2317<FindMembers>"Q_PROPERTY" { // Qt property declaration
2318 yyextra->yyBegLineNr = yyextra->yyLineNr;
2319 yyextra->yyBegColNr = yyextra->yyColNr;
2320 yyextra->current->protection = Protection::Public ;
2321 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2322 yyextra->current->type.clear();
2323 BEGIN(QtPropType);
2324 }
2325<QtPropType>"(" { // start of property arguments
2326 }
2327<QtPropAttr>")" { // end of property arguments
2328 unput(';');
2329 BEGIN(FindMembers);
2330 }
2331<QtPropType>{BN}+ {
2332 yyextra->current->name+=yytext;
2333 }
2334<QtPropType>"*" {
2335 yyextra->current->type+= yyextra->current->name;
2336 yyextra->current->type+= yytext;
2337 yyextra->current->name="";
2338 }
2339<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2340 yyextra->current->type+= yyextra->current->name;
2341 yyextra->current->name=yytext;
2342 }
2343<QtPropType,QtPropAttr>{BN}+"READ"{BN}+ {
2344 yyextra->current->spec.setReadable(true);
2345 BEGIN(QtPropRead);
2346 }
2347<QtPropType,QtPropAttr>{BN}+"WRITE"{BN}+ {
2348 yyextra->current->spec.setWritable(true);
2349 BEGIN(QtPropWrite);
2350 }
2351<QtPropType,QtPropAttr>{BN}+"MEMBER"{BN}+{ID} | // member property => not supported yet
2352<QtPropType,QtPropAttr>{BN}+"RESET"{BN}+{ID} | // reset method => not supported yet
2353<QtPropType,QtPropAttr>{BN}+"SCRIPTABLE"{BN}+{ID} | // scriptable property => not supported yet
2354<QtPropType,QtPropAttr>{BN}+"DESIGNABLE"{BN}+{ID} | // designable property => not supported yet
2355<QtPropType,QtPropAttr>{BN}+"NOTIFY"{BN}+{ID} | // notify property => not supported yet
2356<QtPropType,QtPropAttr>{BN}+"REVISION"{BN}+{ID} | // revision property => not supported yet
2357<QtPropType,QtPropAttr>{BN}+"STORED"{BN}+{ID} | // stored property => not supported yet
2358<QtPropType,QtPropAttr>{BN}+"USER"{BN}+{ID} | // user property => not supported yet
2359<QtPropType,QtPropAttr>{BN}+"CONSTANT"{BN} | // constant property => not supported yet
2360<QtPropType,QtPropAttr>{BN}+"FINAL"{BN} { // final property => not supported yet
2361 BEGIN(QtPropAttr);
2362 }
2363<QtPropRead>{ID} {
2364 yyextra->current->read = yytext;
2365 BEGIN(QtPropAttr);
2366 }
2367<QtPropWrite>{ID} {
2368 yyextra->current->write = yytext;
2369 BEGIN(QtPropAttr);
2370 }
2371<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2372 yyextra->current->name=yytext;
2374 BEGIN(FindMembers);
2375 }
2376<FindMembers>"requires" { // C++20 requires clause
2377 if (yyextra->insideJava) REJECT;
2378 yyextra->current->req.clear();
2379 yyextra->requiresContext = YY_START;
2380 BEGIN(RequiresClause);
2381 }
2382<RequiresClause>"requires"{BN}*/"{" { // requires requires { ... }
2383 if (yyextra->insideJava) REJECT;
2385 yyextra->current->req+=yytext;
2386 BEGIN( RequiresExpression ) ;
2387 }
2388<RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
2389 if (yyextra->insideJava) REJECT;
2391 yyextra->current->req+=yytext;
2392 yyextra->lastRoundContext=RequiresExpression;
2393 yyextra->pCopyRoundString=&yyextra->current->req;
2394 yyextra->roundCount=0;
2395 BEGIN( CopyRound ) ;
2396 }
2397<RequiresExpression>"{" {
2398 yyextra->current->req+=yytext;
2399 yyextra->lastCurlyContext=RequiresClause;
2400 yyextra->pCopyCurlyString=&yyextra->current->req;
2401 yyextra->curlyCount=0;
2402 BEGIN( CopyCurly ) ;
2403 }
2404<RequiresExpression>\n {
2405 yyextra->current->req+=' ';
2407 }
2408<RequiresExpression>. {
2409 yyextra->current->req+=yytext;
2410 }
2411<RequiresClause>"(" { // requires "(A && B)"
2412 yyextra->current->req+=yytext;
2413 yyextra->lastRoundContext=RequiresClause;
2414 yyextra->pCopyRoundString=&yyextra->current->req;
2415 yyextra->roundCount=0;
2416 BEGIN( CopyRound ) ;
2417 }
2418<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" { // "requires func(x)"
2420 {
2422 yyextra->current->req+=yytext;
2423 yyextra->lastRoundContext=RequiresClause;
2424 yyextra->pCopyRoundString=&yyextra->current->req;
2425 yyextra->roundCount=0;
2426 BEGIN( CopyRound );
2427 }
2428 else
2429 {
2430 REJECT;
2431 }
2432 }
static bool startOfRequiresExpression(const QCString &req)
2433<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
2435 {
2437 yyextra->current->req+=yytext;
2438 yyextra->lastSharpContext=RequiresClause;
2439 yyextra->pCopySharpString=&yyextra->current->req;
2440 yyextra->sharpCount=0;
2441 BEGIN( CopySharp );
2442 }
2443 else
2444 {
2445 REJECT
2446 }
2447 }
2448<RequiresClause>{NOTopt}{SCOPENAME} { // something like "requires true" or "requires !my::value"
2450 {
2452 yyextra->current->req=yytext;
2453 BEGIN(yyextra->requiresContext);
2454 }
2455 else
2456 {
2457 REJECT;
2458 }
2459 }
2460<RequiresClause>{NOTopt}"::"{ID} {
2462 yyextra->current->req+=yytext;
2463 }
2464<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) { // "requires A || B" or "requires A && B"
2466 yyextra->current->req+=yytext;
2467 }
2468<RequiresClause>{BN}+ {
2469 yyextra->current->req+=' ';
2471 }
2472<RequiresClause>. {
2473 unput(*yytext);
2474 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2475 BEGIN(yyextra->requiresContext);
2476 }
2477<FindMembers,FindMemberName>{SCOPENAME} {
2479 yyextra->yyBegColNr=yyextra->yyColNr;
2480 yyextra->yyBegLineNr=yyextra->yyLineNr;
2482 if (yyextra->insideIDL && yyleng==9 &&
qstrcmp(yytext,
"cpp_quote")==0)
2483 {
2484 BEGIN(CppQuote);
2485 }
2486 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
qstrcmp(yytext,
"import")==0)
2487 {
2488 if (yyextra->insideIDL)
2489 BEGIN(IDLImport);
2490 else
2491 BEGIN(JavaImport);
2492 }
2493 else if (yyextra->insidePHP &&
qstrcmp(yytext,
"use")==0)
2494 {
2495 BEGIN(PHPUse);
2496 }
2497 else if (yyextra->insideJava &&
qstrcmp(yytext,
"package")==0)
2498 {
2500 BEGIN(PackageName);
2501 }
2502 else if (yyextra->insideIDL &&
qstrcmp(yytext,
"case")==0)
2503 {
2504 BEGIN(IDLUnionCase);
2505 }
2506 else if (yyextra->insideTryBlock &&
qstrcmp(yytext,
"catch")==0)
2507 {
2508 yyextra->insideTryBlock=
FALSE;
2509 BEGIN(TryFunctionBlock);
2510 }
2511 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"alignas")==0)
2512 {
2513 yyextra->lastAlignAsContext = YY_START;
2514 BEGIN(AlignAs);
2515 }
2516 else if (yyextra->insideJS &&
qstrcmp(yytext,
"var")==0)
2517 {
2518 yyextra->current->type="var";
2519 }
2520 else if (yyextra->insideJS &&
qstrcmp(yytext,
"function")==0)
2521 {
2522 yyextra->current->type="function";
2523 }
2524 else if (yyextra->insideCS &&
qstrcmp(yytext,
"this")==0)
2525 {
2526
2528 yyextra->current->name="this";
2529 BEGIN(CSIndexer);
2530 }
2531 else if (yyextra->insideCpp && (
qstrcmp(yytext,
"static_assert")==0 ||
qstrcmp(yytext,
"_Static_assert")==0))
2532 {
2533
2534 BEGIN(StaticAssert);
2535 }
2536 else if (yyextra->insideCpp &&
qstrcmp(yytext,
"decltype")==0)
2537 {
2538
2540 if (!yyextra->current->type.isEmpty()) yyextra->current->type+=' ';
2541 yyextra->current->type+=yytext;
2542 BEGIN(DeclType);
2543 }
2544 else if (yyextra->insideSlice &&
qstrcmp(yytext,
"optional")==0)
2545 {
2546 if (yyextra->current->type.isEmpty())
2547 {
2548 yyextra->current->type = "optional";
2549 }
2550 else
2551 {
2552 yyextra->current->type += " optional";
2553 }
2554 yyextra->lastModifierContext = YY_START;
2555 BEGIN(SliceOptional);
2556 }
2557 else
2558 {
2559 if (YY_START==FindMembers)
2560 {
2562 }
2563 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2564 if (javaLike &&
qstrcmp(yytext,
"public")==0)
2565 {
2566 yyextra->current->protection = Protection::Public;
2567 }
2568 else if (javaLike &&
qstrcmp(yytext,
"protected")==0)
2569 {
2570 yyextra->current->protection = Protection::Protected;
2571 }
2572 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
qstrcmp(yytext,
"internal")==0)
2573 {
2574 yyextra->current->protection = Protection::Package;
2575 }
2576 else if (javaLike &&
qstrcmp(yytext,
"private")==0)
2577 {
2578 yyextra->current->protection = Protection::Private;
2579 }
2580 else if (javaLike &&
qstrcmp(yytext,
"static")==0)
2581 {
2582 if (YY_START==FindMembers)
2583 yyextra->current->name = yytext;
2584 else
2585 yyextra->current->name += yytext;
2586 yyextra->current->isStatic =
TRUE;
2587 }
2588 else
2589 {
2590 if (YY_START==FindMembers)
2591 yyextra->current->name = yytext;
2592 else
2593 yyextra->current->name += yytext;
2594 if (yyextra->current->name.startsWith("static "))
2595 {
2596 yyextra->current->isStatic =
TRUE;
2597 yyextra->current->name= yyextra->current->name.mid(7);
2598 }
2599 else if (yyextra->current->name.startsWith("inline "))
2600 {
2601 if (yyextra->current->type.isEmpty())
2602 {
2603 yyextra->current->type="inline";
2604 }
2605 else
2606 {
2607 yyextra->current->type+="inline ";
2608 }
2609 yyextra->current->name= yyextra->current->name.mid(7);
2610 }
2611 else if (yyextra->current->name.startsWith("constexpr "))
2612 {
2613 if (yyextra->current->type.isEmpty())
2614 {
2615 yyextra->current->type="constexpr";
2616 }
2617 else
2618 {
2619 yyextra->current->type+="constexpr ";
2620 }
2621 yyextra->current->name=yyextra->current->name.mid(10);
2622 }
2623 else if (yyextra->current->name.startsWith("consteval "))
2624 {
2625 if (yyextra->current->type.isEmpty())
2626 {
2627 yyextra->current->type="consteval";
2628 }
2629 else
2630 {
2631 yyextra->current->type+="consteval ";
2632 }
2633 yyextra->current->name=yyextra->current->name.mid(10);
2634 }
2635 else if (yyextra->current->name.startsWith("constinit "))
2636 {
2637 if (yyextra->current->type.isEmpty())
2638 {
2639 yyextra->current->type="constinit";
2640 }
2641 else
2642 {
2643 yyextra->current->type+="constinit ";
2644 }
2645 yyextra->current->name=yyextra->current->name.mid(10);
2646 }
2647 else if (yyextra->current->name.startsWith("const "))
2648 {
2649 if (yyextra->current->type.isEmpty())
2650 {
2651 yyextra->current->type="const";
2652 }
2653 else
2654 {
2655 yyextra->current->type+="const ";
2656 }
2657 yyextra->current->name=yyextra->current->name.mid(6);
2658 }
2659 else if (yyextra->current->name.startsWith("volatile "))
2660 {
2661 if (yyextra->current->type.isEmpty())
2662 {
2663 yyextra->current->type="volatile";
2664 }
2665 else
2666 {
2667 yyextra->current->type+="volatile ";
2668 }
2669 yyextra->current->name=yyextra->current->name.mid(9);
2670 }
2671 else if (yyextra->current->name.startsWith("typedef "))
2672 {
2673 if (yyextra->current->type.isEmpty())
2674 {
2675 yyextra->current->type="typedef";
2676 }
2677 else
2678 {
2679 yyextra->current->type+="typedef ";
2680 }
2681 yyextra->current->name=yyextra->current->name.mid(8);
2682 }
2683 }
2686 {
2687 BEGIN( Operator );
2688 }
2689 else
2690 {
2691 yyextra->externLinkage=
FALSE;
2692 BEGIN(FindMembers);
2693 }
2694 }
2695 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2696 }
2697<StaticAssert>"(" {
2698 yyextra->lastSkipRoundContext = FindMembers;
2699 yyextra->roundCount=0;
2700 BEGIN(SkipRound);
2701 }
2702<StaticAssert>{BN}+ { lineCount(yyscanner); }
2703<StaticAssert>. { // variable with static_assert as name?
2704 unput(*yytext);
2705 BEGIN(FindMembers);
2706 }
2707<DeclType>"(" {
2708 yyextra->current->type+=yytext;
2709 yyextra->lastRoundContext=FindMembers;
2710 yyextra->pCopyRoundString=&yyextra->current->type;
2711 yyextra->roundCount=0;
2712 BEGIN(CopyRound);
2713 }
2714<DeclType>{BN}+ { lineCount(yyscanner); }
2715<DeclType>. {
2716 unput(*yytext);
2717 BEGIN(FindMembers);
2718 }
2719<CSIndexer>"["[^\n\]]*"]" {
2721 BEGIN(FindMembers);
2722 }
2723<FindMembers>[0-9]{ID} { // some number where we did not expect one
2724 }
2725<FindMembers>"." {
2726 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2727 {
2728 yyextra->current->name+=".";
2729 }
2730 }
2731<FindMembers>"::" {
2732 yyextra->current->name+=yytext;
2733 }
2734<CppQuote>"("{B}*"\"" {
2735 yyextra->insideCppQuote=
TRUE;
2736 BEGIN(FindMembers);
2737 }
2738<IDLUnionCase>"::"
2739<IDLUnionCase>":" { BEGIN(FindMembers); }
2740<IDLUnionCase>\n { lineCount(yyscanner); }
2741<IDLUnionCase>.
2742<TryFunctionBlock>\n { lineCount(yyscanner); }
2743<TryFunctionBlock>"{" {
2744 yyextra->curlyCount=0;
2745 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2746 BEGIN( SkipCurly );
2747 }
2748<TryFunctionBlock>.
2749<TryFunctionBlockEnd>{BN}*"catch" { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
2750 }
2751<TryFunctionBlockEnd>\n { unput(*yytext); // rule added to fix bug id 601138
2752 BEGIN( FindMembers );
2753 }
2754<TryFunctionBlockEnd>. { unput(*yytext);
2755 BEGIN( FindMembers );
2756 }
2757<EndCppQuote>")" {
2758 yyextra->insideCppQuote=
FALSE;
2759 BEGIN(FindMembers);
2760 }
2761<FindConceptParts>[^\/\n]* {
2762 yyextra->current->initializer << yytext;
2763 }
2764<FindConceptParts>. {
2765 yyextra->current->initializer << yytext;
2766 }
2767<FindConceptParts>\n {
2768 yyextra->current->initializer << yytext;
2769 yyextra->yyLineNr++;
2770 }
2771<FindConceptParts>{CCS} {
2772 yyextra->current->initializer << yytext;
2773 }
2774<FindConceptParts>{CPPC} {
2775 yyextra->current->initializer << yytext;
2776 }
2777<FindConceptParts>^[ \t]*{CCS}[!*] { // start of a special comment inside Concept definition
2779 int indent = text.
find(
'/');
2780
2781 if (!yyextra->current->initializer.empty())
2782 {
2783 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2785 }
2786 yyextra->current->section = EntryType::makeConceptDocPart();
2787 yyextra->current->startLine = yyextra->yyLineNr;
2788 yyextra->current->startColumn = indent;
2789 yyextra->current->initializer.clear();
2790 BEGIN(FindConceptDocs);
2791 }
2792<FindConceptParts>^[ \t]*{CPPC}[!/].*\n {
2793 if (!yyextra->current->initializer.empty())
2794 {
2795 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2797 }
2799 int indent = line.find('/');
2800 yyextra->current->section = EntryType::makeConceptDocPart();
2801 yyextra->current->startLine = yyextra->yyLineNr;
2802 yyextra->current->startColumn = indent;
2803 yyextra->current->initializer.clear();
2804 yyextra->current->initializer << line.mid(indent+3);
2805 yyextra->yyLineNr++;
2806 BEGIN(FindConceptCxxDocs);
2807 }
2808<FindConceptCxxDocs>^[ \t]*{CPPC}.*\n {
2810 int p = line.find('/');
2811 if (line.at(p+2)=='!' || line.at(p+2)=='/') p++;
2812 yyextra->current->initializer << line.mid(p+2);
2813 yyextra->yyLineNr++;
2814 }
2815<FindConceptCxxDocs>{CCS}|{CCE}|{CPPC} {
2816 yyextra->current->initializer << yytext;
2817 }
2818<FindConceptCxxDocs>. {
2819 if (!yyextra->current->initializer.empty())
2820 {
2821
2823 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2825 }
2826 unput(*yytext);
2827 yyextra->current->section = EntryType::makeConceptCodePart();
2828 yyextra->current->startLine = yyextra->yyLineNr;
2829 BEGIN(FindConceptParts);
2830 }
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
2831<FindConceptDocs>^[ \t]*"*"+/[^/] { // skip leading indentation
2832 }
2833<FindConceptDocs>[^\*\n]+ {
2834 yyextra->current->initializer << yytext;
2835 }
2836<FindConceptDocs>\n {
2837 yyextra->current->initializer << yytext;
2838 yyextra->yyLineNr++;
2839 }
2840<FindConceptDocs>"*"*{CCE}[ t]*\n? {
2841 if (!yyextra->current->initializer.empty())
2842 {
2843
2845 yyextra->current->section = EntryType::makeConceptDocPart();
2846 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2848 }
2850 yyextra->current->section = EntryType::makeConceptCodePart();
2851 yyextra->current->startLine = yyextra->yyLineNr;
2852 BEGIN(FindConceptParts);
2853 }
2854<FindConceptDocs>"*"*{CCE} {
2855 if (!yyextra->current->initializer.empty())
2856 {
2857
2859 yyextra->current->section = EntryType::makeConceptDocPart();
2860 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2862 }
2863 yyextra->current->section = EntryType::makeConceptCodePart();
2864 yyextra->current->startLine = yyextra->yyLineNr;
2865 BEGIN(FindConceptParts);
2866 }
2867<FindConceptParts><<EOF>> {
2868 if (!yyextra->current->initializer.empty())
2869 {
2870 if (!yyextra->current->section.isConceptCodePart())
2871 {
2872 yyextra->current->section = EntryType::makeConceptDocPart();
2873 }
2874 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2876 }
2878 }
2879<FindMembers,FindFields>{B}*"#" { if (yyextra->insidePHP)
2880 REJECT;
2881 yyextra->lastCPPContext = YY_START;
2882 BEGIN( SkipCPP ) ;
2883 }
2884<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2885<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2886 if (yyextra->insidePHP)
2887 REJECT;
2888 yyextra->current->bodyLine = yyextra->yyLineNr;
2889 yyextra->current->bodyColumn = yyextra->yyColNr;
2890 yyextra->current->fileName = yyextra->fileName;
2891 yyextra->current->startLine = yyextra->yyLineNr;
2892 yyextra->current->startColumn = yyextra->yyColNr;
2893 yyextra->current->type.clear();
2894 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2895 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2896 yyextra->current->section = EntryType::makeDefine();
2897 yyextra->lastDefineContext = YY_START;
2898 BEGIN( SDefine );
2899 }
2900<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
2901 yyextra->yyLineNr = atoi(&yytext[1]);
2902
2903 yyextra->lastPreLineCtrlContext = YY_START;
2904 if (YY_START==ReadBody ||
2905 YY_START==ReadNSBody ||
2906 YY_START==ReadBodyIntf)
2907 {
2908 yyextra->current->program << yytext;
2909 }
2910 BEGIN( PreLineCtrl );
2911 }
2912<PreLineCtrl>"\""[^\n\"]*"\"" {
2914 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2915 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2916 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2917 {
2918 yyextra->current->program << yytext;
2919 }
2920 }
static QCString stripQuotes(const char *s)
2921<PreLineCtrl>. {
2922 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2923 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2924 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2925 {
2926 yyextra->current->program << yytext;
2927 }
2928 }
2929<PreLineCtrl>\n {
2930 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2931 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2932 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2933 {
2934 yyextra->current->program << yytext;
2935 }
2937 BEGIN( yyextra->lastPreLineCtrlContext );
2938 }
2939<SkipCPP>.
2940<SkipCPP>\\[\r]*"\n"[\r]* { lineCount(yyscanner); }
2941<SkipCPP>[\r]*\n[\r]* { lineCount(yyscanner);
2942 BEGIN( yyextra->lastCPPContext) ;
2943 }
2944<SDefine>{ID}{B}*"(" {
2945 yyextra->current->name = yytext;
2946 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2947 yyextra->current->args = "(";
2948 yyextra->current->bodyLine = yyextra->yyLineNr;
2949 yyextra->current->bodyColumn = yyextra->yyColNr;
2950 yyextra->currentArgumentContext = DefineEnd;
2951 yyextra->fullArgString=yyextra->current->args;
2952 yyextra->copyArgString=&yyextra->current->args;
2953 BEGIN( ReadFuncArgType ) ;
2954 }
2955
2956<DefineArg>")" {
2957
2958 yyextra->current->args += ')';
2959 BEGIN( DefineEnd );
2960 }
2961<DefineArg>. {
2962 yyextra->current->args += *yytext;
2963 }
2964 */
2965<SDefine>{ID} {
2966
2968 yyextra->current->bodyLine = yyextra->yyLineNr;
2969 yyextra->current->bodyColumn = yyextra->yyColNr;
2970 yyextra->current->name = yytext;
2971 BEGIN(DefineEnd);
2972 }
2973<DefineEnd><<EOF>> |
2974<DefineEnd>\n {
2975
2977 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2979 BEGIN(yyextra->lastDefineContext);
2980 }
2981<DefinePHPEnd>";" {
2982
2983 yyextra->current->fileName = yyextra->fileName;
2984 yyextra->current->startLine = yyextra->yyLineNr;
2985 yyextra->current->startColumn = yyextra->yyColNr;
2986 yyextra->current->type.clear();
2987 yyextra->current->type = "const";
2991 yyextra->current->initializer.str(
init.str());
2992 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2993 yyextra->current->section = EntryType::makeVariable();
2994 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2996 BEGIN(FindMembers);
2997 }
2998<DefinePHPEnd>.
2999<DefineEnd>\\[\r]?\n {
3001 yyextra->current->endBodyLine = yyextra->yyLineNr;
3002 }
3003<DefineEnd>\" {
3004 if (yyextra->insideIDL && yyextra->insideCppQuote)
3005 {
3006 BEGIN(EndCppQuote);
3007 }
3008 else
3009 {
3010 yyextra->lastStringContext=DefineEnd;
3011 BEGIN(SkipString);
3012 }
3013 }
3014<DefineEnd>.
3015<DefinePHP>{ID}["']{BN}*","{BN}* {
3016 yyextra->current->name = yytext;
3017 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3018 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3019 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
3020 yyextra->current->bodyLine = yyextra->yyLineNr;
3021 yyextra->current->bodyColumn = yyextra->yyColNr;
3022 yyextra->lastRoundContext = DefinePHPEnd;
3023 yyextra->pCopyRoundGString = &yyextra->current->initializer;
3024 yyextra->roundCount = 0;
3025 BEGIN( GCopyRound );
3026 }
3027
3028<FindMembers>[\^%] { // ^ and % are C++/CLI extensions
3029 if (yyextra->insideCli)
3030 {
3032 yyextra->current->name = yytext ;
3033 }
3034 else
3035 {
3036 REJECT;
3037 }
3038 }
3039<FindMembers>[*&]+ {
3040 yyextra->current->name += yytext ;
3042 }
3043<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
3044 if (YY_START==ReadInitializer && yyextra->keepComment)
3045 {
3046 REJECT;
3047 }
3048 else
3049 {
3050 if (yyextra->current->bodyLine==-1)
3051 {
3052 yyextra->current->bodyLine=yyextra->yyLineNr;
3053 yyextra->current->bodyColumn = yyextra->yyColNr;
3054 }
3055 yyextra->docBlockContext = YY_START;
3056 yyextra->docBlockInBody =
FALSE;
3057 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3059
3062 yyextra->docBlock.
str(indent.
str());
3063
static int computeIndent(const char *s, int startIndent)
3065
3066 yyextra->docBlockTerm = ';';
3067 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3068 {
3069 yyextra->current->bitfields = ":"+yyextra->current->args;
3070 yyextra->current->args.clear();
3071 yyextra->current->section = EntryType::makeVariable();
3072 }
3073 if (yytext[yyleng-3]=='/')
3074 {
3076 BEGIN( DocLine );
3077 }
3078 else
3079 {
3081 BEGIN( DocBlock );
3082 }
3083 }
3084 }
static void startCommentBlock(yyscan_t yyscanner, bool)
3085<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
3086 if (YY_START==ReadInitializer && yyextra->keepComment)
3087 {
3088 REJECT;
3089 }
3090 else
3091 {
3092 yyextra->docBlockContext = YY_START;
3093 yyextra->docBlockInBody =
FALSE;
3094 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3096
3099 yyextra->docBlock.
str(indent.
str());
3101
3102 yyextra->docBlockTerm = ',';
3103 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3104 {
3105 yyextra->current->bitfields = ":"+yyextra->current->args;
3106 yyextra->current->args.clear();
3107 yyextra->current->section = EntryType::makeVariable();
3108 }
3109 if (yytext[yyleng-3]=='/')
3110 {
3112 BEGIN( DocLine );
3113 }
3114 else
3115 {
3117 BEGIN( DocBlock );
3118 }
3119 }
3120 }
3121<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
3122 if (YY_START==ReadInitializer && yyextra->keepComment)
3123 {
3124 REJECT;
3125 }
3126 else
3127 {
3128 if (yyextra->current->bodyLine==-1)
3129 {
3130 yyextra->current->bodyLine=yyextra->yyLineNr;
3131 yyextra->current->bodyColumn = yyextra->yyColNr;
3132 }
3133 yyextra->docBlockContext = YY_START;
3134 yyextra->docBlockInBody =
FALSE;
3135 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3139 yyextra->docBlock.
str(indent.
str());
3141
3142 yyextra->docBlockTerm = 0;
3143 if (yytext[yyleng-3]=='/')
3144 {
3146 BEGIN( DocLine );
3147 }
3148 else
3149 {
3151 BEGIN( DocBlock );
3152 }
3153 }
3154 }
3155
3156<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
3157
3158 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3159 {
3160
3161 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3162 }
3163 else
3164 {
3165
3166 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3167 }
3168
3170 if (yytext[1]=='/')
3171 {
3172 if (yytext[2]=='!' || yytext[2]=='/')
3173 {
3174 yyextra->docBlockContext = YY_START;
3175 yyextra->docBlockInBody =
FALSE;
3176 yyextra->docBlockAutoBrief =
FALSE;
3177 yyextra->docBlock.str(std::string());
3178 yyextra->docBlockTerm = 0;
3180 BEGIN(DocLine);
3181 }
3182 else
3183 {
3184 yyextra->lastCContext=YY_START;
3185 BEGIN(SkipCxxComment);
3186 }
3187 }
3188 else
3189 {
3190 if (yytext[2]=='!' || yytext[2]=='*')
3191 {
3192 yyextra->docBlockContext = YY_START;
3193 yyextra->docBlockInBody =
FALSE;
3194 yyextra->docBlock.str(std::string());
3195 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3197 yyextra->docBlockTerm = 0;
3199 BEGIN(DocBlock);
3200 }
3201 else
3202 {
3203 yyextra->lastCContext=YY_START;
3204 BEGIN(SkipComment);
3205 }
3206 }
3207 }
3208<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3209 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3210 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3212 }
3213<FindMembers>"=>" {
3214 if (!yyextra->insideCS) REJECT;
3215 yyextra->current->bodyLine = yyextra->yyLineNr;
3216 yyextra->current->bodyColumn = yyextra->yyColNr;
3217 yyextra->current->initializer.str(yytext);
3218 yyextra->lastInitializerContext = YY_START;
3219 yyextra->sharpCount=0;
3220 yyextra->initBracketCount=0;
3221 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3222 yyextra->current->spec.setGettable(true);
3223 BEGIN(ReadInitializerPtr);
3224 }
3225<FindMembers>"=" { // in PHP code this could also be due to "<?="
3226 yyextra->current->bodyLine = yyextra->yyLineNr;
3227 yyextra->current->bodyColumn = yyextra->yyColNr;
3228 yyextra->current->initializer.str(" ");
3229 for (int ii = 2 ; ii < yyextra->yyColNr; ii++)
3230 yyextra->current->initializer << " ";
3231 yyextra->current->initializer << "=";
3232 yyextra->lastInitializerContext = YY_START;
3233 yyextra->sharpCount=0;
3234 yyextra->initBracketCount=0;
3235 BEGIN(ReadInitializer);
3236 }
3237<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3239 yyextra->current->exception += " ";
3241 }
3242<UNOIDLAttributeBlock>"}" {
3243 yyextra->current->exception += " }";
3244 BEGIN(FindMembers);
3245 }
3246
3247<ReadInitializer,ReadInitializerPtr>"(" {
3248 yyextra->lastRoundContext=YY_START;
3249 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3250 yyextra->roundCount=0;
3251 yyextra->current->initializer << *yytext;
3252 BEGIN(GCopyRound);
3253 }
3254<ReadInitializer,ReadInitializerPtr>"[" {
3255 if (!yyextra->insidePHP) REJECT;
3256 yyextra->lastSquareContext=YY_START;
3257 yyextra->pCopySquareGString=&yyextra->current->initializer;
3258 yyextra->squareCount=0;
3259 yyextra->current->initializer << *yytext;
3260 BEGIN(GCopySquare);
3261 }
3262<ReadInitializer,ReadInitializerPtr>"{" {
3263 yyextra->lastCurlyContext=YY_START;
3264 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3265 yyextra->curlyCount=0;
3266 yyextra->current->initializer << *yytext;
3267 BEGIN(GCopyCurly);
3268 }
3269<ReadInitializer,ReadInitializerPtr>[;,] {
3270
3271 if (*yytext==';' && yyextra->current_root->spec.isEnum())
3272 {
3273 yyextra->current->fileName = yyextra->fileName;
3274 yyextra->current->startLine = yyextra->yyLineNr;
3275 yyextra->current->startColumn = yyextra->yyColNr;
3276 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3277 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3278 yyextra->current->section = EntryType::makeVariable();
3279 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3281 BEGIN(FindMembers);
3282 }
3283 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && 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 if (*yytext==',' && yyextra->initBracketCount==0)
3290 {
3291 unput(*yytext);
3292 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3293 BEGIN(yyextra->lastInitializerContext);
3294 }
3295 else
3296 {
3297 yyextra->current->initializer << *yytext;
3298 }
3299 }
3300<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
3301 if (!yyextra->insideCpp)
3302 {
3303 REJECT;
3304 }
3305 else
3306 {
3307 yyextra->current->initializer << yytext;
3309 yyextra->lastRawStringContext = YY_START;
3310 yyextra->pCopyRawGString = &yyextra->current->initializer;
3311 BEGIN(RawGString);
3312
3313 }
3314 }
QCString extractBeginRawStringDelimiter(const char *rawStart)
3315<ReadInitializer>{CPPC}.* {
3316 if (yyextra->keepComment)
3317 {
3318 yyextra->current->initializer << yytext;
3319 }
3320 else
3321 {
3322 REJECT;
3323 }
3324 }
3325<ReadInitializer>{CCS} {
3326 if (yyextra->keepComment)
3327 {
3328 yyextra->current->initializer << yytext;
3329 BEGIN(InitCopyComment);
3330 }
3331 else
3332 {
3333 REJECT;
3334 }
3335 }
3336<InitCopyComment>{CCE} {
3337 yyextra->current->initializer << yytext;
3338 BEGIN(ReadInitializer);
3339 }
3340<InitCopyComment>\n {
3342 yyextra->current->initializer << yytext;
3343 }
3344<InitCopyComment>. {
3345 yyextra->current->initializer << yytext;
3346 }
3347<InitCopyComment><<EOF>> {
3348 warn(yyextra->fileName,yyextra->yyLineNr,
3349 "reached end of file while inside a C style comment block!");
3351 }
3352<RawGString>{RAWEND} {
3354 {
3355 *yyextra->pCopyRawGString << yytext;
3356 BEGIN(yyextra->lastRawStringContext);
3357 }
3358 else
3359 {
3360 REJECT;
3361 }
3362 }
QCString extractEndRawStringDelimiter(const char *rawEnd)
3363<RawGString>[^)\n]+ {
3364 *yyextra->pCopyRawGString << yytext;
3365 }
3366<RawGString>. {
3367 *yyextra->pCopyRawGString << yytext;
3368 }
3369<RawGString>\n {
3370 *yyextra->pCopyRawGString << yytext;
3372 }
3373<RawString>{RAWEND} {
3374 *yyextra->pCopyRawString+=yytext;
3375 yyextra->fullArgString+=yytext;
3377 {
3378 BEGIN(yyextra->lastRawStringContext);
3379 }
3380 }
3381<RawString>[^)]+ {
3382 *yyextra->pCopyRawString += yytext;
3383 yyextra->fullArgString+=yytext;
3384 }
3385<RawString>. {
3386 *yyextra->pCopyRawString += yytext;
3387 yyextra->fullArgString+=yytext;
3388 }
3389<RawString>\n {
3390 *yyextra->pCopyRawString += yytext;
3391 yyextra->fullArgString+=yytext;
3393 }
3394<ReadInitializer,ReadInitializerPtr>\" {
3395 if (yyextra->insideIDL && yyextra->insideCppQuote)
3396 {
3397 BEGIN(EndCppQuote);
3398 }
3399 else
3400 {
3401 yyextra->lastStringContext=YY_START;
3402 yyextra->current->initializer << yytext;
3403 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3404 yyextra->stopAtInvalidString=false;
3405 BEGIN(CopyGString);
3406 }
3407 }
3408<ReadInitializer,ReadInitializerPtr>"->" {
3409 yyextra->current->initializer << yytext;
3410 }
3411<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3412 yyextra->current->initializer << yytext;
3413 }
3414<ReadInitializer,ReadInitializerPtr>(">>") {
3415 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3416 {
3417
3418 yyextra->initBracketCount-=2;
3419 yyextra->sharpCount-=2;
3420 }
3421 yyextra->current->initializer << yytext;
3422 }
3423<ReadInitializer,ReadInitializerPtr>(">=") {
3424 yyextra->current->initializer << yytext;
3425 }
3426<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3427 yyextra->initBracketCount++;
3428 yyextra->sharpCount++;
3429 yyextra->current->initializer << *yytext;
3430 }
3431<ReadInitializer,ReadInitializerPtr>[>\]})] {
3432 yyextra->initBracketCount--;
3433 yyextra->sharpCount--;
3434 if (*yytext=='}')
3435 {
3436 yyextra->current->endBodyLine=yyextra->yyLineNr;
3437 }
3438 yyextra->current->initializer << *yytext;
3439 }
3440<ReadInitializer,ReadInitializerPtr>\' {
3441 if (yyextra->insidePHP)
3442 {
3443 yyextra->current->initializer << yytext;
3444 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3445 yyextra->lastStringContext=YY_START;
3446 BEGIN(CopyPHPGString);
3447 }
3448 else
3449 {
3450 yyextra->current->initializer << yytext;
3451 }
3452 }
3453<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3454 if (yyextra->insidePHP)
3455 {
3456 REJECT;
3457 }
3458 else
3459 {
3460 yyextra->current->initializer << yytext;
3461 }
3462 }
3463<ReadInitializer,ReadInitializerPtr>\n {
3464 yyextra->current->initializer << *yytext;
3466 }
3467<ReadInitializer,ReadInitializerPtr>"@\"" {
3468
3469 yyextra->current->initializer << yytext;
3470 if (!yyextra->insideCS && !yyextra->insideObjC)
3471 {
3472 REJECT;
3473 }
3474 else
3475 {
3476
3477 yyextra->lastSkipVerbStringContext=YY_START;
3478 yyextra->pSkipVerbString=&yyextra->current->initializer;
3479 BEGIN(SkipVerbString);
3480 }
3481 }
3482<SkipVerbString>[^\n"\\]+ {
3483 *yyextra->pSkipVerbString << yytext;
3484 }
3485<SkipVerbString>"\\\\" { // escaped backslash
3486 if (yyextra->insideCS) REJECT
3487 *yyextra->pSkipVerbString << yytext;
3488 }
3489<SkipVerbString>"\\\"" { // backslash escaped quote
3490 if (yyextra->insideCS) REJECT
3491 *yyextra->pSkipVerbString << yytext;
3492 }
3493<SkipVerbString>"\"\"" { // quote escape
3494 *yyextra->pSkipVerbString << yytext;
3495 }
3496<SkipVerbString>"\"" {
3497 *yyextra->pSkipVerbString << *yytext;
3498 BEGIN(yyextra->lastSkipVerbStringContext);
3499 }
3500<SkipVerbString>\n {
3501 *yyextra->pSkipVerbString << *yytext;
3503 }
3504<SkipVerbString>. {
3505 *yyextra->pSkipVerbString << *yytext;
3506 }
3507<ReadInitializer,ReadInitializerPtr>"?>" {
3508 if (yyextra->insidePHP)
3509 BEGIN( FindMembersPHP );
3510 else
3511 yyextra->current->initializer << yytext;
3512 }
3513<ReadInitializer,ReadInitializerPtr>. {
3514 yyextra->current->initializer << *yytext;
3515 }
3516
3517
3518<CopyString,CopyPHPString>\\. {
3519 *yyextra->pCopyQuotedString+=yytext;
3520 }
3521<CopyString>\" {
3522 *yyextra->pCopyQuotedString+=*yytext;
3523 BEGIN( yyextra->lastStringContext );
3524 }
3525<CopyPHPString>\' {
3526 *yyextra->pCopyQuotedString+=*yytext;
3527 BEGIN( yyextra->lastStringContext );
3528 }
3529<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3530 *yyextra->pCopyQuotedString+=yytext;
3531 }
3532<CopyString,CopyPHPString>\n {
3533 *yyextra->pCopyQuotedString+=*yytext;
3535 }
3536<CopyString,CopyPHPString>. {
3537 *yyextra->pCopyQuotedString+=*yytext;
3538 }
3539
3540
3541<CopyGString,CopyPHPGString>\\. {
3542 *yyextra->pCopyQuotedGString << yytext;
3543 }
3544<CopyGString>\" {
3545 *yyextra->pCopyQuotedGString << *yytext;
3546 BEGIN( yyextra->lastStringContext );
3547 }
3548<CopyPHPGString>\' {
3549 *yyextra->pCopyQuotedGString << *yytext;
3550 BEGIN( yyextra->lastStringContext );
3551 }
3552<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3553 *yyextra->pCopyQuotedGString << yytext;
3554 BEGIN( yyextra->lastStringContext );
3555 }
3556<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3557 *yyextra->pCopyQuotedGString << yytext;
3558 }
3559<CopyGString,CopyPHPGString>\n {
3560 *yyextra->pCopyQuotedGString << *yytext;
3561 if (yyextra->stopAtInvalidString)
3562 {
3563 BEGIN( yyextra->lastStringContext );
3564 }
3565 else
3566 {
3568 }
3569 }
3570<CopyGString,CopyPHPGString>. {
3571 *yyextra->pCopyQuotedGString << *yytext;
3572 }
3573
3574
3575<CopyRound>\" {
3576 *yyextra->pCopyRoundString += *yytext;
3577 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3578 yyextra->lastStringContext=YY_START;
3579 BEGIN(CopyString);
3580 }
3581<CopyRound>"(" {
3582 *yyextra->pCopyRoundString += *yytext;
3583 yyextra->roundCount++;
3584 }
3585<CopyRound>")" {
3586 *yyextra->pCopyRoundString += *yytext;
3587 if (--yyextra->roundCount<0)
3588 BEGIN(yyextra->lastRoundContext);
3589 }
3590<CopyRound>\n {
3592 *yyextra->pCopyRoundString += *yytext;
3593 }
3594<CopyRound>\' {
3595 if (yyextra->insidePHP)
3596 {
3597 yyextra->current->initializer << yytext;
3598 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3599 yyextra->lastStringContext=YY_START;
3600 BEGIN(CopyPHPString);
3601 }
3602 else
3603 {
3604 *yyextra->pCopyRoundString += yytext;
3605 }
3606 }
3607<CopyRound>{CHARLIT} {
3608 if (yyextra->insidePHP)
3609 {
3610 REJECT;
3611 }
3612 else
3613 {
3614 *yyextra->pCopyRoundString+=yytext;
3615 }
3616 }
3617<CopyRound>[^"'()\n,]+ {
3618 *yyextra->pCopyRoundString+=yytext;
3619 }
3620<CopyRound>. {
3621 *yyextra->pCopyRoundString+=*yytext;
3622 }
3623
3624
3625<CopySharp>\" {
3626 *yyextra->pCopySharpString += *yytext;
3627 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3628 yyextra->lastStringContext=YY_START;
3629 BEGIN(CopyString);
3630 }
3631<CopySharp>"<" {
3632 *yyextra->pCopySharpString += *yytext;
3633 yyextra->sharpCount++;
3634 }
3635<CopySharp>">" {
3636 *yyextra->pCopySharpString += *yytext;
3637 if (--yyextra->sharpCount<0)
3638 {
3639 BEGIN(yyextra->lastSharpContext);
3640 }
3641 }
3642<CopySharp>\n {
3644 *yyextra->pCopySharpString += *yytext;
3645 }
3646<CopySharp>\' {
3647 if (yyextra->insidePHP)
3648 {
3649 yyextra->current->initializer << yytext;
3650 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3651 yyextra->lastStringContext=YY_START;
3652 BEGIN(CopyPHPString);
3653 }
3654 else
3655 {
3656 *yyextra->pCopySharpString += yytext;
3657 }
3658 }
3659<CopySharp>{CHARLIT} {
3660 if (yyextra->insidePHP)
3661 {
3662 REJECT;
3663 }
3664 else
3665 {
3666 *yyextra->pCopySharpString+=yytext;
3667 }
3668 }
3669<CopySharp>[^"'<>\n,]+ {
3670 *yyextra->pCopySharpString+=yytext;
3671 }
3672<CopySharp>. {
3673 *yyextra->pCopySharpString+=*yytext;
3674 }
3675
3676
3677
3678<GCopyRound>\" {
3679 *yyextra->pCopyRoundGString << *yytext;
3680 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3681 yyextra->lastStringContext=YY_START;
3682 BEGIN(CopyGString);
3683 }
3684<GCopyRound>"(" {
3685 *yyextra->pCopyRoundGString << *yytext;
3686 yyextra->roundCount++;
3687 }
3688<GCopyRound>")" {
3689 *yyextra->pCopyRoundGString << *yytext;
3690 if (--yyextra->roundCount<0)
3691 BEGIN(yyextra->lastRoundContext);
3692 }
3693<GCopyRound>\n {
3695 *yyextra->pCopyRoundGString << *yytext;
3696 }
3697<GCopyRound>\' {
3698 if (yyextra->insidePHP)
3699 {
3700 yyextra->current->initializer << yytext;
3701 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3702 yyextra->lastStringContext=YY_START;
3703 BEGIN(CopyPHPGString);
3704 }
3705 else
3706 {
3707 *yyextra->pCopyRoundGString << yytext;
3708 }
3709 }
3710<GCopyRound>{CHARLIT} {
3711 if (yyextra->insidePHP)
3712 {
3713 REJECT;
3714 }
3715 else
3716 {
3717 *yyextra->pCopyRoundGString << yytext;
3718 }
3719 }
3720<GCopyRound>"@\"" {
3721 if (!yyextra->insideCS) REJECT;
3722 *yyextra->pCopyRoundGString << yytext;
3723 yyextra->lastSkipVerbStringContext=YY_START;
3724 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3725 BEGIN(SkipVerbString);
3726 }
3727<GCopyRound>[^"'()\n\/,R]+ { // R because of raw string start
3728 *yyextra->pCopyRoundGString << yytext;
3729 }
3730<GCopyRound>{RAWBEGIN} {
3731 *yyextra->pCopyRoundGString << yytext;
3733 yyextra->lastRawStringContext = YY_START;
3734 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3735 BEGIN(RawGString);
3736 }
3737<GCopyRound>. {
3738 *yyextra->pCopyRoundGString << *yytext;
3739 }
3740
3741
3742<GCopySquare>\" {
3743 *yyextra->pCopySquareGString << *yytext;
3744 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3745 yyextra->lastStringContext=YY_START;
3746 BEGIN(CopyGString);
3747 }
3748<GCopySquare>\' {
3749 *yyextra->pCopySquareGString << *yytext;
3750 if (yyextra->insidePHP)
3751 {
3752 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3753 yyextra->lastStringContext=YY_START;
3754 BEGIN(CopyPHPGString);
3755 }
3756 }
3757<GCopySquare>"[" {
3758 *yyextra->pCopySquareGString << *yytext;
3759 yyextra->squareCount++;
3760 }
3761<GCopySquare>"]" {
3762 *yyextra->pCopySquareGString << *yytext;
3763 if (--yyextra->squareCount<0)
3764 BEGIN(yyextra->lastSquareContext);
3765 }
3766<GCopySquare>\n {
3768 *yyextra->pCopySquareGString << *yytext;
3769 }
3770<GCopySquare>\' {
3771 if (yyextra->insidePHP)
3772 {
3773 yyextra->current->initializer << yytext;
3774 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3775 yyextra->lastStringContext=YY_START;
3776 BEGIN(CopyPHPGString);
3777 }
3778 else
3779 {
3780 *yyextra->pCopySquareGString << yytext;
3781 }
3782 }
3783<GCopySquare>{CHARLIT} {
3784 if (yyextra->insidePHP)
3785 {
3786 REJECT;
3787 }
3788 else
3789 {
3790 *yyextra->pCopySquareGString << yytext;
3791 }
3792 }
3793<GCopySquare>[^"'\[\]\n\/,]+ {
3794 *yyextra->pCopySquareGString << yytext;
3795 }
3796<GCopySquare>. {
3797 *yyextra->pCopySquareGString << *yytext;
3798 }
3799
3800
3801<CopyCurly>\" {
3802 *yyextra->pCopyCurlyString += *yytext;
3803 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3804 yyextra->lastStringContext=YY_START;
3805 yyextra->keepComment=false;
3806 BEGIN(CopyString);
3807 }
3808<CopyCurly>\' {
3809 *yyextra->pCopyCurlyString += *yytext;
3810 if (yyextra->insidePHP)
3811 {
3812 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3813 yyextra->lastStringContext=YY_START;
3814 yyextra->keepComment=false;
3815 BEGIN(CopyPHPString);
3816 }
3817 }
3818<CopyCurly>"{" {
3819 *yyextra->pCopyCurlyString += *yytext;
3820 yyextra->curlyCount++;
3821 }
3822<CopyCurly>"}" {
3823 *yyextra->pCopyCurlyString += *yytext;
3824 if (--yyextra->curlyCount<0)
3825 {
3826 yyextra->keepComment=false;
3827 BEGIN(yyextra->lastCurlyContext);
3828 }
3829 }
3830<CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3831 {
3832 REJECT;
3833 }
3834 else
3835 {
3836 *yyextra->pCopyCurlyString += yytext;
3837 }
3838 }
3839<CopyCurly>[^"'{}\/\n,]+ {
3840 *yyextra->pCopyCurlyString += yytext;
3841 }
3842<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3843<CopyCurly>\n {
3845 *yyextra->pCopyCurlyString += *yytext;
3846 }
3847<CopyCurly>. {
3848 *yyextra->pCopyCurlyString += *yytext;
3849 }
3850<CopyCurly>{CPPC}[^\n]* {
3851 if (yyextra->keepComment)
3852 {
3853 *yyextra->pCopyCurlyString += yytext;
3854 }
3855 else
3856 {
3857 REJECT;
3858 }
3859 }
3860<CopyCurly>{CCS} {
3861 if (yyextra->keepComment)
3862 {
3863 *yyextra->pCopyCurlyString += yytext;
3864 BEGIN(CopyComment);
3865 }
3866 else
3867 {
3868 REJECT;
3869 }
3870 }
3871<CopyComment>{CCE} {
3872 *yyextra->pCopyCurlyString += yytext;
3873 BEGIN(CopyCurly);
3874 }
3875<CopyComment>\n {
3877 *yyextra->pCopyCurlyString += *yytext;
3878 }
3879<CopyComment>. {
3880 *yyextra->pCopyCurlyString += *yytext;
3881 }
3882<CopyComment><<EOF>> {
3883 warn(yyextra->fileName,yyextra->yyLineNr,
3884 "reached end of file while inside a C style comment block!");
3886 }
3887
3888
3889<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3890 }
3891<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3893 int s = line.
find(
' ');
3894 int e = line.
find(
'"',s);
3895 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3896 if (yytext[yyleng-1]=='\n')
3897 {
3899 yyextra->column=0;
3900 }
3901 }
int toInt(bool *ok=nullptr, int base=10) const
3902<GCopyCurly>\" {
3903 *yyextra->pCopyCurlyGString << *yytext;
3904 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3905 yyextra->lastStringContext=YY_START;
3906 yyextra->keepComment = false;
3907 BEGIN(CopyGString);
3908 }
3909<GCopyCurly>\' {
3910 *yyextra->pCopyCurlyGString << *yytext;
3911 if (yyextra->insidePHP)
3912 {
3913 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3914 yyextra->lastStringContext=YY_START;
3915 yyextra->keepComment = false;
3916 BEGIN(CopyPHPGString);
3917 }
3918 }
3919<GCopyCurly>"{" {
3920 *yyextra->pCopyCurlyGString << *yytext;
3921 yyextra->curlyCount++;
3922 }
3923<GCopyCurly>"}" {
3924 *yyextra->pCopyCurlyGString << *yytext;
3925 if (--yyextra->curlyCount<0)
3926 {
3927 yyextra->current->endBodyLine = yyextra->yyLineNr;
3928 yyextra->keepComment = false;
3929 BEGIN(yyextra->lastCurlyContext);
3930 }
3931 }
3932<GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3933 {
3934 REJECT;
3935 }
3936 else
3937 {
3938 *yyextra->pCopyCurlyGString << yytext;
3939 }
3940 }
3941<GCopyCurly>[^"'{}\/\n,]+ {
3942 *yyextra->pCopyCurlyGString << yytext;
3943 }
3944<GCopyCurly>[,]+ {
3945 *yyextra->pCopyCurlyGString << yytext;
3946 }
3947<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3948<GCopyCurly>\n {
3950 *yyextra->pCopyCurlyGString << *yytext;
3951 }
3952<GCopyCurly>. {
3953 *yyextra->pCopyCurlyGString << *yytext;
3954 }
3955<GCopyCurly>{CPPC}[^\n]* {
3956 if (yyextra->keepComment)
3957 {
3958 *yyextra->pCopyCurlyGString << yytext;
3959 }
3960 else
3961 {
3962 REJECT;
3963 }
3964 }
3965<GCopyCurly>{CCS} {
3966 if (yyextra->keepComment)
3967 {
3968 *yyextra->pCopyCurlyGString << yytext;
3969 BEGIN(GCopyComment);
3970 }
3971 else
3972 {
3973 REJECT;
3974 }
3975 }
3976<GCopyComment>{CCE} {
3977 *yyextra->pCopyCurlyGString << yytext;
3978 BEGIN(GCopyCurly);
3979 }
3980<GCopyComment>\n {
3982 *yyextra->pCopyCurlyGString << *yytext;
3983 }
3984<GCopyComment>. {
3985 *yyextra->pCopyCurlyGString << *yytext;
3986 }
3987<GCopyComment><<EOF>> {
3988 warn(yyextra->fileName,yyextra->yyLineNr,
3989 "reached end of file while inside a C style comment block!");
3991 }
3992
3993
3994
3995
3996<FindMembers>":" {
3997 if (yyextra->current->type.isEmpty() &&
3998 yyextra->current->name=="enum")
3999 {
4000 yyextra->current->section = EntryType::makeEnum();
4001 yyextra->current->name.clear();
4002 yyextra->current->args.clear();
4003 BEGIN(EnumBaseType);
4004 }
4005 else
4006 {
4007 if (yyextra->current->type.isEmpty())
4008 {
4010 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
4011 }
4012 BEGIN(BitFields);
4013 yyextra->current->bitfields+=":";
4014 }
4015 }
4016<BitFields>. {
4017 yyextra->current->bitfields+=*yytext;
4018 }
4019<EnumBaseType>. {
4020 yyextra->current->args+=*yytext;
4021 }
4022<EnumBaseType>\n {
4024 yyextra->current->args+=' ';
4025 }
4026<FindMembers>[;,] {
4027 QCString oldType = yyextra->current->type;
4028 if (yyextra->current->bodyLine==-1)
4029 {
4030 yyextra->current->bodyLine = yyextra->yyLineNr;
4031 yyextra->current->bodyColumn = yyextra->yyColNr;
4032 }
4033 if ( yyextra->insidePHP && yyextra->current->type.startsWith("var"))
4034 {
4035 yyextra->current->type = yyextra->current->type.mid(3);
4036 }
4037 if (yyextra->isTypedef && !yyextra->current->type.startsWith("typedef "))
4038 {
4039 yyextra->current->type.prepend("typedef ");
4040 }
4041 bool isStatic = yyextra->current->isStatic;
4042 Protection prot = yyextra->current->protection;
4043 bool isConcept = yyextra->current->section.isConcept();
4044 bool isModule = yyextra->current->section.isModuleDoc();
4045 if (isConcept)
4046 {
4047 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4049 }
4050 else if (isModule)
4051 {
4052 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4054 }
4055 else if (!yyextra->current->name.isEmpty() && !yyextra->current->section.isEnum())
4056 {
4057 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
4059 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
4060 if (yyextra->current->section.isClass())
4061 {
4063 }
4064 yyextra->current->section = EntryType::makeVariable() ;
4065 yyextra->current->fileName = yyextra->fileName;
4066 yyextra->current->startLine = yyextra->yyBegLineNr;
4067 yyextra->current->startColumn = yyextra->yyBegColNr;
4068 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4070 }
4071 if ( *yytext == ',')
4072 {
4073 yyextra->current->isStatic = isStatic;
4074 yyextra->current->protection = prot;
4075 yyextra->current->name.clear();
4076 yyextra->current->args.clear();
4077 yyextra->current->brief.clear();
4078 yyextra->current->doc.clear();
4079 yyextra->current->initializer.str(std::string());
4080 yyextra->current->bitfields.clear();
4082 }
4083 else
4084 {
4085 yyextra->mtype = MethodTypes::Method;
4086 yyextra->virt = Specifier::Normal;
4087 yyextra->current->bodyLine = -1;
4088 yyextra->current->bodyColumn = 1;
4089 yyextra->current->groups.clear();
4091 }
4092 }
static QCString stripFuncPtr(const QCString &type)
4093
4094<FindMembers>"[" {
4095 if (yyextra->insideSlice)
4096 {
4097 yyextra->squareCount=1;
4098 yyextra->lastSquareContext = YY_START;
4099 yyextra->current->metaData += "[";
4100 BEGIN( SliceMetadata );
4101 }
4102 else if (!yyextra->insideCS &&
4103 (yyextra->current->name.isEmpty() ||
4104 yyextra->current->name=="typedef"
4105 )
4106 )
4107 {
4108 yyextra->squareCount=1;
4109 yyextra->lastSquareContext = YY_START;
4110 yyextra->idlAttr.clear();
4111 yyextra->idlProp.clear();
4112 yyextra->current->mtype = yyextra->mtype;
4113
4115 yyextra->current->mtype == MethodTypes::Property)
4116 {
4117 yyextra->odlProp = true;
4118 yyextra->current->spec.setGettable(true).setSettable(true);
4119 }
4120
4121 BEGIN( IDLAttribute );
4122 }
4123 else if (yyextra->insideCS &&
4124 yyextra->current->name.isEmpty())
4125 {
4126 yyextra->squareCount=1;
4127 yyextra->lastSquareContext = YY_START;
4128
4129
4130 yyextra->current->args.clear();
4131 BEGIN( SkipSquare );
4132 }
4133 else
4134 {
4135 yyextra->current->args += yytext ;
4136 yyextra->squareCount=1;
4137 yyextra->externLinkage=
FALSE;
4138 BEGIN( Array ) ;
4139 }
4140 }
4141<SliceMetadata>"[" { // Global metadata.
4142 yyextra->squareCount++;
4143 yyextra->current->metaData += "[";
4144 }
4145<SliceMetadata>{BN}* {
4147 }
4148<SliceMetadata>\"[^\"]*\" {
4149 yyextra->current->metaData += yytext;
4150 }
4151<SliceMetadata>"," {
4152 yyextra->current->metaData += yytext;
4153 }
4154<SliceMetadata>"]" {
4155 yyextra->current->metaData += yytext;
4156 if (--yyextra->squareCount<=0)
4157 {
4158 BEGIN (yyextra->lastSquareContext);
4159 }
4160 }
4161<SliceOptional>"(" {
4162 yyextra->current->type += "(";
4163 yyextra->roundCount++;
4164 }
4165<SliceOptional>[0-9]+ {
4166 yyextra->current->type += yytext;
4167 }
4168<SliceOptional>")" {
4169 yyextra->current->type += ")";
4170 if(--yyextra->roundCount<=0)
4171 {
4172 BEGIN (yyextra->lastModifierContext);
4173 }
4174 }
4175<IDLAttribute>"]" {
4176
4177 if (--yyextra->squareCount<=0)
4178 {
4180 if (yyextra->current->mtype == MethodTypes::Property)
4181 BEGIN( IDLPropName );
4182 else
4183 BEGIN( yyextra->lastSquareContext );
4184 }
4185 }
4186<IDLAttribute>"propput" {
4188 {
4189 yyextra->current->mtype = MethodTypes::Property;
4190 }
4191 yyextra->current->spec.setSettable(true);
4192 }
4193<IDLAttribute>"propget" {
4195 {
4196 yyextra->current->mtype = MethodTypes::Property;
4197 }
4198 yyextra->current->spec.setGettable(true);
4199 }
4200<IDLAttribute>"property" { // UNO IDL property
4201 yyextra->current->spec.setProperty(true);
4202 }
4203<IDLAttribute>"attribute" { // UNO IDL attribute
4204 yyextra->current->spec.setAttribute(true);
4205 }
4206<IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
4207 yyextra->current->spec.setOptional(true);
4208 }
4209<IDLAttribute>"readonly" { // on UNO IDL attribute or property
4211 {
4212 yyextra->current->spec.setSettable(false);
4213 }
4214 else
4215 {
4216 yyextra->current->spec.setReadonly(true);
4217 }
4218 }
4219<IDLAttribute>"bound" { // on UNO IDL attribute or property
4220 yyextra->current->spec.setBound(true);
4221 }
4222<IDLAttribute>"removable" { // on UNO IDL property
4223 yyextra->current->spec.setRemovable(true);
4224 }
4225<IDLAttribute>"constrained" { // on UNO IDL property
4226 yyextra->current->spec.setConstrained(true);
4227 }
4228<IDLAttribute>"transient" { // on UNO IDL property
4229 yyextra->current->spec.setTransient(true);
4230 }
4231<IDLAttribute>"maybevoid" { // on UNO IDL property
4232 yyextra->current->spec.setMaybeVoid(true);
4233 }
4234<IDLAttribute>"maybedefault" { // on UNO IDL property
4235 yyextra->current->spec.setMaybeDefault(true);
4236 }
4237<IDLAttribute>"maybeambiguous" { // on UNO IDL property
4238 yyextra->current->spec.setMaybeAmbiguous(true);
4239 }
4240<IDLAttribute>. {
4241 }
4242<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
4243
4244
4245 if (yyextra->odlProp)
4246 {
4247 yyextra->idlProp = yytext;
4248 }
4249 }
4250<IDLPropName>{ID}{BN}*"(" {
4251 yyextra->current->name = yytext;
4252 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
4253 yyextra->current->startLine = yyextra->yyLineNr;
4254 yyextra->current->startColumn = yyextra->yyColNr;
4255 BEGIN( IDLProp );
4256 }
4257<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
4258 if (yyextra->odlProp)
4259 {
4260 yyextra->idlProp += yytext;
4261 }
4262 }
4263<IDLPropName>{ID}{BNopt}/";" {
4264 if (yyextra->odlProp)
4265 {
4266 yyextra->current->name = yytext;
4267 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
4268 yyextra->odlProp = false;
4269
4270 BEGIN( IDLProp );
4271 }
4272 }
4273<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
4274 yyextra->idlAttr = yytext;
4275 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
4276 }
4277<IDLProp>{ID} { // property type
4278 yyextra->idlProp = yytext;
4279 }
4280<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
4281 if (yyextra->current->args.isEmpty())
4282 yyextra->current->args = "(";
4283 else
4284 yyextra->current->args += ", ";
4285 yyextra->current->args += yyextra->idlAttr;
4286 yyextra->current->args += " ";
4287 yyextra->current->args += yyextra->idlProp;
4288 yyextra->current->args += " ";
4289 yyextra->current->args += yytext;
4290 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4291 yyextra->idlProp.clear();
4292 yyextra->idlAttr.clear();
4293 BEGIN( IDLProp );
4294 }
4295<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4296
4297 }
4298<IDLProp>";" {
4299 yyextra->current->fileName = yyextra->fileName;
4300 yyextra->current->type = yyextra->idlProp;
4301 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4302 if (!yyextra->current->args.isEmpty())
4303 yyextra->current->args += ")";
4304 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4305 yyextra->current->section = EntryType::makeVariable();
4306 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4308 BEGIN( FindMembers );
4309 }
4310<IDLProp>. { // spaces, *, or other stuff
4311
4312 }
4313<Array>"]" { yyextra->current->args += *yytext ;
4314 if (--yyextra->squareCount<=0)
4315 BEGIN( FindMembers ) ;
4316 }
4317<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4318 if (--yyextra->squareCount<=0)
4319 BEGIN( SFunction ) ;
4320 }
4321<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4322 yyextra->squareCount++;
4323 }
4324<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4325<SkipSquare>"[" { yyextra->squareCount++; }
4326<SkipSquare>"]" {
4327 if (--yyextra->squareCount<=0)
4328 BEGIN( yyextra->lastSquareContext );
4329 }
4330<SkipSquare>\" {
4331 yyextra->lastStringContext=YY_START;
4332 BEGIN( SkipString );
4333 }
4334<SkipSquare>[^\n\[\]\"]+
4335<FindMembers>"<" { addType(yyscanner);
4336 yyextra->current->type += yytext ;
4337 BEGIN( Sharp ) ;
4338 }
4339<Sharp>">" { yyextra->current->type += *yytext ;
4340 if (--yyextra->sharpCount<=0)
4341 BEGIN( FindMembers ) ;
4342 }
4343<Sharp>"<" { yyextra->current->type += *yytext ;
4344 yyextra->sharpCount++;
4345 }
4346<Sharp>{BN}+ {
4347 yyextra->current->type += ' ';
4349 }
4350<Sharp>. { yyextra->current->type += *yytext ; }
4351<FindFields>{ID} {
4353 yyextra->current->bodyLine = yyextra->yyLineNr;
4354 yyextra->current->bodyColumn = yyextra->yyColNr;
4355 yyextra->current->name = yytext;
4356 }
4357<FindFields>[({] {
4358
4359 unput(*yytext);
4360 yyextra->lastInitializerContext = YY_START;
4361 yyextra->sharpCount=0;
4362 yyextra->initBracketCount=0;
4363 yyextra->current->initializer.str("=");
4364 BEGIN(ReadInitializer);
4365 }
4366<FindFields>"=" {
4367 yyextra->lastInitializerContext = YY_START;
4368 yyextra->sharpCount=0;
4369 yyextra->initBracketCount=0;
4370 yyextra->current->initializer.str(yytext);
4371 BEGIN(ReadInitializer);
4372 }
4373<FindFields>";" {
4374 if (yyextra->insideJava)
4375 {
4376 if (!yyextra->current->name.isEmpty())
4377 {
4378 yyextra->current->fileName = yyextra->fileName;
4379 yyextra->current->startLine = yyextra->yyLineNr;
4380 yyextra->current->startColumn = yyextra->yyColNr;
4381 if (!yyextra->current_root->spec.isEnum())
4382 {
4383 yyextra->current->type = "@";
4384 }
4385 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4386 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4387 yyextra->current->section = EntryType::makeVariable();
4388 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4390 }
4391
4392 BEGIN( FindMembers );
4393 }
4394 else
4395 {
4396 REJECT;
4397 }
4398 }
4399<FindFields>"," {
4400
4401
4402
4403 if (!yyextra->current->name.isEmpty())
4404 {
4405 yyextra->current->fileName = yyextra->fileName;
4406 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4407 {
4408 yyextra->current->startLine = yyextra->current->bodyLine;
4409 yyextra->current->startColumn = yyextra->current->bodyColumn;
4410 }
4411 else
4412 {
4413 yyextra->current->startLine = yyextra->yyLineNr;
4414 yyextra->current->startColumn = yyextra->yyColNr;
4415 }
4416 if (!yyextra->current_root->spec.isEnum())
4417 {
4418 yyextra->current->type = "@";
4419 }
4420 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4421 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4422 yyextra->current->section = EntryType::makeVariable();
4423
4424 if (!yyextra->insideCS && !yyextra->insideJava &&
4425 !yyextra->current_root->spec.isStrong())
4426
4427
4428 {
4429
4430
4431
4432 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4433 }
4434 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4436 }
4437 else
4438 {
4439 yyextra->current->reset();
4441 }
4442 }
4443<FindFields>"[" { // attribute list in IDL
4444 yyextra->squareCount=1;
4445 yyextra->lastSquareContext = YY_START;
4446 BEGIN(SkipSquare);
4447 }
4448<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; } // R because of raw string start
4449<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4450<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
4451 REJECT;
4452
4453 yyextra->current->program << yytext ;
4454 }
4455
4456<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
4457 yyextra->current->program << yytext ;
4458 yyextra->pSkipInterpString = &yyextra->current->program;
4459 yyextra->lastSkipInterpStringContext=YY_START;
4460 yyextra->strCurlyCount = 0;
4461 BEGIN( SkipInterpString );
4462 }
4463<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})* {
4464 *yyextra->pSkipInterpString << yytext;
4465 }
4466<SkipInterpString>"{" {
4467 *yyextra->pSkipInterpString << *yytext;
4468 yyextra->strCurlyCount++;
4469 }
4470<SkipInterpString>"}" {
4471 *yyextra->pSkipInterpString << *yytext;
4472 yyextra->strCurlyCount--;
4473 }
4474<SkipInterpString>\" {
4475 *yyextra->pSkipInterpString << *yytext;
4476 if (yyextra->strCurlyCount==0)
4477 {
4478 BEGIN( yyextra->lastSkipInterpStringContext );
4479 }
4480 }
4481<SkipInterpString>. {
4482 *yyextra->pSkipInterpString << *yytext;
4483 }
4484
4485<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$@\" { if (!yyextra->insideCS) REJECT
4486 yyextra->current->program << yytext ;
4487 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4488 yyextra->lastSkipInterpVerbStringContext=YY_START;
4489 yyextra->strCurlyCount = 0;
4490 BEGIN( SkipInterpVerbString );
4491 }
4492<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4493 *yyextra->pSkipInterpVerbString << yytext;
4494 }
4495<SkipInterpVerbString>"{" {
4496 *yyextra->pSkipInterpVerbString << *yytext;
4497 yyextra->strCurlyCount++;
4498 }
4499<SkipInterpVerbString>"}" {
4500 *yyextra->pSkipInterpVerbString << *yytext;
4501 yyextra->strCurlyCount--;
4502 }
4503<SkipInterpVerbString>\" {
4504 *yyextra->pSkipInterpVerbString << *yytext;
4505 if (yyextra->strCurlyCount==0)
4506 {
4507 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4508 }
4509 }
4510<SkipInterpVerbString>. {
4511 *yyextra->pSkipInterpVerbString << *yytext;
4512 }
4513<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4514<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4515 yyextra->pSkipVerbString = &yyextra->current->program;
4516 yyextra->lastSkipVerbStringContext=YY_START;
4517 BEGIN( SkipVerbString );
4518 }
4519<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
4520 {
4521 yyextra->current->program << yytext ;
4522 yyextra->pCopyHereDocGString = &yyextra->current->program;
4523 yyextra->lastHereDocContext=YY_START;
4524 BEGIN( CopyHereDoc );
4525 }
4526 else
4527 {
4528 REJECT;
4529 }
4530 }
4531<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4532 yyextra->current->program << yytext;
4534 yyextra->lastRawStringContext = YY_START;
4535 yyextra->pCopyRawGString = &yyextra->current->program;
4536 BEGIN(RawGString);
4537 }
4538<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4539 yyextra->pCopyQuotedGString = &yyextra->current->program;
4540 yyextra->lastStringContext=YY_START;
4541 yyextra->stopAtInvalidString=false;
4542 BEGIN( CopyGString );
4543 }
4544<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=true; REJECT;}
4545<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4546 yyextra->lastContext = YY_START ;
4547 BEGIN( Comment ) ;
4548 }
4549<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4550 ++yyextra->yyLineNr ;
4551 yyextra->lastContext = YY_START ;
4552 BEGIN( Comment ) ;
4553 }
4554<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4555 if (!yyextra->insidePHP)
4556 {
4557 yyextra->current->program << yytext;
4558 }
4559 else
4560 {
4561 yyextra->current->program << yytext;
4562 yyextra->pCopyQuotedGString = &yyextra->current->program;
4563 yyextra->lastStringContext=YY_START;
4564 BEGIN(CopyPHPGString);
4565 }
4566 }
4567<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4568 if (yyextra->insidePHP)
4569 {
4570 REJECT;
4571
4572 }
4573 else
4574 {
4575 yyextra->current->program << yytext;
4576 }
4577 }
4578<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4579 ++yyextra->curlyCount ;
4580 }
4581<ReadBodyIntf>"}" {
4582 yyextra->current->program << yytext ;
4583 --yyextra->curlyCount ;
4584 }
4585<ReadBody,ReadNSBody>"}" {
4586 if ( yyextra->curlyCount>0 )
4587 {
4588 yyextra->current->program << yytext ;
4589 --yyextra->curlyCount ;
4590 }
4591 else
4592 {
4593 yyextra->current->endBodyLine = yyextra->yyLineNr;
4594 std::shared_ptr<Entry> original_root = yyextra->current_root;
4595 if (yyextra->current->section.isNamespace() && yyextra->current->type == "namespace")
4596 {
4597 int split_point;
4598
4599 QCString doc = yyextra->current->doc;
4600 int docLine = yyextra->current->docLine;
4601 QCString docFile = yyextra->current->docFile;
4602 QCString brief = yyextra->current->brief;
4603 int briefLine = yyextra->current->briefLine;
4604 QCString briefFile = yyextra->current->briefFile;
4605
4606 yyextra->current->doc = "";
4607 yyextra->current->docLine = 0;
4608 yyextra->current->docFile = "";
4609 yyextra->current->brief = "";
4610 yyextra->current->briefLine = 0;
4611 yyextra->current->briefFile = "";
4612 while ((split_point = yyextra->current->name.find("::")) != -1)
4613 {
4614 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4615 yyextra->current->program.str(std::string());
4616 new_current->name = yyextra->current->name.mid(split_point + 2);
4617 yyextra->current->name = yyextra->current->name.left(split_point);
4618 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
4619
4620 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4621 yyextra->current_root = yyextra->current;
4622 yyextra->current = new_current;
4623 }
4624
4625 yyextra->current->doc = doc;
4626 yyextra->current->docLine = docLine;
4627 yyextra->current->docFile = docFile;
4628 yyextra->current->brief = brief;
4629 yyextra->current->briefLine = briefLine;
4630 yyextra->current->briefFile = briefFile;
4631 }
4632 QCString &cn = yyextra->current->name;
4633 QCString rn = yyextra->current_root->name;
4634
4636 {
4638 }
4639 if (yyextra->isTypedef && cn.
isEmpty())
4640 {
4641
4642 BEGIN( TypedefName );
4643 }
4644 else
4645 {
4646 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4647 {
4648 yyextra->current->program << ',';
4649 }
4650
4652
4653 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4654 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4655
4656 if (yyextra->insideObjC &&
4657 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4658 )
4659 {
4660 BEGIN( ReadBodyIntf ) ;
4661 }
4662 else
4663 {
4664 yyextra->memspecEntry = yyextra->current;
4665 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4666 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4667 if (yyextra->current->section.isNamespace() ||
4668 yyextra->current->spec.isInterface() ||
4669 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4670 yyextra->insideSlice
4671 )
4672 {
4673 yyextra->current->reset();
4674 yyextra->current_root = std::move(original_root);
4676 yyextra->memspecEntry.reset();
4677 BEGIN( FindMembers ) ;
4678 }
4679 else
4680 {
4681 static const reg::Ex re(R
"(@\d+$)");
4682 if (!yyextra->isTypedef && yyextra->memspecEntry &&
4683 !
reg::search(yyextra->memspecEntry->name.str(),re))
4684 {
4685
4686 yyextra->current->doc.clear();
4687 yyextra->current->brief.clear();
4688 }
4689 BEGIN( MemberSpec ) ;
4690 }
4691 }
4692 }
4693 }
4694 }
static void prependScope(yyscan_t yyscanner)
4695<ReadBody>"}"{BN}+"typedef"{BN}+ {
4697 if ( yyextra->curlyCount>0 )
4698 {
4699 yyextra->current->program << yytext ;
4700 --yyextra->curlyCount ;
4701 }
4702 else
4703 {
4704 yyextra->isTypedef =
TRUE;
4705 yyextra->current->endBodyLine = yyextra->yyLineNr;
4706 QCString &cn = yyextra->current->name;
4707 QCString rn = yyextra->current_root->name;
4709 {
4711 }
4712 BEGIN( TypedefName );
4713 }
4714 }
4715<TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
4717 yyextra->current->type.prepend(yytext);
4718 }
4719<TypedefName>{ID} {
4720 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4721 {
4722 yyextra->current->program << ",";
4723 }
4724 yyextra->current->name=yytext;
4726 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4727 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4728
4729 if (!yyextra->firstTypedefEntry)
4730 {
4731 yyextra->firstTypedefEntry = yyextra->current;
4732 }
4733 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4735 yyextra->isTypedef=
TRUE;
4736 BEGIN(MemberSpecSkip);
4737 }
4738<TypedefName>";" { /* typedef of anonymous type */
4740 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4741 {
4742 yyextra->current->program << ',';
4743 }
4744
4745 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4746 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4747 yyextra->memspecEntry = yyextra->current;
4748 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4750 unput(';');
4751 BEGIN( MemberSpec ) ;
4752 }
QCString generateAnonymousAnchor(const QCString &fileName, int count)
4753<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4755 int i=0,l=(int)yyleng,j;
4756 while (i<l && (!
isId(yytext[i]))) i++;
4758 j=yyextra->msName.
find(
"[");
4759 if (j!=-1)
4760 {
4761 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4762 yyextra->msName=yyextra->msName.left(j);
4763 }
QCString right(size_t len) const
4765
4766
4767 if (yyextra->firstTypedefEntry)
4768 {
4769 if (yyextra->firstTypedefEntry->spec.isStruct())
4770 {
4771 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4772 }
4773 else if (yyextra->firstTypedefEntry->spec.isUnion())
4774 {
4775 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4776 }
4777 else if (yyextra->firstTypedefEntry->section.isEnum())
4778 {
4779 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4780 }
4781 else
4782 {
4783 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4784 }
4785 }
4786 }
4787<MemberSpec>"(" { // function with struct return type
4789 yyextra->current->name = yyextra->msName;
4791 unput('(');
4792 BEGIN(FindMembers);
4793 }
4794<MemberSpec>[,;] {
4795 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4796 {
4797
4798
4799
4800
4801 const Entry *p=yyextra->current.get();
4802 while (p)
4803 {
4804
4806 {
4807
4809 int pi = (i==-1) ? 0 : i+2;
4811 {
4812
4813
4815 break;
4816 }
4817 }
4818
4819 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4820 }
4821 }
4822
4823 if (!yyextra->msName.isEmpty()
4824 )
4825 {
4827
4828
4829 if (typedefHidesStruct &&
4830 yyextra->isTypedef &&
4831 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4832 yyextra->msType.stripWhiteSpace().isEmpty() &&
4833 yyextra->memspecEntry)
4834 {
4835 yyextra->memspecEntry->name=yyextra->msName;
4836 }
4837 else
4838 {
4839 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4840 varEntry->lang = yyextra->language;
4841 varEntry->protection = yyextra->current->protection ;
4842 varEntry->mtype = yyextra->current->mtype;
4843 varEntry->virt = yyextra->current->virt;
4844 varEntry->isStatic = yyextra->current->isStatic;
4845 varEntry->section = EntryType::makeVariable();
4846 varEntry->name = yyextra->msName.stripWhiteSpace();
4847 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4848 varEntry->args = yyextra->msArgs;
4849 if (yyextra->isTypedef)
4850 {
4851 varEntry->type.prepend("typedef ");
4852
4853 }
4854 if (typedefHidesStruct &&
4855 yyextra->isTypedef &&
4856 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4857 yyextra->memspecEntry
4858 )
4859 {
4860 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4861 }
4862 else
4863 {
4864 varEntry->type+=yyextra->current->name+yyextra->msType;
4865 }
4866 varEntry->fileName = yyextra->fileName;
4867 varEntry->startLine = yyextra->yyLineNr;
4868 varEntry->startColumn = yyextra->yyColNr;
4869 varEntry->doc = yyextra->current->doc;
4870 varEntry->brief = yyextra->current->brief;
4871 varEntry->mGrpId = yyextra->current->mGrpId;
4872 varEntry->initializer.str(yyextra->current->initializer.str());
4873 varEntry->groups = yyextra->current->groups;
4874 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
4875
4876
4877
4878
4879 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4880 }
4881 }
4882 if (*yytext==';')
4883 {
4884 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && yyextra->current->section.isCompound())
4885 {
4886 if (!yyextra->current->doc.isEmpty())
4887 {
4888 yyextra->memspecEntry->doc += yyextra->current->doc;
4889 }
4890 if (!yyextra->current->brief.isEmpty())
4891 {
4892 yyextra->memspecEntry->brief += yyextra->current->brief;
4893 }
4894 }
4895 yyextra->msType.clear();
4896 yyextra->msName.clear();
4897 yyextra->msArgs.clear();
4898 yyextra->isTypedef=
FALSE;
4899 yyextra->firstTypedefEntry.reset();
4900 yyextra->memspecEntry.reset();
4901 yyextra->current->reset();
4903 BEGIN( FindMembers );
4904 }
4905 else
4906 {
4907 yyextra->current->doc.clear();
4908 yyextra->current->brief.clear();
4909 }
4910
4911 }
4912<MemberSpec>"=" {
4913 yyextra->lastInitializerContext=YY_START;
4914 yyextra->sharpCount=0;
4915 yyextra->initBracketCount=0;
4916 yyextra->current->initializer.str(yytext);
4917 BEGIN(ReadInitializer);
4918
4919 }
4920
4921<MemberSpecSkip>"{" {
4922 yyextra->curlyCount=0;
4923 yyextra->lastCurlyContext = MemberSpecSkip;
4924 yyextra->previous = yyextra->current;
4925 BEGIN(SkipCurly);
4926 }
4927 */
4928<MemberSpecSkip>"," { BEGIN(MemberSpec); }
4929<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4930<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4932 }
4933<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4934 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4936 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
4937 yyextra->insideObjC=
FALSE;
4938 BEGIN( FindMembers );
4939 }
4940<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
4941<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
4942
4943<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
4944<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
4945 if (yyextra->insidePHP)
4946 {
4947 REJECT
4948 }
4949 else
4950 {
4951 yyextra->current->bodyLine = yyextra->yyLineNr;
4952 yyextra->current->bodyColumn = yyextra->yyColNr;
4955 yyextra->funcPtrType=yytext;
4956 yyextra->roundCount=0;
4957
4958 BEGIN( FuncPtr );
4959 }
4960 }
4961<FuncPtr>{SCOPENAME} {
4962 yyextra->current->name = yytext;
4964 {
4965 BEGIN( FuncPtrOperator );
4966 }
4967 else
4968 {
4969 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
4970 {
4971 yyextra->funcPtrType += yyextra->current->name;
4972 }
4973 else
4974 {
4975 BEGIN( EndFuncPtr );
4976 }
4977 }
4978 }
4979<FuncPtr>. {
4980
4981 }
4982<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
4983 yyextra->current->name += yytext;
4984 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
4986 }
4987<FuncPtrOperator>\n {
4989 yyextra->current->name += *yytext;
4990 }
4991<FuncPtrOperator>"(" {
4992 unput(*yytext);
4993 BEGIN( EndFuncPtr );
4994 }
4995<FuncPtrOperator>. {
4996 yyextra->current->name += *yytext;
4997 }
4998<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
5000 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5001 BEGIN(FindMembers);
5002 }
5003<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
5005 if (yyextra->funcPtrType!="(")
5006 {
5007 yyextra->current->type+=yyextra->funcPtrType+")";
5008 }
5009 BEGIN(FindMembers);
5010 }
5011<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
5013 yyextra->current->type+=yyextra->funcPtrType;
5014 yyextra->current->args += ")";
5015 BEGIN(FindMembers);
5016 }
5017<EndFuncPtr>"(" { // a function returning a function or
5018
5019 yyextra->current->args += *yytext ;
5020
5021
5022 yyextra->current->bodyLine = yyextra->yyLineNr;
5023 yyextra->current->bodyColumn = yyextra->yyColNr;
5024 yyextra->currentArgumentContext = FuncFuncEnd;
5025 yyextra->fullArgString=yyextra->current->args;
5026 yyextra->copyArgString=&yyextra->current->args;
5027 BEGIN( ReadFuncArgType ) ;
5028 }
5029<EndFuncPtr>"["[^\n\]]*"]" {
5030 yyextra->funcPtrType+=yytext;
5031 }
5032<EndFuncPtr>")" {
5033 BEGIN(FindMembers);
5034 }
5035<FuncFunc>"(" {
5036 yyextra->current->args += *yytext ;
5037 ++yyextra->roundCount;
5038 }
5039<FuncFunc>")" {
5040 yyextra->current->args += *yytext ;
5041 if ( yyextra->roundCount )
5042 --yyextra->roundCount;
5043 else
5044 {
5045 BEGIN(FuncFuncEnd);
5046 }
5047 }
5048<FuncFuncEnd>")"{BN}*"(" {
5050 yyextra->current->type+=yyextra->funcPtrType+")(";
5051 BEGIN(FuncFuncType);
5052 }
5053<FuncFuncEnd>")"{BNopt}/[;{] {
5055 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5056 BEGIN(SFunction);
5057 }
5058<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
5060 yyextra->current->type+=yyextra->funcPtrType;
5061 yyextra->current->args+=")";
5062 BEGIN(FuncFuncArray);
5063 }
5064<FuncFuncEnd>. {
5065 yyextra->current->args += *yytext;
5066 }
5067<FuncFuncType>"(" {
5068 yyextra->current->type += *yytext;
5069 yyextra->roundCount++;
5070 }
5071<FuncFuncType>")" {
5072 yyextra->current->type += *yytext;
5073 if (yyextra->roundCount)
5074 --yyextra->roundCount;
5075 else
5076 BEGIN(SFunction);
5077 }
5078<FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
5079<FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
5080<FuncFuncType>. {
5081 yyextra->current->type += *yytext;
5082 }
5083<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
5084 if (yyextra->current->type.startsWith("typedef") &&
5085 yyextra->current->bodyLine==-1)
5086
5087 {
5088 yyextra->current->bodyLine = yyextra->yyLineNr;
5089 yyextra->current->bodyColumn = yyextra->yyColNr;
5090 BEGIN( GetCallType );
5091 }
5092 else if (!yyextra->current->name.isEmpty())
5093 {
5094 yyextra->current->args = yytext;
5095 yyextra->current->bodyLine = yyextra->yyLineNr;
5096 yyextra->current->bodyColumn = yyextra->yyColNr;
5097 yyextra->currentArgumentContext = FuncQual;
5098 yyextra->fullArgString=yyextra->current->args;
5099 yyextra->copyArgString=&yyextra->current->args;
5100 BEGIN( ReadFuncArgType ) ;
5101
5102 }
5103 }
5104<GetCallType>{BN}*{ID}{BN}*"*" {
5107 yyextra->funcPtrType="(";
5108 yyextra->funcPtrType+=yytext;
5109 yyextra->roundCount=0;
5110 BEGIN( FuncPtr );
5111 }
5112<FindMembers>"(" {
5113 if (!yyextra->current->name.isEmpty())
5114 {
5115 yyextra->current->args = yytext;
5116 yyextra->current->bodyLine = yyextra->yyLineNr;
5117 yyextra->current->bodyColumn = yyextra->yyColNr;
5118 yyextra->currentArgumentContext = FuncQual;
5119 yyextra->fullArgString=yyextra->current->args;
5120 yyextra->copyArgString=&yyextra->current->args;
5121 BEGIN( ReadFuncArgType ) ;
5122
5123 }
5124 }
5125
5126
5127
5128<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
5129 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
5130 else yyextra->fullArgString+=yytext;
5131 }
5132<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
5133 yyextra->fullArgString+=yytext;
5134 }
5135<CopyArgRound>[^\/\n\)\(\"\']+ {
5136 *yyextra->copyArgString+=yytext;
5137 yyextra->fullArgString+=yytext;
5138 }
5139<CopyArgSquare>[^\/\n\]\[\"\']+ {
5140 *yyextra->copyArgString+=yytext;
5141 yyextra->fullArgString+=yytext;
5142 }
5143<ReadFuncArgType,ReadTempArgs>{BN}* {
5144 *yyextra->copyArgString+=" ";
5145 yyextra->fullArgString+=" ";
5147 }
5148<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
5150 yyextra->lastRawStringContext = YY_START;
5151 yyextra->pCopyRawString = yyextra->copyArgString;
5152 *yyextra->pCopyRawString+=yytext;
5153 yyextra->fullArgString+=yytext;
5154 BEGIN(RawString);
5155 }
5156<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
5157 *yyextra->copyArgString+=*yytext;
5158 yyextra->fullArgString+=*yytext;
5159 yyextra->lastCopyArgStringContext = YY_START;
5160 BEGIN( CopyArgString );
5161 }
5162<ReadFuncArgType>"[" {
5163 if (!yyextra->insidePHP) REJECT;
5164 *yyextra->copyArgString+=*yytext;
5165 yyextra->fullArgString+=*yytext;
5166 yyextra->argSquareCount=0;
5167 yyextra->lastCopyArgContext = YY_START;
5168 BEGIN( CopyArgSquare );
5169 }
5170<ReadFuncArgType,ReadTempArgs>"(" {
5171 *yyextra->copyArgString+=*yytext;
5172 yyextra->fullArgString+=*yytext;
5173 yyextra->argRoundCount=0;
5174 yyextra->lastCopyArgContext = YY_START;
5175 BEGIN( CopyArgRound );
5176 }
5177<ReadFuncArgType>")" {
5178 *yyextra->copyArgString+=*yytext;
5179 yyextra->fullArgString+=*yytext;
5181 if (yyextra->insideJS)
5182 {
5184 }
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)
5186
5187
5188
5189
5190
5191
5192 yyextra->docBackup = yyextra->current->doc;
5193 yyextra->briefBackup = yyextra->current->brief;
5194
5195 BEGIN( yyextra->currentArgumentContext );
5196 }
5197
5198<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
5199 if (yyextra->currentArgumentContext==DefineEnd)
5200 {
5201
5202
5203 int i;for (i=(int)yyleng-1;i>=0;i--)
5204 {
5205 unput(yytext[i]);
5206 }
5209 BEGIN( yyextra->currentArgumentContext );
5210 }
5211 else
5212 {
5213
5214
5215 yyextra->fullArgString+=yytext;
5216 yyextra->lastCopyArgChar=0;
5217 yyextra->lastCommentInArgContext=YY_START;
5218 if (yytext[1]=='/')
5219 BEGIN( CopyArgCommentLine );
5220 else
5221 BEGIN( CopyArgComment );
5222 }
5223 }
5224
5225<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
5226<ReadFuncArgType,ReadTempArgs>{CCS} {
5227 yyextra->lastCContext = YY_START;
5228 BEGIN( SkipComment );
5229 }
5230<ReadFuncArgType,ReadTempArgs>{CPPC} {
5231 yyextra->lastCContext = YY_START;
5232 BEGIN( SkipCxxComment );
5233 }
5234
5235<ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
5236 REJECT;
5237 *yyextra->copyArgString+=yytext;
5238 yyextra->fullArgString+=yytext;
5239 }
5240<ReadFuncArgType,ReadTempArgs>"#" {
5241 if (!yyextra->insidePHP)
5242 REJECT;
5243 yyextra->lastCContext = YY_START;
5244 BEGIN( SkipCxxComment );
5245 }
5246 */
5247
5248<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
5250 if (yyextra->currentArgumentContext==DefineEnd)
5251 {
5252
5253
5254 int i;for (i=(int)yyleng-1;i>0;i--)
5255 {
5256 unput(yytext[i]);
5257 }
5258 *yyextra->copyArgString+=*yytext;
5259 yyextra->fullArgString+=*yytext;
5262 BEGIN( yyextra->currentArgumentContext );
5263 }
5264 else
5265 {
5266
5267
5268 yyextra->lastCopyArgChar=*yytext;
5271 yyextra->lastCommentInArgContext=YY_START;
5272 yyextra->fullArgString+=text;
5273 if (text.
find(
"//")!=-1)
5274 BEGIN( CopyArgCommentLine );
5275 else
5276 BEGIN( CopyArgComment );
5277 }
5278 }
5279<CopyArgComment>^{B}*"*"+/{BN}+
5280<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
5281<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
5282 if (yyextra->lastCopyArgChar!=0)
5283 unput(yyextra->lastCopyArgChar);
5284 BEGIN( yyextra->lastCommentInArgContext );
5285 }
5286<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
5288 if (yyextra->lastCopyArgChar!=0)
5289 unput(yyextra->lastCopyArgChar);
5290 BEGIN( yyextra->lastCommentInArgContext );
5291 }
5292<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
5293 yyextra->docBlockName="uml";
5294 yyextra->fullArgString+=yytext;
5295 BEGIN(CopyArgVerbatim);
5296 }
5297<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!)
5298 yyextra->docBlockName=&yytext[1];
5299 yyextra->fullArgString+=yytext;
5300 BEGIN(CopyArgVerbatim);
5301 }
5302<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5303 yyextra->docBlockName=&yytext[1];
5304 if (yyextra->docBlockName.at(1)=='[')
5305 {
5306 yyextra->docBlockName.at(1)=']';
5307 }
5308 if (yyextra->docBlockName.at(1)=='{')
5309 {
5310 yyextra->docBlockName.at(1)='}';
5311 }
5312 if (yyextra->docBlockName.at(1)=='(')
5313 {
5314 yyextra->docBlockName.at(1)=')';
5315 }
5316 yyextra->fullArgString+=yytext;
5317 BEGIN(CopyArgVerbatim);
5318 }
5319<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] { // end of verbatim block
5320 yyextra->fullArgString+=yytext;
5321 if (&yytext[4]==yyextra->docBlockName)
5322 {
5323 yyextra->docBlockName="";
5324 BEGIN(CopyArgCommentLine);
5325 }
5326 }
5327<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") { // end of verbatim block
5328 yyextra->fullArgString+=yytext;
5329 if (yyextra->docBlockName==&yytext[1])
5330 {
5331 yyextra->docBlockName="";
5332 BEGIN(CopyArgCommentLine);
5333 }
5334 }
5335<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5336<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5337<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
5338<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5339<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5340 warn(yyextra->fileName,yyextra->yyLineNr,
5341 "Ignoring {:c}brief command inside argument documentation",*yytext
5342 );
5343 yyextra->fullArgString+=' ';
5344 }
5345<ReadTempArgs>"<" {
5346 *yyextra->copyArgString+=*yytext;
5347 yyextra->fullArgString+=*yytext;
5348 yyextra->argSharpCount=1;
5349 BEGIN( CopyArgSharp );
5350 }
5351<ReadTempArgs>">" {
5352 *yyextra->copyArgString+=*yytext;
5353 yyextra->fullArgString+=*yytext;
5354
5355 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5357 BEGIN( yyextra->currentArgumentContext );
5358 }
5359<CopyArgRound>"(" {
5360 yyextra->argRoundCount++;
5361 *yyextra->copyArgString+=*yytext;
5362 yyextra->fullArgString+=*yytext;
5363 }
5364<CopyArgRound>")" {
5365 *yyextra->copyArgString+=*yytext;
5366 yyextra->fullArgString+=*yytext;
5367 if (yyextra->argRoundCount>0)
5368 yyextra->argRoundCount--;
5369 else
5370 BEGIN( yyextra->lastCopyArgContext );
5371 }
5372<CopyArgSquare>"[" {
5373 yyextra->argSquareCount++;
5374 *yyextra->copyArgString+=*yytext;
5375 yyextra->fullArgString+=*yytext;
5376 }
5377<CopyArgSquare>"]" {
5378 *yyextra->copyArgString+=*yytext;
5379 yyextra->fullArgString+=*yytext;
5380 if (yyextra->argSquareCount>0)
5381 yyextra->argSquareCount--;
5382 else
5383 BEGIN( yyextra->lastCopyArgContext );
5384 }
5385<CopyArgSharp>"(" {
5386 *yyextra->copyArgString+=*yytext;
5387 yyextra->fullArgString+=*yytext;
5388 yyextra->argRoundCount=0;
5389 yyextra->lastCopyArgContext = YY_START;
5390 BEGIN( CopyArgRound );
5391 }
5392<CopyArgSharp>"<" {
5393 yyextra->argSharpCount++;
5394
5395 *yyextra->copyArgString+=*yytext;
5396 yyextra->fullArgString+=*yytext;
5397 }
5398<CopyArgSharp>">" {
5399 *yyextra->copyArgString+=*yytext;
5400 yyextra->fullArgString+=*yytext;
5401 yyextra->argSharpCount--;
5402 if (yyextra->argSharpCount>0)
5403 {
5404
5405 }
5406 else
5407 {
5408 BEGIN( ReadTempArgs );
5409
5410 }
5411 }
5412<CopyArgString,CopyArgPHPString>\\. {
5413 *yyextra->copyArgString+=yytext;
5414 yyextra->fullArgString+=yytext;
5415 }
5416<CopyArgString>\" {
5417 *yyextra->copyArgString+=*yytext;
5418 yyextra->fullArgString+=*yytext;
5419 BEGIN( yyextra->lastCopyArgStringContext );
5420 }
5421<CopyArgPHPString>\' {
5422 *yyextra->copyArgString+=*yytext;
5423 yyextra->fullArgString+=*yytext;
5424 BEGIN( yyextra->lastCopyArgStringContext );
5425 }
5426<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5427 if (yyextra->insidePHP)
5428 {
5429 REJECT;
5430 }
5431 else
5432 {
5433 *yyextra->copyArgString+=yytext;
5434 yyextra->fullArgString+=yytext;
5435 }
5436 }
5437<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5438 *yyextra->copyArgString+=yytext;
5439 yyextra->fullArgString+=yytext;
5440 if (yyextra->insidePHP)
5441 {
5442 yyextra->lastCopyArgStringContext=YY_START;
5443 BEGIN(CopyArgPHPString);
5444 }
5445 }
5446<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5447 *yyextra->copyArgString+=yytext;
5448 yyextra->fullArgString+=yytext;
5449 }
5450<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5452 *yyextra->copyArgString+=*yytext;
5453 yyextra->fullArgString+=*yytext;
5454 }
5455<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5456 *yyextra->copyArgString+=yytext;
5457 yyextra->fullArgString+=yytext;
5458 }
5459<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5460 *yyextra->copyArgString+=*yytext;
5461 yyextra->fullArgString+=*yytext;
5462 }
5463
5464
5465
5466
5467
5468
5469<FuncRound>"(" { yyextra->current->args += *yytext ;
5470 ++yyextra->roundCount ;
5471 }
5472<FuncRound>")" { yyextra->current->args += *yytext ;
5473 if ( yyextra->roundCount )
5474 --yyextra->roundCount ;
5475 else
5476 BEGIN( FuncQual ) ;
5477 }
5478
5479<FuncQual>"#" { if (yyextra->insidePHP)
5480 REJECT;
5481 yyextra->lastCPPContext = YY_START;
5482 BEGIN(SkipCPP);
5483 }
5484 */
5485<FuncQual>[{:;,] {
5486 if (
qstrcmp(yytext,
";")==0 &&
5487 ((yyextra->insideJS || yyextra->insidePHP) &&
5489 {
5490 yyextra->current->reset();
5492 BEGIN( FindMembers );
5493 }
5494 else
5495 {
5496 unput(*yytext); BEGIN( SFunction );
5497 }
5498 }
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
5499<FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
5501 yyextra->current->virt = Specifier::Pure;
5502 yyextra->current->args += " override ";
5503 }
5504<FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
5506 yyextra->current->spec.setOverride(true);
5507 yyextra->current->args += " override ";
5508 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5509 BEGIN(FuncQual);
5510 }
5511<FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
5513 yyextra->current->spec.setFinal(true);
5514 yyextra->current->args += " final ";
5515 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5516 BEGIN(FuncQual);
5517 }
5518<FuncQual>{BN}*"sealed"{BN}* { // sealed member function
5520 yyextra->current->spec.setSealed(true);
5521 yyextra->current->args += " sealed ";
5522 }
5523<FuncQual>{BN}*"new"{BN}* { // new member function
5525 yyextra->current->spec.setNew(true);
5526 yyextra->current->args += " new ";
5527 }
5528<FuncQual>{BN}*"const"{BN}* { // const member function
5530 yyextra->current->args += " const ";
5531 yyextra->current->argList.setConstSpecifier(
TRUE);
5532 }
5533<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
5535 yyextra->current->args += " volatile ";
5536 yyextra->current->argList.setVolatileSpecifier(
TRUE);
5537 }
5538<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
5540 yyextra->current->args += " noexcept ";
5541 yyextra->current->spec.setNoExcept(true);
5542 }
5543<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* { // noexcept(false) expression
5545 yyextra->current->args += " noexcept(false)";
5546 }
5547<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
5549 yyextra->current->args += " noexcept(";
5550 yyextra->current->spec.setNoExcept(true);
5551 yyextra->lastRoundContext=FuncQual;
5552 yyextra->pCopyRoundString=&yyextra->current->args;
5553 yyextra->roundCount=0;
5554 BEGIN(CopyRound);
5555 }
5556<FuncQual>{BN}*"&" {
5557 yyextra->current->args += " &";
5559 }
5560<FuncQual>{BN}*"&&" {
5561 yyextra->current->args += " &&";
5563 }
5564
5565<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
5567 yyextra->current->args += " = 0";
5568 yyextra->current->virt = Specifier::Pure;
5569 yyextra->current->argList.setPureSpecifier(
TRUE);
5570 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5571 BEGIN(FuncQual);
5572 }
5573<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
5575 yyextra->current->args += " = delete";
5576 yyextra->current->spec.setDelete(true);
5577 yyextra->current->argList.setIsDeleted(
TRUE);
5578 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5579 BEGIN(FuncQual);
5580 }
5581<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
5583 yyextra->current->args += " = default";
5584 yyextra->current->spec.setDefault(true);
5585 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5586 BEGIN(FuncQual);
5587 }
5588<FuncQual>{BN}*"->"{BN}* {
5590 yyextra->current->argList.setTrailingReturnType(" -> ");
5591 yyextra->current->args += " -> ";
5592 yyextra->roundCount=0;
5593 BEGIN(TrailingReturn);
5594 }
5595<TrailingReturn>[{;] {
5596 if (yyextra->roundCount>0) REJECT;
5597 unput(*yytext);
5598 yyextra->current->argList.finishTrailingReturnType();
5599 BEGIN(FuncQual);
5600 }
5601<TrailingReturn>"requires"{BN}+ {
5602 if (yyextra->insideJava) REJECT;
5603 yyextra->requiresContext = FuncQual;
5604 yyextra->current->req+=' ';
5605 yyextra->current->argList.finishTrailingReturnType();
5606 BEGIN(RequiresClause);
5607 }
5608<TrailingReturn>"(" {
5609 yyextra->roundCount++;
5610 yyextra->current->argList.appendTrailingReturnType(yytext);
5611 yyextra->current->args+=yytext;
5612 }
5613<TrailingReturn>")" {
5614 if (yyextra->roundCount>0)
5615 {
5616 yyextra->roundCount--;
5617 }
5618 else
5619 {
5620 warn(yyextra->fileName,yyextra->yyLineNr,
5621 "Found ')' without opening '(' for trailing return type '{})...'",
5622 yyextra->current->argList.trailingReturnType());
5623 }
5624 yyextra->current->argList.appendTrailingReturnType(yytext);
5625 yyextra->current->args+=yytext;
5626 }
5627<TrailingReturn>. {
5628 yyextra->current->argList.appendTrailingReturnType(yytext);
5629 yyextra->current->args+=yytext;
5630 }
5631<TrailingReturn>\n {
5633 yyextra->current->argList.appendTrailingReturnType(yytext);
5634 yyextra->current->args+=' ';
5635 }
5636<FuncRound,FuncFunc>{BN}*","{BN}* {
5638 yyextra->current->args += ", " ;
5639 }
5640<FuncQual,FuncRound,FuncFunc>{BN}+ {
5642 yyextra->current->args += ' ' ;
5643 }
5644<SFunction,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
5645 REJECT;
5646 yyextra->lastCPPContext = YY_START;
5647 BEGIN(SkipCPP);
5648 }
5649<FuncQual>"=>" {
5650 if (!yyextra->insideCS)
5651 REJECT;
5652
5653 unput('=');
5654 BEGIN(SFunction);
5655 }
5656<FuncQual>"=" {
5657 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5658 {
5659 BEGIN(CliOverride);
5660 }
5661 else
5662 {
5663
5664 yyextra->lastInitializerContext=YY_START;
5665 yyextra->sharpCount=0;
5666 yyextra->initBracketCount=0;
5667 yyextra->current->initializer.str(yytext);
5668 BEGIN(ReadInitializer);
5669 }
5670 }
5671<ReadExpressionBody>";" {
5672 if (!yyextra->current->sli.empty() && yyextra->previous)
5673 {
5674 yyextra->previous->sli = yyextra->current->sli;
5675 yyextra->current->sli.clear();
5676 }
5677 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5678 BEGIN(FindMembers);
5679 }
5680<CliOverride>{ID} {
5681 }
5682<CliOverride>"{" {
5683 unput(*yytext);
5684 BEGIN(FuncQual);
5685 }
5686<CliOverride>\n {
5688 }
5689<CliOverride>. {
5690 }
5691<FuncQual>{ID} {
5692 if (yyextra->insideCpp &&
qstrcmp(yytext,
"requires")==0)
5693 {
5694
5695 yyextra->requiresContext = YY_START;
5696 if (!yyextra->current->req.isEmpty())
5697 {
5698 yyextra->current->req+=" && ";
5699 }
5700 BEGIN(RequiresClause);
5701 }
5702 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
5703 {
5704
5705 yyextra->current->typeConstr.clear();
5706 yyextra->current->typeConstr.push_back(
Argument());
5707 yyextra->lastCSConstraint = YY_START;
5708 BEGIN( CSConstraintName );
5709 }
5711 {
5712 yyextra->current->args = yytext;
5713 yyextra->oldStyleArgType.clear();
5714 BEGIN(OldStyleArgs);
5715 }
5716 else
5717 {
5718 yyextra->current->args += yytext;
5719 }
5720 }
static bool checkForKnRstyleC(yyscan_t yyscanner)
5721<OldStyleArgs>[,;] {
5724 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5726 if (yyextra->current->doc!=yyextra->docBackup)
5727 {
5728 doc=yyextra->current->doc;
5729 yyextra->current->doc=yyextra->docBackup;
5730 }
5731 if (yyextra->current->brief!=yyextra->briefBackup)
5732 {
5733 brief=yyextra->current->brief;
5734 yyextra->current->brief=yyextra->briefBackup;
5735 }
5736 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5737 oldStyleArgName,brief,doc);
5738 yyextra->current->args.clear();
5739 if (*yytext==';') yyextra->oldStyleArgType.clear();
5740 }
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)
5741<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5742<OldStyleArgs>"{" {
5743 if (yyextra->current->argList.empty())
5744 {
5745 yyextra->current->argList.setNoParameters(
TRUE);
5746 }
5748 unput('{');
5749 BEGIN(FuncQual);
5750 }
5751<OldStyleArgs>. { yyextra->current->args += *yytext; }
5752<FuncQual,FuncRound,FuncFunc>\" {
5753 if (yyextra->insideIDL && yyextra->insideCppQuote)
5754 {
5755 BEGIN(EndCppQuote);
5756 }
5757 else
5758 {
5759 yyextra->current->args += *yytext;
5760 }
5761 }
5762<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5763<FuncQual>{BN}*"try:" |
5764<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
5765 yyextra->insideTryBlock=
TRUE;
5767 if (yytext[yyleng-1]==':')
5768 {
5769 unput(':');
5770 BEGIN( SFunction );
5771 }
5772 }
5773<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
5774 yyextra->current->exception = " throw (" ;
5775 yyextra->roundCount=0;
5777 BEGIN( ExcpRound ) ;
5778 }
5779<FuncQual>{BN}*"raises"{BN}*"(" {
5780 yyextra->current->exception = " raises (" ;
5782 yyextra->roundCount=0;
5783 BEGIN( ExcpRound ) ;
5784 }
5785<FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
5786 yyextra->current->exception = " throws " ;
5788 BEGIN( ExcpList );
5789 }
5790<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5791 ++yyextra->roundCount ;
5792 }
5793<ExcpRound>")" { yyextra->current->exception += *yytext ;
5794 if ( yyextra->roundCount )
5795 --yyextra->roundCount ;
5796 else
5797 BEGIN( FuncQual ) ;
5798 }
5799<ExcpRound>. {
5800 yyextra->current->exception += *yytext;
5801 }
5802<ExcpList>"{" {
5803 unput('{'); BEGIN( FuncQual );
5804 }
5805<ExcpList>";" {
5806 unput(';'); BEGIN( FuncQual );
5807 }
5808<ExcpList>"\n" {
5809 yyextra->current->exception += ' ';
5811 }
5812<ExcpList>. {
5813 yyextra->current->exception += *yytext;
5814 }
5815<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5816 yyextra->current->name = yyextra->current->args ;
5817 yyextra->current->args = yytext ;
5818 yyextra->roundCount=0;
5819 BEGIN( FuncRound ) ;
5820 }
5821<SFunction>":" {
5822 if (!yyextra->insidePHP) BEGIN(SkipInits);
5823 }
5824<SFunction>[=;{,] {
5828 yyextra->current->fileName = yyextra->fileName;
5829 yyextra->current->startLine = yyextra->yyBegLineNr;
5830 yyextra->current->startColumn = yyextra->yyBegColNr;
5831 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5833 std::string type = yyextra->current->type.str();
5834 int ti=-1;
5836 {
5837 ti = (int)
match.position();
5838 }
5839 if (ti!=-1)
5840 {
5841 int di = yyextra->current->type.find("decltype(");
5842 if (di!=-1 && di<ti)
5843 {
5844 ti=-1;
5845 }
5846 }
5847 int ts=yyextra->current->type.find('<');
5848 int te=yyextra->current->type.findRev('>');
5849
5850
5851 bool startsWithTypedef = yyextra->current->type.startsWith("typedef ");
5852 bool isFunction = ti==-1 ||
5853 (ts!=-1 && ts<te && ts<ti && ti<te);
5854 bool isVariable = !yyextra->current->type.isEmpty() &&
5855 (!isFunction || startsWithTypedef);
5856
5857
5858
5859
5860 if (*yytext!=';' || yyextra->current_root->section.isCompound())
5861 {
5862 if (isVariable)
5863 {
5864
5865 if (yyextra->isTypedef && !startsWithTypedef)
5866 {
5867 yyextra->current->type.prepend("typedef ");
5868 }
5869 yyextra->current->section = EntryType::makeVariable() ;
5870 }
5871 else
5872 {
5873
5874 yyextra->current->section = EntryType::makeFunction() ;
5875 yyextra->current->proto = *yytext==';';
5876 }
5877 }
5878 else
5879 {
5880
5881 if (isVariable)
5882 {
5883 if (yyextra->isTypedef && !startsWithTypedef)
5884 {
5885 yyextra->current->type.prepend("typedef ");
5886 }
5887
5888 yyextra->current->section = EntryType::makeVariable();
5889 }
5890 else
5891 {
5892
5893 yyextra->current->section = EntryType::makeFunction();
5894 yyextra->current->proto =
TRUE;
5895 }
5896 }
5897
5898 if ( yyextra->insidePHP)
5899 {
5901 {
5902 yyextra->current->spec.setFinal(true);
5903 }
5905 {
5906 yyextra->current->spec.setAbstract(true);
5907 }
5908 }
5909 if ( yyextra->insidePHP && !
containsWord(yyextra->current->type,
"function"))
5910 {
5912 if ( *yytext == '{' )
5913 {
5914 yyextra->lastCurlyContext = FindMembers;
5915 yyextra->curlyCount=0;
5916 BEGIN( SkipCurly );
5917 }
5918 else
5919 {
5920 BEGIN( FindMembers );
5921 }
5922 }
5923 else
5924 {
5925 if ( yyextra->insidePHP)
5926 {
5928 }
5929 yyextra->previous = yyextra->current;
5930 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5932
5933 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
5934 {
5935 yyextra->current->spec.setOptional(true).setRequired(true);
5936 }
5937 yyextra->lastCurlyContext = FindMembers;
5938 if ( *yytext == ',' )
5939 {
5940 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
5941 }
5942 if ( *yytext == '{' )
5943 {
5944 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
5945 {
5946 yyextra->previous->spec.setInline(true);
5947 }
5948 yyextra->curlyCount=0;
5949 BEGIN( SkipCurly ) ;
5950 }
5951 else if ( *yytext == '=' )
5952 {
5953 yyextra->previous->spec.setInline(true);
5954 yyextra->curlyCount=0;
5955 BEGIN( ReadExpressionBody );
5956 }
5957 else
5958 {
5959 if (!yyextra->previous->section.isVariable())
5960 yyextra->previous->bodyLine=-1;
5961 BEGIN( FindMembers ) ;
5962 }
5963 }
5964 }
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
5965<SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
5967 yyextra->curlyCount=1;
5968 BEGIN(SkipC11Inits);
5969 }
5970<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
5972 yyextra->curlyCount=1;
5973 BEGIN(SkipC11Inits);
5974 }
5975<SkipC11Inits>"{" {
5976 ++yyextra->curlyCount;
5977 }
5978<SkipC11Inits>"}" {
5979 if ( --yyextra->curlyCount<=0 )
5980 {
5981 BEGIN(SkipInits);
5982 }
5983 }
5984<SkipC11Attribute>"]]" {
5985 BEGIN(yyextra->lastC11AttributeContext);
5986 }
5987<SkipInits>"{" { // C++11 style initializer
5988 unput('{');
5989 BEGIN( SFunction );
5990 }
5991<SkipCurly>"{" {
5992
5993 ++yyextra->curlyCount ;
5994 }
5995<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
5996<SkipCurly>"}" {
5997
5998 if( yyextra->curlyCount )
5999 {
6000 --yyextra->curlyCount ;
6001 }
6002 else
6003 {
6004 if (!yyextra->current->sli.empty() && yyextra->previous)
6005 {
6006 yyextra->previous->sli = yyextra->current->sli;
6007 yyextra->current->sli.clear();
6008 }
6009 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
6010 BEGIN( yyextra->lastCurlyContext ) ;
6011 }
6012 }
6013<SkipCurly>"}"{BN}*{DCOMM}"<" {
6015 if ( yyextra->curlyCount )
6016 {
6017
6018 --yyextra->curlyCount ;
6019 }
6020 else
6021 {
6022 yyextra->current->endBodyLine=yyextra->yyLineNr;
6023 yyextra->tempEntry = yyextra->current;
6024 yyextra->current = yyextra->previous;
6025
6026 yyextra->docBlockContext = SkipCurlyEndDoc;
6027 yyextra->docBlockInBody =
FALSE;
6028 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6030 yyextra->docBlock.str(std::string());
6031 yyextra->docBlockTerm = '}';
6032 if (yytext[yyleng-3]=='/')
6033 {
6035 BEGIN( DocLine );
6036 }
6037 else
6038 {
6040 BEGIN( DocBlock );
6041 }
6042 }
6043 }
6044<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
6045 yyextra->docBlockContext = SkipCurlyEndDoc;
6046 yyextra->docBlockInBody =
FALSE;
6047 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6049 yyextra->docBlock.str(std::string());
6050 yyextra->docBlockTerm = '}';
6051 if (yytext[yyleng-3]=='/')
6052 {
6054 BEGIN( DocLine );
6055 }
6056 else
6057 {
6059 BEGIN( DocBlock );
6060 }
6061 }
6062<SkipCurlyEndDoc>"}" {
6063
6064 if (yyextra->tempEntry)
6065 {
6066 yyextra->current = yyextra->tempEntry;
6067 yyextra->tempEntry.reset();
6068 }
6069 BEGIN( yyextra->lastCurlyContext );
6070 }
6071<SkipCurly,ReadExpressionBody>\" {
6072
6073 yyextra->lastStringContext=YY_START;
6074 BEGIN( SkipString );
6075 }
6076<SkipCurly>^{B}*"#" {
6077 if (yyextra->insidePHP)
6078 REJECT;
6079
6080 BEGIN( SkipCurlyCpp );
6081 }
6082<SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute,ReadExpressionBody>\n {
6084
6085 }
6086<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
6087 if (!yyextra->insidePHP)
6088 {
6089 REJECT;
6090 }
6091 else
6092 {
6093 yyextra->lastHereDocContext = YY_START;
6094 BEGIN(HereDoc);
6095 }
6096 }
6097<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
6099 yyextra->lastRawStringContext = YY_START;
6100 yyextra->dummyRawString.clear();
6101 yyextra->pCopyRawString = &yyextra->dummyRawString;
6102 *yyextra->pCopyRawString += yytext;
6103 BEGIN(RawString);
6104 }
6105<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
6107
6108 }
6109<SkipCurly,SkipCurlyCpp>"\$" {}
6110<SkipCurlyCpp>\n {
6111
6113 yyextra->lastCurlyContext = FindMembers;
6114 BEGIN( SkipCurly );
6115 }
6116<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
6117
6119 }
6120<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>{CCS} {
6121
6122 yyextra->lastCContext = YY_START;
6123 BEGIN(SkipComment);
6124 }
6125<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>{CPPC} {
6126
6127 yyextra->lastCContext = YY_START;
6128 BEGIN(SkipCxxComment);
6129 }
6130<SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
6131 yyextra->roundCount=0;
6132 yyextra->lastSkipRoundContext=YY_START;
6133 BEGIN(SkipRound);
6134 }
6135<SkipInits,SkipC11Inits,SkipC11Attribute>\" {
6136 yyextra->lastStringContext=YY_START;
6137 BEGIN( SkipString );
6138 }
6139<SkipInits>; {
6140 warn(yyextra->fileName,yyextra->yyLineNr,
6141 "Found ';' while parsing initializer list! "
6142 "(doxygen could be confused by a macro call without semicolon)"
6143 );
6144 BEGIN( FindMembers );
6145 }
6146<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
6147 if (!yyextra->insidePHP)
6148 REJECT;
6149
6150 yyextra->lastCContext = YY_START;
6151 BEGIN(SkipCxxComment);
6152 }
6153<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>@\" {
6154 if (!yyextra->insideCS) REJECT;
6155
6156
6157 yyextra->lastSkipVerbStringContext=YY_START;
6158 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
6159 yyextra->dummyTextStream.clear();
6160 BEGIN(SkipVerbString);
6161 }
6162<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>{CHARLIT} {
6163 if (yyextra->insidePHP) REJECT;
6164 }
6165<SkipInits,SkipCurly,SkipCurlyCpp>\' {
6166 if (yyextra->insidePHP)
6167 {
6168 yyextra->lastStringContext=YY_START;
6169 BEGIN(SkipPHPString);
6170 }
6171 }
6172<SkipC11Attribute>{ID} {
6174 {
6175 yyextra->current->spec.setNoDiscard(true);
6176 }
6177 }
6178<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute,ReadExpressionBody>. { }
6179<SkipString,SkipPHPString>\\. { }
6180<SkipString>\" {
6181 BEGIN( yyextra->lastStringContext );
6182 }
6183<SkipPHPString>\' {
6184 BEGIN( yyextra->lastStringContext );
6185 }
6186<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
6187<SkipString,SkipPHPString>\n {
6189 }
6190<SkipString>"[[" { }
6191<SkipString,SkipPHPString>. { }
6192<CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
6193 unput(':');
6194 BEGIN(ClassVar);
6195 }
6196<CompoundName>";" {
6197 yyextra->current->section = EntryType::makeEmpty() ;
6198 yyextra->current->type.clear() ;
6199 yyextra->current->name.clear() ;
6200 yyextra->current->args.clear() ;
6201 yyextra->current->argList.clear();
6202 BEGIN( FindMembers ) ;
6203 }
6204<Bases>";" {
6205 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
6206 {
6207
6208
6209 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
6210 {
6212 }
6213 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6214
6215 if (!yyextra->baseName.isEmpty())
6216 {
6217 yyextra->current->extends.emplace_back(
6218 yyextra->baseName,Protection::Public,Specifier::Normal);
6219 yyextra->baseName.clear();
6220 }
6221 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
6223 }
6224 else
6225 {
6226 yyextra->current->section = EntryType::makeEmpty() ;
6227 yyextra->current->type.clear() ;
6228 yyextra->current->name.clear() ;
6229 yyextra->current->args.clear() ;
6230 yyextra->current->argList.clear();
6231 }
6232 BEGIN( FindMembers ) ;
6233 }
6234<CompoundName>{SCOPENAME}/{BN}*"<" {
6235 yyextra->sharpCount = 0;
6236 yyextra->current->name = yytext ;
6238 if (yyextra->current->spec.isProtocol())
6239 {
6240 yyextra->current->name+="-p";
6241 }
6243 yyextra->lastClassTemplSpecContext = ClassVar;
6244 if (yyextra->insideObjC)
6245 {
6246 BEGIN( ObjCProtocolList );
6247 }
6248 else if (yyextra->insideCS)
6249 {
6250
6251 BEGIN( CSGeneric );
6252 }
6253 else
6254 {
6255 yyextra->roundCount=0;
6256 BEGIN( ClassTemplSpec );
6257 }
6258 }
6259<CSGeneric>"<" {
6261
6262
6263 yyextra->current->tArgLists.
push_back(al);
6264 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
6265 yyextra->templateStr="<";
6266 yyextra->current->name += "<";
6267 yyextra->fullArgString = yyextra->templateStr;
6268 yyextra->copyArgString = &yyextra->current->name;
6269
6270 yyextra->currentArgumentContext = ClassVar;
6271 BEGIN( ReadTempArgs );
6272 }
6273<ObjCProtocolList>"<" {
6274 yyextra->insideProtocolList=
TRUE;
6275 BEGIN( Bases );
6276 }
6277<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
6278 yyextra->current->name += yytext;
6280 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6281 {
6283 if (yyextra->current->spec.isProtocol())
6284 {
6285 unput('{');
6286 BEGIN( ClassVar );
6287 }
6288 else
6289 {
6290 BEGIN( yyextra->lastClassTemplSpecContext );
6291 }
6292 }
6293 }
6294<ClassTemplSpec>"<" {
6295 yyextra->current->name += yytext;
6296 if (yyextra->roundCount==0) yyextra->sharpCount++;
6297 }
6298<ClassTemplSpec>. {
6299 yyextra->current->name += yytext;
6300 }
6301<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" { // forward declaration?
6302 if (yyextra->insideCS && yyextra->current->type == "namespace")
6303 {
6304
6306 yyextra->current->name =
substitute(yytext,
".",
"::");
6307 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6308 yyextra->fakeNS++;
6309 unput('{');
6310 BEGIN( ClassVar );
6311 }
6312 else if (!yyextra->current->tArgLists.empty())
6313 {
6314
6315
6316 yyextra->current->name = yytext;
6317 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6319
6320 QCString rn = yyextra->current_root->name;
6321
6322 if (!yyextra->current->name.isEmpty() && !rn.
isEmpty())
6323 {
6325 }
6326 yyextra->current->spec.setForwardDecl(true);
6327 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6328 }
6329 else if (yyextra->insideIDL &&
6330 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6331 yyextra->current->spec.isInterface()) ||
6332 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6333 yyextra->current->spec.isService())
6334 )
6335 )
6336 {
6337
6338
6339
6340
6341 yyextra->current->name = yytext;
6342 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6343 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6345
6346 yyextra->current->spec.setInterface(false).setService(false);
6347
6348
6349
6350 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6351 }
6352
6353 if (!(yyextra->insideCS && yyextra->current->type == "namespace"))
6354 {
6355 unput(';');
6356 yyextra->current->reset();
6358 if (yyextra->insideObjC)
6359 {
6360 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6361 yyextra->insideObjC =
FALSE;
6362 }
6363 if (yyextra->isTypedef)
6364 {
6365 yyextra->current->type.prepend("typedef");
6366 }
6367 BEGIN( FindMembers );
6368 }
6369 }
6370<CompoundName>{SCOPENAME}/{BN}*"(" {
6371 yyextra->current->name = yytext ;
6374 if (yyextra->insideCpp && yyextra->current->name=="alignas")
6375 {
6376 yyextra->lastAlignAsContext = YY_START;
6377 BEGIN( AlignAs );
6378 }
6379 else
6380 {
6381 if (yyextra->current->spec.isProtocol())
6382 {
6383 yyextra->current->name += "-p";
6384 }
6385 BEGIN( ClassVar );
6386 }
6387 }
6388<AlignAs>"(" { yyextra->roundCount=0;
6389 BEGIN( AlignAsEnd );
6390 }
6391<AlignAs>\n { lineCount(yyscanner); }
6392<AlignAs>.
6393<AlignAsEnd>"(" { yyextra->roundCount++; }
6394<AlignAsEnd>")" { if (--yyextra->roundCount<0)
6395 {
6396 BEGIN( yyextra->lastAlignAsContext );
6397 }
6398 }
6399<AlignAsEnd>\n { lineCount(yyscanner); }
6400<AlignAsEnd>.
6401<ConceptName>{ID} {
6402 yyextra->current->name = yytext ;
6404 }
6405<ConceptName>"=" {
6406 yyextra->current->bodyLine = yyextra->yyLineNr;
6407 yyextra->current->bodyColumn = yyextra->yyColNr;
6408 yyextra->current->initializer.str(std::string());
6409 yyextra->lastInitializerContext = FindMembers;
6410 yyextra->sharpCount=0;
6411 yyextra->initBracketCount=0;
6412 BEGIN(ReadInitializer);
6413 }
6414<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
6415
6416 yyextra->current->reset();
6418 }
6419<CompoundName>{SCOPENAME} {
6420 yyextra->current->name = yytext ;
6423 if (yyextra->current->spec.isProtocol())
6424 {
6425 yyextra->current->name += "-p";
6426 }
6427 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6428 {
6429 unput('{');
6430 }
6431 BEGIN( ClassVar );
6432 }
6433<CompoundName>{CSSCOPENAME} { // C# style scope
6434 yyextra->current->name =
substitute(yytext,
".",
"::");
6436 BEGIN( ClassVar );
6437 }
6438<ClassVar>{SCOPENAME}{BNopt}/"(" {
6439 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6440 {
6441
6442 yyextra->roundCount=0;
6443 BEGIN(SkipUnionSwitch);
6444 }
6445 else
6446 {
6448 yyextra->yyBegColNr=yyextra->yyColNr;
6449 yyextra->yyBegLineNr=yyextra->yyLineNr;
6450 yyextra->current->name = yytext;
6451 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6454 BEGIN( FindMembers );
6455 }
6456 }
6457<ClassVar>"," {
6458 if (yyextra->isTypedef)
6459 {
6460
6461 unput(',');
6462 yyextra->current->type.prepend("typedef ");
6463 BEGIN(FindMembers);
6464 }
6465 else
6466 {
6467
6468 }
6469 }
6470<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6471 if (yyextra->insideCli)
6472 {
6473 if (yytext[0]=='s')
6474 yyextra->current->spec.setSealedClass(true);
6475 else
6476 yyextra->current->spec.setAbstractClass(true);
6477 BEGIN( ClassVar );
6478 }
6479 else
6480 {
6481 REJECT;
6482 }
6483 }
6484<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6485 yyextra->yyBegColNr=yyextra->yyColNr;
6486 yyextra->yyBegLineNr=yyextra->yyLineNr;
6489 if (yyextra->current->section.isEnum())
6490 {
6491 yyextra->current->section = EntryType::makeVariable() ;
6492 }
6493 yyextra->current->type += ' ' ;
6494 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...
6496
6498 {
6499 BEGIN( Operator );
6500 }
6501 }
6502<ClassVar>{ID} {
6503 yyextra->yyBegColNr=yyextra->yyColNr;
6504 yyextra->yyBegLineNr=yyextra->yyLineNr;
6506 if (yyextra->insideIDL &&
qstrcmp(yytext,
"switch")==0)
6507 {
6508
6509 yyextra->roundCount=0;
6510 BEGIN(SkipUnionSwitch);
6511 }
6512 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
qstrcmp(yytext,
"implements")==0 ||
qstrcmp(yytext,
"extends")==0))
6513 {
6514 yyextra->current->type.clear();
6515 yyextra->baseProt = Protection::Public;
6516 yyextra->baseVirt = Specifier::Normal;
6517 yyextra->baseName.clear();
6518 BEGIN( BasesProt ) ;
6519 }
6520 else if (yyextra->insideCS &&
qstrcmp(yytext,
"where")==0)
6521 {
6522 yyextra->current->typeConstr.clear();
6523 yyextra->current->typeConstr.push_back(
Argument());
6524 yyextra->lastCSConstraint = YY_START;
6525 BEGIN( CSConstraintName );
6526 }
6527 else if (yyextra->insideCli &&
qstrcmp(yytext,
"abstract")==0)
6528 {
6529 yyextra->current->spec.setAbstract(true);
6530 }
6531 else if (yyextra->insideCli &&
qstrcmp(yytext,
"sealed")==0)
6532 {
6533 yyextra->current->spec.setSealed(true);
6534 }
6535 else if (
qstrcmp(yytext,
"final")==0)
6536 {
6537 yyextra->current->spec.setFinal(true);
6538 }
6539 else
6540 {
6541 if (yyextra->current->section.isEnum())
6542 {
6543 yyextra->current->section = EntryType::makeVariable() ;
6544 }
6545 yyextra->current->type += ' ' ;
6546 yyextra->current->type += yyextra->current->name ;
6547 yyextra->current->name = yytext ;
6548
6550 {
6551 BEGIN( Operator );
6552 }
6553 }
6554 }
6555<ClassVar>[(\[] {
6556 if (yyextra->insideObjC && *yytext=='(')
6557 {
6558 yyextra->current->name+='(';
6559 yyextra->current->spec.setCategory(true);
6560 BEGIN( ClassCategory );
6561 }
6562 else if (yyextra->insideCS && *yytext=='(')
6563 {
6564 yyextra->current->args=yytext;
6565 yyextra->currentArgumentContext = ClassVar;
6566 yyextra->fullArgString = yyextra->current->args;
6567 yyextra->copyArgString = &yyextra->current->args;
6568 BEGIN( ReadFuncArgType ) ;
6569 }
6570 else
6571 {
6572
6573 unput(*yytext);
6574 BEGIN( FindMembers );
6575 }
6576 }
6577<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
6578<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
6579 yyextra->fullArgString.clear();
6580 yyextra->lastCopyArgChar='#';
6581 yyextra->lastCommentInArgContext=YY_START;
6582 if (yytext[1]=='/')
6583 BEGIN( CopyArgCommentLine );
6584 else
6585 BEGIN( CopyArgComment );
6586 }
6587<CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
6588 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6589 }
6590<CSConstraintType>"=>" { // end of type constraint reached
6591
6593 unput('>');
6594 unput('=');
6595 BEGIN( yyextra->lastCSConstraint );
6596 }
6597<CSConstraintType>"{" { // end of type constraint reached
6598
6600 unput('{');
6601 BEGIN( yyextra->lastCSConstraint );
6602 }
6603<CSConstraintType,CSConstraintName>";" {
6605 unput(';');
6606 BEGIN( yyextra->lastCSConstraint );
6607 }
6608<CSConstraintName>":" {
6609 BEGIN( CSConstraintType );
6610 }
6611<CSConstraintName>{ID} {
6612
6613 yyextra->current->typeConstr.back().name=yytext;
6614 }
6615<CSConstraintType>"where" { // another constraint for a different param
6616 yyextra->current->typeConstr.push_back(
Argument());
6617 BEGIN( CSConstraintName );
6618 }
6619<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6620 if (yyextra->current->typeConstr.back().type.isEmpty())
6621
6622 {
6623 yyextra->current->typeConstr.back().type=yytext;
6624 }
6625 else
6626 {
6627 QCString name = yyextra->current->typeConstr.back().name;
6628 yyextra->current->typeConstr.push_back(
Argument());
6629 yyextra->current->typeConstr.back().name=name;
6630 yyextra->current->typeConstr.back().type=yytext;
6631 }
6632 }
6633<CSConstraintName,CSConstraintType>\n {
6635 }
6636<CSConstraintName,CSConstraintType>. {
6637 }
6638<ClassCategory>{ID} {
6639 yyextra->current->name+=yytext;
6640 }
6641<ClassCategory>")"/{BN}*"{" {
6642 yyextra->current->name+=')';
6643 BEGIN( ClassVar );
6644 }
6645<ClassCategory>")"/{BN}*"<" {
6646 yyextra->current->name+=')';
6647 BEGIN( ObjCProtocolList );
6648 }
6649<ClassCategory>")" {
6650 yyextra->current->name+=')';
6651 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6652 {
6653 unput('{');
6654 }
6655 else
6656 {
6657 unput('}');
6658 unput('{');
6659 }
6660 BEGIN( ClassVar );
6661 }
6662<ClassVar>":" {
6663 if (yyextra->current->section.isVariable())
6664 {
6665 yyextra->current->bitfields+=":";
6666 yyextra->current->args.clear();
6667 BEGIN(BitFields);
6668 }
6669 else if (yyextra->current->section.isEnum())
6670
6671 {
6672 yyextra->current->args.clear();
6673 BEGIN(EnumBaseType);
6674 }
6675 else
6676 {
6677 yyextra->current->type.clear();
6678 if (yyextra->current->spec.isInterface() ||
6679 yyextra->current->spec.isStruct() ||
6680 yyextra->current->spec.isRef() ||
6681 yyextra->current->spec.isValue() ||
6682 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6683 )
6684 {
6685 yyextra->baseProt = Protection::Public;
6686 }
6687 else
6688 {
6689 yyextra->baseProt = Protection::Private;
6690 }
6691 yyextra->baseVirt = Specifier::Normal;
6692 yyextra->baseName.clear();
6693 BEGIN( BasesProt ) ;
6694 }
6695 }
6696<ClassVar>[;=*&] {
6697 if (yyextra->isTypedef)
6698 {
6699 yyextra->current->type.prepend("typedef");
6700 }
6701 if ((yytext[0]=='*' || yytext[0]=='&') && yyextra->current->section.isEnum())
6702 {
6703 yyextra->current->section = EntryType::makeVariable() ;
6704 }
6705 if (yytext[0]==';' && yyextra->current->section.isEnum())
6706 {
6707 yyextra->current->reset();
6709 }
6710 else
6711 {
6712 unput(*yytext);
6713 }
6714 BEGIN( FindMembers );
6715 }
6716<Bases,ClassVar>{CPPC}"/"/[^/] {
6717 if (!yyextra->insideObjC)
6718 {
6719 REJECT;
6720 }
6721 else
6722 {
6724 yyextra->current->program << yytext;
6725 yyextra->current->fileName = yyextra->fileName ;
6726 yyextra->current->startLine = yyextra->yyLineNr ;
6727 yyextra->current->startColumn = yyextra->yyColNr;
6728 yyextra->curlyCount=0;
6729 BEGIN( ReadBodyIntf );
6730 }
6731 }
6732<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6733<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6734<Bases,ClassVar>{CPPC}"!" |
6735<Bases,ClassVar>[\-+]{BN}* {
6736 if (!yyextra->insideObjC)
6737 {
6738 REJECT;
6739 }
6740 else
6741 {
6743 yyextra->current->program << yytext;
6744 yyextra->current->fileName = yyextra->fileName ;
6745 yyextra->current->startLine = yyextra->yyLineNr ;
6746 yyextra->current->startColumn = yyextra->yyColNr;
6747 yyextra->curlyCount=0;
6748 BEGIN( ReadBodyIntf );
6749 }
6750 }
6751<CompoundName,ClassVar>{B}*"{"{B}* {
6752 yyextra->current->program.str(std::string());
6753 yyextra->current->fileName = yyextra->fileName ;
6754 yyextra->current->bodyLine = yyextra->yyLineNr;
6755 yyextra->current->bodyColumn = yyextra->yyColNr;
6757 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef)
6758 {
6759 if (yyextra->current->section.isNamespace())
6760 {
6762 {
6763 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6764 }
6765 else
6766 {
6768 }
6769 }
6770 else
6771 {
6773 }
6774 }
6775 yyextra->curlyCount=0;
6776 if (yyextra->current_root &&
6777 !yyextra->current_root->spec.isInterface() &&
6778 (yyextra->current->spec.isInterface() ||
6779 yyextra->current->spec.isProtocol() ||
6780 yyextra->current->spec.isCategory() ||
6781 yyextra->current->section.isObjcImpl()
6782 ) &&
6783 yyextra->insideObjC
6784 )
6785 {
6786 BEGIN( ReadBodyIntf );
6787 }
6788 else if (yyextra->current->section.isNamespace())
6789 {
6790 BEGIN( ReadNSBody );
6791 }
6792 else
6793 {
6794 BEGIN( ReadBody ) ;
6795 }
6796 }
QCString stripPath(const QCString &s)
6797<BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6798<BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6799<BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6800<BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6801<BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6802<BasesProt>{BN} { lineCount(yyscanner); }
6803<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6804<Bases>"decltype"{BN}*"(" {
6806 yyextra->roundCount=0;
6807 yyextra->lastSkipRoundContext=YY_START;
6808 BEGIN(SkipRound);
6809 }
6810<Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
6811 if (!yyextra->insidePHP)
6812 {
6813 REJECT;
6814 }
6815 else
6816 {
6820 yyextra->baseName += bn;
6821 yyextra->current->args += ' ';
6822 yyextra->current->args += yytext;
6823 }
6824 }
6825<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6829 {
6830
6831 yyextra->current->typeConstr.clear();
6832 yyextra->current->typeConstr.push_back(
Argument());
6833 yyextra->lastCSConstraint = YY_START;
6834 BEGIN( CSConstraintName );
6835 }
6836 else
6837 {
6838 yyextra->baseName+=yytext;
6839 yyextra->current->args += ' ';
6840 yyextra->current->args += yytext;
6841 }
6842 }
6843<Bases>{BN}*{ID}("."{ID})* { // Java style class
6845 yyextra->baseName += name;
6846 yyextra->current->args += ' ';
6847 yyextra->current->args += name;
6848 }
6849<ClassVar,Bases>\n/{BN}*[^{, \t\n:] {
6850 if (!yyextra->insideObjC)
6851 {
6852 REJECT;
6853 }
6854 else
6855 {
6857 unput('{');
6858 }
6859 }
6860<ClassVar,Bases>"@end" { // empty ObjC interface
6861 unput('d');
6862 unput('n');
6863 unput('e');
6864 unput('@');
6865 unput('}');
6866 unput('{');
6867 }
6868<ClassVar>"<" { yyextra->current->name += *yytext;
6869 yyextra->sharpCount=1;
6870 yyextra->roundCount=0;
6871 yyextra->lastSkipSharpContext = YY_START;
6872 yyextra->specName = &yyextra->current->name;
6873 BEGIN ( Specialization );
6874 }
6875<Bases>{BN}*"<" {
6877 yyextra->sharpCount=1;
6878 yyextra->roundCount=0;
6879 yyextra->lastSkipSharpContext = YY_START;
6880 if (yyextra->insideObjC)
6881 {
6882 unput(',');
6883 }
6884 else
6885 {
6886
6887
6888
6889
6890 yyextra->templateStr = yytext;
6891 yyextra->specName = &yyextra->templateStr;
6892 BEGIN ( Specialization );
6893 }
6894 }
6895<Specialization>"<" { *yyextra->specName += *yytext;
6896 if (yyextra->roundCount==0) yyextra->sharpCount++;
6897 }
6898<Specialization>">" {
6899 *yyextra->specName += *yytext;
6900 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6901 {
6903 BEGIN(yyextra->lastSkipSharpContext);
6904 }
6905 }
6906<Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6907<Specialization>"<<" { *yyextra->specName += yytext; }
6908<Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6909 unput('>');
6910 unput(' ');
6911 unput('>');
6912 }
6913<Specialization>">>" {
6914 if (yyextra->insideCS)
6915 {
6916 REJECT;
6917 }
6918 else
6919
6920
6921
6922
6923 {
6924 if (yyextra->roundCount>0)
6925 {
6926 *yyextra->specName += yytext;
6927 }
6928 else
6929 {
6930 unput('>');
6931 unput(' ');
6932 unput('>');
6933 }
6934 }
6935 }
6936<Specialization>"typename"{BN}+ { lineCount(yyscanner); }
6937<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
6938<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
6939
6940<Specialization>"\\\\" { *yyextra->specName += *yytext;}
6941<Specialization>"\\'" { *yyextra->specName += *yytext;}
6942<Specialization>"\\\"" { *yyextra->specName += *yytext;}
6943<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
6944<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
6945<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
6946<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
6947<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6948<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
6949<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6950<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
6951
6952<Specialization>. {
6953 *yyextra->specName += *yytext;
6954 }
6955<SkipRound>"(" { ++yyextra->roundCount; }
6956<SkipRound>")" { if (--yyextra->roundCount<0)
6957 BEGIN ( yyextra->lastSkipRoundContext );
6958 }
6959<SkipRound>\" {
6960 yyextra->lastStringContext=SkipRound;
6961 BEGIN(SkipString);
6962 }
6963<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
6964 if (yyextra->insideProtocolList)
6965 {
6966 yyextra->baseName+="-p";
6967 }
6968 else
6969 {
6970 yyextra->current->args += ',' ;
6971 }
6973 if (!yyextra->baseName.isEmpty())
6974 {
6975 yyextra->current->extends.emplace_back(
6976 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
6977 );
6978 }
6979 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
6980 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
6981 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
6982 {
6983 yyextra->baseProt=Protection::Public;
6984 }
6985 else
6986 {
6987 yyextra->baseProt=Protection::Private;
6988 }
6989 yyextra->baseVirt=Specifier::Normal;
6990 yyextra->baseName.clear();
6991 if (*yytext=='>')
6992 {
6993 yyextra->insideProtocolList=
FALSE;
6994 if (yyleng==1)
6995 {
6996 if (yyextra->insideObjC && !yyextra->current->spec.isProtocol())
6997 {
6998 BEGIN(ClassVar);
6999 }
7000 else
7001 {
7002 unput('{');
7003 }
7004 }
7005 else
7006 {
7007 yyless(1);
7008 }
7009 }
7010 else
7011 {
7012 if (*yytext==',' && yyextra->insideObjC)
7013 {
7014 yyextra->insideProtocolList=
TRUE;
7015 }
7016 BEGIN(BasesProt);
7017 }
7018 }
7019<Bases>{B}*"{"{B}* {
7020 yyextra->current->program.str(std::string());
7021 yyextra->current->fileName = yyextra->fileName ;
7022 yyextra->current->bodyLine = yyextra->yyLineNr;
7023 yyextra->current->bodyColumn = yyextra->yyColNr;
7025 if (!yyextra->baseName.isEmpty())
7026 {
7027 yyextra->current->extends.emplace_back(
7028 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7029 );
7030 yyextra->baseName.clear();
7031 }
7032 yyextra->curlyCount=0;
7033 if (yyextra->insideObjC)
7034 {
7035 BEGIN( ReadBodyIntf );
7036 }
7037 else
7038 {
7039 BEGIN( ReadBody ) ;
7040 }
7041 }
7042<SkipUnionSwitch>{B}*"(" {
7043 yyextra->roundCount++;
7044 }
7045<SkipUnionSwitch>")" {
7046 if (--yyextra->roundCount==0)
7047 {
7048 BEGIN(ClassVar);
7049 }
7050 }
7051<SkipUnionSwitch>\n { lineCount(yyscanner); }
7052<SkipUnionSwitch>.
7053<Comment>{BN}+ { yyextra->current->program << yytext ;
7055 }
7056<Comment>{CCS} { yyextra->current->program << yytext ; }
7057<Comment>{CPPC} { yyextra->current->program << yytext ; }
7058<Comment>{CMD}("code"|"verbatim"|"iliteral") {
7059 if (yyextra->doxygenComment) yyextra->insideCode=
TRUE;
7060 yyextra->current->program << yytext ;
7061 }
7062<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
7063 if (yyextra->doxygenComment) yyextra->insideCode=
FALSE;
7064 yyextra->current->program << yytext ;
7065 }
7066<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
7067<Comment>{CCE} { yyextra->current->program << yytext ;
7068 if (!yyextra->insideCode)
7069 {
7070 yyextra->doxygenComment=false;
7071 BEGIN( yyextra->lastContext );
7072 }
7073 }
7074<Comment>. { yyextra->current->program << *yytext ; }
7075
7076<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,ReadExpressionBody,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
7077
7078 if (!yyextra->current->doc.isEmpty())
7079 {
7080 yyextra->current->doc+="\n\n";
7081 }
7082 else
7083 {
7084 yyextra->current->docLine = yyextra->yyLineNr;
7085 yyextra->current->docFile = yyextra->fileName;
7086 }
7087
7088 yyextra->lastDocContext = YY_START;
7089 if (yyextra->current_root->section.isScope())
7090 {
7091 yyextra->current->inside = yyextra->current_root->name+"::";
7092 }
7093 yyextra->docBlockContext = YY_START;
7094 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7096
7099 yyextra->docBlock.
str(indent.
str());
7100
7101 if (yyextra->docBlockAutoBrief)
7102 {
7103 yyextra->current->briefLine = yyextra->yyLineNr;
7104 yyextra->current->briefFile = yyextra->fileName;
7105 }
7107 BEGIN( DocBlock );
7108 }
7109<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,ReadExpressionBody,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
7112
7113 if( javadocBanner )
7114 {
7115 yyextra->lastDocContext = YY_START;
7116
7117
7118 if (yyextra->current_root->section.isScope())
7119 {
7120 yyextra->current->inside = yyextra->current_root->name+"::";
7121 }
7122 yyextra->current->docLine = yyextra->yyLineNr;
7123 yyextra->current->docFile = yyextra->fileName;
7124 yyextra->docBlockContext = YY_START;
7125 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7127 yyextra->docBlockAutoBrief = javadocAutoBrief;
7128
7131 yyextra->docBlock.
str(indent.
str());
7132
7133 if (yyextra->docBlockAutoBrief)
7134 {
7135 yyextra->current->briefLine = yyextra->yyLineNr;
7136 yyextra->current->briefFile = yyextra->fileName;
7137 }
7139 BEGIN( DocBlock );
7140 }
7141 else
7142 {
7143 yyextra->current->program << yytext ;
7144 yyextra->lastContext = YY_START ;
7145 yyextra->doxygenComment=true;
7146 BEGIN( Comment ) ;
7147 }
7148 }
7149<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,ReadExpressionBody,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7151 yyextra->yyColNr=1;
7152 REJECT;
7153 }
7154<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,ReadExpressionBody,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7155 yyextra->lastDocContext = YY_START;
7156
7157
7158 if (yyextra->current_root->section.isScope())
7159 {
7160 yyextra->current->inside = yyextra->current_root->name+"::";
7161 }
7162 yyextra->current->docLine = yyextra->yyLineNr;
7163 yyextra->current->docFile = yyextra->fileName;
7164 yyextra->docBlockContext = YY_START;
7165 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7167 yyextra->docBlockAutoBrief = javadocAutoBrief;
7168
7171 yyextra->docBlock.
str(indent.
str());
7172
7173 if (yyextra->docBlockAutoBrief)
7174 {
7175 yyextra->current->briefLine = yyextra->yyLineNr;
7176 yyextra->current->briefFile = yyextra->fileName;
7177 }
7179 BEGIN( DocBlock );
7180 }
7181<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
7182 yyextra->lastDocContext = YY_START;
7183 if (yyextra->current_root->section.isScope())
7184 {
7185 yyextra->current->inside = yyextra->current_root->name+"::";
7186 }
7187 yyextra->docBlockContext = YY_START;
7188 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7189 yyextra->docBlockAutoBrief =
FALSE;
7190
7193 yyextra->docBlock.
str(indent.
str());
7194
7196 BEGIN( DocLine );
7197 }
7198<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
7199 yyextra->lastDocContext = YY_START;
7200 if (yyextra->current_root->section.isScope())
7201 {
7202 yyextra->current->inside = yyextra->current_root->name+"::";
7203 }
7204 yyextra->docBlockContext = YY_START;
7205 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7206 yyextra->docBlockAutoBrief =
FALSE;
7209 yyextra->docBlock.
str(indent.
str());
7211 BEGIN( DocLine );
7212 }
7213<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
7215 yyextra->externLinkage=
TRUE;
7216 }
7217<FindMembers>"{" {
7218 if (yyextra->externLinkage)
7219 {
7220 yyextra->externLinkage=
FALSE;
7221 }
7222 else if (yyextra->insideCS &&
7223 !yyextra->current->name.isEmpty() &&
7224 !yyextra->current->type.isEmpty())
7225 {
7226 if (yyextra->current->mtype == MethodTypes::Event)
7227 {
7228 yyextra->mtype = MethodTypes::Event;
7229 }
7231 {
7232 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
7233 }
7234 else
7235 {
7236 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
7237 }
7238 yyextra->current->bodyLine = yyextra->yyLineNr;
7239 yyextra->current->bodyColumn = yyextra->yyColNr;
7240 yyextra->curlyCount=0;
7241 BEGIN( CSAccessorDecl );
7242 }
7243 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
7244 {
7245
7246
7247 yyextra->current->exception = " {";
7248 BEGIN(UNOIDLAttributeBlock);
7249 }
7250 else
7251 {
7252 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
7253 yyextra->current->name.isEmpty()
7254 )
7255 {
7256
7257 yyextra->needsSemi =
FALSE;
7258 if (yyextra->current->isStatic)
7259 {
7260 yyextra->current->name="[static initializer]";
7261 yyextra->current->type.clear();
7262 }
7263 else
7264 {
7265 yyextra->current->name="[instance initializer]";
7266 }
7267 unput(*yytext);
7268 BEGIN( SFunction );
7269 }
7270 else
7271 {
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282 yyextra->current->bodyLine = yyextra->yyLineNr;
7283 yyextra->current->bodyColumn = yyextra->yyColNr;
7284 yyextra->current->initializer.str(yytext);
7285 yyextra->lastInitializerContext = YY_START;
7286 yyextra->sharpCount=0;
7287 yyextra->initBracketCount=1;
7288 BEGIN(ReadInitializer);
7289 }
7290 }
7291 }
7292<CSAccessorDecl>"{" { yyextra->curlyCount++; }
7293<CSAccessorDecl>"}"{B}*"=" {
7294
7295 if (yyextra->curlyCount != 0) REJECT;
7296 yyextra->current->initializer.str("=");
7297 yyextra->current->endBodyLine=yyextra->yyLineNr;
7298 yyextra->lastInitializerContext = FindMembers;
7299 BEGIN(ReadInitializer);
7300 }
7301<CSAccessorDecl>"}" {
7302 if (yyextra->curlyCount)
7303 {
7304 yyextra->curlyCount--;
7305 }
7306 else
7307 {
7308 yyextra->mtype = MethodTypes::Method;
7309 yyextra->virt = Specifier::Normal;
7310
7311 yyextra->current->endBodyLine=yyextra->yyLineNr;
7312 unput(';');
7313 BEGIN(FindMembers);
7314 }
7315 }
7316<CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(true); }
7317<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(true); }
7318<CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(true); }
7319<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(true); }
7320<CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(true); }
7321<CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(true); }
7322<CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(true); }
7323<CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(true); }
7324<CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(true); }
7325<CSAccessorDecl>{CHARLIT} {}
7326<CSAccessorDecl>"\"" { BEGIN(CSString);}
7327<CSAccessorDecl>"." {}
7328<CSAccessorDecl>\n { lineCount(yyscanner); }
7329<CSString>"\"" { BEGIN(CSAccessorDecl);}
7330<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
7331<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
7332<CSString>\n { lineCount(yyscanner); }
7333<CSString>"." {}
7334
7335
7336
7337<SliceSequence>{SCOPENAME} {
7338 if (yyextra->current->spec.isLocal())
7339 {
7340 yyextra->current->type = "local ";
7341 }
7342 yyextra->current->type += "sequence<";
7343 yyextra->current->type += yytext;
7344 yyextra->current->type += ">";
7345 }
7346
7347<SliceSequence>{BN}*">"{BN}* {
7349 BEGIN(SliceSequenceName);
7350 }
7351
7352<SliceSequenceName>{ID}{BN}* {
7354 yyextra->current->name = yytext ;
7355 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7356 }
7357
7358<SliceSequenceName>";" {
7359 yyextra->current->section = EntryType::makeVariable();
7360 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7362 BEGIN(FindMembers);
7363 }
7364
7365<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7367 if (yyextra->current->spec.isLocal())
7368 {
7369 yyextra->current->type = "local ";
7370 }
7371 yyextra->current->type += "dictionary<";
7372 yyextra->current->type += yytext;
7373 yyextra->current->type += ">";
7374 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7375 }
7376
7377<SliceDictionary>{BN}*">"{BN}* {
7379 BEGIN(SliceDictionaryName);
7380 }
7381
7382<SliceDictionaryName>{ID}{BN}* {
7384 yyextra->current->name = yytext ;
7385 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7386 }
7387
7388<SliceDictionaryName>";" {
7389 yyextra->current->section = EntryType::makeVariable();
7390 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7392 BEGIN(FindMembers);
7393 }
7394
7395
7396
7397
7398
7399
7400<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
7401 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
7402 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7404 }
7405<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
7406 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7407 BEGIN( yyextra->docBlockContext );
7408 }
7409<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
7410 yyextra->docBlock << yytext;
7411 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7412 BEGIN( yyextra->docBlockContext );
7413 }
7414<DocLine>{NONLopt}/"\n" { // whole line
7415 yyextra->docBlock << yytext;
7416 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
7417 BEGIN( yyextra->docBlockContext );
7418 }
7419
7420
7421
7422<DocBlock>"*"*{CCE} { // end of comment block
7424 BEGIN(yyextra->docBlockContext);
7425 }
7426<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7429 yyextra->docBlock << "\\ilinebr " << indent;
7430 }
7431<DocBlock>^{B}*"*"+/[^/] {
7434 yyextra->docBlock << indent;
7435 }
7436<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
7439 yyextra->docBlock << indent;
7440 }
7441<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
7442 }
7443<DocBlock>{CPPC} { // slashes in the middle of a comment block
7444 yyextra->docBlock << yytext;
7445 }
7446<DocBlock>{CCS} { // start of a new comment in the
7447
7448 yyextra->docBlock << yytext;
7449 }
7450<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
7451 yyextra->docBlock << yytext;
7452 }
7453<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7454 yyextra->docBlock << yytext;
7455 char blockName[] = "f$";
7456 char c = yytext[2];
7457 if (c=='[') blockName[1]=']';
7458 else if (c=='{') blockName[1]='}';
7459 else if (c=='(') blockName[1]=')';
7461 BEGIN(DocCopyBlock);
7462 }
static void startVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0, bool codeBlock=false)
7463<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7464 yyextra->fileName = &yytext[6];
7465 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7466 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7467 yyextra->docBlock << yytext;
7468 }
7469<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7470 yyextra->fileName = &yytext[6];
7471 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7472 yyextra->docBlock << yytext;
7473 }
7474<DocBlock>{CMD}"iline"{LINENR}{B} {
7475 bool ok = false;
7477 if (!ok)
7478 {
7479 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7480 }
7481 else
7482 {
7483 yyextra->yyLineNr = nr;
7484 }
7485 yyextra->docBlock << yytext;
7486 }
7487<DocBlock>{B}*"<"{PRE}">" {
7488 yyextra->docBlock << yytext;
7490 BEGIN(DocCopyBlock);
7491 }
7492<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7493 yyextra->docBlock << yytext;
7495 BEGIN(DocCopyBlock);
7496 }
7497<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7498 yyextra->docBlock << yytext;
7500 BEGIN(DocCopyBlock);
7501 }
7502<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
7503 yyextra->docBlock << yytext;
7505 BEGIN(DocCopyBlock);
7506 }
7507<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7509 yyextra->docBlock << "\\ilinebr ";
7510 yyextra->docBlock << pat;
7512 BEGIN(DocCopyBlock);
7513 }
7514<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7516 yyextra->docBlock << pat;
7518 BEGIN(DocCopyBlock);
7519 }
7520<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7521<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7522<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7524 yyextra->docBlock << "\\ilinebr ";
7525 yyextra->docBlock << pat;
7527 BEGIN(DocCopyBlock);
7528 }
7529<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7530<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7531<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7533 yyextra->docBlock << pat;
7535 BEGIN(DocCopyBlock);
7536 }
7537<DocBlock>"```" { // skip ``` if not at the start of a line
7538 yyextra->docBlock << "```";
7539 }
7540<DocBlock>"\\`" { // skip escaped backtick
7541 yyextra->docBlock << yytext;
7542 }
7543<DocBlock>"`"{1,2} {
7544 yyextra->docBlock << yytext;
7546 BEGIN(DocCopyBlock);
7547 }
7548<DocBlock>{B}*"<"{CODE}">" {
7549 if (yyextra->insideCS)
7550 {
7551 yyextra->docBlock << yytext;
7553 BEGIN(DocCopyBlock);
7554 }
7555 else
7556 {
7557 REJECT;
7558 }
7559 }
7560<DocBlock>[^@*~`'\/\\\n]+ { // any character that isn't special
7561 yyextra->docBlock << yytext;
7562 }
7563<DocBlock>\n { // newline
7565 yyextra->docBlock << *yytext;
7566 }
7567<DocBlock>. { // command block
7568 yyextra->docBlock << *yytext;
7569 }
7570
7571
7572
7573<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
7575 {
7576 BEGIN(DocBlock);
7577 }
7578 yyextra->docBlock << yytext;
7579 }
static bool endVerbatimBlock(yyscan_t yyscanner, const QCString &blockName, size_t fencedSize=0)
7580<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
7582 {
7583 BEGIN(DocBlock);
7584 }
7585 yyextra->docBlock << yytext;
7586 }
7587<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7589 {
7590 BEGIN(DocBlock);
7591 }
7592 yyextra->docBlock << yytext;
7593 }
7594<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
7596 {
7597 BEGIN(DocBlock);
7598 }
7599 yyextra->docBlock << yytext;
7600 }
7601<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
7602 if ((yyextra->docBlockName=="verbatim") || (yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7603 {
7604 REJECT;
7605 }
7606 else
7607 {
7610 yyextra->docBlock << indent;
7611 }
7612 }
7613<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
7614 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7615 {
7618 yyextra->docBlock << indent;
7619 }
7620 else
7621 {
7622 REJECT;
7623 }
7624 }
7625<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
7626 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7627 {
7630 yyextra->docBlock << indent+"*";
7631 }
7632 else
7633 {
7634 REJECT;
7635 }
7636 }
7637<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
7638 if ((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral"))
7639 {
7641 if (yyextra->nestedComment>0)
7642 {
7644 yyextra->docBlock << indent+"*";
7645 }
7646 else
7647 {
7649 yyextra->docBlock << indent;
7650 }
7651 }
7652 else
7653 {
7654 REJECT;
7655 }
7656 }
7657<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7660 {
7661 BEGIN(DocBlock);
7662 }
7663 yyextra->docBlock << pat;
7664 }
7665<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7668 {
7669 BEGIN(DocBlock);
7670 }
7671 yyextra->docBlock << pat;
7672 }
7673<DocCopyBlock>"```" { // backtick + end marker
7674 if (yyextra->docBlockName=="``")
7675 {
7676 yyextra->docBlock << "`";
7678 yyextra->docBlock << "``";
7679 BEGIN(DocBlock);
7680 }
7681 else
7682 {
7683 yyextra->docBlock << yytext;
7684 }
7685 }
7686<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7688 {
7689 BEGIN(DocBlock);
7690 }
7691 yyextra->docBlock << yytext;
7692 }
7693<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7695 {
7696 BEGIN(DocBlock);
7697 }
7698 yyextra->docBlock << yytext;
7699 }
7700<DocCopyBlock>"`"{1,2} {
7702 {
7703 BEGIN(DocBlock);
7704 }
7705 yyextra->docBlock << yytext;
7706 }
7707<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ { // any character that is not special
7708 yyextra->docBlock << yytext;
7709 }
7710<DocCopyBlock>\" {
7711 yyextra->docBlock << yytext;
7712 if (yyextra->docBlockName=="code" || yyextra->docBlockName=="iliteral")
7713
7714
7715 {
7716 yyextra->lastStringContext=YY_START;
7717 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7718 yyextra->stopAtInvalidString=true;
7719 BEGIN(CopyGString);
7720 }
7721 }
7722<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7723 if (yytext[1]=='*')
7724 {
7725 yyextra->nestedComment++;
7726 }
7727 else if (yytext[0]=='*' && yyextra->nestedComment>0)
7728 {
7729 yyextra->nestedComment--;
7730 }
7731 else if (yytext[0]=='*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7732 {
7733 warn(yyextra->fileName,yyextra->yyLineNr,
7734 "Found end of C comment inside a '{}' block without matching start of the comment!"
7735 " Maybe the end marker for the block is missing?",
7736 yyextra->docBlockName);
7737 BEGIN(DocBlock);
7738 }
7739 yyextra->docBlock << yytext;
7740 }
7741<DocCopyBlock>\n { // newline
7742 yyextra->docBlock << *yytext;
7744 }
7745<DocCopyBlock>. { // any other character
7746 yyextra->docBlock << *yytext;
7747 }
7748<DocCopyBlock><<EOF>> {
7749 warn(yyextra->fileName,yyextra->yyLineNr,
7750 "reached end of file while inside a '{}' block!"
7751 " The command that should end the block seems to be missing!",
7752 yyextra->docBlockName);
7754 }
7755
7756
7757
7758
7759<Prototype>"operator"{B}*"("{B}*")" {
7760 yyextra->current->name+=yytext;
7761 }
7762<Prototype>"(" {
7763 yyextra->current->args+=*yytext;
7764 yyextra->currentArgumentContext = PrototypeQual;
7765 yyextra->fullArgString = yyextra->current->args;
7766 yyextra->copyArgString = &yyextra->current->args;
7767 BEGIN( ReadFuncArgType ) ;
7768 }
7769<Prototype>"("({ID}"::")*({B}*[&*])+ {
7770 if (yyextra->insidePHP)
7771 {
7772 REJECT;
7773 }
7774 else
7775 {
7776 yyextra->current->type+=yyextra->current->name+yytext;
7777 yyextra->current->name.clear();
7778 BEGIN( PrototypePtr );
7779 }
7780 }
7781<PrototypePtr>{SCOPENAME} {
7782 yyextra->current->name+=yytext;
7783 }
7784<PrototypePtr>"(" {
7785 yyextra->current->args+=*yytext;
7786 yyextra->currentArgumentContext = PrototypeQual;
7787 yyextra->fullArgString = yyextra->current->args;
7788 yyextra->copyArgString = &yyextra->current->args;
7789 BEGIN( ReadFuncArgType ) ;
7790 }
7791<PrototypePtr>")" {
7792 yyextra->current->type+=')';
7793 BEGIN( Prototype );
7794 }
7795<PrototypePtr>. {
7796 yyextra->current->name+=yytext;
7797 }
7798<PrototypeQual>"{" {
7799 BEGIN( PrototypeSkipLine);
7800 }
7801<PrototypeQual>{B}*"const"{B}* {
7802 yyextra->current->args += " const ";
7803 yyextra->current->argList.setConstSpecifier(
TRUE);
7804 }
7805<PrototypeQual>{B}*"volatile"{B}* {
7806 yyextra->current->args += " volatile ";
7807 yyextra->current->argList.setVolatileSpecifier(
TRUE);
7808 }
7809<PrototypeQual>{B}*"="{B}*"0"{B}* {
7810 yyextra->current->args += " = 0";
7811 yyextra->current->virt = Specifier::Pure;
7812 yyextra->current->argList.setPureSpecifier(
TRUE);
7813 }
7814<PrototypeQual>"throw"{B}*"(" {
7815 yyextra->current->exception = "throw(";
7816 BEGIN(PrototypeExc);
7817 }
7818<PrototypeExc>")" {
7819 yyextra->current->exception += ')';
7820 BEGIN(PrototypeQual);
7821 }
7822<PrototypeExc>. {
7823 yyextra->current->exception += *yytext;
7824 }
7825<PrototypeQual>. {
7826 yyextra->current->args += *yytext;
7827 }
7828<Prototype>. {
7829 yyextra->current->name += *yytext;
7830 }
7831<PrototypeSkipLine>. {
7832 }
7833
7834
7835
7836
7837<SkipCxxComment>.*"\\\n" { // line continuation
7838 if (yyextra->insideCS)
7839 {
7840 REJECT;
7841 }
7842 else
7843 {
7845 }
7846 }
7847<SkipCxxComment>{ANYopt}/\n {
7848 BEGIN( yyextra->lastCContext ) ;
7849 }
7850<SkipComment>[^\*\n]+
7851
7852
7853
7854<*>"[[" { // C++11 attribute
7855 if (!yyextra->insideCpp) REJECT;
7856 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7857 yyextra->lastC11AttributeContext = YY_START;
7858 BEGIN( SkipC11Attribute );
7859 }
7860
7861<*>\n { lineCount(yyscanner); }
7862<*>\" {
7863 if (yyextra->insideIDL && yyextra->insideCppQuote)
7864 {
7865 BEGIN(EndCppQuote);
7866 }
7867 else if (yyextra->insidePHP)
7868 {
7869 yyextra->lastStringContext=YY_START;
7870 BEGIN(SkipString);
7871 }
7872 }
7873<*>^{B}*"#" {
7874 if (!yyextra->insidePHP)
7875 {
7876 yyextra->lastCPPContext = YY_START;
7877 BEGIN( SkipCPP ) ;
7878 }
7879 else
7880 {
7881 yyextra->lastCContext = YY_START ;
7882 BEGIN( SkipCxxComment ) ;
7883 }
7884 }
7885<*>"#" {
7886 if (!yyextra->insidePHP)
7887 REJECT;
7888 yyextra->lastCContext = YY_START ;
7889 BEGIN( SkipCxxComment ) ;
7890 }
7891<*>\' {
7892 if (yyextra->insidePHP)
7893 {
7894 yyextra->lastStringContext=YY_START;
7895 BEGIN(SkipPHPString);
7896 }
7897 }
7898<*>\? {
7899 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
7900 {
7901 if (yyextra->current->type.isEmpty())
7902 {
7903 if (yyextra->current->name.isEmpty())
7904 yyextra->current->name="?";
7905 else
7906 yyextra->current->name+="?";
7907 }
7908 else
7909 {
7910 yyextra->current->type+="?";
7911 }
7912 }
7913 }
7914<*>"}" { yyextra->exported=false; }
7915<*>.
7916<SkipComment>{CPPC}|{CCS}
7917<*>{CCS} { yyextra->lastCContext = YY_START ;
7918 BEGIN( SkipComment ) ;
7919 }
7920<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
7921<*>{CPPC} {
7922 yyextra->lastCContext = YY_START ;
7923 BEGIN( SkipCxxComment ) ;
7924 }
7925<<EOF>> {
7926 if (yyextra->insideCS && yyextra->fakeNS)
7927 {
7928 yyextra->fakeNS--;
7929 unput('}');
7930 BEGIN ( ReadNSBody);
7931 }
7932 else
7933 {
7935 }
7936 }
7937%%