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