1 /*****************************************************************************
3 * Copyright (C) 1997-2021 by Dimitri van Heesch.
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
15 %option never-interactive
16 %option prefix="scannerYY"
18 %option extra-type="struct scannerYY_state *"
21 // forward declare yyscan_t to improve typesafety
22 #define YY_TYPEDEF_YY_SCANNER_T
24 typedef yyguts_t *yyscan_t;
51 #include "commentscan.h"
52 #include "arguments.h"
54 #include "clangparser.h"
59 #define YY_NO_UNISTD_H 1
61 #define USE_STATE2STRING 0
63 static AtomicInt anonCount;
64 static AtomicInt anonNSCount;
66 struct scannerYY_state
68 OutlineParserInterface *thisParser;
69 CommentScanner commentScanner;
70 const char * inputString = 0;
71 int inputPosition = 0;
74 int lastDocContext = 0;
75 int lastCPPContext = 0;
76 int lastSkipSharpContext = 0;
77 int lastSkipRoundContext = 0;
78 int lastStringContext = 0;
79 int lastCurlyContext = 0;
80 int lastRoundContext = 0;
81 int lastSharpContext = 0;
82 int lastSquareContext = 0;
83 int lastInitializerContext = 0;
84 int lastClassTemplSpecContext = 0;
85 int lastPreLineCtrlContext = 0;
86 int lastSkipVerbStringContext = 0;
87 int lastCommentInArgContext = 0;
88 int lastRawStringContext = 0;
89 int lastCSConstraint = 0;
90 int lastHereDocContext = 0;
91 int lastDefineContext = 0;
92 int lastAlignAsContext = 0;
93 int lastC11AttributeContext = 0;
94 int lastModifierContext = 0;
95 Protection protection = Public;
96 Protection baseProt = Public;
100 int squareCount = 0 ;
102 std::shared_ptr<Entry> current;
103 std::shared_ptr<Entry> current_root;
104 std::shared_ptr<Entry> previous;
105 std::shared_ptr<Entry> tempEntry;
106 std::shared_ptr<Entry> firstTypedefEntry;
107 std::shared_ptr<Entry> memspecEntry;
109 int yyBegLineNr = 1 ;
113 MethodTypes mtype = Method;
115 Specifier virt = Normal;
116 Specifier baseVirt = Normal;
120 bool isTypedef = false;
121 QCString funcPtrType;
122 QCString templateStr;
125 QCString* specName = 0;
127 SrcLangExt language = SrcLangExt_Unknown;
128 bool insideIDL = false; //!< processing IDL code?
129 bool insideJava = false; //!< processing Java code?
130 bool insideCS = false; //!< processing C# code?
131 bool insideD = false; //!< processing D code?
132 bool insidePHP = false; //!< processing PHP code?
133 bool insideObjC = false; //!< processing Objective C code?
134 bool insideCli = false; //!< processing C++/CLI code?
135 bool insideJS = false; //!< processing JavaScript code?
136 bool insideSlice = false; //!< processing Slice code?
137 bool insideCpp = true; //!< processing C/C++ code
139 bool insideCppQuote = false;
140 bool insideProtocolList = false;
142 int argRoundCount = 0;
143 int argSquareCount = 0;
144 int argSharpCount = 0;
145 int currentArgumentContext = 0;
146 int lastCopyArgStringContext = 0;
147 int lastCopyArgContext = 0;
148 int requiresContext = 0;
149 QCString *copyArgString = 0;
150 QCString fullArgString;
151 QCString dummyRawString;
153 ArgumentList *currentArgumentList = 0;
154 char lastCopyArgChar = '\0';
156 QCString *pCopyQuotedString = 0;
157 QCString *pCopyRoundString = 0;
158 QCString *pCopyCurlyString = 0;
159 QCString *pCopySharpString = 0;
160 QCString *pCopyRawString = 0;
161 TextStream *pCopyCurlyGString = 0;
162 TextStream *pCopyRoundGString = 0;
163 TextStream *pCopySquareGString = 0;
164 TextStream *pCopyQuotedGString = 0;
165 TextStream *pCopyHereDocGString = 0;
166 TextStream *pCopyRawGString = 0;
167 TextStream *pSkipVerbString = 0;
169 bool insideFormula = false;
170 bool insideTryBlock = false;
171 bool insideCode = false;
172 bool needsSemi = false;
174 int initBracketCount = 0;
176 QCString oldStyleArgType;
178 QCString briefBackup;
180 int docBlockContext = 0;
182 QCString docBlockName;
183 bool docBlockInBody = false;
184 bool docBlockAutoBrief = false;
185 char docBlockTerm = '\0';
189 bool odlProp = false;
191 bool lexInit = false;
192 bool externLinkage = false;
199 bool nestedComment = false;
200 std::vector< std::pair<Entry*,std::shared_ptr<Entry> > > outerScopeEntries;
203 ClangTUParser * clangParser = 0;
207 static const char *stateToString(int state);
209 //-----------------------------------------------------------------------------
211 // forward declarations for stateless functions
212 static inline int computeIndent(const char *s,int startIndent);
213 static QCString stripQuotes(const char *s);
214 static bool nameIsOperator(QCString &name);
215 void fixArgumentListForJavaScript(ArgumentList &al);
217 // forward declarations for statefull functions
218 static void initParser(yyscan_t yyscanner);
219 static void initEntry(yyscan_t yyscanner);
220 static void lineCount(yyscan_t yyscanner);
221 static void addType(yyscan_t yyscanner);
222 static void setContext(yyscan_t yyscanner);
223 static void prependScope(yyscan_t yyscanner);
224 static void startCommentBlock(yyscan_t yyscanner,bool);
225 static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief);
226 static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al);
227 static bool checkForKnRstyleC(yyscan_t yyscanner);
228 static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &oldStyleArgName);
229 static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString &name,
230 const QCString &brief,const QCString &docs);
231 static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
233 /* ----------------------------------------------------------------- */
235 #define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
239 /* start command character */
246 ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
247 SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
248 TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
249 CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID})
251 CODE [cC][oO][dD][eE]
252 CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
253 PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
254 PHPUSEKW ("public"|"private"|"protected")
255 IDLATTR ("["[^\]]*"]"){BN}*
256 TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
257 RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
258 RAWEND ")"[^ \t\(\)\\]{0,16}\"
259 ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
260 ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
261 LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>"
262 BITOP "&"|"|"|"^"|"<<"|">>"|"~"
263 OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
265 /* no comment start / end signs inside square brackets */
273 // doxygen start comment
274 DCOMM ("/\*!"|"/\**"|"/\/!"|"/\/\/")
276 // Optional any character
278 // Optional all but newline
283 /* language parsing states */
343 %x TryFunctionBlockEnd
368 %x ReadInitializerPtr
369 %x UNOIDLAttributeBlock
396 %x SpecializationSingleQuote
397 %x SpecializationDoubleQuote
408 %x CopyArgCommentLine
429 %x SliceDictionaryName
431 /** Prototype scanner states */
439 /** comment parsing states */
445 /** C++20 concepts */
448 %x RequiresExpression
454 yyextra->curlyCount=0;
455 yyextra->needsSemi = TRUE;
456 BEGIN(SkipCurlyBlock);
459 yyextra->roundCount=0;
460 BEGIN(SkipRoundBlock);
462 <SkipRoundBlock>"(" {
463 ++yyextra->roundCount;
465 <SkipRoundBlock>")" {
466 if (yyextra->roundCount )
467 --yyextra->roundCount ;
471 <SkipCurlyBlock>"{" {
472 ++yyextra->curlyCount ;
474 <SkipCurlyBlock>"}" {
475 if( yyextra->curlyCount )
477 --yyextra->curlyCount ;
479 else if (yyextra->needsSemi)
485 BEGIN( FindMembers );
489 if (yyextra->insidePHP)
491 yyextra->lastStringContext=NextSemi;
492 BEGIN(SkipPHPString);
495 <NextSemi>{CHARLIT} { if (yyextra->insidePHP) REJECT; }
497 yyextra->lastStringContext=NextSemi;
502 BEGIN( FindMembers );
506 BEGIN( FindMembers );
508 <EnumBaseType>[{;,] {
509 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
513 <FindMembers>"<?php" { // PHP code with unsupported extension?
514 yyextra->insidePHP = TRUE;
516 <FindMembersPHP>"<?"("php"?) { // PHP code start
517 BEGIN( FindMembers );
519 <FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" { // PHP code start
520 lineCount(yyscanner) ;
521 BEGIN( FindMembers );
523 <FindMembers>"?>"|"</script>" { // PHP code end
524 if (yyextra->insidePHP)
525 BEGIN( FindMembersPHP );
529 <FindMembersPHP>[^\n<]+ { // Non-PHP code text, ignore
531 <FindMembersPHP>\n { // Non-PHP code text, ignore
532 lineCount(yyscanner);
534 <FindMembersPHP>. { // Non-PHP code text, ignore
536 <FindMembers>{PHPKW} { if (yyextra->insidePHP)
541 <FindMembers>"%{"[^\n]* { // Mozilla XPIDL lang-specific block
542 if (!yyextra->insideIDL)
545 <FindMembers>"%}" { // Mozilla XPIDL lang-specific block end
546 if (!yyextra->insideIDL)
549 <FindMembers>{B}*("properties"){BN}*":"{BN}* { // IDL or Borland C++ builder property
550 yyextra->current->mtype = yyextra->mtype = Property;
551 yyextra->current->protection = yyextra->protection = Public ;
552 yyextra->current->type.resize(0);
553 yyextra->current->name.resize(0);
554 yyextra->current->args.resize(0);
555 yyextra->current->argList.clear();
556 lineCount(yyscanner) ;
559 <FindMembers>{B}*"k_dcop"{BN}*":"{BN}* { yyextra->current->mtype = yyextra->mtype = DCOP;
560 yyextra->current->protection = yyextra->protection = Public ;
561 yyextra->current->type.resize(0);
562 yyextra->current->name.resize(0);
563 yyextra->current->args.resize(0);
564 yyextra->current->argList.clear();
565 lineCount(yyscanner) ;
568 <FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* { yyextra->current->mtype = yyextra->mtype = Signal;
570 yyextra->current->protection = yyextra->protection = Public ;
571 yyextra->current->type.resize(0);
572 yyextra->current->name.resize(0);
573 yyextra->current->args.resize(0);
574 yyextra->current->argList.clear();
575 lineCount(yyscanner) ;
578 <FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
579 yyextra->current->protection = yyextra->protection = Public ;
580 yyextra->current->mtype = yyextra->mtype = Slot;
581 yyextra->current->type.resize(0);
582 yyextra->current->name.resize(0);
583 yyextra->current->args.resize(0);
584 yyextra->current->argList.clear();
585 lineCount(yyscanner);
588 <FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
589 yyextra->current->protection = yyextra->protection = Protected ;
590 yyextra->current->mtype = yyextra->mtype = Slot;
591 yyextra->current->type.resize(0);
592 yyextra->current->name.resize(0);
593 yyextra->current->args.resize(0);
594 yyextra->current->argList.clear();
595 lineCount(yyscanner);
598 <FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
599 yyextra->current->protection = yyextra->protection = Private ;
600 yyextra->current->mtype = yyextra->mtype = Slot;
601 yyextra->current->type.resize(0);
602 yyextra->current->name.resize(0);
603 yyextra->current->args.resize(0);
604 yyextra->current->argList.clear();
605 lineCount(yyscanner);
607 <FindMembers>{B}*("public"|"methods"|"__published"){BN}*":"{BN}* {
608 yyextra->current->protection = yyextra->protection = Public ;
609 yyextra->current->mtype = yyextra->mtype = Method;
610 yyextra->current->type.resize(0);
611 yyextra->current->name.resize(0);
612 yyextra->current->args.resize(0);
613 yyextra->current->argList.clear();
614 lineCount(yyscanner) ;
616 <FindMembers>{B}*"internal"{BN}*":"{BN}* { // for now treat C++/CLI's internal as package...
617 if (yyextra->insideCli)
619 yyextra->current->protection = yyextra->protection = Package ;
620 yyextra->current->mtype = yyextra->mtype = Method;
621 yyextra->current->type.resize(0);
622 yyextra->current->name.resize(0);
623 yyextra->current->args.resize(0);
624 yyextra->current->argList.clear();
625 lineCount(yyscanner) ;
632 <FindMembers>{B}*"protected"{BN}*":"{BN}* {
633 yyextra->current->protection = yyextra->protection = Protected ;
634 yyextra->current->mtype = yyextra->mtype = Method;
635 yyextra->current->type.resize(0);
636 yyextra->current->name.resize(0);
637 yyextra->current->args.resize(0);
638 yyextra->current->argList.clear();
639 lineCount(yyscanner) ;
641 <FindMembers>{B}*"private"{BN}*":"{BN}* {
642 yyextra->current->protection = yyextra->protection = Private ;
643 yyextra->current->mtype = yyextra->mtype = Method;
644 yyextra->current->type.resize(0);
645 yyextra->current->name.resize(0);
646 yyextra->current->args.resize(0);
647 yyextra->current->argList.clear();
648 lineCount(yyscanner) ;
650 <FindMembers>{B}*"event"{BN}+ {
651 if (yyextra->insideCli)
654 lineCount(yyscanner) ;
655 yyextra->current->mtype = yyextra->mtype = Event;
656 yyextra->current->bodyLine = yyextra->yyLineNr;
657 yyextra->current->bodyColumn = yyextra->yyColNr;
658 yyextra->curlyCount=0;
659 BEGIN( CliPropertyType );
661 else if (yyextra->insideCS)
663 lineCount(yyscanner) ;
664 yyextra->current->mtype = Event;
665 yyextra->current->bodyLine = yyextra->yyLineNr;
666 yyextra->current->bodyColumn = yyextra->yyColNr;
673 <FindMembers>{B}*"property"{BN}+ {
674 if (yyextra->insideCli)
677 lineCount(yyscanner) ;
678 yyextra->current->mtype = yyextra->mtype = Property;
679 yyextra->current->bodyLine = yyextra->yyLineNr;
680 yyextra->current->bodyColumn = yyextra->yyColNr;
681 yyextra->curlyCount=0;
682 BEGIN( CliPropertyType );
689 <CliPropertyType>{ID} {
691 yyextra->current->name = yytext;
693 <CliPropertyType>"[" { // C++/CLI indexed property
694 yyextra->current->args = "[";
695 BEGIN( CliPropertyIndex );
697 <CliPropertyType>"{" {
698 yyextra->curlyCount=0;
699 //printf("event: '%s' '%s'\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name));
700 BEGIN( CSAccessorDecl );
702 <CliPropertyType>";" {
704 BEGIN( FindMembers );
706 <CliPropertyType>\n {
707 lineCount(yyscanner);
709 <CliPropertyType>{B}* {
713 yyextra->current->type += yytext;
715 <CliPropertyIndex>"]" {
716 BEGIN( CliPropertyType );
717 yyextra->current->args+=yytext;
719 <CliPropertyIndex>. {
720 yyextra->current->args+=yytext;
723 <FindMembers>{B}*"property"{BN}+ {
724 if (!yyextra->current->type.isEmpty())
730 yyextra->current->mtype = yyextra->mtype = Property;
731 lineCount(yyscanner);
735 <FindMembers>{B}*"@private"{BN}+ {
736 yyextra->current->protection = yyextra->protection = Private ;
737 yyextra->current->mtype = yyextra->mtype = Method;
738 yyextra->current->type.resize(0);
739 yyextra->current->name.resize(0);
740 yyextra->current->args.resize(0);
741 yyextra->current->argList.clear();
742 lineCount(yyscanner) ;
744 <FindMembers>{B}*"@protected"{BN}+ {
745 yyextra->current->protection = yyextra->protection = Protected ;
746 yyextra->current->mtype = yyextra->mtype = Method;
747 yyextra->current->type.resize(0);
748 yyextra->current->name.resize(0);
749 yyextra->current->args.resize(0);
750 yyextra->current->argList.clear();
751 lineCount(yyscanner) ;
753 <FindMembers>{B}*"@public"{BN}+ {
754 yyextra->current->protection = yyextra->protection = Public ;
755 yyextra->current->mtype = yyextra->mtype = Method;
756 yyextra->current->type.resize(0);
757 yyextra->current->name.resize(0);
758 yyextra->current->args.resize(0);
759 yyextra->current->argList.clear();
760 lineCount(yyscanner) ;
762 <FindMembers>[\-+]{BN}* {
763 if (!yyextra->insideObjC)
769 lineCount(yyscanner);
770 yyextra->current->fileName = yyextra->yyFileName;
771 yyextra->current->startLine = yyextra->yyLineNr;
772 yyextra->current->startColumn = yyextra->yyColNr;
773 yyextra->current->bodyLine = yyextra->yyLineNr;
774 yyextra->current->bodyColumn = yyextra->yyColNr;
775 yyextra->current->section = Entry::FUNCTION_SEC;
776 yyextra->current->protection = yyextra->protection = Public ;
777 yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
778 yyextra->insideObjC = TRUE;
779 yyextra->current->virt = Virtual;
780 yyextra->current->stat=yytext[0]=='+';
781 yyextra->current->mtype = yyextra->mtype = Method;
782 yyextra->current->type.resize(0);
783 yyextra->current->name.resize(0);
784 yyextra->current->args.resize(0);
785 yyextra->current->argList.clear();
789 <ObjCMethod>"(" { // start of method's return type
790 BEGIN( ObjCReturnType );
792 <ObjCMethod>{ID} { // found method name
793 if (yyextra->current->type.isEmpty())
795 yyextra->current->type = "id";
797 yyextra->current->name = yytext;
798 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
800 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
803 <ObjCMethod>":"{B}* { // start of parameter list
804 yyextra->current->name += ':';
806 yyextra->current->argList.push_back(a);
809 <ObjCReturnType>[^)]* { // TODO: check if nested braches are possible.
810 yyextra->current->type = yytext;
812 <ObjCReturnType>")" {
815 <ObjCParams>({ID})?{BN}*":" { // Keyword of parameter
816 QCString keyw = yytext;
817 keyw=keyw.left(keyw.length()-1).stripWhiteSpace(); // strip :
820 yyextra->current->name += " :";
824 yyextra->current->name += keyw+":";
826 if (yyextra->current->argList.back().type.isEmpty())
828 yyextra->current->argList.back().type="id";
831 a.attrib=(QCString)"["+keyw+"]";
832 yyextra->current->argList.push_back(a);
834 <ObjCParams>{ID}{BN}* { // name of parameter
835 lineCount(yyscanner);
836 yyextra->current->argList.back().name=QCString(yytext).stripWhiteSpace();
838 <ObjCParams>","{BN}*"..." { // name of parameter
839 lineCount(yyscanner);
840 // do we want the comma as part of the name?
841 //yyextra->current->name += ",";
845 yyextra->current->argList.push_back(a);
849 yyextra->current->name += ':';
853 yyextra->roundCount=0;
854 yyextra->current->argList.back().type.resize(0);
855 BEGIN( ObjCParamType );
858 yyextra->roundCount++;
859 yyextra->current->argList.back().type+=yytext;
861 <ObjCParamType>")"/{B}* {
862 if (yyextra->roundCount<=0)
868 yyextra->current->argList.back().type+=yytext;
869 yyextra->roundCount--;
872 <ObjCParamType>[^()]* {
873 yyextra->current->argList.back().type+=QCString(yytext).stripWhiteSpace();
875 <ObjCMethod,ObjCParams>";" { // end of method declaration
876 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
878 yyextra->current->argList.back().type="id";
880 if (yyextra->current->argList.empty()) // method without parameters
882 yyextra->current->argList.setNoParameters(TRUE);
884 yyextra->current->args = argListToString(yyextra->current->argList);
885 //printf("argList=%s\n",qPrint(yyextra->current->args));
889 <ObjCMethod,ObjCParams>(";"{BN}+)?"{" { // start of a method body
890 lineCount(yyscanner);
891 //printf("Type=%s Name=%s args=%s\n",
892 // qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(argListToString(yyextra->current->argList))
894 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
896 yyextra->current->argList.back().type="id";
898 if (yyextra->current->argList.empty()) // method without parameters
900 yyextra->current->argList.setNoParameters(TRUE);
902 yyextra->current->args = argListToString(yyextra->current->argList);
906 <FindMembers>{B}*"sequence"{BN}*"<"{BN}* {
907 if (yyextra->insideSlice)
909 lineCount(yyscanner);
910 yyextra->current->bodyLine = yyextra->yyLineNr;
911 yyextra->current->bodyColumn = yyextra->yyColNr;
912 yyextra->current->fileName = yyextra->yyFileName ;
913 yyextra->current->startLine = yyextra->yyLineNr ;
914 yyextra->current->startColumn = yyextra->yyColNr;
915 yyextra->current->args.resize(0);
916 yyextra->current->section = Entry::TYPEDEF_SEC ;
917 yyextra->isTypedef = TRUE;
918 BEGIN( SliceSequence );
923 <FindMembers>{B}*"dictionary"{BN}*"<"{BN}* {
924 if (yyextra->insideSlice)
926 lineCount(yyscanner);
927 yyextra->current->bodyLine = yyextra->yyLineNr;
928 yyextra->current->bodyColumn = yyextra->yyColNr;
929 yyextra->current->fileName = yyextra->yyFileName ;
930 yyextra->current->startLine = yyextra->yyLineNr ;
931 yyextra->current->startColumn = yyextra->yyColNr;
932 yyextra->current->args.resize(0);
933 yyextra->current->section = Entry::TYPEDEF_SEC ;
934 yyextra->isTypedef = TRUE;
935 BEGIN( SliceDictionary );
940 <FindMembers>{BN}{1,80} {
941 lineCount(yyscanner);
943 <FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
944 if (yyextra->insideJava) // Java annotation
946 lineCount(yyscanner);
947 yyextra->lastSkipRoundContext = YY_START;
948 yyextra->roundCount=0;
951 else if (qstrncmp(yytext,"@property",9)==0) // ObjC 2.0 property
953 yyextra->current->mtype = yyextra->mtype = Property;
954 yyextra->current->spec|=Entry::Readable | Entry::Writable | Entry::Assign;
955 yyextra->current->protection = Public ;
957 BEGIN( ObjCPropAttr );
964 <ObjCPropAttr>"getter="{ID} {
965 yyextra->current->read = yytext+7;
967 <ObjCPropAttr>"setter="{ID} {
968 yyextra->current->write = yytext+7;
970 <ObjCPropAttr>"readonly" {
971 yyextra->current->spec&=~Entry::Writable;
973 <ObjCPropAttr>"readwrite" { // default
975 <ObjCPropAttr>"assign" { // default
977 <ObjCPropAttr>"unsafe_unretained" {
978 yyextra->current->spec&=~Entry::Assign;
979 yyextra->current->spec|=Entry::Unretained;
981 <ObjCPropAttr>"retain" {
982 yyextra->current->spec&=~Entry::Assign;
983 yyextra->current->spec|=Entry::Retain;
985 <ObjCPropAttr>"copy" {
986 yyextra->current->spec&=~Entry::Assign;
987 yyextra->current->spec|=Entry::Copy;
989 <ObjCPropAttr>"weak" {
990 yyextra->current->spec&=~Entry::Assign;
991 yyextra->current->spec|=Entry::Weak;
993 <ObjCPropAttr>"strong" {
994 yyextra->current->spec&=~Entry::Assign;
995 yyextra->current->spec|=Entry::Strong;
997 <ObjCPropAttr>"nonatomic" {
998 yyextra->current->spec|=Entry::NonAtomic;
1003 <FindMembers>"@"{ID} {
1004 if (yyextra->insideJava) // Java annotation
1008 else if (qstrcmp(yytext,"@property")==0) // ObjC 2.0 property
1010 yyextra->current->mtype = yyextra->mtype = Property;
1011 yyextra->current->spec|=Entry::Writable | Entry::Readable;
1012 yyextra->current->protection = Public ;
1014 else if (qstrcmp(yytext,"@synthesize")==0)
1016 BEGIN( ObjCSkipStatement );
1018 else if (qstrcmp(yytext,"@dynamic")==0)
1020 BEGIN( ObjCSkipStatement );
1027 <ObjCSkipStatement>";" {
1030 <PackageName>{ID}(("."|"\\"){ID})* {
1031 yyextra->isTypedef=FALSE;
1032 //printf("Found namespace %s lang=%d\n",yytext,yyextra->current->lang);
1033 yyextra->current->name = yytext;
1034 yyextra->current->name = substitute(yyextra->current->name,".","::");
1035 yyextra->current->name = substitute(yyextra->current->name,"\\","::");
1036 yyextra->current->section = Entry::NAMESPACE_SEC;
1037 yyextra->current->type = "namespace" ;
1038 yyextra->current->fileName = yyextra->yyFileName;
1039 yyextra->current->startLine = yyextra->yyLineNr;
1040 yyextra->current->startColumn = yyextra->yyColNr;
1041 yyextra->current->bodyLine = yyextra->yyLineNr;
1042 yyextra->current->bodyColumn = yyextra->yyColNr;
1043 lineCount(yyscanner);
1046 std::shared_ptr<Entry> tmp = yyextra->current;
1047 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1048 yyextra->current_root = tmp;
1049 initEntry(yyscanner);
1053 yyextra->curlyCount=0;
1054 BEGIN( ReadNSBody );
1056 <FindMembers>{B}*"initonly"{BN}+ {
1057 yyextra->current->type += " initonly ";
1058 if (yyextra->insideCli) yyextra->current->spec |= Entry::Initonly;
1059 lineCount(yyscanner);
1061 <FindMembers>{B}*"static"{BN}+ { yyextra->current->type += " static ";
1062 yyextra->current->stat = TRUE;
1063 lineCount(yyscanner);
1065 <FindMembers>{B}*"extern"{BN}+ {
1066 yyextra->current->stat = FALSE;
1067 yyextra->current->explicitExternal = TRUE;
1068 lineCount(yyscanner);
1070 <FindMembers>{B}*"const"{BN}+ { if (yyextra->insideCS)
1072 yyextra->current->type += " const ";
1073 if (yyextra->insideCS) yyextra->current->stat = TRUE;
1074 lineCount(yyscanner);
1081 <FindMembers>{B}*"virtual"{BN}+ { yyextra->current->type += " virtual ";
1082 yyextra->current->virt = Virtual;
1083 lineCount(yyscanner);
1085 <FindMembers>{B}*"constexpr"{BN}+ {
1086 if (yyextra->insideCpp)
1088 yyextra->current->type += " constexpr ";
1089 yyextra->current->spec |= Entry::ConstExpr;
1090 lineCount(yyscanner);
1097 <FindMembers>{B}*"published"{BN}+ { // UNO IDL published keyword
1098 if (yyextra->insideIDL)
1100 lineCount(yyscanner);
1101 yyextra->current->spec |= Entry::Published;
1108 <FindMembers>{B}*"abstract"{BN}+ {
1109 if (!yyextra->insidePHP)
1111 yyextra->current->type += " abstract ";
1112 if (!yyextra->insideJava)
1114 yyextra->current->virt = Pure;
1118 yyextra->current->spec|=Entry::Abstract;
1123 yyextra->current->spec|=Entry::Abstract;
1125 lineCount(yyscanner);
1127 <FindMembers>{B}*"inline"{BN}+ { yyextra->current->spec|=Entry::Inline;
1128 lineCount(yyscanner);
1130 <FindMembers>{B}*"mutable"{BN}+ { yyextra->current->spec|=Entry::Mutable;
1131 lineCount(yyscanner);
1133 <FindMembers>{B}*"explicit"{BN}+ { yyextra->current->spec|=Entry::Explicit;
1134 lineCount(yyscanner);
1136 <FindMembers>{B}*"local"{BN}+ { yyextra->current->spec|=Entry::Local;
1137 lineCount(yyscanner);
1139 <FindMembers>{B}*"@required"{BN}+ { // Objective C 2.0 protocol required section
1140 yyextra->current->spec=(yyextra->current->spec & ~Entry::Optional) | Entry::Required;
1141 lineCount(yyscanner);
1143 <FindMembers>{B}*"@optional"{BN}+ { // Objective C 2.0 protocol optional section
1144 yyextra->current->spec=(yyextra->current->spec & ~Entry::Required) | Entry::Optional;
1145 lineCount(yyscanner);
1148 <FindMembers>{B}*"import"{BN}+ { // IDL import keyword
1152 <FindMembers>{B}*"typename"{BN}+ { lineCount(yyscanner); }
1153 <FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] {
1154 yyextra->isTypedef=FALSE;
1155 yyextra->current->section = Entry::NAMESPACE_SEC;
1156 yyextra->current->type = "namespace" ;
1157 yyextra->current->fileName = yyextra->yyFileName;
1158 yyextra->current->startLine = yyextra->yyLineNr;
1159 yyextra->current->startColumn = yyextra->yyColNr;
1160 yyextra->current->bodyLine = yyextra->yyLineNr;
1161 yyextra->current->bodyColumn = yyextra->yyColNr;
1162 lineCount(yyscanner);
1163 if (yyextra->insidePHP)
1165 BEGIN( PackageName );
1169 BEGIN( CompoundName );
1172 <FindMembers>{B}*"module"{BN}+ {
1173 lineCount(yyscanner);
1174 if (yyextra->insideIDL || yyextra->insideSlice)
1176 yyextra->isTypedef=FALSE;
1177 yyextra->current->section = Entry::NAMESPACE_SEC;
1178 yyextra->current->type = "module" ;
1179 yyextra->current->fileName = yyextra->yyFileName;
1180 yyextra->current->startLine = yyextra->yyLineNr;
1181 yyextra->current->startColumn = yyextra->yyColNr;
1182 yyextra->current->bodyLine = yyextra->yyLineNr;
1183 yyextra->current->bodyColumn = yyextra->yyColNr;
1184 BEGIN( CompoundName );
1186 else if (yyextra->insideD)
1188 lineCount(yyscanner);
1194 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1197 <FindMembers>{B}*"library"{BN}+ {
1198 lineCount(yyscanner);
1199 if (yyextra->insideIDL)
1201 yyextra->isTypedef=FALSE;
1202 yyextra->current->section = Entry::NAMESPACE_SEC;
1203 yyextra->current->type = "library" ;
1204 yyextra->current->fileName = yyextra->yyFileName;
1205 yyextra->current->startLine = yyextra->yyLineNr;
1206 yyextra->current->startColumn = yyextra->yyColNr;
1207 yyextra->current->bodyLine = yyextra->yyLineNr;
1208 yyextra->current->bodyColumn = yyextra->yyColNr;
1209 BEGIN( CompoundName );
1214 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1217 <FindMembers>{B}*"constants"{BN}+ { // UNO IDL constant group
1218 lineCount(yyscanner);
1219 if (yyextra->insideIDL)
1221 yyextra->isTypedef=FALSE;
1222 yyextra->current->section = Entry::NAMESPACE_SEC;
1223 yyextra->current->type = "constants";
1224 yyextra->current->fileName = yyextra->yyFileName;
1225 yyextra->current->startLine = yyextra->yyLineNr;
1226 yyextra->current->startColumn = yyextra->yyColNr;
1227 yyextra->current->bodyLine = yyextra->yyLineNr;
1228 yyextra->current->bodyColumn = yyextra->yyColNr;
1229 BEGIN( CompoundName );
1234 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1237 <FindMembers>{BN}*("service"){BN}+ { // UNO IDL service
1238 lineCount(yyscanner);
1239 if (yyextra->insideIDL)
1241 yyextra->isTypedef=FALSE;
1242 yyextra->current->section = Entry::CLASS_SEC;
1243 yyextra->current->spec = Entry::Service |
1244 // preserve UNO IDL [optional] or published
1245 (yyextra->current->spec & (Entry::Optional|Entry::Published));
1247 yyextra->current->type += " service " ;
1248 yyextra->current->fileName = yyextra->yyFileName;
1249 yyextra->current->startLine = yyextra->yyLineNr;
1250 yyextra->current->bodyLine = yyextra->yyLineNr;
1251 yyextra->current->bodyColumn = yyextra->yyColNr;
1252 BEGIN( CompoundName );
1254 else // TODO is addType right? just copy/pasted
1257 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1260 <FindMembers>{BN}*("singleton"){BN}+ { // UNO IDL singleton
1261 lineCount(yyscanner);
1262 if (yyextra->insideIDL)
1264 yyextra->isTypedef=FALSE;
1265 yyextra->current->section = Entry::CLASS_SEC;
1266 yyextra->current->spec = Entry::Singleton |
1267 (yyextra->current->spec & Entry::Published); // preserve
1269 yyextra->current->type += " singleton " ;
1270 yyextra->current->fileName = yyextra->yyFileName;
1271 yyextra->current->startLine = yyextra->yyLineNr;
1272 yyextra->current->bodyLine = yyextra->yyLineNr;
1273 yyextra->current->bodyColumn = yyextra->yyColNr;
1274 BEGIN( CompoundName );
1276 else // TODO is addType right? just copy/pasted
1279 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1282 <FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba/UNO IDL/Java/Slice interface
1283 lineCount(yyscanner);
1284 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1286 yyextra->isTypedef=FALSE;
1287 yyextra->current->section = Entry::CLASS_SEC;
1288 yyextra->current->spec = Entry::Interface |
1289 // preserve UNO IDL [optional], published, Slice local
1290 (yyextra->current->spec & (Entry::Optional|Entry::Published|Entry::Local));
1292 yyextra->current->type += " interface" ;
1293 yyextra->current->fileName = yyextra->yyFileName;
1294 yyextra->current->startLine = yyextra->yyLineNr;
1295 yyextra->current->startColumn = yyextra->yyColNr;
1296 yyextra->current->bodyLine = yyextra->yyLineNr;
1297 yyextra->current->bodyColumn = yyextra->yyColNr;
1298 BEGIN( CompoundName );
1303 yyextra->current->name = QCString(yytext).stripWhiteSpace();
1306 <FindMembers>{B}*"@implementation"{BN}+ { // Objective-C class implementation
1307 lineCount(yyscanner);
1308 yyextra->isTypedef=FALSE;
1309 yyextra->current->section = Entry::OBJCIMPL_SEC;
1310 yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
1311 yyextra->insideObjC = TRUE;
1312 yyextra->current->protection = yyextra->protection = Public ;
1314 yyextra->current->type += " implementation" ;
1315 yyextra->current->fileName = yyextra->yyFileName;
1316 yyextra->current->startLine = yyextra->yyLineNr;
1317 yyextra->current->bodyLine = yyextra->yyLineNr;
1318 yyextra->current->bodyColumn = yyextra->yyColNr;
1319 BEGIN( CompoundName );
1321 <FindMembers>{B}*"@interface"{BN}+ { // Objective-C class interface, or Java attribute
1322 lineCount(yyscanner);
1323 yyextra->isTypedef=FALSE;
1324 yyextra->current->section = Entry::CLASS_SEC;
1325 yyextra->current->spec = Entry::Interface;
1326 if (!yyextra->insideJava)
1328 yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
1329 yyextra->insideObjC = TRUE;
1331 yyextra->current->protection = yyextra->protection = Public ;
1333 yyextra->current->type += " interface" ;
1334 yyextra->current->fileName = yyextra->yyFileName;
1335 yyextra->current->startLine = yyextra->yyLineNr;
1336 yyextra->current->startColumn = yyextra->yyColNr;
1337 yyextra->current->bodyLine = yyextra->yyLineNr;
1338 yyextra->current->bodyColumn = yyextra->yyColNr;
1339 BEGIN( CompoundName );
1341 <FindMembers>{B}*"@protocol"{BN}+ { // Objective-C protocol definition
1342 lineCount(yyscanner);
1343 yyextra->isTypedef=FALSE;
1344 yyextra->current->section = Entry::CLASS_SEC;
1345 yyextra->current->spec = Entry::Protocol;
1346 yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
1347 yyextra->insideObjC = TRUE;
1348 yyextra->current->protection = yyextra->protection = Public ;
1350 yyextra->current->type += " protocol" ;
1351 yyextra->current->fileName = yyextra->yyFileName;
1352 yyextra->current->startLine = yyextra->yyLineNr;
1353 yyextra->current->startColumn = yyextra->yyColNr;
1354 yyextra->current->bodyLine = yyextra->yyLineNr;
1355 yyextra->current->bodyColumn = yyextra->yyColNr;
1356 BEGIN( CompoundName );
1358 <FindMembers>{B}*"exception"{BN}+ { // Corba IDL/Slice exception
1359 yyextra->isTypedef=FALSE;
1360 yyextra->current->section = Entry::CLASS_SEC;
1361 // preserve UNO IDL, Slice local
1362 yyextra->current->spec = Entry::Exception |
1363 (yyextra->current->spec & Entry::Published) |
1364 (yyextra->current->spec & Entry::Local);
1366 yyextra->current->type += " exception" ;
1367 yyextra->current->fileName = yyextra->yyFileName;
1368 yyextra->current->startLine = yyextra->yyLineNr;
1369 yyextra->current->startColumn = yyextra->yyColNr;
1370 yyextra->current->bodyLine = yyextra->yyLineNr;
1371 yyextra->current->bodyColumn = yyextra->yyColNr;
1372 lineCount(yyscanner);
1373 BEGIN( CompoundName );
1375 <FindMembers>"@class" | // for Objective C class declarations
1376 <FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1377 <FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1378 QCString decl = yytext;
1379 yyextra->isTypedef=decl.find("typedef")!=-1;
1380 bool isConst=decl.find("const")!=-1;
1381 bool isVolatile=decl.find("volatile")!=-1;
1382 yyextra->current->section = Entry::CLASS_SEC;
1384 uint64 spec = yyextra->current->spec;
1385 if (yyextra->insidePHP && yyextra->current->spec&Entry::Abstract)
1387 // convert Abstract to AbstractClass
1388 yyextra->current->spec=(yyextra->current->spec&~Entry::Abstract)|Entry::AbstractClass;
1390 if (yyextra->insideSlice && spec&Entry::Local)
1392 yyextra->current->spec|=Entry::Local;
1396 yyextra->current->type += " const";
1398 else if (isVolatile)
1400 yyextra->current->type += " volatile";
1402 yyextra->current->type += " class" ;
1403 yyextra->current->fileName = yyextra->yyFileName;
1404 yyextra->current->startLine = yyextra->yyLineNr;
1405 yyextra->current->startColumn = yyextra->yyColNr;
1406 yyextra->current->bodyLine = yyextra->yyLineNr;
1407 yyextra->current->bodyColumn = yyextra->yyColNr;
1410 yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
1411 yyextra->insideObjC = TRUE;
1413 lineCount(yyscanner) ;
1414 if (yytext[yyleng-1]=='{') unput('{');
1415 BEGIN( CompoundName ) ;
1417 <FindMembers>{B}*"value class{" | // C++/CLI extension
1418 <FindMembers>{B}*"value class"{BN}+ {
1419 yyextra->isTypedef=FALSE;
1420 yyextra->current->section = Entry::CLASS_SEC;
1421 yyextra->current->spec = Entry::Value;
1423 yyextra->current->type += " value class" ;
1424 yyextra->current->fileName = yyextra->yyFileName;
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 lineCount(yyscanner) ;
1430 if (yytext[yyleng-1]=='{') unput('{');
1431 BEGIN( CompoundName ) ;
1433 <FindMembers>{B}*"ref class{" | // C++/CLI extension
1434 <FindMembers>{B}*"ref class"{BN}+ {
1435 yyextra->isTypedef=FALSE;
1436 yyextra->current->section = Entry::CLASS_SEC;
1437 yyextra->current->spec = Entry::Ref;
1439 yyextra->current->type += " ref class" ;
1440 yyextra->current->fileName = yyextra->yyFileName;
1441 yyextra->current->startLine = yyextra->yyLineNr;
1442 yyextra->current->startColumn = yyextra->yyColNr;
1443 yyextra->current->bodyLine = yyextra->yyLineNr;
1444 yyextra->current->bodyColumn = yyextra->yyColNr;
1445 lineCount(yyscanner) ;
1446 if (yytext[yyleng-1]=='{') unput('{');
1447 BEGIN( CompoundName ) ;
1449 <FindMembers>{B}*"interface class{" | // C++/CLI extension
1450 <FindMembers>{B}*"interface class"{BN}+ {
1451 yyextra->isTypedef=FALSE;
1452 yyextra->current->section = Entry::CLASS_SEC;
1453 yyextra->current->spec = Entry::Interface;
1455 yyextra->current->type += " interface class" ;
1456 yyextra->current->fileName = yyextra->yyFileName;
1457 yyextra->current->startLine = yyextra->yyLineNr;
1458 yyextra->current->startColumn = yyextra->yyColNr;
1459 yyextra->current->bodyLine = yyextra->yyLineNr;
1460 yyextra->current->bodyColumn = yyextra->yyColNr;
1461 lineCount(yyscanner) ;
1462 if (yytext[yyleng-1]=='{') unput('{');
1463 BEGIN( CompoundName ) ;
1465 <FindMembers>{B}*"coclass"{BN}+ {
1466 if (yyextra->insideIDL)
1468 yyextra->isTypedef=FALSE;
1469 yyextra->current->section = Entry::CLASS_SEC;
1471 yyextra->current->type += " coclass" ;
1472 yyextra->current->fileName = yyextra->yyFileName;
1473 yyextra->current->startLine = yyextra->yyLineNr;
1474 yyextra->current->startColumn = yyextra->yyColNr;
1475 yyextra->current->bodyLine = yyextra->yyLineNr;
1476 yyextra->current->bodyColumn = yyextra->yyColNr;
1477 lineCount(yyscanner) ;
1478 BEGIN( CompoundName ) ;
1483 yyextra->current->name = yytext;
1484 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1485 lineCount(yyscanner);
1488 <FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1489 <FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1490 QCString decl = yytext;
1491 yyextra->isTypedef=decl.find("typedef")!=-1;
1492 bool isConst=decl.find("const")!=-1;
1493 bool isVolatile=decl.find("volatile")!=-1;
1494 yyextra->current->section = Entry::CLASS_SEC ;
1495 // preserve UNO IDL & Inline attributes, Slice local
1496 yyextra->current->spec = Entry::Struct |
1497 (yyextra->current->spec & Entry::Published) |
1498 (yyextra->current->spec & Entry::Inline) |
1499 (yyextra->current->spec & Entry::Local);
1500 // bug 582676: can be a struct nested in an interface so keep yyextra->insideObjC state
1501 //yyextra->current->objc = yyextra->insideObjC = FALSE;
1505 yyextra->current->type += " const";
1507 else if (isVolatile)
1509 yyextra->current->type += " volatile";
1511 yyextra->current->type += " struct" ;
1512 yyextra->current->fileName = yyextra->yyFileName;
1513 yyextra->current->startLine = yyextra->yyLineNr;
1514 yyextra->current->startColumn = yyextra->yyColNr;
1515 yyextra->current->bodyLine = yyextra->yyLineNr;
1516 yyextra->current->bodyColumn = yyextra->yyColNr;
1517 lineCount(yyscanner) ;
1518 if (yytext[yyleng-1]=='{') unput('{');
1519 BEGIN( CompoundName ) ;
1521 <FindMembers>{B}*"value struct{" | // C++/CLI extension
1522 <FindMembers>{B}*"value struct"{BN}+ {
1523 yyextra->isTypedef=FALSE;
1524 yyextra->current->section = Entry::CLASS_SEC;
1525 yyextra->current->spec = Entry::Struct | Entry::Value;
1527 yyextra->current->type += " value struct" ;
1528 yyextra->current->fileName = yyextra->yyFileName;
1529 yyextra->current->startLine = yyextra->yyLineNr;
1530 yyextra->current->startColumn = yyextra->yyColNr;
1531 yyextra->current->bodyLine = yyextra->yyLineNr;
1532 yyextra->current->bodyColumn = yyextra->yyColNr;
1533 lineCount(yyscanner) ;
1534 if (yytext[yyleng-1]=='{') unput('{');
1535 BEGIN( CompoundName ) ;
1537 <FindMembers>{B}*"ref struct{" | // C++/CLI extension
1538 <FindMembers>{B}*"ref struct"{BN}+ {
1539 yyextra->isTypedef=FALSE;
1540 yyextra->current->section = Entry::CLASS_SEC;
1541 yyextra->current->spec = Entry::Struct | Entry::Ref;
1543 yyextra->current->type += " ref struct" ;
1544 yyextra->current->fileName = yyextra->yyFileName;
1545 yyextra->current->startLine = yyextra->yyLineNr;
1546 yyextra->current->startColumn = yyextra->yyColNr;
1547 yyextra->current->bodyLine = yyextra->yyLineNr;
1548 yyextra->current->bodyColumn = yyextra->yyColNr;
1549 lineCount(yyscanner) ;
1550 if (yytext[yyleng-1]=='{') unput('{');
1551 BEGIN( CompoundName ) ;
1553 <FindMembers>{B}*"interface struct{" | // C++/CLI extension
1554 <FindMembers>{B}*"interface struct"{BN}+ {
1555 yyextra->isTypedef=FALSE;
1556 yyextra->current->section = Entry::CLASS_SEC;
1557 yyextra->current->spec = Entry::Struct | Entry::Interface;
1559 yyextra->current->type += " interface struct";
1560 yyextra->current->fileName = yyextra->yyFileName;
1561 yyextra->current->startLine = yyextra->yyLineNr;
1562 yyextra->current->startColumn = yyextra->yyColNr;
1563 yyextra->current->bodyLine = yyextra->yyLineNr;
1564 yyextra->current->bodyColumn = yyextra->yyColNr;
1565 lineCount(yyscanner) ;
1566 if (yytext[yyleng-1]=='{') unput('{');
1567 BEGIN( CompoundName ) ;
1569 <FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1570 <FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1571 QCString decl=yytext;
1572 yyextra->isTypedef=decl.find("typedef")!=-1;
1573 bool isConst=decl.find("const")!=-1;
1574 bool isVolatile=decl.find("volatile")!=-1;
1575 yyextra->current->section = Entry::CLASS_SEC;
1576 yyextra->current->spec = Entry::Union;
1577 // bug 582676: can be a struct nested in an interface so keep yyextra->insideObjC state
1578 //yyextra->current->objc = yyextra->insideObjC = FALSE;
1582 yyextra->current->type += " const";
1584 else if (isVolatile)
1586 yyextra->current->type += " volatile";
1588 yyextra->current->type += " union" ;
1589 yyextra->current->fileName = yyextra->yyFileName;
1590 yyextra->current->startLine = yyextra->yyLineNr;
1591 yyextra->current->startColumn = yyextra->yyColNr;
1592 yyextra->current->bodyLine = yyextra->yyLineNr;
1593 yyextra->current->bodyColumn = yyextra->yyColNr;
1594 lineCount(yyscanner) ;
1595 if (yytext[yyleng-1]=='{') unput('{');
1596 BEGIN( CompoundName ) ;
1598 <FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1599 <FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum
1600 QCString text=yytext;
1601 yyextra->isTypedef = text.find("typedef")!=-1;
1602 bool isStrongEnum = text.find("class")!=-1 || yyextra->insideCS;
1603 bool isEnumSytruct = text.find("struct")!=-1;
1604 if (yyextra->insideJava)
1606 yyextra->current->section = Entry::CLASS_SEC;
1607 yyextra->current->spec = Entry::Enum;
1611 yyextra->current->section = Entry::ENUM_SEC ;
1614 yyextra->current->type += " enum";
1617 yyextra->current->spec |= Entry::Strong;
1621 yyextra->current->spec |= Entry::Strong;
1622 yyextra->current->spec |= Entry::EnumStruct;
1624 yyextra->current->fileName = yyextra->yyFileName;
1625 yyextra->current->startLine = yyextra->yyLineNr;
1626 yyextra->current->startColumn = yyextra->yyColNr;
1627 yyextra->current->bodyLine = yyextra->yyLineNr;
1628 yyextra->current->bodyColumn = yyextra->yyColNr;
1629 lineCount(yyscanner) ;
1630 if (yytext[yyleng-1]=='{') unput('{');
1631 BEGIN( CompoundName ) ;
1633 <FindMembers>{B}*"concept"{BN}+ { // C++20 concept
1634 yyextra->isTypedef=FALSE;
1635 yyextra->current->section = Entry::CONCEPT_SEC;
1637 yyextra->current->type += " concept";
1638 yyextra->current->fileName = yyextra->yyFileName;
1639 yyextra->current->startLine = yyextra->yyLineNr;
1640 yyextra->current->startColumn = yyextra->yyColNr;
1641 yyextra->current->bodyLine = yyextra->yyLineNr;
1642 yyextra->current->bodyColumn = yyextra->yyColNr;
1643 lineCount(yyscanner) ;
1644 BEGIN( ConceptName ) ;
1646 <Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" { // A::operator()<int>(int arg)
1647 lineCount(yyscanner);
1648 yyextra->current->name += "()";
1649 BEGIN( FindMembers );
1651 <Operator>"("{BN}*")"{BNopt}/"(" {
1652 lineCount(yyscanner);
1653 yyextra->current->name += yytext ;
1654 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1655 BEGIN( FindMembers ) ;
1657 <Operator>";" { // can occur when importing members
1659 BEGIN( FindMembers ) ;
1662 lineCount(yyscanner);
1663 yyextra->current->name += *yytext ;
1665 <Operator>"<>" { /* skip guided templ specifiers */ }
1667 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1669 BEGIN( FindMembers ) ;
1671 <FindMembers>("template"|"generic")({BN}*)"<"/[>]? { // generic is a C++/CLI extension
1672 lineCount(yyscanner);
1674 //yyextra->current->spec |= (yytext[0]=='g') ? Entry::Generic : Entry::Template;
1675 yyextra->current->tArgLists.push_back(al);
1676 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1677 yyextra->templateStr="<";
1678 yyextra->fullArgString = yyextra->templateStr;
1679 yyextra->copyArgString = &yyextra->templateStr;
1680 yyextra->currentArgumentContext = FindMembers;
1681 BEGIN( ReadTempArgs );
1683 <FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
1684 lineCount(yyscanner);
1685 BEGIN( NSAliasName );
1688 yyextra->aliasName = yytext;
1689 BEGIN( NSAliasArg );
1691 <NSAliasArg>({ID}"::")*{ID} {
1692 //printf("Inserting namespace alias %s::%s->%s\n",qPrint(yyextra->current_root->name),qPrint(yyextra->aliasName),yytext);
1693 // TODO: namespace aliases are now treated as global entities
1694 // while they should be aware of the scope they are in
1695 Doxygen::namespaceAliasMap.insert({yyextra->aliasName.str(),std::string(yytext)});
1698 BEGIN( FindMembers );
1700 <PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1701 lineCount(yyscanner);
1702 yyextra->aliasName=yytext;
1705 <PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1706 lineCount(yyscanner);
1707 yyextra->current->name=removeRedundantWhiteSpace(substitute(yytext,"\\","::"));
1708 //printf("PHP: adding use relation: %s\n",qPrint(yyextra->current->name));
1709 yyextra->current->fileName = yyextra->yyFileName;
1710 // add a using declaration
1711 yyextra->current->section=Entry::USINGDECL_SEC;
1712 yyextra->current_root->copyToSubEntry(yyextra->current);
1713 // also add it as a using directive
1714 yyextra->current->section=Entry::USINGDIR_SEC;
1715 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1716 initEntry(yyscanner);
1717 yyextra->aliasName.resize(0);
1719 <PHPUseAs>{BN}+"as"{BN}+ {
1720 lineCount(yyscanner);
1722 <PHPUseAs>{PHPUSEKW} {
1725 //printf("PHP: adding use as relation: %s->%s\n",yytext,qPrint(yyextra->aliasName));
1726 if (!yyextra->aliasName.isEmpty())
1728 Doxygen::namespaceAliasMap.insert({yytext,
1729 std::string(removeRedundantWhiteSpace(
1730 substitute(yyextra->aliasName,"\\","::")).str())});
1732 yyextra->aliasName.resize(0);
1734 <PHPUse,PHPUseAs>[,;] {
1744 <JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
1745 lineCount(yyscanner);
1746 QCString scope=yytext;
1747 yyextra->current->name=removeRedundantWhiteSpace(substitute(scope.left(scope.length()-1),".","::"));
1748 yyextra->current->fileName = yyextra->yyFileName;
1749 yyextra->current->section=Entry::USINGDIR_SEC;
1750 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1751 initEntry(yyscanner);
1754 <JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
1755 lineCount(yyscanner);
1756 QCString scope=yytext;
1757 yyextra->current->name=removeRedundantWhiteSpace(substitute(scope,".","::"));
1758 yyextra->current->fileName = yyextra->yyFileName;
1759 if (yyextra->insideD)
1761 yyextra->current->section=Entry::USINGDIR_SEC;
1765 //printf("import name = %s -> %s\n",yytext,qPrint(yyextra->current->name));
1766 yyextra->current->section=Entry::USINGDECL_SEC;
1768 yyextra->previous = yyextra->current;
1769 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1770 initEntry(yyscanner);
1773 <FindMembers>"using"{BN}+ {
1774 yyextra->current->startLine=yyextra->yyLineNr;
1775 yyextra->current->startColumn = yyextra->yyColNr;
1776 lineCount(yyscanner);
1779 <Using>"namespace"{BN}+ { lineCount(yyscanner); BEGIN(UsingDirective); }
1780 <Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}) {
1781 lineCount(yyscanner);
1782 yyextra->current->name=yytext;
1783 yyextra->current->fileName = yyextra->yyFileName;
1784 yyextra->current->section=Entry::USINGDECL_SEC;
1785 yyextra->current->startLine = yyextra->yyLineNr;
1786 yyextra->previous = yyextra->current;
1787 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1788 initEntry(yyscanner);
1789 if (yyextra->insideCS) /* Hack: in C# a using declaration and
1790 directive have the same syntax, so we
1791 also add it as a using directive here
1794 yyextra->current->name=yytext;
1795 yyextra->current->fileName = yyextra->yyFileName;
1796 yyextra->current->startLine = yyextra->yyLineNr;
1797 yyextra->current->startColumn = yyextra->yyColNr;
1798 yyextra->current->section=Entry::USINGDIR_SEC;
1799 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1800 initEntry(yyscanner);
1804 <Using>"=" { // C++11 style template alias?
1808 yyextra->previous->section=Entry::VARIABLE_SEC;
1809 yyextra->previous->args = yyextra->previous->args.stripWhiteSpace();
1810 yyextra->previous->args.stripPrefix("class ");
1811 yyextra->previous->args.stripPrefix("struct ");
1812 yyextra->previous->type = "typedef "+yyextra->previous->args;
1813 yyextra->previous->type=yyextra->previous->type.simplifyWhiteSpace();
1814 yyextra->previous->args.resize(0);
1815 yyextra->previous->name=yyextra->previous->name.stripWhiteSpace();
1816 yyextra->previous->bodyLine = yyextra->yyLineNr;
1817 yyextra->previous->bodyColumn = yyextra->yyColNr;
1818 yyextra->previous->spec |= Entry::Alias;
1821 <UsingAlias>";"{BN}*{DCOMM}"<" {
1822 yyextra->docBlockContext = UsingAliasEnd;
1823 yyextra->docBlockInBody = FALSE;
1824 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
1825 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
1827 indent.fill(' ',computeIndent(yytext,yyextra->column));
1828 yyextra->docBlock.str(indent.str());
1829 lineCount(yyscanner);
1831 yyextra->docBlockTerm = ';';
1832 if (yytext[yyleng-3]=='/')
1834 startCommentBlock(yyscanner,TRUE);
1839 startCommentBlock(yyscanner,FALSE);
1844 yyextra->previous->args+="> >"; // see bug769552
1847 yyextra->previous->args+=yytext;
1850 yyextra->previous->args+=yytext;
1851 lineCount(yyscanner);
1853 <UsingAliasEnd>";" {
1854 yyextra->previous->doc = yyextra->current->doc;
1855 yyextra->previous->brief = yyextra->current->brief;
1856 yyextra->current->doc.resize(0);
1857 yyextra->current->brief.resize(0);
1861 <UsingDirective>{SCOPENAME} { yyextra->current->name=removeRedundantWhiteSpace(yytext);
1862 yyextra->current->fileName = yyextra->yyFileName;
1863 yyextra->current->section=Entry::USINGDIR_SEC;
1864 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1865 initEntry(yyscanner);
1868 <Using>";" { BEGIN(FindMembers); }
1869 <FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl
1872 yyextra->current->name=n.left(n.length()-2);
1874 <FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
1875 yyextra->roundCount=0;
1876 yyextra->sharpCount=0;
1877 lineCount(yyscanner);
1879 yyextra->current->name=yytext;
1880 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
1881 //yyextra->current->scopeSpec.resize(0);
1882 // yyextra->currentTemplateSpec = &yyextra->current->scopeSpec;
1883 if (nameIsOperator(yyextra->current->name))
1886 BEGIN( EndTemplate );
1888 <FindMemberName>{SCOPENAME}{BNopt}/"<" {
1889 yyextra->sharpCount=0;
1890 yyextra->roundCount=0;
1891 lineCount(yyscanner);
1892 yyextra->current->name+=((QCString)yytext).stripWhiteSpace();
1893 //yyextra->current->memberSpec.resize(0);
1894 // yyextra->currentTemplateSpec = &yyextra->current->memberSpec;
1895 if (nameIsOperator(yyextra->current->name))
1898 BEGIN( EndTemplate );
1900 <EndTemplate>"<<<" {
1901 if (!yyextra->insidePHP)
1907 yyextra->lastHereDocContext = YY_START;
1911 <ClassTemplSpec,EndTemplate>"<<" {
1912 yyextra->current->name+=yytext;
1913 // *yyextra->currentTemplateSpec+=yytext;
1916 if (yyextra->roundCount==0)
1918 // *yyextra->currentTemplateSpec+='<';
1919 yyextra->sharpCount++;
1921 yyextra->current->name+=yytext;
1923 <ClassTemplSpec,EndTemplate>">>" {
1924 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
1932 yyextra->current->name+=yytext;
1934 // *yyextra->currentTemplateSpec+=yytext;
1937 yyextra->current->name+='>';
1938 // *yyextra->currentTemplateSpec+='>';
1939 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
1941 //printf("Found %s\n",qPrint(yyextra->current->name));
1945 <EndTemplate>">"{BN}*"(" {
1946 lineCount(yyscanner);
1947 yyextra->current->name+='>';
1948 // *yyextra->currentTemplateSpec+='>';
1949 --yyextra->sharpCount;
1950 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
1952 yyextra->current->bodyLine = yyextra->yyLineNr;
1953 yyextra->current->bodyColumn = yyextra->yyColNr;
1954 yyextra->current->args = "(";
1955 yyextra->currentArgumentContext = FuncQual;
1956 yyextra->fullArgString = yyextra->current->args;
1957 yyextra->copyArgString = &yyextra->current->args;
1958 //printf("Found %s\n",qPrint(yyextra->current->name));
1959 BEGIN( ReadFuncArgType ) ;
1963 yyextra->current->name+="(";
1964 yyextra->roundCount++;
1967 <EndTemplate>">"{BNopt}/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
1968 lineCount(yyscanner);
1969 yyextra->current->name+='>';
1970 if (yyextra->roundCount==0)
1975 <EndTemplate>">"{BNopt}/"::" {
1976 lineCount(yyscanner);
1977 yyextra->current->name+='>';
1978 // *yyextra->currentTemplateSpec+='>';
1979 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
1981 BEGIN(FindMemberName);
1984 <ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
1985 yyextra->roundCount++;
1987 <ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
1988 if (yyextra->roundCount>0) yyextra->roundCount--;
1991 yyextra->current->name+=*yytext;
1992 // *yyextra->currentTemplateSpec+=*yytext;
1994 <FindMembers>"define"{BN}*"("{BN}*["'] {
1995 if (yyextra->insidePHP)
1997 yyextra->current->bodyLine = yyextra->yyLineNr;
1998 yyextra->current->bodyColumn = yyextra->yyColNr;
2004 <CopyHereDoc>{ID} { // PHP heredoc
2005 yyextra->delimiter = yytext;
2006 *yyextra->pCopyHereDocGString << yytext;
2007 BEGIN(CopyHereDocEnd);
2009 <CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
2010 yyextra->delimiter = &yytext[1];
2011 *yyextra->pCopyHereDocGString << yytext;
2012 BEGIN(CopyHereDocEnd);
2014 <HereDoc>{ID} { // PHP heredoc
2015 yyextra->delimiter = yytext;
2018 <HereDoc>"'"{ID}/"'" { // PHP nowdoc
2019 yyextra->delimiter = &yytext[1];
2022 <HereDocEnd>^{ID} { // id at start of the line could mark the end of the block
2023 if (yyextra->delimiter==yytext) // it is the end marker
2025 BEGIN(yyextra->lastHereDocContext);
2029 <CopyHereDocEnd>^{ID} { // id at start of the line could mark the end of the block
2030 *yyextra->pCopyHereDocGString << yytext;
2031 if (yyextra->delimiter==yytext) // it is the end marker
2033 BEGIN(yyextra->lastHereDocContext);
2036 <CopyHereDocEnd>\n {
2037 lineCount(yyscanner);
2038 *yyextra->pCopyHereDocGString << yytext;
2040 <CopyHereDocEnd>{ID} {
2041 *yyextra->pCopyHereDocGString << yytext;
2044 *yyextra->pCopyHereDocGString << yytext;
2046 <FindMembers>"Q_OBJECT" { // Qt object macro
2048 <FindMembers>"Q_PROPERTY" { // Qt property declaration
2049 yyextra->current->protection = Public ; // see bug734245 & bug735462
2050 yyextra->current->mtype = yyextra->mtype = Property;
2051 yyextra->current->type.resize(0);
2054 <QtPropType>"(" { // start of property arguments
2056 <QtPropAttr>")" { // end of property arguments
2061 yyextra->current->name+=yytext;
2064 yyextra->current->type+= yyextra->current->name;
2065 yyextra->current->type+= yytext;
2066 yyextra->current->name="";
2068 <QtPropType>({TSCOPE}"::")*{TSCOPE} {
2069 yyextra->current->type+= yyextra->current->name;
2070 yyextra->current->name=yytext;
2072 <QtPropType,QtPropAttr>{B}+"READ"{B}+ {
2073 yyextra->current->spec |= Entry::Readable;
2076 <QtPropType,QtPropAttr>{B}+"WRITE"{B}+ {
2077 yyextra->current->spec |= Entry::Writable;
2080 <QtPropType,QtPropAttr>{B}+"MEMBER"{B}+{ID} | // member property => not supported yet
2081 <QtPropType,QtPropAttr>{B}+"RESET"{B}+{ID} | // reset method => not supported yet
2082 <QtPropType,QtPropAttr>{B}+"SCRIPTABLE"{B}+{ID} | // scriptable property => not supported yet
2083 <QtPropType,QtPropAttr>{B}+"DESIGNABLE"{B}+{ID} | // designable property => not supported yet
2084 <QtPropType,QtPropAttr>{B}+"NOTIFY"{B}+{ID} | // notify property => not supported yet
2085 <QtPropType,QtPropAttr>{B}+"REVISION"{B}+{ID} | // revision property => not supported yet
2086 <QtPropType,QtPropAttr>{B}+"STORED"{B}+{ID} | // stored property => not supported yet
2087 <QtPropType,QtPropAttr>{B}+"USER"{B}+{ID} | // user property => not supported yet
2088 <QtPropType,QtPropAttr>{B}+"CONSTANT"{B} | // constant property => not supported yet
2089 <QtPropType,QtPropAttr>{B}+"FINAL"{B} { // final property => not supported yet
2093 yyextra->current->read = yytext;
2097 yyextra->current->write = yytext;
2100 <FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2101 yyextra->current->name=yytext;
2102 lineCount(yyscanner) ;
2105 <FindMembers>"requires" { // C++20 requires clause
2106 yyextra->current->req.resize(0);
2107 yyextra->requiresContext = YY_START;
2108 BEGIN(RequiresClause);
2110 <RequiresClause>"requires"{BN}*/"{" { // requires requires { ... }
2111 lineCount(yyscanner) ;
2112 yyextra->current->req+=yytext;
2113 BEGIN( RequiresExpression ) ;
2115 <RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
2116 lineCount(yyscanner) ;
2117 yyextra->current->req+=yytext;
2118 yyextra->lastRoundContext=RequiresExpression;
2119 yyextra->pCopyRoundString=&yyextra->current->req;
2120 yyextra->roundCount=0;
2121 BEGIN( CopyRound ) ;
2123 <RequiresExpression>"{" {
2124 yyextra->current->req+=yytext;
2125 yyextra->lastCurlyContext=RequiresClause;
2126 yyextra->pCopyCurlyString=&yyextra->current->req;
2127 yyextra->curlyCount=0;
2128 BEGIN( CopyCurly ) ;
2130 <RequiresExpression>\n {
2131 yyextra->current->req+=' ';
2132 lineCount(yyscanner);
2134 <RequiresExpression>. {
2135 yyextra->current->req+=yytext;
2137 <RequiresClause>"(" { // requires "(A && B)"
2138 yyextra->current->req+=yytext;
2139 yyextra->lastRoundContext=RequiresClause;
2140 yyextra->pCopyRoundString=&yyextra->current->req;
2141 yyextra->roundCount=0;
2142 BEGIN( CopyRound ) ;
2144 <RequiresClause>{ID} { // something like "requires true"
2145 if (yyextra->current->req.stripWhiteSpace().isEmpty())
2147 yyextra->current->req=yytext;
2148 BEGIN(yyextra->requiresContext);
2155 <RequiresClause>{SCOPENAME}{BNopt}"(" { // "requires func(x)"
2156 yyextra->current->req+=yytext;
2157 yyextra->lastRoundContext=RequiresClause;
2158 yyextra->pCopyRoundString=&yyextra->current->req;
2159 yyextra->roundCount=0;
2162 <RequiresClause>{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
2163 yyextra->current->req+=yytext;
2164 yyextra->lastSharpContext=RequiresClause;
2165 yyextra->pCopySharpString=&yyextra->current->req;
2166 yyextra->sharpCount=0;
2169 <RequiresClause>"||"|"&&" { // "requires A || B" or "requires A && B"
2170 yyextra->current->req+=yytext;
2172 <RequiresClause>{BN}+ {
2173 yyextra->current->req+=' ';
2174 lineCount(yyscanner) ;
2178 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2179 BEGIN(yyextra->requiresContext);
2181 <FindMembers,FindMemberName>{SCOPENAME} {
2182 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
2184 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
2186 yyextra->yyBegColNr=yyextra->yyColNr;
2187 yyextra->yyBegLineNr=yyextra->yyLineNr;
2188 lineCount(yyscanner);
2189 if (yyextra->insideIDL && yyleng==9 && qstrcmp(yytext,"cpp_quote")==0)
2193 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 && qstrcmp(yytext,"import")==0)
2195 if (yyextra->insideIDL)
2197 else // yyextra->insideJava or yyextra->insideD
2200 else if (yyextra->insidePHP && qstrcmp(yytext,"use")==0)
2204 else if (yyextra->insideJava && qstrcmp(yytext,"package")==0)
2206 lineCount(yyscanner);
2209 else if (yyextra->insideIDL && qstrcmp(yytext,"case")==0)
2211 BEGIN(IDLUnionCase);
2213 else if (yyextra->insideTryBlock && qstrcmp(yytext,"catch")==0)
2215 yyextra->insideTryBlock=FALSE;
2216 BEGIN(TryFunctionBlock);
2218 else if (yyextra->insideCpp && qstrcmp(yytext,"alignas")==0)
2220 yyextra->lastAlignAsContext = YY_START;
2223 else if (yyextra->insideJS && qstrcmp(yytext,"var")==0)
2224 { // javascript variable
2225 yyextra->current->type="var";
2227 else if (yyextra->insideJS && qstrcmp(yytext,"function")==0)
2228 { // javascript function
2229 yyextra->current->type="function";
2231 else if (yyextra->insideCS && qstrcmp(yytext,"this")==0)
2235 yyextra->current->name="this";
2238 else if (yyextra->insideCpp && qstrcmp(yytext,"static_assert")==0)
2240 // C++11 static_assert
2241 BEGIN(StaticAssert);
2243 else if (yyextra->insideCpp && qstrcmp(yytext,"decltype")==0)
2245 // C++11 decltype(x)
2247 if (!yyextra->current->type.isEmpty()) yyextra->current->type+=' ';
2248 yyextra->current->type+=yytext;
2251 else if (yyextra->insideSlice && qstrcmp(yytext,"optional")==0)
2253 if (yyextra->current->type.isEmpty())
2255 yyextra->current->type = "optional";
2259 yyextra->current->type += " optional";
2261 yyextra->lastModifierContext = YY_START;
2262 BEGIN(SliceOptional);
2266 if (YY_START==FindMembers)
2270 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2271 if (javaLike && qstrcmp(yytext,"public")==0)
2273 yyextra->current->protection = Public;
2275 else if (javaLike && qstrcmp(yytext,"protected")==0)
2277 yyextra->current->protection = Protected;
2279 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) && qstrcmp(yytext,"internal")==0)
2281 yyextra->current->protection = Package;
2283 else if (javaLike && qstrcmp(yytext,"private")==0)
2285 yyextra->current->protection = Private;
2287 else if (javaLike && qstrcmp(yytext,"static")==0)
2289 if (YY_START==FindMembers)
2290 yyextra->current->name = yytext;
2292 yyextra->current->name += yytext;
2293 yyextra->current->stat = TRUE;
2297 if (YY_START==FindMembers)
2298 yyextra->current->name = yytext;
2300 yyextra->current->name += yytext;
2301 if (yyextra->current->name.left(7)=="static ")
2303 yyextra->current->stat = TRUE;
2304 yyextra->current->name= yyextra->current->name.mid(7);
2306 else if (yyextra->current->name.left(7)=="inline ")
2308 if (yyextra->current->type.isEmpty())
2310 yyextra->current->type="inline";
2314 yyextra->current->type+="inline ";
2316 yyextra->current->name= yyextra->current->name.mid(7);
2318 else if (yyextra->current->name.left(6)=="const ")
2320 if (yyextra->current->type.isEmpty())
2322 yyextra->current->type="const";
2326 yyextra->current->type+="const ";
2328 yyextra->current->name=yyextra->current->name.mid(6);
2330 else if (yyextra->current->name.left(9)=="volatile ")
2332 if (yyextra->current->type.isEmpty())
2334 yyextra->current->type="volatile";
2338 yyextra->current->type+="volatile ";
2340 yyextra->current->name=yyextra->current->name.mid(9);
2343 QCString tmp=yytext;
2344 if (nameIsOperator(tmp))
2350 yyextra->externLinkage=FALSE; // see bug759247
2354 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2357 yyextra->lastSkipRoundContext = FindMembers;
2358 yyextra->roundCount=0;
2361 <StaticAssert>{BN}+ { lineCount(yyscanner); }
2362 <StaticAssert>. { // variable with static_assert as name?
2367 yyextra->current->type+=yytext;
2368 yyextra->lastRoundContext=FindMembers;
2369 yyextra->pCopyRoundString=&yyextra->current->type;
2370 yyextra->roundCount=0;
2373 <DeclType>{BN}+ { lineCount(yyscanner); }
2378 <CSIndexer>"["[^\n\]]*"]" {
2379 yyextra->current->name+=removeRedundantWhiteSpace(yytext);
2382 <FindMembers>[0-9]{ID} { // some number where we did not expect one
2385 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2387 yyextra->current->name+=".";
2391 yyextra->current->name+=yytext;
2393 <CppQuote>"("{B}*"\"" {
2394 yyextra->insideCppQuote=TRUE;
2398 <IDLUnionCase>":" { BEGIN(FindMembers); }
2399 <IDLUnionCase>\n { lineCount(yyscanner); }
2401 <TryFunctionBlock>\n { lineCount(yyscanner); }
2402 <TryFunctionBlock>"{" {
2403 yyextra->curlyCount=0;
2404 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2408 <TryFunctionBlockEnd>{BN}*"catch" { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
2410 <TryFunctionBlockEnd>\n { unput(*yytext); // rule added to fix bug id 601138
2411 BEGIN( FindMembers );
2413 <TryFunctionBlockEnd>. { unput(*yytext);
2414 BEGIN( FindMembers );
2417 yyextra->insideCppQuote=FALSE;
2420 <FindMembers,FindFields>{B}*"#" { if (yyextra->insidePHP)
2422 yyextra->lastCPPContext = YY_START;
2425 <FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2426 if (yyextra->insidePHP)
2428 yyextra->current->bodyLine = yyextra->yyLineNr;
2429 yyextra->current->bodyColumn = yyextra->yyColNr;
2430 yyextra->lastDefineContext = YY_START;
2433 <FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
2434 yyextra->yyLineNr = atoi(&yytext[1]);
2435 //printf("setting line number to %d\n",yyextra->yyLineNr);
2436 yyextra->lastPreLineCtrlContext = YY_START;
2437 if (YY_START==ReadBody ||
2438 YY_START==ReadNSBody ||
2439 YY_START==ReadBodyIntf)
2441 yyextra->current->program << yytext;
2443 BEGIN( PreLineCtrl );
2445 <PreLineCtrl>"\""[^\n\"]*"\"" {
2446 yyextra->yyFileName = stripQuotes(yytext);
2447 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2448 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2449 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2451 yyextra->current->program << yytext;
2455 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2456 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2457 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2459 yyextra->current->program << yytext;
2463 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2464 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2465 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2467 yyextra->current->program << yytext;
2469 lineCount(yyscanner);
2470 BEGIN( yyextra->lastPreLineCtrlContext );
2473 <SkipCPP>\\[\r]*"\n"[\r]* { lineCount(yyscanner); }
2474 <SkipCPP>[\r]*\n[\r]* { lineCount(yyscanner);
2475 BEGIN( yyextra->lastCPPContext) ;
2477 <Define>{ID}{B}*"(" {
2478 yyextra->current->name = yytext;
2479 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2480 yyextra->current->args = "(";
2481 yyextra->current->bodyLine = yyextra->yyLineNr;
2482 yyextra->current->bodyColumn = yyextra->yyColNr;
2483 yyextra->currentArgumentContext = DefineEnd;
2484 yyextra->fullArgString=yyextra->current->args;
2485 yyextra->copyArgString=&yyextra->current->args;
2486 BEGIN( ReadFuncArgType ) ;
2490 //printf("Define with args\n");
2491 yyextra->current->args += ')';
2495 yyextra->current->args += *yytext;
2499 //printf("Define '%s' without args\n",yytext);
2500 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
2502 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
2504 yyextra->current->bodyLine = yyextra->yyLineNr;
2505 yyextra->current->bodyColumn = yyextra->yyColNr;
2506 yyextra->current->name = yytext;
2510 //printf("End define: doc=%s docFile=%s docLine=%d\n",qPrint(yyextra->current->doc),qPrint(yyextra->current->docFile),yyextra->current->docLine);
2511 yyextra->current->fileName = yyextra->yyFileName;
2512 yyextra->current->startLine = yyextra->yyLineNr;
2513 yyextra->current->startColumn = yyextra->yyColNr;
2514 yyextra->current->type.resize(0);
2515 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2516 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2517 yyextra->current->section = Entry::DEFINE_SEC;
2518 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2519 lineCount(yyscanner);
2520 initEntry(yyscanner);
2521 BEGIN(yyextra->lastDefineContext);
2524 //printf("End define\n");
2525 yyextra->current->fileName = yyextra->yyFileName;
2526 yyextra->current->startLine = yyextra->yyLineNr;
2527 yyextra->current->startColumn = yyextra->yyColNr;
2528 yyextra->current->type.resize(0);
2529 yyextra->current->type = "const";
2530 QCString init = yyextra->current->initializer.str();
2531 init = init.simplifyWhiteSpace();
2532 init = init.left(init.length()-1);
2533 yyextra->current->initializer.str(init.str());
2534 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2535 yyextra->current->section = Entry::VARIABLE_SEC;
2536 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2537 initEntry(yyscanner);
2541 <DefineEnd>\\[\r]?\n {
2542 lineCount(yyscanner);
2545 if (yyextra->insideIDL && yyextra->insideCppQuote)
2551 yyextra->lastStringContext=DefineEnd;
2556 <DefinePHP>{ID}["']{BN}*","{BN}* {
2557 yyextra->current->name = yytext;
2558 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2559 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2560 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
2561 yyextra->current->bodyLine = yyextra->yyLineNr;
2562 yyextra->current->bodyColumn = yyextra->yyColNr;
2563 yyextra->lastRoundContext = DefinePHPEnd;
2564 yyextra->pCopyRoundGString = &yyextra->current->initializer;
2565 yyextra->roundCount = 0;
2566 BEGIN( GCopyRound );
2569 <FindMembers>[\^%] { // ^ and % are C++/CLI extensions
2570 if (yyextra->insideCli)
2573 yyextra->current->name = yytext ;
2580 <FindMembers>[*&]+ {
2581 yyextra->current->name += yytext ;
2584 <FindMembers,MemberSpec,Function,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
2585 if (yyextra->current->bodyLine==-1)
2587 yyextra->current->bodyLine=yyextra->yyLineNr;
2588 yyextra->current->bodyColumn = yyextra->yyColNr;
2590 yyextra->docBlockContext = YY_START;
2591 yyextra->docBlockInBody = FALSE;
2592 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2593 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
2596 indent.fill(' ',computeIndent(yytext,yyextra->column));
2597 yyextra->docBlock.str(indent.str());
2598 //printf("indent=%d\n",computeIndent(yytext+1,yyextra->column));
2599 lineCount(yyscanner);
2601 yyextra->docBlockTerm = ';';
2602 if (YY_START==EnumBaseType && yyextra->current->section==Entry::ENUM_SEC)
2604 yyextra->current->bitfields = ":"+yyextra->current->args;
2605 yyextra->current->args.resize(0);
2606 yyextra->current->section=Entry::VARIABLE_SEC;
2608 if (yytext[yyleng-3]=='/')
2610 startCommentBlock(yyscanner,TRUE);
2615 startCommentBlock(yyscanner,FALSE);
2619 <MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
2620 yyextra->docBlockContext = YY_START;
2621 yyextra->docBlockInBody = FALSE;
2622 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2623 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
2626 indent.fill(' ',computeIndent(yytext,yyextra->column));
2627 yyextra->docBlock.str(indent.str());
2628 lineCount(yyscanner);
2630 yyextra->docBlockTerm = ',';
2631 if (YY_START==EnumBaseType && yyextra->current->section==Entry::ENUM_SEC)
2633 yyextra->current->bitfields = ":"+yyextra->current->args;
2634 yyextra->current->args.resize(0);
2635 yyextra->current->section=Entry::VARIABLE_SEC;
2637 if (yytext[yyleng-3]=='/')
2639 startCommentBlock(yyscanner,TRUE);
2644 startCommentBlock(yyscanner,FALSE);
2648 <DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
2649 if (yyextra->current->bodyLine==-1)
2651 yyextra->current->bodyLine=yyextra->yyLineNr;
2652 yyextra->current->bodyColumn = yyextra->yyColNr;
2654 yyextra->docBlockContext = YY_START;
2655 yyextra->docBlockInBody = FALSE;
2656 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2657 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
2659 indent.fill(' ',computeIndent(yytext,yyextra->column));
2660 yyextra->docBlock.str(indent.str());
2661 lineCount(yyscanner);
2663 yyextra->docBlockTerm = 0;
2664 if (yytext[yyleng-3]=='/')
2666 startCommentBlock(yyscanner,TRUE);
2671 startCommentBlock(yyscanner,FALSE);
2676 <FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
2677 //handleGroupStartCommand(yyextra->current->name);
2678 if (yyextra->previous && yyextra->previous->section==Entry::GROUPDOC_SEC)
2680 // link open command to the group defined in the yyextra->previous entry
2681 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->yyFileName,yyextra->yyLineNr);
2685 // link open command to the yyextra->current entry
2686 yyextra->commentScanner.open(yyextra->current.get(),yyextra->yyFileName,yyextra->yyLineNr);
2688 //yyextra->current = tmp;
2689 initEntry(yyscanner);
2692 if (yytext[2]=='!' || yytext[2]=='/')
2694 yyextra->docBlockContext = YY_START;
2695 yyextra->docBlockInBody = FALSE;
2696 yyextra->docBlockAutoBrief = FALSE;
2697 yyextra->docBlock.str(std::string());
2698 yyextra->docBlockTerm = 0;
2699 startCommentBlock(yyscanner,TRUE);
2704 yyextra->lastCContext=YY_START;
2705 BEGIN(SkipCxxComment);
2710 if (yytext[2]=='!' || yytext[2]=='*')
2712 yyextra->docBlockContext = YY_START;
2713 yyextra->docBlockInBody = FALSE;
2714 yyextra->docBlock.str(std::string());
2715 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
2716 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
2717 yyextra->docBlockTerm = 0;
2718 startCommentBlock(yyscanner,FALSE);
2723 yyextra->lastCContext=YY_START;
2728 <FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
2729 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields); // see bug746226
2730 yyextra->commentScanner.close(yyextra->current.get(),yyextra->yyFileName,yyextra->yyLineNr,insideEnum);
2731 lineCount(yyscanner);
2734 if (!yyextra->insideCS) REJECT;
2735 yyextra->current->bodyLine = yyextra->yyLineNr;
2736 yyextra->current->bodyColumn = yyextra->yyColNr;
2737 yyextra->current->initializer.str(yytext);
2738 yyextra->lastInitializerContext = YY_START;
2739 yyextra->initBracketCount=0;
2740 yyextra->current->mtype = yyextra->mtype = Property;
2741 yyextra->current->spec |= Entry::Gettable;
2742 BEGIN(ReadInitializerPtr);
2744 <FindMembers>"=" { // in PHP code this could also be due to "<?="
2745 yyextra->current->bodyLine = yyextra->yyLineNr;
2746 yyextra->current->bodyColumn = yyextra->yyColNr;
2747 yyextra->current->initializer.str(yytext);
2748 yyextra->lastInitializerContext = YY_START;
2749 yyextra->initBracketCount=0;
2750 BEGIN(ReadInitializer);
2752 <UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
2753 lineCount(yyscanner);
2754 yyextra->current->exception += " ";
2755 yyextra->current->exception += removeRedundantWhiteSpace(yytext);
2757 <UNOIDLAttributeBlock>"}" {
2758 yyextra->current->exception += " }";
2761 /* Read initializer rules */
2762 <ReadInitializer,ReadInitializerPtr>"(" {
2763 yyextra->lastRoundContext=YY_START;
2764 yyextra->pCopyRoundGString=&yyextra->current->initializer;
2765 yyextra->roundCount=0;
2766 yyextra->current->initializer << *yytext;
2769 <ReadInitializer,ReadInitializerPtr>"[" {
2770 if (!yyextra->insidePHP) REJECT;
2771 yyextra->lastSquareContext=YY_START;
2772 yyextra->pCopySquareGString=&yyextra->current->initializer;
2773 yyextra->squareCount=0;
2774 yyextra->current->initializer << *yytext;
2777 <ReadInitializer,ReadInitializerPtr>"{" {
2778 yyextra->lastCurlyContext=YY_START;
2779 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
2780 yyextra->curlyCount=0;
2781 yyextra->current->initializer << *yytext;
2784 <ReadInitializer,ReadInitializerPtr>[;,] {
2785 //printf(">> initializer '%s' <<\n",qPrint(yyextra->current->initializer));
2786 if (*yytext==';' && (yyextra->current_root->spec&Entry::Enum))
2788 yyextra->current->fileName = yyextra->yyFileName;
2789 yyextra->current->startLine = yyextra->yyLineNr;
2790 yyextra->current->startColumn = yyextra->yyColNr;
2791 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2792 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2793 yyextra->current->section = Entry::VARIABLE_SEC;
2794 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2795 initEntry(yyscanner);
2798 else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0)) // yyextra->initBracketCount==0 was added for bug 665778
2801 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
2802 BEGIN(yyextra->lastInitializerContext);
2804 else if (*yytext==',' && yyextra->initBracketCount==0) // for "int a=0,b=0"
2807 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
2808 BEGIN(yyextra->lastInitializerContext);
2812 yyextra->current->initializer << *yytext;
2815 <ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
2816 if (!yyextra->insideCpp)
2822 QCString text=yytext;
2823 yyextra->current->initializer << text;
2824 int i=text.find('"');
2825 yyextra->delimiter = yytext+i+1;
2826 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
2827 yyextra->lastRawStringContext = YY_START;
2828 yyextra->pCopyRawGString = &yyextra->current->initializer;
2830 //printf("RawGString delimiter='%s'\n",qPrint(delimiter));
2833 <RawGString>{RAWEND} {
2834 *yyextra->pCopyRawGString << yytext;
2835 QCString delimiter = yytext+1;
2836 delimiter=delimiter.left(delimiter.length()-1);
2837 if (delimiter==yyextra->delimiter)
2839 BEGIN(yyextra->lastRawStringContext);
2842 <RawGString>[^)\n]+ {
2843 *yyextra->pCopyRawGString << yytext;
2846 *yyextra->pCopyRawGString << yytext;
2849 *yyextra->pCopyRawGString << yytext;
2850 lineCount(yyscanner);
2852 <RawString>{RAWEND} {
2853 *yyextra->pCopyRawString+=yytext;
2854 yyextra->fullArgString+=yytext;
2855 QCString delimiter = yytext+1;
2856 delimiter=delimiter.left(delimiter.length()-1);
2857 if (delimiter==yyextra->delimiter)
2859 BEGIN(yyextra->lastRawStringContext);
2863 *yyextra->pCopyRawString += yytext;
2864 yyextra->fullArgString+=yytext;
2867 *yyextra->pCopyRawString += yytext;
2868 yyextra->fullArgString+=yytext;
2871 *yyextra->pCopyRawString += yytext;
2872 yyextra->fullArgString+=yytext;
2873 lineCount(yyscanner);
2875 <ReadInitializer,ReadInitializerPtr>\" {
2876 if (yyextra->insideIDL && yyextra->insideCppQuote)
2882 yyextra->lastStringContext=YY_START;
2883 yyextra->current->initializer << yytext;
2884 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
2888 <ReadInitializer,ReadInitializerPtr>"->" {
2889 yyextra->current->initializer << yytext;
2891 <ReadInitializer,ReadInitializerPtr>"<<" {
2892 yyextra->current->initializer << yytext;
2894 <ReadInitializer,ReadInitializerPtr>">>" {
2895 yyextra->current->initializer << yytext;
2897 <ReadInitializer,ReadInitializerPtr>[<\[{(] {
2898 yyextra->initBracketCount++;
2899 yyextra->current->initializer << *yytext;
2901 <ReadInitializer,ReadInitializerPtr>[>\]})] {
2902 yyextra->initBracketCount--;
2903 yyextra->current->initializer << *yytext;
2905 <ReadInitializer,ReadInitializerPtr>\' {
2906 if (yyextra->insidePHP)
2908 yyextra->current->initializer << yytext;
2909 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
2910 yyextra->lastStringContext=YY_START;
2911 BEGIN(CopyPHPGString);
2915 yyextra->current->initializer << yytext;
2918 <ReadInitializer,ReadInitializerPtr>{CHARLIT} {
2919 if (yyextra->insidePHP)
2925 yyextra->current->initializer << yytext;
2928 <ReadInitializer,ReadInitializerPtr>\n {
2929 yyextra->current->initializer << *yytext;
2930 lineCount(yyscanner);
2932 <ReadInitializer,ReadInitializerPtr>"@\"" {
2933 //printf("yyextra->insideCS=%d\n",yyextra->insideCS);
2934 yyextra->current->initializer << yytext;
2935 if (!yyextra->insideCS && !yyextra->insideObjC)
2941 // C#/ObjC verbatim string
2942 yyextra->lastSkipVerbStringContext=YY_START;
2943 yyextra->pSkipVerbString=&yyextra->current->initializer;
2944 BEGIN(SkipVerbString);
2947 <SkipVerbString>[^\n"]+ {
2948 *yyextra->pSkipVerbString << yytext;
2950 <SkipVerbString>"\"\"" { // quote escape
2951 *yyextra->pSkipVerbString << yytext;
2953 <SkipVerbString>"\"" {
2954 *yyextra->pSkipVerbString << *yytext;
2955 BEGIN(yyextra->lastSkipVerbStringContext);
2957 <SkipVerbString>\n {
2958 *yyextra->pSkipVerbString << *yytext;
2959 lineCount(yyscanner);
2962 *yyextra->pSkipVerbString << *yytext;
2964 <ReadInitializer,ReadInitializerPtr>"?>" {
2965 if (yyextra->insidePHP)
2966 BEGIN( FindMembersPHP );
2968 yyextra->current->initializer << yytext;
2970 <ReadInitializer,ReadInitializerPtr>. {
2971 yyextra->current->initializer << *yytext;
2974 /* generic quoted string copy rules */
2975 <CopyString,CopyPHPString>\\. {
2976 *yyextra->pCopyQuotedString+=yytext;
2979 *yyextra->pCopyQuotedString+=*yytext;
2980 BEGIN( yyextra->lastStringContext );
2983 *yyextra->pCopyQuotedString+=*yytext;
2984 BEGIN( yyextra->lastStringContext );
2986 <CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
2987 *yyextra->pCopyQuotedString+=yytext;
2989 <CopyString,CopyPHPString>\n {
2990 *yyextra->pCopyQuotedString+=*yytext;
2991 lineCount(yyscanner);
2993 <CopyString,CopyPHPString>. {
2994 *yyextra->pCopyQuotedString+=*yytext;
2997 /* generic quoted growable string copy rules */
2998 <CopyGString,CopyPHPGString>\\. {
2999 *yyextra->pCopyQuotedGString << yytext;
3002 *yyextra->pCopyQuotedGString << *yytext;
3003 BEGIN( yyextra->lastStringContext );
3005 <CopyPHPGString>\' {
3006 *yyextra->pCopyQuotedGString << *yytext;
3007 BEGIN( yyextra->lastStringContext );
3009 <CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
3010 *yyextra->pCopyQuotedGString << yytext;
3011 BEGIN( yyextra->lastStringContext );
3013 <CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3014 *yyextra->pCopyQuotedGString << yytext;
3016 <CopyGString,CopyPHPGString>\n {
3017 *yyextra->pCopyQuotedGString << *yytext;
3018 lineCount(yyscanner);
3020 <CopyGString,CopyPHPGString>. {
3021 *yyextra->pCopyQuotedGString << *yytext;
3024 /* generic round bracket list copy rules */
3026 *yyextra->pCopyRoundString += *yytext;
3027 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3028 yyextra->lastStringContext=YY_START;
3032 *yyextra->pCopyRoundString += *yytext;
3033 yyextra->roundCount++;
3036 *yyextra->pCopyRoundString += *yytext;
3037 if (--yyextra->roundCount<0)
3038 BEGIN(yyextra->lastRoundContext);
3041 lineCount(yyscanner);
3042 *yyextra->pCopyRoundString += *yytext;
3045 if (yyextra->insidePHP)
3047 yyextra->current->initializer << yytext;
3048 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3049 yyextra->lastStringContext=YY_START;
3050 BEGIN(CopyPHPString);
3054 *yyextra->pCopyRoundString += yytext;
3057 <CopyRound>{CHARLIT} {
3058 if (yyextra->insidePHP)
3064 *yyextra->pCopyRoundString+=yytext;
3067 <CopyRound>[^"'()\n,]+ {
3068 *yyextra->pCopyRoundString+=yytext;
3071 *yyextra->pCopyRoundString+=*yytext;
3074 /* generic sharp bracket list copy rules */
3076 *yyextra->pCopySharpString += *yytext;
3077 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3078 yyextra->lastStringContext=YY_START;
3082 *yyextra->pCopySharpString += *yytext;
3083 yyextra->sharpCount++;
3086 *yyextra->pCopySharpString += *yytext;
3087 if (--yyextra->sharpCount<0)
3089 BEGIN(yyextra->lastSharpContext);
3093 lineCount(yyscanner);
3094 *yyextra->pCopySharpString += *yytext;
3097 if (yyextra->insidePHP)
3099 yyextra->current->initializer << yytext;
3100 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3101 yyextra->lastStringContext=YY_START;
3102 BEGIN(CopyPHPString);
3106 *yyextra->pCopySharpString += yytext;
3109 <CopySharp>{CHARLIT} {
3110 if (yyextra->insidePHP)
3116 *yyextra->pCopySharpString+=yytext;
3119 <CopySharp>[^"'<>\n,]+ {
3120 *yyextra->pCopySharpString+=yytext;
3123 *yyextra->pCopySharpString+=*yytext;
3127 /* generic round bracket list copy rules for growable strings */
3129 *yyextra->pCopyRoundGString << *yytext;
3130 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3131 yyextra->lastStringContext=YY_START;
3135 *yyextra->pCopyRoundGString << *yytext;
3136 yyextra->roundCount++;
3139 *yyextra->pCopyRoundGString << *yytext;
3140 if (--yyextra->roundCount<0)
3141 BEGIN(yyextra->lastRoundContext);
3144 lineCount(yyscanner);
3145 *yyextra->pCopyRoundGString << *yytext;
3148 if (yyextra->insidePHP)
3150 yyextra->current->initializer << yytext;
3151 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3152 yyextra->lastStringContext=YY_START;
3153 BEGIN(CopyPHPGString);
3157 *yyextra->pCopyRoundGString << yytext;
3160 <GCopyRound>{CHARLIT} {
3161 if (yyextra->insidePHP)
3167 *yyextra->pCopyRoundGString << yytext;
3170 <GCopyRound>[^"'()\n\/,]+ {
3171 *yyextra->pCopyRoundGString << yytext;
3174 *yyextra->pCopyRoundGString << *yytext;
3177 /* generic square bracket list copy rules for growable strings, we should only enter here in case of php, left the test part as in GCopyRound to keep it compatible with the round bracket version */
3179 *yyextra->pCopySquareGString << *yytext;
3180 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3181 yyextra->lastStringContext=YY_START;
3185 *yyextra->pCopySquareGString << *yytext;
3186 yyextra->squareCount++;
3189 *yyextra->pCopySquareGString << *yytext;
3190 if (--yyextra->squareCount<0)
3191 BEGIN(yyextra->lastSquareContext);
3194 lineCount(yyscanner);
3195 *yyextra->pCopySquareGString << *yytext;
3198 if (yyextra->insidePHP)
3200 yyextra->current->initializer << yytext;
3201 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3202 yyextra->lastStringContext=YY_START;
3203 BEGIN(CopyPHPGString);
3207 *yyextra->pCopySquareGString << yytext;
3210 <GCopySquare>{CHARLIT} {
3211 if (yyextra->insidePHP)
3217 *yyextra->pCopySquareGString << yytext;
3220 <GCopySquare>[^"\[\]\n\/,]+ {
3221 *yyextra->pCopySquareGString << yytext;
3224 *yyextra->pCopySquareGString << *yytext;
3227 /* generic curly bracket list copy rules */
3229 *yyextra->pCopyCurlyString += *yytext;
3230 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3231 yyextra->lastStringContext=YY_START;
3235 *yyextra->pCopyCurlyString += *yytext;
3236 if (yyextra->insidePHP)
3238 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3239 yyextra->lastStringContext=YY_START;
3240 BEGIN(CopyPHPString);
3244 *yyextra->pCopyCurlyString += *yytext;
3245 yyextra->curlyCount++;
3248 *yyextra->pCopyCurlyString += *yytext;
3249 if (--yyextra->curlyCount<0)
3250 BEGIN(yyextra->lastCurlyContext);
3252 <CopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3258 *yyextra->pCopyCurlyString += yytext;
3261 <CopyCurly>[^"'{}\/\n,]+ {
3262 *yyextra->pCopyCurlyString += yytext;
3264 <CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3266 lineCount(yyscanner);
3267 *yyextra->pCopyCurlyString += *yytext;
3270 *yyextra->pCopyCurlyString += *yytext;
3273 /* generic curly bracket list copy rules for growable strings */
3274 <GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? { // start of included file marker
3276 <GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? { // end of included file marker
3277 QCString line = QCString(yytext);
3278 int s = line.find(' ');
3279 int e = line.find('"',s);
3280 yyextra->yyLineNr = line.mid(s,e-s).toInt();
3281 if (yytext[yyleng-1]=='\n')
3283 lineCount(yyscanner);
3288 *yyextra->pCopyCurlyGString << *yytext;
3289 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3290 yyextra->lastStringContext=YY_START;
3294 *yyextra->pCopyCurlyGString << *yytext;
3295 if (yyextra->insidePHP)
3297 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3298 yyextra->lastStringContext=YY_START;
3299 BEGIN(CopyPHPGString);
3303 *yyextra->pCopyCurlyGString << *yytext;
3304 yyextra->curlyCount++;
3307 *yyextra->pCopyCurlyGString << *yytext;
3308 if (--yyextra->curlyCount<0)
3309 BEGIN(yyextra->lastCurlyContext);
3311 <GCopyCurly>{CHARLIT} { if (yyextra->insidePHP)
3317 *yyextra->pCopyCurlyGString << yytext;
3320 <GCopyCurly>[^"'{}\/\n,]+ {
3321 *yyextra->pCopyCurlyGString << yytext;
3324 *yyextra->pCopyCurlyGString << yytext;
3326 <GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
3328 lineCount(yyscanner);
3329 *yyextra->pCopyCurlyGString << *yytext;
3332 *yyextra->pCopyCurlyGString << *yytext;
3335 /* ---------------------- */
3339 if (yyextra->current->type.isEmpty() &&
3340 yyextra->current->name=="enum") // see bug 69041, C++11 style anon enum: 'enum : unsigned int {...}'
3342 yyextra->current->section=Entry::ENUM_SEC;
3343 yyextra->current->name.resize(0);
3344 yyextra->current->args.resize(0);
3345 BEGIN(EnumBaseType);
3349 if (yyextra->current->type.isEmpty()) // anonymous padding field, e.g. "int :7;"
3352 yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
3355 yyextra->current->bitfields+=":";
3359 yyextra->current->bitfields+=*yytext;
3362 yyextra->current->args+=*yytext;
3365 lineCount(yyscanner);
3366 yyextra->current->args+=' ';
3369 QCString oldType = yyextra->current->type;
3370 if (yyextra->current->bodyLine==-1)
3372 yyextra->current->bodyLine = yyextra->yyLineNr;
3373 yyextra->current->bodyColumn = yyextra->yyColNr;
3375 if ( yyextra->insidePHP && yyextra->current->type.left(3) == "var" )
3377 yyextra->current->type = yyextra->current->type.mid(3);
3379 if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
3381 yyextra->current->type.prepend("typedef ");
3383 bool stat = yyextra->current->stat;
3384 Protection prot = yyextra->current->protection;
3385 if (yyextra->current->section==Entry::CONCEPT_SEC) // C++20 concept
3387 auto groups = yyextra->current->groups;
3388 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3389 yyextra->current->groups = groups;
3390 initEntry(yyscanner);
3392 else if (!yyextra->current->name.isEmpty() && yyextra->current->section!=Entry::ENUM_SEC)
3394 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
3395 yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
3396 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
3397 if (yyextra->current->section==Entry::CLASS_SEC) // remove spec for "struct Bla bla;"
3399 yyextra->current->spec = 0;
3401 yyextra->current->section = Entry::VARIABLE_SEC ;
3402 yyextra->current->fileName = yyextra->yyFileName;
3403 yyextra->current->startLine = yyextra->yyBegLineNr;
3404 yyextra->current->startColumn = yyextra->yyBegColNr;
3405 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3406 initEntry(yyscanner);
3408 if ( *yytext == ',')
3410 yyextra->current->stat = stat; // the static attribute holds for all variables
3411 yyextra->current->protection = prot;
3412 yyextra->current->name.resize(0);
3413 yyextra->current->args.resize(0);
3414 yyextra->current->brief.resize(0);
3415 yyextra->current->doc.resize(0);
3416 yyextra->current->initializer.str(std::string());
3417 yyextra->current->bitfields.resize(0);
3418 int i=oldType.length();
3419 while (i>0 && (oldType[i-1]=='*' || oldType[i-1]=='&' || oldType[i-1]==' ')) i--;
3420 yyextra->current->type = oldType.left(i);
3424 yyextra->mtype = Method;
3425 yyextra->virt = Normal;
3426 initEntry(yyscanner);
3431 if (yyextra->insideSlice)
3433 yyextra->squareCount=1;
3434 yyextra->lastSquareContext = YY_START;
3435 yyextra->current->metaData += "[";
3436 BEGIN( SliceMetadata );
3438 else if (!yyextra->insideCS &&
3439 (yyextra->current->name.isEmpty() ||
3440 yyextra->current->name=="typedef"
3442 ) // IDL function property
3444 yyextra->squareCount=1;
3445 yyextra->lastSquareContext = YY_START;
3446 yyextra->idlAttr.resize(0);
3447 yyextra->idlProp.resize(0);
3448 yyextra->current->mtype = yyextra->mtype;
3450 if (Config_getBool(IDL_PROPERTY_SUPPORT) &&
3451 yyextra->current->mtype == Property)
3452 { // we are yyextra->inside the properties section of a dispinterface
3453 yyextra->odlProp = true;
3454 yyextra->current->spec |= Entry::Gettable;
3455 yyextra->current->spec |= Entry::Settable;
3458 BEGIN( IDLAttribute );
3460 else if (yyextra->insideCS &&
3461 yyextra->current->name.isEmpty())
3463 yyextra->squareCount=1;
3464 yyextra->lastSquareContext = YY_START;
3465 // Skip the C# attribute
3467 yyextra->current->args.resize(0);
3468 BEGIN( SkipSquare );
3472 yyextra->current->args += yytext ;
3473 yyextra->squareCount=1;
3474 yyextra->externLinkage=FALSE; // see bug759247
3478 <SliceMetadata>"[" { // Global metadata.
3479 yyextra->squareCount++;
3480 yyextra->current->metaData += "[";
3482 <SliceMetadata>{BN}* {
3483 lineCount(yyscanner);
3485 <SliceMetadata>\"[^\"]*\" {
3486 yyextra->current->metaData += yytext;
3488 <SliceMetadata>"," {
3489 yyextra->current->metaData += yytext;
3491 <SliceMetadata>"]" {
3492 yyextra->current->metaData += yytext;
3493 if (--yyextra->squareCount<=0)
3495 BEGIN (yyextra->lastSquareContext);
3498 <SliceOptional>"(" {
3499 yyextra->current->type += "(";
3500 yyextra->roundCount++;
3502 <SliceOptional>[0-9]+ {
3503 yyextra->current->type += yytext;
3505 <SliceOptional>")" {
3506 yyextra->current->type += ")";
3507 if(--yyextra->roundCount<=0)
3509 BEGIN (yyextra->lastModifierContext);
3513 // end of IDL function attribute
3514 if (--yyextra->squareCount<=0)
3516 lineCount(yyscanner);
3517 if (yyextra->current->mtype == Property)
3518 BEGIN( IDLPropName );
3520 BEGIN( yyextra->lastSquareContext );
3523 <IDLAttribute>"propput" {
3524 if (Config_getBool(IDL_PROPERTY_SUPPORT))
3526 yyextra->current->mtype = Property;
3528 yyextra->current->spec |= Entry::Settable;
3530 <IDLAttribute>"propget" {
3531 if (Config_getBool(IDL_PROPERTY_SUPPORT))
3533 yyextra->current->mtype = Property;
3535 yyextra->current->spec |= Entry::Gettable;
3537 <IDLAttribute>"property" { // UNO IDL property
3538 yyextra->current->spec |= Entry::Property;
3540 <IDLAttribute>"attribute" { // UNO IDL attribute
3541 yyextra->current->spec |= Entry::Attribute;
3543 <IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
3544 yyextra->current->spec |= Entry::Optional;
3546 <IDLAttribute>"readonly" { // on UNO IDL attribute or property
3547 if (Config_getBool(IDL_PROPERTY_SUPPORT) && yyextra->odlProp)
3549 yyextra->current->spec ^= Entry::Settable;
3553 yyextra->current->spec |= Entry::Readonly;
3556 <IDLAttribute>"bound" { // on UNO IDL attribute or property
3557 yyextra->current->spec |= Entry::Bound;
3559 <IDLAttribute>"removable" { // on UNO IDL property
3560 yyextra->current->spec |= Entry::Removable;
3562 <IDLAttribute>"constrained" { // on UNO IDL property
3563 yyextra->current->spec |= Entry::Constrained;
3565 <IDLAttribute>"transient" { // on UNO IDL property
3566 yyextra->current->spec |= Entry::Transient;
3568 <IDLAttribute>"maybevoid" { // on UNO IDL property
3569 yyextra->current->spec |= Entry::MaybeVoid;
3571 <IDLAttribute>"maybedefault" { // on UNO IDL property
3572 yyextra->current->spec |= Entry::MaybeDefault;
3574 <IDLAttribute>"maybeambiguous" { // on UNO IDL property
3575 yyextra->current->spec |= Entry::MaybeAmbiguous;
3579 <IDLPropName>{BN}*{ID}{BN}* {
3580 // return type (probably HRESULT) - skip it
3582 if (yyextra->odlProp)
3584 yyextra->idlProp = yytext;
3587 <IDLPropName>{ID}{BN}*"(" {
3588 yyextra->current->name = yytext;
3589 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3590 yyextra->current->startLine = yyextra->yyLineNr;
3591 yyextra->current->startColumn = yyextra->yyColNr;
3594 <IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
3595 if (yyextra->odlProp)
3597 yyextra->idlProp += yytext;
3600 <IDLPropName>{ID}{BNopt}/";" {
3601 if (yyextra->odlProp)
3603 yyextra->current->name = yytext;
3604 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
3605 yyextra->odlProp = false;
3610 <IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
3611 yyextra->idlAttr = yytext;
3612 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
3614 <IDLProp>{ID} { // property type
3615 yyextra->idlProp = yytext;
3617 <IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
3618 if (yyextra->current->args.isEmpty())
3619 yyextra->current->args = "(";
3621 yyextra->current->args += ", ";
3622 yyextra->current->args += yyextra->idlAttr;
3623 yyextra->current->args += " ";
3624 yyextra->current->args += yyextra->idlProp; // prop was actually type of extra parameter
3625 yyextra->current->args += " ";
3626 yyextra->current->args += yytext;
3627 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1); // strip comma
3628 yyextra->idlProp.resize(0);
3629 yyextra->idlAttr.resize(0);
3632 <IDLProp>{BN}*{ID}{BN}*")"{BN}* {
3633 // the parameter name for the property - just skip.
3636 yyextra->current->fileName = yyextra->yyFileName;
3637 yyextra->current->type = yyextra->idlProp;
3638 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3639 if (!yyextra->current->args.isEmpty())
3640 yyextra->current->args += ")";
3641 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3642 yyextra->current->section = Entry::VARIABLE_SEC;
3643 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3644 initEntry(yyscanner);
3645 BEGIN( FindMembers );
3647 <IDLProp>. { // spaces, *, or other stuff
3648 //yyextra->idlProp+=yytext;
3650 <Array>"]" { yyextra->current->args += *yytext ;
3651 if (--yyextra->squareCount<=0)
3652 BEGIN( FindMembers ) ;
3654 <FuncFuncArray>"]" { yyextra->current->args += *yytext ;
3655 if (--yyextra->squareCount<=0)
3658 <Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
3659 yyextra->squareCount++;
3661 <Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
3662 <SkipSquare>"[" { yyextra->squareCount++; }
3664 if (--yyextra->squareCount<=0)
3665 BEGIN( yyextra->lastSquareContext );
3668 yyextra->lastStringContext=YY_START;
3669 BEGIN( SkipString );
3671 <SkipSquare>[^\n\[\]\"]+
3672 <FindMembers>"<" { addType(yyscanner);
3673 yyextra->current->type += yytext ;
3676 <Sharp>">" { yyextra->current->type += *yytext ;
3677 if (--yyextra->sharpCount<=0)
3678 BEGIN( FindMembers ) ;
3680 <Sharp>"<" { yyextra->current->type += *yytext ;
3681 yyextra->sharpCount++;
3684 yyextra->current->type += ' ';
3685 lineCount(yyscanner);
3687 <Sharp>. { yyextra->current->type += *yytext ; }
3689 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
3691 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
3693 yyextra->current->bodyLine = yyextra->yyLineNr;
3694 yyextra->current->bodyColumn = yyextra->yyColNr;
3695 yyextra->current->name = yytext;
3698 // Java enum initializer
3700 yyextra->lastInitializerContext = YY_START;
3701 yyextra->initBracketCount=0;
3702 yyextra->current->initializer.str("=");
3703 BEGIN(ReadInitializer);
3706 yyextra->lastInitializerContext = YY_START;
3707 yyextra->initBracketCount=0;
3708 yyextra->current->initializer.str(yytext);
3709 BEGIN(ReadInitializer);
3712 if (yyextra->insideJava) // yyextra->last enum field in Java class
3714 if (!yyextra->current->name.isEmpty())
3716 yyextra->current->fileName = yyextra->yyFileName;
3717 yyextra->current->startLine = yyextra->yyLineNr;
3718 yyextra->current->startColumn = yyextra->yyColNr;
3719 if (!(yyextra->current_root->spec&Entry::Enum))
3721 yyextra->current->type = "@"; // enum marker
3723 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3724 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3725 yyextra->current->section = Entry::VARIABLE_SEC;
3726 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3727 initEntry(yyscanner);
3730 BEGIN( FindMembers );
3738 //printf("adding '%s' '%s' '%s' to enum '%s' (mGrpId=%d)\n",
3739 // qPrint(yyextra->current->type), qPrint(yyextra->current->name),
3740 // qPrint(yyextra->current->args), qPrint(yyextra->current_root->name),yyextra->current->mGrpId);
3741 if (!yyextra->current->name.isEmpty())
3743 yyextra->current->fileName = yyextra->yyFileName;
3744 yyextra->current->startLine = yyextra->yyLineNr;
3745 yyextra->current->startColumn = yyextra->yyColNr;
3746 if (!(yyextra->current_root->spec&Entry::Enum))
3748 yyextra->current->type = "@"; // enum marker
3750 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3751 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3752 yyextra->current->section = Entry::VARIABLE_SEC;
3753 // add to the scope of the enum
3754 if (!yyextra->insideCS && !yyextra->insideJava &&
3755 !(yyextra->current_root->spec&Entry::Strong))
3756 // for C# and Java 1.5+ enum values always have to be explicitly qualified,
3757 // same for C++11 style enums (enum class Name {})
3759 // add to the scope surrounding the enum (copy!)
3760 // we cannot during it directly as that would invalidate the iterator in parseCompounds.
3761 //printf("*** adding outer scope entry for %s\n",qPrint(yyextra->current->name));
3762 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
3764 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3765 initEntry(yyscanner);
3767 else // probably a redundant ,
3769 yyextra->current->reset();
3770 initEntry(yyscanner);
3773 <FindFields>"[" { // attribute list in IDL
3774 yyextra->squareCount=1;
3775 yyextra->lastSquareContext = YY_START;
3778 <ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]* { yyextra->current->program << yytext ; }
3779 <ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
3780 <ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
3782 // append PHP comment.
3783 yyextra->current->program << yytext ;
3785 <ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
3786 yyextra->pSkipVerbString = &yyextra->current->program;
3787 yyextra->lastSkipVerbStringContext=YY_START;
3788 BEGIN( SkipVerbString );
3790 <ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
3792 yyextra->current->program << yytext ;
3793 yyextra->pCopyHereDocGString = &yyextra->current->program;
3794 yyextra->lastHereDocContext=YY_START;
3795 BEGIN( CopyHereDoc );
3802 <ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
3803 yyextra->pCopyQuotedGString = &yyextra->current->program;
3804 yyextra->lastStringContext=YY_START;
3805 BEGIN( CopyGString );
3807 <ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
3808 yyextra->lastContext = YY_START ;
3811 <ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
3812 ++yyextra->yyLineNr ;
3813 yyextra->lastContext = YY_START ;
3816 <ReadBody,ReadNSBody,ReadBodyIntf>"'" {
3817 if (!yyextra->insidePHP)
3819 yyextra->current->program << yytext;
3822 { // begin of single quoted string
3823 yyextra->current->program << yytext;
3824 yyextra->pCopyQuotedGString = &yyextra->current->program;
3825 yyextra->lastStringContext=YY_START;
3826 BEGIN(CopyPHPGString);
3829 <ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
3830 if (yyextra->insidePHP)
3832 REJECT; // for PHP code single quotes
3833 // are used for strings of arbitrary length
3837 yyextra->current->program << yytext;
3840 <ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
3841 ++yyextra->curlyCount ;
3844 yyextra->current->program << yytext ;
3845 --yyextra->curlyCount ;
3847 <ReadBody,ReadNSBody>"}" { //err("ReadBody count=%d\n",yyextra->curlyCount);
3848 if ( yyextra->curlyCount>0 )
3850 yyextra->current->program << yytext ;
3851 --yyextra->curlyCount ;
3855 yyextra->current->endBodyLine = yyextra->yyLineNr;
3856 std::shared_ptr<Entry> original_root = yyextra->current_root; // save root this namespace is in
3857 if (yyextra->current->section == Entry::NAMESPACE_SEC && yyextra->current->type == "namespace")
3860 // save documentation values
3861 QCString doc = yyextra->current->doc;
3862 int docLine = yyextra->current->docLine;
3863 QCString docFile = yyextra->current->docFile;
3864 QCString brief = yyextra->current->brief;
3865 int briefLine = yyextra->current->briefLine;
3866 QCString briefFile = yyextra->current->briefFile;
3867 // reset documentation values
3868 yyextra->current->doc = "";
3869 yyextra->current->docLine = 0;
3870 yyextra->current->docFile = "";
3871 yyextra->current->brief = "";
3872 yyextra->current->briefLine = 0;
3873 yyextra->current->briefFile = "";
3874 while ((split_point = yyextra->current->name.find("::")) != -1)
3876 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
3877 yyextra->current->program.str(std::string());
3878 new_current->name = yyextra->current->name.mid(split_point + 2);
3879 yyextra->current->name = yyextra->current->name.left(split_point);
3880 if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
3882 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
3883 yyextra->current_root = yyextra->current;
3884 yyextra->current = new_current;
3886 // restore documentation values
3887 yyextra->current->doc = doc;
3888 yyextra->current->docLine = docLine;
3889 yyextra->current->docFile = docFile;
3890 yyextra->current->brief = brief;
3891 yyextra->current->briefLine = briefLine;
3892 yyextra->current->briefFile = briefFile;
3894 QCString &cn = yyextra->current->name;
3895 QCString rn = yyextra->current_root->name;
3896 //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",qPrint(cn),qPrint(rn),yyextra->isTypedef);
3897 if (!cn.isEmpty() && !rn.isEmpty())
3899 prependScope(yyscanner);
3901 if (yyextra->isTypedef && cn.isEmpty())
3903 //printf("Typedef Name\n");
3904 BEGIN( TypedefName );
3908 if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
3910 yyextra->current->program << ','; // add field terminator
3912 // add compound definition to the tree
3913 yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
3914 // was: yyextra->current->args.simplifyWhiteSpace();
3915 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
3916 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3917 //printf("adding '%s' '%s' '%s' brief=%s yyextra->insideObjC=%d %x\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args),qPrint(yyextra->current->brief),yyextra->insideObjC,yyextra->current->section);
3918 if (yyextra->insideObjC &&
3919 ((yyextra->current->spec&Entry::Interface) || (yyextra->current->spec==Entry::Category))
3920 ) // method definition follows
3922 BEGIN( ReadBodyIntf ) ;
3926 yyextra->memspecEntry = yyextra->current;
3927 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
3928 yyextra->current = std::make_shared<Entry>(*yyextra->current);
3929 if (yyextra->current->section==Entry::NAMESPACE_SEC ||
3930 (yyextra->current->spec==Entry::Interface) ||
3931 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
3932 yyextra->insideSlice
3934 { // namespaces and interfaces and java classes ends with a closing bracket without semicolon
3935 yyextra->current->reset();
3936 yyextra->current_root = original_root; // restore scope from before namespace descent
3937 initEntry(yyscanner);
3938 yyextra->memspecEntry.reset();
3939 BEGIN( FindMembers ) ;
3943 static const reg::Ex re(R"(@\d+$)");
3944 if (!yyextra->isTypedef && yyextra->memspecEntry &&
3945 !reg::search(yyextra->memspecEntry->name.str(),re)) // not typedef or anonymous type (see bug691071)
3947 // enabled the next two lines for bug 623424
3948 yyextra->current->doc.resize(0);
3949 yyextra->current->brief.resize(0);
3951 BEGIN( MemberSpec ) ;
3957 <ReadBody>"}"{BN}+"typedef"{BN}+ { //err("ReadBody count=%d\n",yyextra->curlyCount);
3958 lineCount(yyscanner);
3959 if ( yyextra->curlyCount>0 )
3961 yyextra->current->program << yytext ;
3962 --yyextra->curlyCount ;
3966 yyextra->isTypedef = TRUE;
3967 yyextra->current->endBodyLine = yyextra->yyLineNr;
3968 QCString &cn = yyextra->current->name;
3969 QCString rn = yyextra->current_root->name;
3970 if (!cn.isEmpty() && !rn.isEmpty())
3972 prependScope(yyscanner);
3974 BEGIN( TypedefName );
3977 <TypedefName>("const"|"volatile"){BN} { // late "const" or "volatile" keyword
3978 lineCount(yyscanner);
3979 yyextra->current->type.prepend(yytext);
3982 if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
3984 yyextra->current->program << ","; // add field terminator
3986 yyextra->current->name=yytext;
3987 prependScope(yyscanner);
3988 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3989 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
3990 //printf("Adding compound %s %s %s\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
3991 if (!yyextra->firstTypedefEntry)
3993 yyextra->firstTypedefEntry = yyextra->current;
3995 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
3996 initEntry(yyscanner);
3997 yyextra->isTypedef=TRUE; // to undo reset by initEntry(yyscanner)
3998 BEGIN(MemberSpecSkip);
4000 <TypedefName>";" { /* typedef of anonymous type */
4001 yyextra->current->name.sprintf("@%d",anonCount++);
4002 if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
4004 yyextra->current->program << ','; // add field terminator
4006 // add compound definition to the tree
4007 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4008 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4009 yyextra->memspecEntry = yyextra->current;
4010 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4011 initEntry(yyscanner);
4013 BEGIN( MemberSpec ) ;
4015 <MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
4016 lineCount(yyscanner);
4017 int i=0,l=(int)yyleng,j;
4018 while (i<l && (!isId(yytext[i]))) i++;
4019 yyextra->msName = QCString(yytext).right(l-i).stripWhiteSpace();
4020 j=yyextra->msName.find("[");
4023 yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
4024 yyextra->msName=yyextra->msName.left(j);
4026 yyextra->msType=QCString(yytext).left(i);
4028 // handle *pName in: typedef { ... } name, *pName;
4029 if (yyextra->firstTypedefEntry)
4031 if (yyextra->firstTypedefEntry->spec&Entry::Struct)
4033 yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
4035 else if (yyextra->firstTypedefEntry->spec&Entry::Union)
4037 yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
4039 else if (yyextra->firstTypedefEntry->section==Entry::ENUM_SEC)
4041 yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
4045 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
4049 <MemberSpec>"(" { // function with struct return type
4051 yyextra->current->name = yyextra->msName;
4052 yyextra->current->spec = 0;
4057 if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
4059 // see if the compound does not have a name or is yyextra->inside another
4060 // anonymous compound. If so we insert a
4061 // special 'anonymous' variable.
4062 //Entry *p=yyextra->current_root;
4063 const Entry *p=yyextra->current.get();
4066 // only look for class scopes, not namespace scopes
4067 if ((p->section & Entry::COMPOUND_MASK) && !p->name.isEmpty())
4069 //printf("Trying scope '%s'\n",qPrint(p->name));
4070 int i=p->name.findRev("::");
4071 int pi = (i==-1) ? 0 : i+2;
4072 if (p->name.at(pi)=='@')
4074 // anonymous compound yyextra->inside -> insert dummy variable name
4075 //printf("Adding anonymous variable for scope %s\n",qPrint(p->name));
4076 yyextra->msName.sprintf("@%d",anonCount++);
4081 if (p==yyextra->current.get()) p=yyextra->current_root.get(); else p=p->parent();
4084 //printf("yyextra->msName=%s yyextra->current->name=%s\n",qPrint(yyextra->msName),qPrint(yyextra->current->name));
4085 if (!yyextra->msName.isEmpty()
4086 /*&& yyextra->msName!=yyextra->current->name*/) // skip typedef T {} T;, removed due to bug608493
4088 bool typedefHidesStruct = Config_getBool(TYPEDEF_HIDES_STRUCT);
4089 // case 1: typedef struct _S { ... } S_t;
4090 // -> omit typedef and use S_t as the struct name
4091 if (typedefHidesStruct &&
4092 yyextra->isTypedef &&
4093 ((yyextra->current->spec&(Entry::Struct|Entry::Union)) ||
4094 yyextra->current->section==Entry::ENUM_SEC )&&
4095 yyextra->msType.stripWhiteSpace().isEmpty() &&
4096 yyextra->memspecEntry)
4098 yyextra->memspecEntry->name=yyextra->msName;
4100 else // case 2: create a typedef field
4102 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4103 varEntry->lang = yyextra->language;
4104 varEntry->protection = yyextra->current->protection ;
4105 varEntry->mtype = yyextra->current->mtype;
4106 varEntry->virt = yyextra->current->virt;
4107 varEntry->stat = yyextra->current->stat;
4108 varEntry->section = Entry::VARIABLE_SEC;
4109 varEntry->name = yyextra->msName.stripWhiteSpace();
4110 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
4111 varEntry->args = yyextra->msArgs;
4112 if (yyextra->isTypedef)
4114 varEntry->type.prepend("typedef ");
4115 // //printf("yyextra->current->name = %s %s\n",qPrint(yyextra->current->name),qPrint(yyextra->msName));
4117 if (typedefHidesStruct &&
4118 yyextra->isTypedef &&
4119 (yyextra->current->spec&(Entry::Struct|Entry::Union)) &&
4120 yyextra->memspecEntry
4121 ) // case 1: use S_t as type for pS_t in "typedef struct _S {} S_t, *pS_t;"
4123 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4125 else // case 2: use _S as type for for pS_t
4127 varEntry->type+=yyextra->current->name+yyextra->msType;
4129 varEntry->fileName = yyextra->yyFileName;
4130 varEntry->startLine = yyextra->yyLineNr;
4131 varEntry->startColumn = yyextra->yyColNr;
4132 varEntry->doc = yyextra->current->doc;
4133 varEntry->brief = yyextra->current->brief;
4134 varEntry->mGrpId = yyextra->current->mGrpId;
4135 varEntry->initializer.str(yyextra->current->initializer.str());
4136 varEntry->groups = yyextra->current->groups;
4137 varEntry->sli = yyextra->current->sli;
4139 //printf("Add: type='%s',name='%s',args='%s' brief=%s doc=%s\n",
4140 // qPrint(varEntry->type),qPrint(varEntry->name),
4141 // qPrint(varEntry->args),qPrint(varEntry->brief),qPrint(varEntry->doc));
4142 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4145 if (*yytext==';') // end of a struct/class ...
4147 if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && (yyextra->current->section&Entry::COMPOUND_MASK))
4148 { // case where a class/struct has a doc block after it
4149 if (!yyextra->current->doc.isEmpty())
4151 yyextra->memspecEntry->doc += yyextra->current->doc;
4153 if (!yyextra->current->brief.isEmpty())
4155 yyextra->memspecEntry->brief += yyextra->current->brief;
4158 yyextra->msType.resize(0);
4159 yyextra->msName.resize(0);
4160 yyextra->msArgs.resize(0);
4161 yyextra->isTypedef=FALSE;
4162 yyextra->firstTypedefEntry.reset();
4163 yyextra->memspecEntry.reset();
4164 yyextra->current->reset();
4165 initEntry(yyscanner);
4166 BEGIN( FindMembers );
4170 yyextra->current->doc.resize(0);
4171 yyextra->current->brief.resize(0);
4176 yyextra->lastInitializerContext=YY_START;
4177 yyextra->initBracketCount=0;
4178 yyextra->current->initializer.str(yytext);
4179 BEGIN(ReadInitializer);
4180 /* BEGIN(MemberSpecSkip); */
4183 <MemberSpecSkip>"{" {
4184 yyextra->curlyCount=0;
4185 yyextra->lastCurlyContext = MemberSpecSkip;
4186 yyextra->previous = yyextra->current;
4190 <MemberSpecSkip>"," { BEGIN(MemberSpec); }
4191 <MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
4192 <ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
4193 lineCount(yyscanner) ;
4195 <ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
4196 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4197 initEntry(yyscanner);
4198 yyextra->language = yyextra->current->lang = SrcLangExt_Cpp; // see bug746361
4199 yyextra->insideObjC=FALSE;
4200 BEGIN( FindMembers );
4202 <ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
4204 <FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
4205 <FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
4206 if (yyextra->insidePHP) // reference parameter
4212 yyextra->current->bodyLine = yyextra->yyLineNr;
4213 yyextra->current->bodyColumn = yyextra->yyColNr;
4214 lineCount(yyscanner);
4216 yyextra->funcPtrType=yytext;
4217 yyextra->roundCount=0;
4218 //yyextra->current->type += yytext;
4222 <FuncPtr>{SCOPENAME} {
4223 yyextra->current->name = yytext;
4224 if (nameIsOperator(yyextra->current->name))
4226 BEGIN( FuncPtrOperator );
4230 if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
4232 yyextra->funcPtrType += yyextra->current->name;
4236 BEGIN( EndFuncPtr );
4241 //printf("error: FuncPtr '%c' unexpected at line %d of %s\n",*yytext,yyextra->yyLineNr,yyextra->yyFileName);
4243 <FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
4244 yyextra->current->name += yytext;
4245 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
4246 lineCount(yyscanner);
4248 <FuncPtrOperator>\n {
4249 lineCount(yyscanner);
4250 yyextra->current->name += *yytext;
4252 <FuncPtrOperator>"(" {
4254 BEGIN( EndFuncPtr );
4256 <FuncPtrOperator>. {
4257 yyextra->current->name += *yytext;
4259 <EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
4260 lineCount(yyscanner);
4261 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4264 <EndFuncPtr>")"{BNopt}/"(" { // a function pointer
4265 lineCount(yyscanner);
4266 yyextra->current->type+=yyextra->funcPtrType+")";
4269 <EndFuncPtr>")"{BNopt}/"[" { // an array of variables
4270 lineCount(yyscanner);
4271 yyextra->current->type+=yyextra->funcPtrType;
4272 yyextra->current->args += ")";
4275 <EndFuncPtr>"(" { // a function returning a function or
4276 // a function returning a pointer to an array
4277 yyextra->current->args += *yytext ;
4278 //yyextra->roundCount=0;
4279 //BEGIN( FuncFunc );
4280 yyextra->current->bodyLine = yyextra->yyLineNr;
4281 yyextra->current->bodyColumn = yyextra->yyColNr;
4282 yyextra->currentArgumentContext = FuncFuncEnd;
4283 yyextra->fullArgString=yyextra->current->args;
4284 yyextra->copyArgString=&yyextra->current->args;
4285 BEGIN( ReadFuncArgType ) ;
4287 <EndFuncPtr>"["[^\n\]]*"]" {
4288 yyextra->funcPtrType+=yytext;
4294 yyextra->current->args += *yytext ;
4295 ++yyextra->roundCount;
4298 yyextra->current->args += *yytext ;
4299 if ( yyextra->roundCount )
4300 --yyextra->roundCount;
4306 <FuncFuncEnd>")"{BN}*"(" {
4307 lineCount(yyscanner);
4308 yyextra->current->type+=yyextra->funcPtrType+")(";
4309 BEGIN(FuncFuncType);
4311 <FuncFuncEnd>")"{BNopt}/[;{] {
4312 lineCount(yyscanner);
4313 yyextra->current->type+=yyextra->funcPtrType.mid(1);
4316 <FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
4317 lineCount(yyscanner);
4318 yyextra->current->type+=yyextra->funcPtrType;
4319 yyextra->current->args+=")";
4320 BEGIN(FuncFuncArray);
4323 yyextra->current->args += *yytext;
4326 yyextra->current->type += *yytext;
4327 yyextra->roundCount++;
4330 yyextra->current->type += *yytext;
4331 if (yyextra->roundCount)
4332 --yyextra->roundCount;
4336 <FuncFuncType>{BN}*","{BN}* { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
4337 <FuncFuncType>{BN}+ { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
4339 yyextra->current->type += *yytext;
4341 <FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
4342 if (yyextra->current->type.left(7)=="typedef" && yyextra->current->bodyLine==-1)
4343 // the bodyLine check is to prevent this guard to be true more than once
4345 yyextra->current->bodyLine = yyextra->yyLineNr;
4346 yyextra->current->bodyColumn = yyextra->yyColNr;
4347 BEGIN( GetCallType );
4349 else if (!yyextra->current->name.isEmpty()) // normal function
4351 yyextra->current->args = yytext;
4352 yyextra->current->bodyLine = yyextra->yyLineNr;
4353 yyextra->current->bodyColumn = yyextra->yyColNr;
4354 yyextra->currentArgumentContext = FuncQual;
4355 yyextra->fullArgString=yyextra->current->args;
4356 yyextra->copyArgString=&yyextra->current->args;
4357 BEGIN( ReadFuncArgType ) ;
4358 //printf(">>> Read function arguments!\n");
4361 <GetCallType>{BN}*{ID}{BN}*"*" {
4362 lineCount(yyscanner);
4364 yyextra->funcPtrType="(";
4365 yyextra->funcPtrType+=yytext;
4366 yyextra->roundCount=0;
4370 if (!yyextra->current->name.isEmpty())
4372 yyextra->current->args = yytext;
4373 yyextra->current->bodyLine = yyextra->yyLineNr;
4374 yyextra->current->bodyColumn = yyextra->yyColNr;
4375 yyextra->currentArgumentContext = FuncQual;
4376 yyextra->fullArgString=yyextra->current->args;
4377 yyextra->copyArgString=&yyextra->current->args;
4378 BEGIN( ReadFuncArgType ) ;
4379 //printf(">>> Read function arguments yyextra->current->argList.size()=%d\n",yyextra->current->argList.size());
4383 <FindMembers>"("{BN}*("void"{BN}*)?")" {
4384 lineCount(yyscanner);
4385 yyextra->current->args = "()";
4390 /*- Function argument reading rules ---------------------------------------*/
4392 <ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
4393 yyextra->fullArgString+=yytext;
4395 <CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
4396 yyextra->fullArgString+=yytext;
4398 <CopyArgRound>[^\/\n\)\(\"\']+ {
4399 *yyextra->copyArgString+=yytext;
4400 yyextra->fullArgString+=yytext;
4402 <CopyArgSquare>[^\/\n\]\[\"\']+ {
4403 *yyextra->copyArgString+=yytext;
4404 yyextra->fullArgString+=yytext;
4406 <ReadFuncArgType,ReadTempArgs>{BN}* {
4407 *yyextra->copyArgString+=" ";
4408 yyextra->fullArgString+=" ";
4409 lineCount(yyscanner);
4411 <ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
4412 yyextra->delimiter = yytext+2;
4413 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
4414 yyextra->lastRawStringContext = YY_START;
4415 yyextra->pCopyRawString = yyextra->copyArgString;
4416 *yyextra->pCopyRawString+=yytext;
4417 yyextra->fullArgString+=yytext;
4420 <ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
4421 *yyextra->copyArgString+=*yytext;
4422 yyextra->fullArgString+=*yytext;
4423 yyextra->lastCopyArgStringContext = YY_START;
4424 BEGIN( CopyArgString );
4426 <ReadFuncArgType>"[" {
4427 if (!yyextra->insidePHP) REJECT;
4428 *yyextra->copyArgString+=*yytext;
4429 yyextra->fullArgString+=*yytext;
4430 yyextra->argSquareCount=0;
4431 yyextra->lastCopyArgContext = YY_START;
4432 BEGIN( CopyArgSquare );
4434 <ReadFuncArgType,ReadTempArgs>"(" {
4435 *yyextra->copyArgString+=*yytext;
4436 yyextra->fullArgString+=*yytext;
4437 yyextra->argRoundCount=0;
4438 yyextra->lastCopyArgContext = YY_START;
4439 BEGIN( CopyArgRound );
4441 <ReadFuncArgType>")" {
4442 *yyextra->copyArgString+=*yytext;
4443 yyextra->fullArgString+=*yytext;
4444 yyextra->current->argList = *stringToArgumentList(yyextra->language, yyextra->fullArgString);
4445 if (yyextra->insideJS)
4447 fixArgumentListForJavaScript(yyextra->current->argList);
4449 handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
4451 /* remember the yyextra->current documentation block, since
4452 we could overwrite it with the documentation of
4453 a function argument, which we then have to correct later
4456 yyextra->docBackup = yyextra->current->doc;
4457 yyextra->briefBackup = yyextra->current->brief;
4459 BEGIN( yyextra->currentArgumentContext );
4461 /* a special comment */
4462 <ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
4463 if (yyextra->currentArgumentContext==DefineEnd)
4465 // for defines we interpret a comment
4466 // as documentation for the define
4467 int i;for (i=(int)yyleng-1;i>=0;i--)
4471 yyextra->current->argList = *stringToArgumentList(yyextra->language, yyextra->fullArgString);
4472 handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
4473 BEGIN( yyextra->currentArgumentContext );
4475 else // not a define
4477 // for functions we interpret a comment
4478 // as documentation for the argument
4479 yyextra->fullArgString+=yytext;
4480 yyextra->lastCopyArgChar=0;
4481 yyextra->lastCommentInArgContext=YY_START;
4483 BEGIN( CopyArgCommentLine );
4485 BEGIN( CopyArgComment );
4488 /* a non-special comment */
4489 <ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
4490 <ReadFuncArgType,ReadTempArgs>{CCS} {
4491 yyextra->lastCContext = YY_START;
4492 BEGIN( SkipComment );
4494 <ReadFuncArgType,ReadTempArgs>{CPPC} {
4495 yyextra->lastCContext = YY_START;
4496 BEGIN( SkipCxxComment );
4499 <ReadFuncArgType,ReadTempArgs>"'#" { if (yyextra->insidePHP)
4501 *yyextra->copyArgString+=yytext;
4502 yyextra->fullArgString+=yytext;
4504 <ReadFuncArgType,ReadTempArgs>"#" {
4505 if (!yyextra->insidePHP)
4507 yyextra->lastCContext = YY_START;
4508 BEGIN( SkipCxxComment );
4511 /* ')' followed by a special comment */
4512 <ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
4513 lineCount(yyscanner);
4514 if (yyextra->currentArgumentContext==DefineEnd)
4516 // for defines we interpret a comment
4517 // as documentation for the define
4518 int i;for (i=(int)yyleng-1;i>0;i--)
4522 *yyextra->copyArgString+=*yytext;
4523 yyextra->fullArgString+=*yytext;
4524 yyextra->current->argList = *stringToArgumentList(yyextra->language, yyextra->fullArgString);
4525 handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
4526 BEGIN( yyextra->currentArgumentContext );
4530 // for functions we interpret a comment
4531 // as documentation for the yyextra->last argument
4532 yyextra->lastCopyArgChar=*yytext;
4533 QCString text=&yytext[1];
4534 text=text.stripWhiteSpace();
4535 yyextra->lastCommentInArgContext=YY_START;
4536 yyextra->fullArgString+=text;
4537 if (text.find("//")!=-1)
4538 BEGIN( CopyArgCommentLine );
4540 BEGIN( CopyArgComment );
4543 <CopyArgComment>^{B}*"*"+/{BN}+
4544 <CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
4545 <CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
4546 if (yyextra->lastCopyArgChar!=0)
4547 unput(yyextra->lastCopyArgChar);
4548 BEGIN( yyextra->lastCommentInArgContext );
4550 <CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
4551 lineCount(yyscanner);
4552 if (yyextra->lastCopyArgChar!=0)
4553 unput(yyextra->lastCopyArgChar);
4554 BEGIN( yyextra->lastCommentInArgContext );
4556 <CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim type command (which could contain nested comments!)
4557 yyextra->docBlockName="uml";
4558 yyextra->fullArgString+=yytext;
4559 BEGIN(CopyArgVerbatim);
4561 <CopyArgCommentLine>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
4562 yyextra->docBlockName=&yytext[1];
4563 yyextra->fullArgString+=yytext;
4564 BEGIN(CopyArgVerbatim);
4566 <CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
4567 yyextra->docBlockName=&yytext[1];
4568 if (yyextra->docBlockName.at(1)=='[')
4570 yyextra->docBlockName.at(1)=']';
4572 if (yyextra->docBlockName.at(1)=='{')
4574 yyextra->docBlockName.at(1)='}';
4576 if (yyextra->docBlockName.at(1)=='(')
4578 yyextra->docBlockName.at(1)=')';
4580 yyextra->fullArgString+=yytext;
4581 BEGIN(CopyArgVerbatim);
4583 <CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode"|"f$"|"f]"|"f}"|"f)")/[^a-z_A-Z0-9\-] { // end of verbatim block
4584 yyextra->fullArgString+=yytext;
4585 if (yytext[1]=='f' && yyextra->docBlockName==&yytext[1])
4587 BEGIN(CopyArgCommentLine);
4589 if (&yytext[4]==yyextra->docBlockName)
4591 BEGIN(CopyArgCommentLine);
4594 <CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
4595 <CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
4596 <CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
4597 <CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
4598 <CopyArgComment>{CMD}("brief"|"short"){B}+ {
4599 warn(yyextra->yyFileName,yyextra->yyLineNr,
4600 "Ignoring %cbrief command inside argument documentation",*yytext
4602 yyextra->fullArgString+=' ';
4605 *yyextra->copyArgString+=*yytext;
4606 yyextra->fullArgString+=*yytext;
4607 yyextra->argSharpCount=1;
4608 BEGIN( CopyArgSharp );
4611 *yyextra->copyArgString+=*yytext;
4612 yyextra->fullArgString+=*yytext;
4613 //printf("end template list '%s'\n",qPrint(*yyextra->copyArgString));
4614 *yyextra->currentArgumentList = *stringToArgumentList(yyextra->language, yyextra->fullArgString);
4615 BEGIN( yyextra->currentArgumentContext );
4618 yyextra->argRoundCount++;
4619 *yyextra->copyArgString+=*yytext;
4620 yyextra->fullArgString+=*yytext;
4623 *yyextra->copyArgString+=*yytext;
4624 yyextra->fullArgString+=*yytext;
4625 if (yyextra->argRoundCount>0)
4626 yyextra->argRoundCount--;
4628 BEGIN( yyextra->lastCopyArgContext );
4630 <CopyArgSquare>"[" {
4631 yyextra->argSquareCount++;
4632 *yyextra->copyArgString+=*yytext;
4633 yyextra->fullArgString+=*yytext;
4635 <CopyArgSquare>"]" {
4636 *yyextra->copyArgString+=*yytext;
4637 yyextra->fullArgString+=*yytext;
4638 if (yyextra->argSquareCount>0)
4639 yyextra->argSquareCount--;
4641 BEGIN( yyextra->lastCopyArgContext );
4644 *yyextra->copyArgString+=*yytext;
4645 yyextra->fullArgString+=*yytext;
4646 yyextra->argRoundCount=0;
4647 yyextra->lastCopyArgContext = YY_START;
4648 BEGIN( CopyArgRound );
4651 yyextra->argSharpCount++;
4652 //printf("yyextra->argSharpCount++=%d copy\n",yyextra->argSharpCount);
4653 *yyextra->copyArgString+=*yytext;
4654 yyextra->fullArgString+=*yytext;
4657 *yyextra->copyArgString+=*yytext;
4658 yyextra->fullArgString+=*yytext;
4659 yyextra->argSharpCount--;
4660 if (yyextra->argSharpCount>0)
4662 //printf("yyextra->argSharpCount--=%d copy\n",yyextra->argSharpCount);
4666 BEGIN( ReadTempArgs );
4667 //printf("end of yyextra->argSharpCount\n");
4670 <CopyArgString,CopyArgPHPString>\\. {
4671 *yyextra->copyArgString+=yytext;
4672 yyextra->fullArgString+=yytext;
4675 *yyextra->copyArgString+=*yytext;
4676 yyextra->fullArgString+=*yytext;
4677 BEGIN( yyextra->lastCopyArgStringContext );
4679 <CopyArgPHPString>\' {
4680 *yyextra->copyArgString+=*yytext;
4681 yyextra->fullArgString+=*yytext;
4682 BEGIN( yyextra->lastCopyArgStringContext );
4684 <ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
4685 if (yyextra->insidePHP)
4691 *yyextra->copyArgString+=yytext;
4692 yyextra->fullArgString+=yytext;
4695 <ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
4696 *yyextra->copyArgString+=yytext;
4697 yyextra->fullArgString+=yytext;
4698 if (yyextra->insidePHP)
4700 yyextra->lastCopyArgStringContext=YY_START;
4701 BEGIN(CopyArgPHPString);
4704 <ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
4705 lineCount(yyscanner);
4706 *yyextra->copyArgString+=*yytext;
4707 yyextra->fullArgString+=*yytext;
4709 <ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
4710 *yyextra->copyArgString+=*yytext;
4711 yyextra->fullArgString+=*yytext;
4716 /*------------------------------------------------------------------------*/
4719 <FuncRound>"(" { yyextra->current->args += *yytext ;
4720 ++yyextra->roundCount ;
4722 <FuncRound>")" { yyextra->current->args += *yytext ;
4723 if ( yyextra->roundCount )
4724 --yyextra->roundCount ;
4729 <FuncQual>"#" { if (yyextra->insidePHP)
4731 yyextra->lastCPPContext = YY_START;
4736 if ( qstrcmp(yytext,";")==0 &&
4737 yyextra->insidePHP &&
4738 !containsWord(yyextra->current->type,"function") )
4740 yyextra->current->reset();
4741 initEntry(yyscanner);
4742 BEGIN( FindMembers );
4746 unput(*yytext); BEGIN( Function );
4749 <FuncQual>{BN}*"abstract"{BN}* { // pure virtual member function
4750 lineCount(yyscanner) ;
4751 yyextra->current->virt = Pure;
4752 yyextra->current->args += " override ";
4754 <FuncQual,TrailingReturn>{BN}*"override"{BN}* { // C++11 overridden virtual member function
4755 lineCount(yyscanner) ;
4756 yyextra->current->spec |= Entry::Override;
4757 yyextra->current->args += " override ";
4760 <FuncQual,TrailingReturn>{BN}*"final"{BN}* { // C++11 final method
4761 lineCount(yyscanner) ;
4762 yyextra->current->spec |= Entry::Final;
4763 yyextra->current->args += " final ";
4766 <FuncQual>{BN}*"sealed"{BN}* { // sealed member function
4767 lineCount(yyscanner) ;
4768 yyextra->current->spec |= Entry::Sealed;
4769 yyextra->current->args += " sealed ";
4771 <FuncQual>{BN}*"new"{BN}* { // new member function
4772 lineCount(yyscanner) ;
4773 yyextra->current->spec |= Entry::New;
4774 yyextra->current->args += " new ";
4776 <FuncQual>{BN}*"const"{BN}* { // const member function
4777 lineCount(yyscanner) ;
4778 yyextra->current->args += " const ";
4779 yyextra->current->argList.setConstSpecifier(TRUE);
4781 <FuncQual>{BN}*"volatile"{BN}* { // volatile member function
4782 lineCount(yyscanner) ;
4783 yyextra->current->args += " volatile ";
4784 yyextra->current->argList.setVolatileSpecifier(TRUE);
4786 <FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier
4787 lineCount(yyscanner) ;
4788 yyextra->current->args += " noexcept ";
4789 yyextra->current->spec |= Entry::NoExcept;
4791 <FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression
4792 lineCount(yyscanner) ;
4793 yyextra->current->args += " noexcept(";
4794 yyextra->current->spec |= Entry::NoExcept;
4795 yyextra->lastRoundContext=FuncQual;
4796 yyextra->pCopyRoundString=&yyextra->current->args;
4797 yyextra->roundCount=0;
4800 <FuncQual>{BN}*"&" {
4801 yyextra->current->args += " &";
4802 yyextra->current->argList.setRefQualifier(RefQualifierLValue);
4804 <FuncQual>{BN}*"&&" {
4805 yyextra->current->args += " &&";
4806 yyextra->current->argList.setRefQualifier(RefQualifierRValue);
4809 <FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
4810 lineCount(yyscanner) ;
4811 yyextra->current->args += " = 0";
4812 yyextra->current->virt = Pure;
4813 yyextra->current->argList.setPureSpecifier(TRUE);
4816 <FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* { // C++11 explicitly delete member
4817 lineCount(yyscanner);
4818 yyextra->current->args += " = delete";
4819 yyextra->current->spec |= Entry::Delete;
4820 yyextra->current->argList.setIsDeleted(TRUE);
4823 <FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* { // C++11 explicitly defaulted constructor/assignment operator
4824 lineCount(yyscanner);
4825 yyextra->current->args += " = default";
4826 yyextra->current->spec |= Entry::Default;
4829 <FuncQual>{BN}*"->"{BN}* {
4830 lineCount(yyscanner);
4831 yyextra->current->argList.setTrailingReturnType(" -> ");
4832 yyextra->current->args += " -> ";
4833 yyextra->roundCount=0;
4834 BEGIN(TrailingReturn);
4836 <TrailingReturn>[{;] {
4837 if (yyextra->roundCount>0) REJECT;
4841 <TrailingReturn>"requires"{BN}+ {
4842 yyextra->requiresContext = FuncQual;
4843 yyextra->current->req+=' ';
4844 BEGIN(RequiresClause);
4846 <TrailingReturn>"(" {
4847 yyextra->roundCount++;
4848 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
4849 yyextra->current->args+=yytext;
4851 <TrailingReturn>")" {
4852 if (yyextra->roundCount>0)
4854 yyextra->roundCount--;
4858 warn(yyextra->yyFileName,yyextra->yyLineNr,
4859 "Found ')' without opening '(' for trailing return type '%s)...'",
4860 qPrint(yyextra->current->argList.trailingReturnType()));
4862 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
4863 yyextra->current->args+=yytext;
4866 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
4867 yyextra->current->args+=yytext;
4869 <TrailingReturn>\n {
4870 lineCount(yyscanner);
4871 yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
4872 yyextra->current->args+=' ';
4874 <FuncRound,FuncFunc>{BN}*","{BN}* {
4875 lineCount(yyscanner) ;
4876 yyextra->current->args += ", " ;
4878 <FuncQual,FuncRound,FuncFunc>{BN}+ {
4879 lineCount(yyscanner) ;
4880 yyextra->current->args += ' ' ;
4882 <Function,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
4884 yyextra->lastCPPContext = YY_START;
4888 if (yyextra->insideCli &&
4889 (yyextra->current_root->section&Entry::COMPOUND_MASK)
4896 // typically an initialized function pointer
4897 yyextra->lastInitializerContext=YY_START;
4898 yyextra->initBracketCount=0;
4899 yyextra->current->initializer.str(yytext);
4900 BEGIN(ReadInitializer);
4910 lineCount(yyscanner);
4915 if (yyextra->insideCpp && qstrcmp(yytext,"requires")==0)
4917 // c++20 trailing requires clause
4918 yyextra->requiresContext = YY_START;
4919 yyextra->current->req+=' ';
4920 BEGIN(RequiresClause);
4922 else if (yyextra->insideCS && qstrcmp(yytext,"where")==0)
4924 // type constraint for a method
4925 yyextra->current->typeConstr.clear();
4926 yyextra->current->typeConstr.push_back(Argument());
4927 yyextra->lastCSConstraint = YY_START;
4928 BEGIN( CSConstraintName );
4930 else if (checkForKnRstyleC(yyscanner)) // K&R style C function
4932 yyextra->current->args = yytext;
4933 yyextra->oldStyleArgType.resize(0);
4934 BEGIN(OldStyleArgs);
4938 yyextra->current->args += yytext;
4941 <OldStyleArgs>[,;] {
4942 QCString oldStyleArgPtr;
4943 QCString oldStyleArgName;
4944 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
4946 if (yyextra->current->doc!=yyextra->docBackup)
4948 doc=yyextra->current->doc;
4949 yyextra->current->doc=yyextra->docBackup;
4951 if (yyextra->current->brief!=yyextra->briefBackup)
4953 brief=yyextra->current->brief;
4954 yyextra->current->brief=yyextra->briefBackup;
4956 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
4957 oldStyleArgName,brief,doc);
4958 yyextra->current->args.resize(0);
4959 if (*yytext==';') yyextra->oldStyleArgType.resize(0);
4961 <OldStyleArgs>{ID} { yyextra->current->args += yytext; }
4963 if (yyextra->current->argList.empty())
4965 yyextra->current->argList.setNoParameters(TRUE);
4967 yyextra->current->args = argListToString(yyextra->current->argList);
4971 <OldStyleArgs>. { yyextra->current->args += *yytext; }
4972 <FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
4973 <FuncQual>{BN}*"try:" |
4974 <FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
4975 yyextra->insideTryBlock=TRUE;
4976 lineCount(yyscanner);
4977 if (yytext[yyleng-1]==':')
4983 <FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
4984 yyextra->current->exception = " throw (" ;
4985 yyextra->roundCount=0;
4986 lineCount(yyscanner) ;
4987 BEGIN( ExcpRound ) ;
4989 <FuncQual>{BN}*"raises"{BN}*"(" {
4990 yyextra->current->exception = " raises (" ;
4991 lineCount(yyscanner) ;
4992 yyextra->roundCount=0;
4993 BEGIN( ExcpRound ) ;
4995 <FuncQual>{BN}*"throws"{BN}+ { // Java style throw clause
4996 yyextra->current->exception = " throws " ;
4997 lineCount(yyscanner) ;
5000 <ExcpRound>"(" { yyextra->current->exception += *yytext ;
5001 ++yyextra->roundCount ;
5003 <ExcpRound>")" { yyextra->current->exception += *yytext ;
5004 if ( yyextra->roundCount )
5005 --yyextra->roundCount ;
5010 yyextra->current->exception += *yytext;
5013 unput('{'); BEGIN( FuncQual );
5016 unput(';'); BEGIN( FuncQual );
5019 yyextra->current->exception += ' ';
5020 lineCount(yyscanner);
5023 yyextra->current->exception += *yytext;
5025 <Function>"(" { yyextra->current->type += yyextra->current->name ;
5026 yyextra->current->name = yyextra->current->args ;
5027 yyextra->current->args = yytext ;
5028 yyextra->roundCount=0;
5029 BEGIN( FuncRound ) ;
5032 if (!yyextra->insidePHP) BEGIN(SkipInits);
5035 yyextra->current->name=removeRedundantWhiteSpace(yyextra->current->name);
5036 yyextra->current->type=removeRedundantWhiteSpace(yyextra->current->type);
5037 yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
5038 yyextra->current->fileName = yyextra->yyFileName;
5039 yyextra->current->startLine = yyextra->yyBegLineNr;
5040 yyextra->current->startColumn = yyextra->yyBegColNr;
5041 static const reg::Ex re(R"(\([^)]*[*&][^)]*\))");
5043 std::string type = yyextra->current->type.str();
5045 if (reg::search(type,match,re))
5047 ti = (int)match.position();
5049 int ts=yyextra->current->type.find('<');
5050 int te=yyextra->current->type.findRev('>');
5052 // bug677315: A<int(void *, char *)> get(); is not a function pointer
5053 bool isFunction = ti==-1 || // not a (...*...) pattern
5054 (ts!=-1 && ts<te && ts<ti && ti<te); // (...*...) is part of a template argument list
5055 bool isVariable = (!yyextra->current->type.isEmpty() &&
5056 (!isFunction || yyextra->current->type.left(8)=="typedef "));
5058 //printf("type=%s ts=%d te=%d ti=%d isFunction=%d\n",
5059 // qPrint(yyextra->current->type),ts,te,ti,isFunction);
5061 if (*yytext!=';' || (yyextra->current_root->section&Entry::COMPOUND_MASK) )
5063 int tempArg=yyextra->current->name.find('<');
5065 if (tempArg==-1) tempName=yyextra->current->name; else tempName=yyextra->current->name.left(tempArg);
5068 //printf("Scanner.l: found in class variable: '%s' '%s' '%s'\n", qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
5069 if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
5071 yyextra->current->type.prepend("typedef ");
5073 yyextra->current->section = Entry::VARIABLE_SEC ;
5077 //printf("Scanner.l: found in class function: '%s' '%s' '%s'\n", qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
5078 yyextra->current->section = Entry::FUNCTION_SEC ;
5079 yyextra->current->proto = *yytext==';';
5082 else // a global function prototype or function variable
5084 //printf("Scanner.l: prototype? type='%s' name='%s' args='%s'\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
5087 if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
5089 yyextra->current->type.prepend("typedef ");
5091 //printf("Scanner.l: found function variable!\n");
5092 yyextra->current->section = Entry::VARIABLE_SEC;
5096 //printf("Scanner.l: found prototype\n");
5097 yyextra->current->section = Entry::FUNCTION_SEC;
5098 yyextra->current->proto = TRUE;
5101 //printf("Adding entry '%s'\n",qPrint(yyextra->current->name));
5102 if ( yyextra->insidePHP)
5104 if (findAndRemoveWord(yyextra->current->type,"final"))
5106 yyextra->current->spec |= Entry::Final;
5108 if (findAndRemoveWord(yyextra->current->type,"abstract"))
5110 yyextra->current->spec |= Entry::Abstract;
5113 if ( yyextra->insidePHP && !containsWord(yyextra->current->type,"function"))
5115 initEntry(yyscanner);
5116 if ( *yytext == '{' )
5118 yyextra->lastCurlyContext = FindMembers;
5119 yyextra->curlyCount=0;
5124 BEGIN( FindMembers );
5129 if ( yyextra->insidePHP)
5131 findAndRemoveWord(yyextra->current->type,"function");
5133 yyextra->previous = yyextra->current;
5134 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5135 initEntry(yyscanner);
5136 // Objective C 2.0: Required/Optional section
5137 if (yyextra->previous->spec & (Entry::Optional | Entry::Required))
5139 yyextra->current->spec |= yyextra->previous->spec & (Entry::Optional|Entry::Required);
5141 yyextra->lastCurlyContext = FindMembers;
5142 if ( *yytext == ',' )
5144 yyextra->current->type = yyextra->previous->type;
5145 // we need to strip any trailing * and & (see bugs 623023 and 649103 for test cases)
5146 int i=yyextra->current->type.length();
5147 while (i>0 && (yyextra->current->type[i-1]=='*' || yyextra->current->type[i-1]=='&' || yyextra->current->type[i-1]==' ')) i--;
5148 yyextra->current->type = yyextra->current->type.left(i);
5150 if ( *yytext == '{' )
5152 if ( !yyextra->insidePHP && (yyextra->current_root->section & Entry::COMPOUND_MASK) )
5154 yyextra->previous->spec |= Entry::Inline;
5156 //addToBody(yytext);
5157 yyextra->curlyCount=0;
5158 BEGIN( SkipCurly ) ;
5162 if (yyextra->previous->section!=Entry::VARIABLE_SEC)
5163 yyextra->previous->bodyLine=-1; // a function/member declaration
5164 BEGIN( FindMembers ) ;
5168 <SkipInits>">"{BN}*"{" { // C++11 style initializer (see bug 790788)
5169 lineCount(yyscanner);
5170 yyextra->curlyCount=1;
5171 BEGIN(SkipC11Inits);
5173 <SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647)
5174 lineCount(yyscanner);
5175 yyextra->curlyCount=1;
5176 BEGIN(SkipC11Inits);
5179 ++yyextra->curlyCount;
5182 if ( --yyextra->curlyCount<=0 )
5187 <SkipC11Attribute>"]]" {
5188 BEGIN(yyextra->lastC11AttributeContext);
5190 <SkipInits>"{" { // C++11 style initializer
5195 //addToBody(yytext);
5196 ++yyextra->curlyCount ;
5198 <SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
5200 //addToBody(yytext);
5201 if( yyextra->curlyCount )
5203 --yyextra->curlyCount ;
5207 if (!yyextra->current->sli.empty() && yyextra->previous) // copy special list items
5209 yyextra->previous->sli = yyextra->current->sli;
5210 yyextra->current->sli.clear();
5212 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5213 BEGIN( yyextra->lastCurlyContext ) ;
5216 <SkipCurly>"}"{BN}*{DCOMM}"<" {
5217 lineCount(yyscanner);
5218 if ( yyextra->curlyCount )
5220 //addToBody(yytext);
5221 --yyextra->curlyCount ;
5225 yyextra->current->endBodyLine=yyextra->yyLineNr;
5226 yyextra->tempEntry = yyextra->current; // temporarily switch to the previous entry
5227 yyextra->current = yyextra->previous;
5229 yyextra->docBlockContext = SkipCurlyEndDoc;
5230 yyextra->docBlockInBody = FALSE;
5231 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5232 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
5233 yyextra->docBlock.str(std::string());
5234 yyextra->docBlockTerm = '}';
5235 if (yytext[yyleng-3]=='/')
5237 startCommentBlock(yyscanner,TRUE);
5242 startCommentBlock(yyscanner,FALSE);
5247 <SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
5248 yyextra->docBlockContext = SkipCurlyEndDoc;
5249 yyextra->docBlockInBody = FALSE;
5250 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
5251 ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
5252 yyextra->docBlock.str(std::string());
5253 yyextra->docBlockTerm = '}';
5254 if (yytext[yyleng-3]=='/')
5256 startCommentBlock(yyscanner,TRUE);
5261 startCommentBlock(yyscanner,FALSE);
5265 <SkipCurlyEndDoc>"}" {
5267 if (yyextra->tempEntry) // we can only switch back to yyextra->current if no new item was created
5269 yyextra->current = yyextra->tempEntry;
5270 yyextra->tempEntry.reset();
5272 BEGIN( yyextra->lastCurlyContext );
5275 //addToBody(yytext);
5276 yyextra->lastStringContext=SkipCurly;
5277 BEGIN( SkipString );
5279 <SkipCurly>^{B}*"#" {
5280 if (yyextra->insidePHP)
5282 //addToBody(yytext);
5283 BEGIN( SkipCurlyCpp );
5285 <SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n {
5286 lineCount(yyscanner);
5287 //addToBody(yytext);
5289 <SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
5290 if (!yyextra->insidePHP)
5296 yyextra->lastHereDocContext = YY_START;
5300 <SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
5301 QCString raw=QCString(yytext).stripWhiteSpace();
5302 yyextra->delimiter = raw.mid(2);
5303 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
5304 yyextra->lastRawStringContext = YY_START;
5305 yyextra->dummyRawString.resize(0);
5306 yyextra->pCopyRawString = &yyextra->dummyRawString;
5307 *yyextra->pCopyRawString += yytext;
5310 <SkipCurly,SkipCurlyCpp>[^\n#"'@\\/{}<]+ {
5311 lineCount(yyscanner); // for yyextra->column updates
5312 //addToBody(yytext);
5315 //addToBody(yytext);
5316 lineCount(yyscanner);
5317 yyextra->lastCurlyContext = FindMembers;
5320 <SkipCurlyCpp>\\[\r]*"\n"[\r]* {
5321 //addToBody(yytext);
5322 lineCount(yyscanner);
5324 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CCS} {
5325 //addToBody(yytext);
5326 yyextra->lastCContext = YY_START;
5329 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CPPC} {
5330 //addToBody(yytext);
5331 yyextra->lastCContext = YY_START;
5332 BEGIN(SkipCxxComment);
5334 <SkipInits,SkipC11Inits,SkipC11Attribute>"(" {
5335 yyextra->roundCount=0;
5336 yyextra->lastSkipRoundContext=YY_START;
5339 <SkipInits,SkipC11Inits,SkipC11Attribute>\" {
5340 yyextra->lastStringContext=YY_START;
5341 BEGIN( SkipString );
5344 warn(yyextra->yyFileName,yyextra->yyLineNr,
5345 "Found ';' while parsing initializer list! "
5346 "(doxygen could be confused by a macro call without semicolon)"
5348 BEGIN( FindMembers );
5350 <SkipInits,SkipCurly,SkipCurlyCpp>"#" {
5351 if (!yyextra->insidePHP)
5353 //addToBody(yytext);
5354 yyextra->lastCContext = YY_START;
5355 BEGIN(SkipCxxComment);
5357 <SkipInits,SkipCurly,SkipCurlyCpp>@\" {
5358 if (!yyextra->insideCS) REJECT;
5359 // C# verbatim string
5360 yyextra->lastSkipVerbStringContext=YY_START;
5361 yyextra->pSkipVerbString=&yyextra->current->initializer;
5362 BEGIN(SkipVerbString);
5364 <SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} {
5365 if (yyextra->insidePHP) REJECT;
5367 <SkipInits,SkipCurly,SkipCurlyCpp>\' {
5368 if (yyextra->insidePHP)
5370 yyextra->lastStringContext=YY_START;
5371 BEGIN(SkipPHPString);
5374 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>. { }
5375 <SkipString,SkipPHPString>\\. { }
5377 BEGIN( yyextra->lastStringContext );
5380 BEGIN( yyextra->lastStringContext );
5382 <SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
5383 <SkipString,SkipPHPString>\n {
5384 lineCount(yyscanner);
5386 <SkipString,SkipPHPString>. { }
5387 <CompoundName>":" { // for "class : public base {} var;" construct, see bug 608359
5392 yyextra->current->section = Entry::EMPTY_SEC ;
5393 yyextra->current->type.resize(0) ;
5394 yyextra->current->name.resize(0) ;
5395 yyextra->current->args.resize(0) ;
5396 yyextra->current->argList.clear();
5397 BEGIN( FindMembers ) ;
5400 if (yyextra->insideIDL && (yyextra->current->spec & (Entry::Singleton |
5403 // in UNO IDL a service or singleton may be defined
5404 // completely like this: "service Foo : XFoo;"
5405 if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
5407 prependScope(yyscanner);
5409 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
5410 // there can be only one base class here
5411 if (!yyextra->baseName.isEmpty())
5413 yyextra->current->extends.push_back(
5414 BaseInfo(yyextra->baseName,Public,Normal));
5415 yyextra->baseName.resize(0);
5417 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5418 initEntry(yyscanner);
5422 yyextra->current->section = Entry::EMPTY_SEC ;
5423 yyextra->current->type.resize(0) ;
5424 yyextra->current->name.resize(0) ;
5425 yyextra->current->args.resize(0) ;
5426 yyextra->current->argList.clear();
5428 BEGIN( FindMembers ) ;
5430 <CompoundName>{SCOPENAME}/{BN}*"<" {
5431 yyextra->sharpCount = 0;
5432 yyextra->current->name = yytext ;
5433 if (yyextra->current->spec & Entry::Protocol)
5435 yyextra->current->name+="-p";
5437 lineCount(yyscanner);
5438 yyextra->lastClassTemplSpecContext = ClassVar;
5439 if (yyextra->insideObjC) // protocol list
5441 BEGIN( ObjCProtocolList );
5443 else if (yyextra->insideCS) // C# generic class
5445 //yyextra->current->name+="-g";
5448 else // C++ template specialization
5450 yyextra->roundCount=0;
5451 BEGIN( ClassTemplSpec );
5456 // check bug 612858 before enabling the next line
5457 //yyextra->current->spec |= Entry::Template;
5458 yyextra->current->tArgLists.push_back(al);
5459 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
5460 yyextra->templateStr="<";
5461 yyextra->current->name += "<";
5462 yyextra->fullArgString = yyextra->templateStr;
5463 yyextra->copyArgString = &yyextra->current->name;
5464 //yyextra->copyArgString = &yyextra->templateStr;
5465 yyextra->currentArgumentContext = ClassVar;
5466 BEGIN( ReadTempArgs );
5468 <ObjCProtocolList>"<" {
5469 yyextra->insideProtocolList=TRUE;
5472 <ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
5473 yyextra->current->name += yytext;
5474 lineCount(yyscanner);
5475 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
5477 yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
5478 if (yyextra->current->spec & Entry::Protocol)
5479 { // Objective-C protocol
5480 unput('{'); // fake start of body
5485 BEGIN( yyextra->lastClassTemplSpecContext );
5489 <ClassTemplSpec>"<" {
5490 yyextra->current->name += yytext;
5491 if (yyextra->roundCount==0) yyextra->sharpCount++;
5494 yyextra->current->name += yytext;
5496 <CompoundName>{SCOPENAME}{BN}*";" { // forward declaration
5497 if (!yyextra->current->tArgLists.empty())
5499 // found a forward template declaration, this has
5500 // a purpose of its own
5501 yyextra->current->name = yytext;
5502 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5503 //printf("template class declaration for %s!\n",qPrint(yyextra->current->name));
5504 QCString rn = yyextra->current_root->name;
5505 //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",qPrint(cn),qPrint(rn),yyextra->isTypedef);
5506 if (!yyextra->current->name.isEmpty() && !rn.isEmpty())
5508 prependScope(yyscanner);
5510 yyextra->current->spec|=Entry::ForwardDecl;
5511 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5513 else if (yyextra->insideIDL &&
5514 (((yyextra->current_root->spec & (Entry::Interface |
5516 (yyextra->current->spec & Entry::Interface)) ||
5517 ((yyextra->current_root->spec & (Entry::Service |
5518 Entry::Singleton)) &&
5519 (yyextra->current->spec & Entry::Service))))
5521 // interface yyextra->inside of UNO IDL service or interface
5522 // service yyextra->inside of UNO IDL service or singleton
5523 // there may be documentation on the member,
5524 // so do not throw it away...
5525 yyextra->current->name = yytext;
5526 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
5527 yyextra->current->section = (yyextra->current->spec & Entry::Interface)
5528 ? Entry::EXPORTED_INTERFACE_SEC
5529 : Entry::INCLUDED_SERVICE_SEC;
5530 // yyextra->current->section = Entry::MEMBERDOC_SEC;
5531 yyextra->current->spec &= ~(Entry::Interface|Entry::Service); // FIXME: horrible: Interface == Gettable, so need to clear it - actually we're mixing values from different enums in this case... granted only Optional and Interface are actually valid in this context but urgh...
5532 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
5536 yyextra->current->reset();
5537 initEntry(yyscanner);
5538 if (yyextra->insideObjC) // see bug746361
5540 yyextra->language = yyextra->current->lang = SrcLangExt_Cpp;
5541 yyextra->insideObjC = FALSE;
5543 if (yyextra->isTypedef) // typedef of a class, put typedef keyword back
5545 yyextra->current->type.prepend("typedef");
5547 BEGIN( FindMembers );
5549 <CompoundName>{SCOPENAME}/{BN}*"(" {
5550 yyextra->current->name = yytext ;
5551 lineCount(yyscanner);
5552 if (yyextra->insideCpp && yyextra->current->name=="alignas") // C++11
5554 yyextra->lastAlignAsContext = YY_START;
5559 if (yyextra->current->spec & Entry::Protocol)
5561 yyextra->current->name += "-p";
5566 <AlignAs>"(" { yyextra->roundCount=0;
5567 BEGIN( AlignAsEnd );
5569 <AlignAs>\n { lineCount(yyscanner); }
5571 <AlignAsEnd>"(" { yyextra->roundCount++; }
5572 <AlignAsEnd>")" { if (--yyextra->roundCount<0)
5574 BEGIN( yyextra->lastAlignAsContext );
5577 <AlignAsEnd>\n { lineCount(yyscanner); }
5580 yyextra->current->name = yytext ;
5583 yyextra->current->bodyLine = yyextra->yyLineNr;
5584 yyextra->current->bodyColumn = yyextra->yyColNr;
5585 yyextra->current->initializer.str(std::string());
5586 yyextra->lastInitializerContext = FindMembers;
5587 yyextra->initBracketCount=0;
5588 BEGIN(ReadInitializer);
5590 <CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
5591 // e.g. @protocol A,B;
5592 yyextra->current->reset();
5593 initEntry(yyscanner);
5595 <CompoundName>{SCOPENAME} {
5596 yyextra->current->name = yytext ;
5597 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
5599 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
5601 lineCount(yyscanner);
5602 if (yyextra->current->spec & Entry::Protocol)
5604 yyextra->current->name += "-p";
5606 if ((yyextra->current->spec & Entry::Protocol) ||
5607 yyextra->current->section == Entry::OBJCIMPL_SEC)
5609 unput('{'); // fake start of body
5613 <CompoundName>{CSSCOPENAME} { // C# style scope
5614 yyextra->current->name = substitute(yytext,".","::");
5615 lineCount(yyscanner);
5618 <ClassVar>{SCOPENAME}{BNopt}/"(" {
5619 if (yyextra->insideIDL && qstrncmp(yytext,"switch",6)==0 && !isId(yytext[6]))
5621 // Corba IDL style union
5622 yyextra->roundCount=0;
5623 BEGIN(SkipUnionSwitch);
5628 yyextra->yyBegColNr=yyextra->yyColNr;
5629 yyextra->yyBegLineNr=yyextra->yyLineNr;
5630 yyextra->current->name = yytext;
5631 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
5632 lineCount(yyscanner);
5633 BEGIN( FindMembers );
5637 if (yyextra->isTypedef)
5639 // multiple types in one typedef
5641 yyextra->current->type.prepend("typedef ");
5646 // Multiple class forward declaration
5649 <ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
5650 if (yyextra->insideCli)
5652 if (yytext[0]=='s') // sealed
5653 yyextra->current->spec |= Entry::SealedClass;
5655 yyextra->current->spec |= Entry::AbstractClass;
5664 yyextra->yyBegColNr=yyextra->yyColNr;
5665 yyextra->yyBegLineNr=yyextra->yyLineNr;
5667 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
5669 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
5671 if (yyextra->insideIDL && qstrcmp(yytext,"switch")==0)
5673 // Corba IDL style union
5674 yyextra->roundCount=0;
5675 BEGIN(SkipUnionSwitch);
5677 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (qstrcmp(yytext,"implements")==0 || qstrcmp(yytext,"extends")==0))
5679 yyextra->current->type.resize(0);
5680 yyextra->baseProt=Public;
5681 yyextra->baseVirt=Normal;
5682 yyextra->baseName.resize(0);
5683 BEGIN( BasesProt ) ;
5685 else if (yyextra->insideCS && qstrcmp(yytext,"where")==0) // C# type constraint
5687 yyextra->current->typeConstr.clear();
5688 yyextra->current->typeConstr.push_back(Argument());
5689 yyextra->lastCSConstraint = YY_START;
5690 BEGIN( CSConstraintName );
5692 else if (yyextra->insideCli && qstrcmp(yytext,"abstract")==0)
5694 yyextra->current->spec|=Entry::Abstract;
5696 else if (yyextra->insideCli && qstrcmp(yytext,"sealed")==0)
5698 yyextra->current->spec|=Entry::Sealed;
5700 else if (qstrcmp(yytext,"final")==0)
5702 yyextra->current->spec|=Entry::Final;
5706 if (yyextra->current->section == Entry::ENUM_SEC)
5707 { // found "enum a b" -> variable
5708 yyextra->current->section = Entry::VARIABLE_SEC ;
5710 yyextra->current->type += ' ' ;
5711 yyextra->current->type += yyextra->current->name ;
5712 yyextra->current->name = yytext ;
5714 if (nameIsOperator(yyextra->current->name))
5721 if (yyextra->insideObjC && *yytext=='(') // class category
5723 yyextra->current->name+='(';
5724 //if (yyextra->current->section!=Entry::OBJCIMPL_SEC)
5726 yyextra->current->spec|=Entry::Category;
5728 BEGIN( ClassCategory );
5732 // probably a function anyway
5734 BEGIN( FindMembers );
5737 <CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
5738 <CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
5739 yyextra->fullArgString.resize(0);
5740 yyextra->lastCopyArgChar='#'; // end marker
5741 yyextra->lastCommentInArgContext=YY_START;
5743 BEGIN( CopyArgCommentLine );
5745 BEGIN( CopyArgComment );
5747 <CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
5748 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
5750 <CSConstraintType>"{" { // end of type constraint reached
5751 // parse documentation of the constraints
5752 handleParametersCommentBlocks(yyscanner,yyextra->current->typeConstr);
5754 BEGIN( yyextra->lastCSConstraint );
5756 <CSConstraintType,CSConstraintName>";" {
5757 handleParametersCommentBlocks(yyscanner,yyextra->current->typeConstr);
5759 BEGIN( yyextra->lastCSConstraint );
5761 <CSConstraintName>":" {
5762 BEGIN( CSConstraintType );
5764 <CSConstraintName>{ID} {
5766 yyextra->current->typeConstr.back().name=yytext;
5768 <CSConstraintType>"where" { // another constraint for a different param
5769 yyextra->current->typeConstr.push_back(Argument());
5770 BEGIN( CSConstraintName );
5772 <CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
5773 if (yyextra->current->typeConstr.back().type.isEmpty())
5774 // first type constraint for this parameter
5776 yyextra->current->typeConstr.back().type=yytext;
5778 else // new type constraint for same parameter
5780 QCString name = yyextra->current->typeConstr.back().name;
5781 yyextra->current->typeConstr.push_back(Argument());
5782 yyextra->current->typeConstr.back().name=name;
5783 yyextra->current->typeConstr.back().type=yytext;
5786 <CSConstraintName,CSConstraintType>\n {
5787 lineCount(yyscanner);
5789 <CSConstraintName,CSConstraintType>. {
5791 <ClassCategory>{ID} {
5792 yyextra->current->name+=yytext;
5794 <ClassCategory>")"/{BN}*"{" {
5795 yyextra->current->name+=')';
5798 <ClassCategory>")"/{BN}*"<" {
5799 yyextra->current->name+=')';
5800 BEGIN( ObjCProtocolList );
5802 <ClassCategory>")" {
5803 yyextra->current->name+=')';
5804 if ((yyextra->current->section & Entry::Protocol) ||
5805 yyextra->current->section == Entry::OBJCIMPL_SEC)
5807 unput('{'); // fake start of body
5809 else // category has no variables so push back an empty body
5817 if (yyextra->current->section==Entry::VARIABLE_SEC) // enum A B:2, see bug 748208
5819 yyextra->current->bitfields+=":";
5820 yyextra->current->args.resize(0);
5823 else if (yyextra->current->section==Entry::ENUM_SEC) // enum E:2, see bug 313527,
5824 // or C++11 style enum: 'E : unsigned int {...}'
5826 yyextra->current->args.resize(0);
5827 BEGIN(EnumBaseType);
5831 yyextra->current->type.resize(0);
5832 if ((yyextra->current->spec & Entry::Interface) ||
5833 (yyextra->current->spec & Entry::Struct) ||
5834 (yyextra->current->spec & Entry::Ref) ||
5835 (yyextra->current->spec & Entry::Value) ||
5836 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
5838 yyextra->baseProt=Public;
5840 yyextra->baseProt=Private;
5841 yyextra->baseVirt=Normal;
5842 yyextra->baseName.resize(0);
5843 BEGIN( BasesProt ) ;
5848 if (yyextra->isTypedef) // typedef of a class, put typedef keyword back
5850 yyextra->current->type.prepend("typedef");
5852 if ((yytext[0]=='*' || yytext[0]=='&') &&
5853 yyextra->current->section == Entry::ENUM_SEC)
5854 { // found "enum a *b" -> variable
5855 yyextra->current->section = Entry::VARIABLE_SEC ;
5857 BEGIN( FindMembers );
5859 <Bases,ClassVar>{CPPC}"/"/[^/] {
5860 if (!yyextra->insideObjC)
5866 lineCount(yyscanner);
5867 yyextra->current->program << yytext;
5868 yyextra->current->fileName = yyextra->yyFileName ;
5869 yyextra->current->startLine = yyextra->yyLineNr ;
5870 yyextra->current->startColumn = yyextra->yyColNr;
5871 yyextra->curlyCount=0;
5872 BEGIN( ReadBodyIntf );
5875 <Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
5876 <Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
5877 <Bases,ClassVar>{CPPC}"!" |
5878 <Bases,ClassVar>[\-+]{BN}* {
5879 if (!yyextra->insideObjC)
5885 lineCount(yyscanner);
5886 yyextra->current->program << yytext;
5887 yyextra->current->fileName = yyextra->yyFileName ;
5888 yyextra->current->startLine = yyextra->yyLineNr ;
5889 yyextra->current->startColumn = yyextra->yyColNr;
5890 yyextra->curlyCount=0;
5891 BEGIN( ReadBodyIntf );
5894 <CompoundName,ClassVar>{B}*"{"{B}* {
5895 yyextra->current->program.str(std::string());
5896 yyextra->current->fileName = yyextra->yyFileName ;
5897 yyextra->current->bodyLine = yyextra->yyLineNr;
5898 yyextra->current->bodyColumn = yyextra->yyColNr;
5899 yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
5900 if (yyextra->current->name.isEmpty() && !yyextra->isTypedef) // anonymous compound
5902 if (yyextra->current->section==Entry::NAMESPACE_SEC) // allow reopening of anonymous namespaces
5904 if (Config_getBool(EXTRACT_ANON_NSPACES)) // use visible name
5906 yyextra->current->name="anonymous_namespace{"+stripPath(yyextra->current->fileName)+"}";
5908 else // use invisible name
5910 yyextra->current->name.sprintf("@%d",anonNSCount.load());
5915 yyextra->current->name.sprintf("@%d",anonCount++);
5918 yyextra->curlyCount=0;
5919 if (yyextra->current_root && // not a nested struct yyextra->inside an @interface section
5920 !(yyextra->current_root->spec & Entry::Interface) &&
5921 ((yyextra->current->spec & (Entry::Interface | Entry::Protocol | Entry::Category) ||
5922 yyextra->current->section==Entry::OBJCIMPL_SEC)
5926 { // ObjC body that ends with @end
5927 BEGIN( ReadBodyIntf );
5929 else if (yyextra->current->section==Entry::NAMESPACE_SEC)
5931 BEGIN( ReadNSBody );
5938 <BasesProt>"virtual"{BN}+ { lineCount(yyscanner); yyextra->baseVirt = Virtual; }
5939 <BasesProt>"public"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Public; }
5940 <BasesProt>"protected"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Protected; }
5941 <BasesProt>"internal"{BN}+ { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Package; }
5942 <BasesProt>"private"{BN}+ { lineCount(yyscanner); yyextra->baseProt = Private; }
5943 <BasesProt>{BN} { lineCount(yyscanner); }
5944 <BasesProt>. { unput(*yytext); BEGIN(Bases); }
5945 <Bases>("\\")?({ID}"\\")*{ID} { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
5946 if (!yyextra->insidePHP)
5950 else // PHP base class of the form \Ns\Cl or Ns\Cl
5952 lineCount(yyscanner);
5954 bn = substitute(bn,"\\","::");
5955 yyextra->baseName += bn;
5956 yyextra->current->args += ' ';
5957 yyextra->current->args += yytext;
5960 <Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID} {
5961 lineCount(yyscanner);
5962 QCString baseScope = yytext;
5963 if (yyextra->insideCS && baseScope.stripWhiteSpace()=="where")
5965 // type constraint for a class
5966 yyextra->current->typeConstr.clear();
5967 yyextra->current->typeConstr.push_back(Argument());
5968 yyextra->lastCSConstraint = YY_START;
5969 BEGIN( CSConstraintName );
5973 yyextra->baseName+=yytext;
5974 yyextra->current->args += ' ';
5975 yyextra->current->args += yytext;
5978 <Bases>{BN}*{ID}("."{ID})* { // Java style class
5979 QCString name = substitute(yytext,".","::");
5980 yyextra->baseName += name;
5981 yyextra->current->args += ' ';
5982 yyextra->current->args += name;
5984 <ClassVar,Bases>\n/{BN}*[^{, \t\n] {
5985 if (!yyextra->insideObjC)
5991 lineCount(yyscanner);
5995 <ClassVar,Bases>"@end" { // empty ObjC interface
5996 unput('d'); // insert fake body: {}@end
6003 <ClassVar>"<" { yyextra->current->name += *yytext;
6004 yyextra->sharpCount=1;
6005 yyextra->roundCount=0;
6006 yyextra->lastSkipSharpContext = YY_START;
6007 yyextra->specName = &yyextra->current->name;
6008 BEGIN ( Specialization );
6011 lineCount(yyscanner);
6012 yyextra->sharpCount=1;
6013 yyextra->roundCount=0;
6014 yyextra->lastSkipSharpContext = YY_START;
6015 if (yyextra->insideObjC) // start of protocol list
6019 else // template specialization
6021 //if (yyextra->insideCS) // generic
6023 // yyextra->baseName+="-g";
6025 yyextra->templateStr = yytext;
6026 yyextra->specName = &yyextra->templateStr;
6027 BEGIN ( Specialization );
6030 <Specialization>"<" { *yyextra->specName += *yytext;
6031 if (yyextra->roundCount==0) yyextra->sharpCount++;
6033 <Specialization>">" {
6034 *yyextra->specName += *yytext;
6035 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6037 yyextra->baseName+=removeRedundantWhiteSpace(*yyextra->specName);
6038 BEGIN(yyextra->lastSkipSharpContext);
6041 <Specialization>{BN}+ { lineCount(yyscanner); *yyextra->specName +=' '; }
6042 <Specialization>"<<" { *yyextra->specName += yytext; }
6043 <Specialization>">>"/{B}*"::" { // M$ C++ extension to allow >> to close a template...
6048 <Specialization>">>" {
6049 if (yyextra->insideCS) // for C# >> ends a nested template
6053 else // for C++ >> is a bitshift
6054 // operator and > > would end
6055 // a nested template.
6056 // We require the bitshift to be enclosed in braces.
6057 // See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
6059 if (yyextra->roundCount>0)
6061 *yyextra->specName += yytext;
6071 <Specialization>"typename"{BN}+ { lineCount(yyscanner); }
6072 <Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
6073 <Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
6075 <Specialization>"\\\\" { *yyextra->specName += *yytext;}
6076 <Specialization>"\\'" { *yyextra->specName += *yytext;}
6077 <Specialization>"\\\"" { *yyextra->specName += *yytext;}
6078 <Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
6079 <Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
6080 <SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
6081 <SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
6082 <SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6083 <SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
6084 <SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
6085 <SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
6088 *yyextra->specName += *yytext;
6090 <SkipRound>"(" { ++yyextra->roundCount; }
6091 <SkipRound>")" { if (--yyextra->roundCount<0)
6092 BEGIN ( yyextra->lastSkipRoundContext );
6095 yyextra->lastStringContext=SkipRound;
6098 <Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) { lineCount(yyscanner);
6099 if (yyextra->insideProtocolList)
6101 yyextra->baseName+="-p";
6105 yyextra->current->args += ',' ;
6107 yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
6108 if (!yyextra->baseName.isEmpty())
6110 yyextra->current->extends.push_back(
6111 BaseInfo(yyextra->baseName,yyextra->baseProt,yyextra->baseVirt)
6114 if ((yyextra->current->spec & (Entry::Interface|Entry::Struct)) ||
6115 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
6116 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
6118 yyextra->baseProt=Public;
6122 yyextra->baseProt=Private;
6124 yyextra->baseVirt=Normal;
6125 yyextra->baseName.resize(0);
6127 { // end of a ObjC protocol list
6128 yyextra->insideProtocolList=FALSE;
6131 unput('{'); // dummy start body
6140 if (*yytext==',' && yyextra->insideObjC) // Begin of protocol list
6142 yyextra->insideProtocolList=TRUE;
6147 <Bases>{B}*"{"{B}* {
6148 yyextra->current->program.str(std::string());
6149 yyextra->current->fileName = yyextra->yyFileName ;
6150 yyextra->current->bodyLine = yyextra->yyLineNr;
6151 yyextra->current->bodyColumn = yyextra->yyColNr;
6152 yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
6153 if (!yyextra->baseName.isEmpty())
6154 yyextra->current->extends.push_back(
6155 BaseInfo(yyextra->baseName,yyextra->baseProt,yyextra->baseVirt)
6157 yyextra->curlyCount=0;
6158 if (yyextra->insideObjC)
6160 BEGIN( ReadBodyIntf );
6167 <SkipUnionSwitch>{B}*"(" {
6168 yyextra->roundCount++;
6170 <SkipUnionSwitch>")" {
6171 if (--yyextra->roundCount==0)
6176 <SkipUnionSwitch>\n { lineCount(yyscanner); }
6178 <Comment>{BN}+ { yyextra->current->program << yytext ;
6179 lineCount(yyscanner) ;
6181 <Comment>{CCS} { yyextra->current->program << yytext ; }
6182 <Comment>{CPPC} { yyextra->current->program << yytext ; }
6183 <Comment>{CMD}("code"|"verbatim") {
6184 yyextra->insideCode=TRUE;
6185 yyextra->current->program << yytext ;
6187 <Comment>{CMD}("endcode"|"endverbatim") {
6188 yyextra->insideCode=FALSE;
6189 yyextra->current->program << yytext ;
6191 <Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
6192 <Comment>{CCE} { yyextra->current->program << yytext ;
6193 if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
6195 <Comment>. { yyextra->current->program << *yytext ; }
6197 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
6198 //printf("Start doc block at %d\n",yyextra->yyLineNr);
6199 if (!yyextra->current->doc.isEmpty())
6201 yyextra->current->doc+="\n\n";
6205 yyextra->current->docLine = yyextra->yyLineNr;
6206 yyextra->current->docFile = yyextra->yyFileName;
6209 yyextra->lastDocContext = YY_START;
6210 if (yyextra->current_root->section & Entry::SCOPE_MASK)
6212 yyextra->current->inside = yyextra->current_root->name+"::";
6214 yyextra->docBlockContext = YY_START;
6215 yyextra->docBlockInBody = YY_START==SkipCurly;
6216 yyextra->docBlockAutoBrief = Config_getBool(QT_AUTOBRIEF);
6219 indent.fill(' ',computeIndent(yytext,yyextra->column));
6220 yyextra->docBlock.str(indent.str());
6222 if (yyextra->docBlockAutoBrief)
6224 yyextra->current->briefLine = yyextra->yyLineNr;
6225 yyextra->current->briefFile = yyextra->yyFileName;
6227 startCommentBlock(yyscanner,FALSE);
6230 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
6231 bool javadocBanner = Config_getBool(JAVADOC_BANNER);
6232 lineCount(yyscanner);
6236 yyextra->lastDocContext = YY_START;
6238 //printf("Found comment banner at %s:%d\n",yyextra->yyFileName,yyextra->yyLineNr);
6239 if (yyextra->current_root->section & Entry::SCOPE_MASK)
6241 yyextra->current->inside = yyextra->current_root->name+"::";
6243 yyextra->current->docLine = yyextra->yyLineNr;
6244 yyextra->current->docFile = yyextra->yyFileName;
6245 yyextra->docBlockContext = YY_START;
6246 yyextra->docBlockInBody = YY_START==SkipCurly;
6247 bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
6248 yyextra->docBlockAutoBrief = javadocAutoBrief;
6251 indent.fill(' ',computeIndent(yytext,yyextra->column));
6252 yyextra->docBlock.str(indent.str());
6254 if (yyextra->docBlockAutoBrief)
6256 yyextra->current->briefLine = yyextra->yyLineNr;
6257 yyextra->current->briefFile = yyextra->yyFileName;
6259 startCommentBlock(yyscanner,FALSE);
6264 yyextra->current->program << yytext ;
6265 yyextra->lastContext = YY_START ;
6269 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
6270 yyextra->lastDocContext = YY_START;
6272 //printf("Found comment block at %s:%d\n",yyextra->yyFileName,yyextra->yyLineNr);
6273 if (yyextra->current_root->section & Entry::SCOPE_MASK)
6275 yyextra->current->inside = yyextra->current_root->name+"::";
6277 yyextra->current->docLine = yyextra->yyLineNr;
6278 yyextra->current->docFile = yyextra->yyFileName;
6279 yyextra->docBlockContext = YY_START;
6280 yyextra->docBlockInBody = YY_START==SkipCurly;
6281 bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
6282 yyextra->docBlockAutoBrief = javadocAutoBrief;
6285 indent.fill(' ',computeIndent(yytext,yyextra->column));
6286 yyextra->docBlock.str(indent.str());
6288 if (yyextra->docBlockAutoBrief)
6290 yyextra->current->briefLine = yyextra->yyLineNr;
6291 yyextra->current->briefFile = yyextra->yyFileName;
6293 startCommentBlock(yyscanner,FALSE);
6296 <FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
6297 yyextra->lastDocContext = YY_START;
6298 if (yyextra->current_root->section & Entry::SCOPE_MASK)
6300 yyextra->current->inside = yyextra->current_root->name+"::";
6302 yyextra->docBlockContext = YY_START;
6303 yyextra->docBlockInBody = YY_START==SkipCurly;
6304 yyextra->docBlockAutoBrief = FALSE;
6307 indent.fill(' ',computeIndent(yytext,yyextra->column));
6308 yyextra->docBlock.str(indent.str());
6310 startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
6313 <FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
6314 yyextra->lastDocContext = YY_START;
6315 if (yyextra->current_root->section & Entry::SCOPE_MASK)
6317 yyextra->current->inside = yyextra->current_root->name+"::";
6319 yyextra->docBlockContext = YY_START;
6320 yyextra->docBlockInBody = YY_START==SkipCurly;
6321 yyextra->docBlockAutoBrief = FALSE;
6323 indent.fill(' ',computeIndent(yytext,yyextra->column));
6324 yyextra->docBlock.str(indent.str());
6325 startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
6328 <FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
6329 lineCount(yyscanner);
6330 yyextra->externLinkage=TRUE;
6333 if (yyextra->externLinkage)
6335 yyextra->externLinkage=FALSE;
6337 else if (yyextra->insideCS &&
6338 !yyextra->current->name.isEmpty() &&
6339 !yyextra->current->type.isEmpty())
6341 if (containsWord(yyextra->current->type,"event")) // event
6343 yyextra->current->mtype = yyextra->mtype = Event;
6347 yyextra->current->mtype = yyextra->mtype = Property;
6349 yyextra->current->bodyLine = yyextra->yyLineNr;
6350 yyextra->current->bodyColumn = yyextra->yyColNr;
6351 yyextra->curlyCount=0;
6352 BEGIN( CSAccessorDecl );
6354 else if (yyextra->insideIDL && (yyextra->current->spec & Entry::Attribute))
6356 // UNO IDL: attributes may have setter and getter
6357 // exception specifications
6358 yyextra->current->exception = " {";
6359 BEGIN(UNOIDLAttributeBlock);
6363 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
6364 yyextra->current->name.isEmpty()
6367 // static Java initializer
6368 yyextra->needsSemi = FALSE;
6369 if (yyextra->current->stat)
6371 yyextra->current->name="[static initializer]";
6372 yyextra->current->type.resize(0);
6376 yyextra->current->name="[instance initializer]";
6383 // pre C++11 code -> ignore the initializer
6384 //yyextra->needsSemi = TRUE;
6385 //yyextra->current->type.resize(0);
6386 //yyextra->current->name.resize(0);
6387 //yyextra->current->args.resize(0);
6388 //yyextra->current->argList.clear();
6389 //yyextra->curlyCount=0;
6390 //BEGIN( SkipCurlyBlock );
6392 // C++11 style initializer list
6393 yyextra->current->bodyLine = yyextra->yyLineNr;
6394 yyextra->current->bodyColumn = yyextra->yyColNr;
6395 yyextra->current->initializer.str(yytext);
6396 yyextra->lastInitializerContext = YY_START;
6397 yyextra->initBracketCount=1;
6398 BEGIN(ReadInitializer);
6402 <CSAccessorDecl>"{" { yyextra->curlyCount++; }
6403 <CSAccessorDecl>"}"{B}*"=" {
6404 // fall back to next rule if it's not the right bracket
6405 if (yyextra->curlyCount != 0) REJECT;
6406 yyextra->current->initializer.str("=");
6407 yyextra->current->endBodyLine=yyextra->yyLineNr;
6408 yyextra->lastInitializerContext = FindMembers;
6409 BEGIN(ReadInitializer);
6411 <CSAccessorDecl>"}" {
6412 if (yyextra->curlyCount)
6414 yyextra->curlyCount--;
6418 yyextra->mtype = Method;
6419 yyextra->virt = Normal;
6420 // not really important, but while we are at it
6421 yyextra->current->endBodyLine=yyextra->yyLineNr;
6426 <CSAccessorDecl>"private "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::PrivateSettable; }
6427 <CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::ProtectedSettable; }
6428 <CSAccessorDecl>"private "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::PrivateGettable; }
6429 <CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::ProtectedGettable; }
6430 <CSAccessorDecl>"set" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Settable; }
6431 <CSAccessorDecl>"get" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Gettable; }
6432 <CSAccessorDecl>"add" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Addable; }
6433 <CSAccessorDecl>"remove" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Removable; }
6434 <CSAccessorDecl>"raise" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Raisable; }
6435 <CSAccessorDecl>"\"" { BEGIN(CSString);}
6436 <CSAccessorDecl>"." {}
6437 <CSAccessorDecl>\n { lineCount(yyscanner); }
6438 <CSString>"\"" { BEGIN(CSAccessorDecl);}
6439 <CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
6440 <CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
6441 <CSString>\n { lineCount(yyscanner); }
6444 /* ---- Slice-specific rules ------ */
6446 <SliceSequence>{SCOPENAME} {
6447 if (yyextra->current->spec&Entry::Local)
6449 yyextra->current->type = "local ";
6451 yyextra->current->type += "sequence<";
6452 yyextra->current->type += yytext;
6453 yyextra->current->type += ">";
6456 <SliceSequence>{BN}*">"{BN}* {
6457 lineCount(yyscanner);
6458 BEGIN(SliceSequenceName);
6461 <SliceSequenceName>{ID}{BN}* {
6462 lineCount(yyscanner);
6463 yyextra->current->name = yytext ;
6464 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6467 <SliceSequenceName>";" {
6468 yyextra->current->section = Entry::VARIABLE_SEC;
6469 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6470 initEntry(yyscanner);
6474 <SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
6475 lineCount(yyscanner);
6476 if (yyextra->current->spec&Entry::Local)
6478 yyextra->current->type = "local ";
6480 yyextra->current->type += "dictionary<";
6481 yyextra->current->type += yytext;
6482 yyextra->current->type += ">";
6483 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
6486 <SliceDictionary>{BN}*">"{BN}* {
6487 lineCount(yyscanner);
6488 BEGIN(SliceDictionaryName);
6491 <SliceDictionaryName>{ID}{BN}* {
6492 lineCount(yyscanner);
6493 yyextra->current->name = yytext ;
6494 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6497 <SliceDictionaryName>";" {
6498 yyextra->current->section = Entry::VARIABLE_SEC;
6499 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6500 initEntry(yyscanner);
6504 /**********************************************************************************/
6505 /******************** Documentation block related rules ***************************/
6506 /**********************************************************************************/
6508 /* ---- Single line comments ------ */
6509 <DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
6510 int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
6511 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
6512 lineCount(yyscanner);
6514 <DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
6515 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
6516 BEGIN( yyextra->docBlockContext );
6518 <DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
6519 yyextra->docBlock << yytext;
6520 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
6521 BEGIN( yyextra->docBlockContext );
6523 <DocLine>{NONLopt}/"\n" { // whole line
6524 yyextra->docBlock << yytext;
6525 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
6526 BEGIN( yyextra->docBlockContext );
6529 /* ---- Comments blocks ------ */
6531 <DocBlock>"*"*{CCE} { // end of comment block
6532 handleCommentBlock(yyscanner,yyextra->docBlock.str(),FALSE);
6533 BEGIN(yyextra->docBlockContext);
6535 <DocBlock>^{B}*"*"+/[^/] {
6538 indent.fill(' ',computeIndent(yytext,yyextra->column));
6539 yyextra->docBlock << indent;
6541 <DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
6543 indent.fill(' ',computeIndent(yytext,yyextra->column));
6544 yyextra->docBlock << indent;
6546 <DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
6548 <DocBlock>{CPPC} { // slashes in the middle of a comment block
6549 yyextra->docBlock << yytext;
6551 <DocBlock>{CCS} { // start of a new comment in the
6552 // middle of a comment block
6553 yyextra->docBlock << yytext;
6555 <DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
6556 yyextra->docBlock << yytext;
6558 <DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
6559 yyextra->docBlock << yytext;
6560 yyextra->docBlockName=&yytext[1];
6561 if (yyextra->docBlockName.at(1)=='[')
6563 yyextra->docBlockName.at(1)=']';
6565 if (yyextra->docBlockName.at(1)=='{')
6567 yyextra->docBlockName.at(1)='}';
6569 if (yyextra->docBlockName.at(1)=='(')
6571 yyextra->docBlockName.at(1)=')';
6573 yyextra->fencedSize=0;
6574 yyextra->nestedComment=FALSE;
6575 BEGIN(DocCopyBlock);
6577 <DocBlock>{B}*"<"{PRE}">" {
6578 yyextra->docBlock << yytext;
6579 yyextra->docBlockName="<pre>";
6580 yyextra->fencedSize=0;
6581 yyextra->nestedComment=FALSE;
6582 BEGIN(DocCopyBlock);
6584 <DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
6585 yyextra->docBlock << yytext;
6586 yyextra->docBlockName="uml";
6587 yyextra->fencedSize=0;
6588 yyextra->nestedComment=FALSE;
6589 BEGIN(DocCopyBlock);
6591 <DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
6592 yyextra->docBlock << yytext;
6593 yyextra->docBlockName=&yytext[1];
6594 yyextra->fencedSize=0;
6595 yyextra->nestedComment=FALSE;
6596 BEGIN(DocCopyBlock);
6598 <DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
6600 QCString pat = substitute(yytext,"*"," ");
6601 yyextra->docBlock << pat;
6602 yyextra->docBlockName="~~~";
6603 yyextra->fencedSize=pat.stripWhiteSpace().length();
6604 yyextra->nestedComment=FALSE;
6605 BEGIN(DocCopyBlock);
6607 <DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
6608 <DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
6609 <DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
6610 QCString pat = substitute(yytext,"*"," ");
6611 yyextra->docBlock << pat;
6612 yyextra->docBlockName="```";
6613 yyextra->fencedSize=pat.stripWhiteSpace().length();
6614 yyextra->nestedComment=FALSE;
6615 BEGIN(DocCopyBlock);
6617 <DocBlock>{B}*"<code>" {
6618 if (yyextra->insideCS)
6620 yyextra->docBlock << yytext;
6621 yyextra->docBlockName="<code>";
6622 yyextra->nestedComment=FALSE;
6623 BEGIN(DocCopyBlock);
6630 <DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
6631 yyextra->docBlock << yytext;
6633 <DocBlock>\n { // newline
6634 lineCount(yyscanner);
6635 yyextra->docBlock << *yytext;
6637 <DocBlock>. { // command block
6638 yyextra->docBlock << *yytext;
6641 /* ---- Copy verbatim sections ------ */
6643 <DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
6644 yyextra->docBlock << yytext;
6645 if (yyextra->docBlockName=="<pre>")
6650 <DocCopyBlock>"</"{CODE}">" { // end of a <code> block
6651 yyextra->docBlock << yytext;
6652 if (yyextra->docBlockName=="<code>")
6657 <DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
6658 yyextra->docBlock << yytext;
6659 if (yyextra->docBlockName==&yytext[1])
6664 <DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
6665 yyextra->docBlock << yytext;
6666 if (&yytext[4]==yyextra->docBlockName)
6671 <DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
6672 if (yyextra->docBlockName=="verbatim")
6676 else if (yyextra->docBlockName=="code")
6683 indent.fill(' ',computeIndent(yytext,0));
6684 yyextra->docBlock << indent;
6687 <DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
6688 if (yyextra->docBlockName=="code")
6691 indent.fill(' ',computeIndent(yytext,0));
6692 yyextra->docBlock << indent;
6699 <DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
6700 if (yyextra->docBlockName=="code")
6703 indent.fill(' ',computeIndent(yytext,-1));
6704 yyextra->docBlock << indent+"*";
6711 <DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
6712 if (yyextra->docBlockName=="code")
6715 if (yyextra->nestedComment) // keep * it is part of the code
6717 indent.fill(' ',computeIndent(yytext,-1));
6718 yyextra->docBlock << indent+"*";
6720 else // remove * it is part of the comment block
6722 indent.fill(' ',computeIndent(yytext,0));
6723 yyextra->docBlock << indent;
6731 <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
6732 QCString pat = substitute(yytext,"*"," ");
6733 yyextra->docBlock << pat;
6734 if (yyextra->fencedSize==pat.stripWhiteSpace().length())
6739 <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
6740 QCString pat = substitute(yytext,"*"," ");
6741 yyextra->docBlock << pat;
6742 if (yyextra->fencedSize==pat.stripWhiteSpace().length())
6747 <DocCopyBlock>[^<@/\*\]~\$\\\n]+ { // any character that is not special
6748 yyextra->docBlock << yytext;
6750 <DocCopyBlock>{CCS}|{CCE}|{CPPC} {
6753 yyextra->nestedComment=TRUE;
6755 else if (yytext[0]=='*')
6757 yyextra->nestedComment=FALSE;
6759 yyextra->docBlock << yytext;
6761 <DocCopyBlock>\n { // newline
6762 yyextra->docBlock << *yytext;
6763 lineCount(yyscanner);
6765 <DocCopyBlock>. { // any other character
6766 yyextra->docBlock << *yytext;
6768 <DocCopyBlock><<EOF>> {
6769 warn(yyextra->yyFileName,yyextra->yyLineNr,
6770 "reached end of file while inside a '%s' block!\n"
6771 "The command that should end the block seems to be missing!\n",
6772 qPrint(yyextra->docBlockName));
6777 /* ------------- Prototype parser -------------- */
6779 <Prototype>"operator"{B}*"("{B}*")" {
6780 yyextra->current->name+=yytext;
6783 yyextra->current->args+=*yytext;
6784 yyextra->currentArgumentContext = PrototypeQual;
6785 yyextra->fullArgString = yyextra->current->args;
6786 yyextra->copyArgString = &yyextra->current->args;
6787 BEGIN( ReadFuncArgType ) ;
6789 <Prototype>"("({ID}"::")*({B}*[&*])+ {
6790 if (yyextra->insidePHP) // reference parameter
6796 yyextra->current->type+=yyextra->current->name+yytext;
6797 yyextra->current->name.resize(0);
6798 BEGIN( PrototypePtr );
6801 <PrototypePtr>{SCOPENAME} {
6802 yyextra->current->name+=yytext;
6805 yyextra->current->args+=*yytext;
6806 yyextra->currentArgumentContext = PrototypeQual;
6807 yyextra->fullArgString = yyextra->current->args;
6808 yyextra->copyArgString = &yyextra->current->args;
6809 BEGIN( ReadFuncArgType ) ;
6812 yyextra->current->type+=')';
6816 yyextra->current->name+=yytext;
6818 <PrototypeQual>"{" {
6819 BEGIN( PrototypeSkipLine);
6821 <PrototypeQual>{B}*"const"{B}* {
6822 yyextra->current->args += " const ";
6823 yyextra->current->argList.setConstSpecifier(TRUE);
6825 <PrototypeQual>{B}*"volatile"{B}* {
6826 yyextra->current->args += " volatile ";
6827 yyextra->current->argList.setVolatileSpecifier(TRUE);
6829 <PrototypeQual>{B}*"="{B}*"0"{B}* {
6830 yyextra->current->args += " = 0";
6831 yyextra->current->virt = Pure;
6832 yyextra->current->argList.setPureSpecifier(TRUE);
6834 <PrototypeQual>"throw"{B}*"(" {
6835 yyextra->current->exception = "throw(";
6836 BEGIN(PrototypeExc);
6839 yyextra->current->exception += ')';
6840 BEGIN(PrototypeQual);
6843 yyextra->current->exception += *yytext;
6846 yyextra->current->args += *yytext;
6849 yyextra->current->name += *yytext;
6851 <PrototypeSkipLine>. {
6857 <SkipCxxComment>.*"\\\n" { // line continuation
6858 if (yyextra->insideCS)
6864 lineCount(yyscanner);
6867 <SkipCxxComment>{ANYopt}/\n {
6868 BEGIN( yyextra->lastCContext ) ;
6870 <SkipComment>[^\*\n]+
6872 /* ------------ Generic rules -------------- */
6874 <*>"[[" { // C++11 attribute
6875 if (!yyextra->insideCpp) REJECT;
6876 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
6877 yyextra->lastC11AttributeContext = YY_START;
6878 BEGIN( SkipC11Attribute );
6881 <*>\n { lineCount(yyscanner); }
6883 if (yyextra->insideIDL && yyextra->insideCppQuote)
6889 if (!yyextra->insidePHP)
6891 yyextra->lastCContext = YY_START ;
6892 BEGIN( SkipCxxComment ) ;
6895 if (yyextra->insidePHP)
6897 yyextra->lastStringContext=YY_START;
6898 BEGIN(SkipPHPString);
6902 if (yyextra->insidePHP)
6904 yyextra->lastStringContext=YY_START;
6909 if (yyextra->insideCS && (YY_START != SkipRound))
6911 if (yyextra->current->type.isEmpty())
6913 if (yyextra->current->name.isEmpty())
6914 yyextra->current->name="?";
6916 yyextra->current->name+="?";
6920 yyextra->current->type+="?";
6925 <SkipComment>{CPPC}|{CCS}
6926 <*>{CCS} { yyextra->lastCContext = YY_START ;
6927 BEGIN( SkipComment ) ;
6929 <SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
6931 yyextra->lastCContext = YY_START ;
6932 BEGIN( SkipCxxComment ) ;
6936 //----------------------------------------------------------------------------
6937 static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size)
6939 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
6941 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
6943 *buf = yyextra->inputString[yyextra->inputPosition++] ;
6944 //printf("%d (%c)\n",*buf,*buf);
6951 static void initParser(yyscan_t yyscanner)
6953 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
6954 yyextra->outerScopeEntries.clear();
6955 yyextra->baseName.resize(0);
6956 yyextra->protection = Public;
6957 yyextra->baseProt = Public;
6958 yyextra->sharpCount = 0;
6959 yyextra->roundCount = 0;
6960 yyextra->curlyCount = 0;
6961 yyextra->mtype = Method;
6962 yyextra->stat = FALSE;
6963 yyextra->virt = Normal;
6964 yyextra->baseVirt = Normal;
6965 yyextra->isTypedef = FALSE;
6966 yyextra->insideTryBlock = FALSE;
6967 yyextra->insideFormula = FALSE;
6968 yyextra->insideCode=FALSE;
6969 yyextra->insideCli=Config_getBool(CPP_CLI_SUPPORT);
6970 yyextra->previous = 0;
6971 yyextra->firstTypedefEntry.reset();
6972 yyextra->memspecEntry.reset();
6975 static void initEntry(yyscan_t yyscanner)
6977 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
6978 if (yyextra->insideJava)
6980 yyextra->protection = (yyextra->current_root->spec & (Entry::Interface|Entry::Enum)) ? Public : Package;
6982 yyextra->current->protection = yyextra->protection ;
6983 yyextra->current->mtype = yyextra->mtype;
6984 yyextra->current->virt = yyextra->virt;
6985 yyextra->current->stat = yyextra->stat;
6986 yyextra->current->lang = yyextra->language;
6987 //printf("*** initEntry(yyscanner) yyextra->language=%d\n",yyextra->language);
6988 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
6989 yyextra->isTypedef=FALSE;
6993 //-----------------------------------------------------------------------------
6995 static void lineCount(yyscan_t yyscanner)
6997 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
6998 int tabSize = Config_getInt(TAB_SIZE);
7000 for (p = yytext ; *p ; ++p )
7004 yyextra->yyLineNr++,yyextra->column=0,yyextra->yyColNr=1;
7008 yyextra->column+=tabSize - (yyextra->column%tabSize);
7012 yyextra->column++,yyextra->yyColNr++;
7015 //printf("lineCount()=%d\n",yyextra->column);
7018 static inline int computeIndent(const char *s,int startIndent)
7020 int col=startIndent;
7021 int tabSize=Config_getInt(TAB_SIZE);
7026 if (c=='\t') col+=tabSize-(col%tabSize);
7027 else if (c=='\n') col=0;
7033 static void addType(yyscan_t yyscanner)
7035 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7036 uint tl=yyextra->current->type.length();
7037 if( tl>0 && !yyextra->current->name.isEmpty() && yyextra->current->type.at(tl-1)!='.')
7039 yyextra->current->type += ' ' ;
7041 yyextra->current->type += yyextra->current->name;
7042 yyextra->current->name.resize(0) ;
7043 tl=yyextra->current->type.length();
7044 if( tl>0 && !yyextra->current->args.isEmpty() && yyextra->current->type.at(tl-1)!='.')
7046 yyextra->current->type += ' ' ;
7048 yyextra->current->type += yyextra->current->args ;
7049 yyextra->current->args.resize(0) ;
7050 yyextra->current->argList.clear();
7054 static QCString stripQuotes(const char *s)
7057 if (s==0 || *s==0) return name;
7059 if (name.at(0)=='"' && name.at(name.length()-1)=='"')
7061 name=name.mid(1,name.length()-2);
7066 //-----------------------------------------------------------------
7068 static bool nameIsOperator(QCString &name)
7070 int i=name.find("operator");
7071 if (i==-1) return FALSE;
7072 if (i==0 && !isId(name.at(8))) return TRUE; // case operator ::X
7073 if (i>0 && !isId(name.at(i-1)) && !isId(name.at(i+8))) return TRUE; // case X::operator
7074 return FALSE; // case TEXToperatorTEXT
7077 //-----------------------------------------------------------------------------
7079 static void setContext(yyscan_t yyscanner)
7081 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7082 yyextra->language = getLanguageFromFileName(yyextra->yyFileName);
7083 yyextra->insideIDL = yyextra->language==SrcLangExt_IDL;
7084 yyextra->insideJava = yyextra->language==SrcLangExt_Java;
7085 yyextra->insideCS = yyextra->language==SrcLangExt_CSharp;
7086 yyextra->insideD = yyextra->language==SrcLangExt_D;
7087 yyextra->insidePHP = yyextra->language==SrcLangExt_PHP;
7088 yyextra->insideObjC = yyextra->language==SrcLangExt_ObjC;
7089 yyextra->insideJS = yyextra->language==SrcLangExt_JS;
7090 yyextra->insideSlice = yyextra->language==SrcLangExt_Slice;
7091 yyextra->insideCpp = (yyextra->language==SrcLangExt_Cpp ||
7092 yyextra->language==SrcLangExt_Lex);
7093 //printf("setContext(%s) yyextra->insideIDL=%d yyextra->insideJava=%d yyextra->insideCS=%d "
7094 // "yyextra->insideD=%d yyextra->insidePHP=%d yyextra->insideObjC=%d\n",
7095 // qPrint(yyextra->yyFileName),yyextra->insideIDL,yyextra->insideJava,yyextra->insideCS,yyextra->insideD,yyextra->insidePHP,yyextra->insideObjC
7099 //-----------------------------------------------------------------------------
7101 static void prependScope(yyscan_t yyscanner)
7103 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7104 if (yyextra->current_root->section & Entry::SCOPE_MASK)
7106 //printf("--- prependScope %s to %s\n",qPrint(yyextra->current_root->name),qPrint(yyextra->current->name));
7107 yyextra->current->name.prepend(yyextra->current_root->name+"::");
7108 //printf("prependScope #=%d #yyextra->current=%d\n",yyextra->current_root->tArgLists->count(),yyextra->current->tArgLists->count());
7109 for (const ArgumentList &srcAl : yyextra->current_root->tArgLists)
7111 yyextra->current->tArgLists.insert(yyextra->current->tArgLists.begin(),srcAl);
7116 //-----------------------------------------------------------------------------
7118 /*! Returns TRUE iff the yyextra->current entry could be a K&R style C function */
7119 static bool checkForKnRstyleC(yyscan_t yyscanner)
7121 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7122 if (((QCString)yyextra->yyFileName).right(2).lower()!=".c") return FALSE; // must be a C file
7123 if (yyextra->current->argList.empty()) return FALSE; // must have arguments
7124 for (const Argument &a : yyextra->current->argList)
7126 // in K&R style argument do not have a type, but doxygen expects a type
7127 // so it will think the argument has no name
7128 if (a.type.isEmpty() || !a.name.isEmpty()) return FALSE;
7133 //-----------------------------------------------------------------------------
7135 static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &oldStyleArgName)
7137 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7138 int si = yyextra->current->args.length();
7139 if (yyextra->oldStyleArgType.isEmpty()) // new argument
7141 std::string args = yyextra->current->args.str();
7142 static const reg::Ex re(R"(\([^)]*\).*)"); // find first (...)
7146 if (reg::search(args,match,re))
7148 bi1=(int)match.position();
7149 size_t secondMatchStart = match.position()+match.length(); // search again after first match
7150 if (reg::search(args,match,re,secondMatchStart))
7152 bi2=(int)match.position();
7156 if (bi1!=-1 && bi2!=-1) // found something like "int (*func)(int arg)"
7158 int s=bi2+1; // keep opening (
7159 yyextra->oldStyleArgType = yyextra->current->args.left(s);
7161 while (i<si && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i++;
7162 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
7164 while (i<si && isId(yyextra->current->args.at(i))) i++;
7165 oldStyleArgName = yyextra->current->args.mid(s,i-s);
7166 yyextra->oldStyleArgType+=yyextra->current->args.mid(i);
7168 else if (bi1!=-1) // redundant braces like in "int (*var)"
7170 int s=bi1; // strip opening (
7171 yyextra->oldStyleArgType = yyextra->current->args.left(s);
7174 while (i<si && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i++;
7175 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
7177 while (i<si && isId(yyextra->current->args.at(i))) i++;
7178 oldStyleArgName = yyextra->current->args.mid(s,i-s);
7180 else // normal "int *var"
7183 // look for start of name in "type *name"
7184 while (i>=0 && isId(yyextra->current->args.at(i))) i--;
7186 // look for start of *'s
7187 while (i>=0 && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i--;
7191 yyextra->oldStyleArgType=yyextra->current->args.left(i);
7192 oldStyleArgPtr=yyextra->current->args.mid(i,j-i);
7193 oldStyleArgName=yyextra->current->args.mid(j).stripWhiteSpace();
7197 oldStyleArgName=yyextra->current->args.stripWhiteSpace();
7201 else // continuation like *arg2 in "int *args,*arg2"
7205 while (j<l && ((c=yyextra->current->args.at(j))=='*' || isspace((uchar)c))) j++;
7208 oldStyleArgPtr=yyextra->current->args.left(j);
7209 oldStyleArgName=yyextra->current->args.mid(j).stripWhiteSpace();
7213 oldStyleArgName=yyextra->current->args.stripWhiteSpace();
7218 //-----------------------------------------------------------------------------
7220 /*! Update the argument \a name with additional \a type info. For K&R style
7221 * function the type is found \e after the argument list, so this routine
7222 * in needed to fix up.
7224 static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString &name,
7225 const QCString &brief,const QCString &docs)
7227 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7228 for (Argument &a : yyextra->current->argList)
7232 a.type=type.stripWhiteSpace();
7233 if (a.type.left(9)=="register ") // strip keyword
7235 a.type=a.type.mid(9);
7237 a.name=name.stripWhiteSpace();
7238 if (!brief.isEmpty() && !docs.isEmpty())
7240 a.docs=brief+"\n\n"+docs;
7242 else if (!brief.isEmpty())
7254 //-----------------------------------------------------------------------------
7257 void fixArgumentListForJavaScript(ArgumentList &al)
7259 for (Argument &a : al)
7261 if (!a.type.isEmpty() && a.name.isEmpty())
7262 { // a->type is actually the (typeless) parameter name, so move it
7270 static void startCommentBlock(yyscan_t yyscanner,bool brief)
7272 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7275 yyextra->current->briefFile = yyextra->yyFileName;
7276 yyextra->current->briefLine = yyextra->yyLineNr;
7280 yyextra->current->docFile = yyextra->yyFileName;
7281 yyextra->current->docLine = yyextra->yyLineNr;
7285 //----------------------------------------------------------------------------
7287 static void newEntry(yyscan_t yyscanner)
7289 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7290 if (yyextra->tempEntry==0) // if temp entry is not 0, it holds yyextra->current,
7291 // and yyextra->current is actually replaced by yyextra->previous which was
7292 // already added to yyextra->current_root, so we should not add it again
7295 yyextra->previous = yyextra->current;
7296 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7300 yyextra->previous = yyextra->current;
7301 yyextra->current = yyextra->tempEntry;
7302 yyextra->tempEntry.reset();
7304 initEntry(yyscanner);
7307 static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief)
7309 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7310 bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
7311 if (yyextra->docBlockInBody && hideInBodyDocs) return;
7312 //printf("parseCommentBlock [%s] brief=%d\n",qPrint(doc),brief);
7313 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine; // line of block start
7315 // fill in inbodyFile && inbodyLine the first time, see bug 633891
7316 std::shared_ptr<Entry> docEntry = yyextra->docBlockInBody && yyextra->previous ? yyextra->previous : yyextra->current;
7317 if (yyextra->docBlockInBody && docEntry && docEntry->inbodyLine==-1)
7319 docEntry->inbodyFile = yyextra->yyFileName;
7320 docEntry->inbodyLine = lineNr;
7324 bool needsEntry=FALSE;
7325 Markdown markdown(yyextra->yyFileName,lineNr);
7326 QCString strippedDoc = stripIndentation(doc);
7327 QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(strippedDoc,lineNr) : strippedDoc;
7328 while (yyextra->commentScanner.parseCommentBlock(
7329 yyextra->thisParser,
7330 yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(),
7331 processedDoc, // text
7332 yyextra->yyFileName, // file
7333 lineNr, // line of block start
7334 yyextra->docBlockInBody ? FALSE : brief, // isBrief
7335 yyextra->docBlockInBody ? FALSE : yyextra->docBlockAutoBrief, // isJavaDocStyle
7336 yyextra->docBlockInBody, // isInBody
7337 yyextra->protection,
7340 Config_getBool(MARKDOWN_SUPPORT)
7344 //printf("parseCommentBlock position=%d [%s]\n",position,qPrint(doc)+position);
7347 QCString docFile = yyextra->current->docFile;
7348 newEntry(yyscanner);
7349 yyextra->current->docFile = docFile;
7350 yyextra->current->docLine = lineNr;
7355 newEntry(yyscanner);
7358 if (yyextra->docBlockTerm)
7360 unput(yyextra->docBlockTerm);
7361 yyextra->docBlockTerm=0;
7365 static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
7367 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7368 //printf(">>>>>>> handleParametersCommentBlocks()\n");
7369 for (Argument &a : al)
7371 //printf(" Param %s docs=%s\n",qPrint(a->name),qPrint(a->docs));
7372 if (!a.docs.isEmpty())
7374 if (a.name.isEmpty() && a.type == "...") a.name= "...";
7379 QCString orgDoc = yyextra->current->doc;
7380 QCString orgBrief = yyextra->current->brief;
7381 int orgDocLine = yyextra->current->docLine;
7382 int orgBriefLine = yyextra->current->briefLine;
7384 yyextra->current->doc.resize(0);
7385 yyextra->current->brief.resize(0);
7387 //printf("handleParametersCommentBlock [%s]\n",qPrint(doc));
7388 while (yyextra->commentScanner.parseCommentBlock(
7389 yyextra->thisParser,
7390 yyextra->current.get(),
7392 yyextra->yyFileName, // file
7393 yyextra->current->docLine, // line of block start
7397 yyextra->protection,
7400 Config_getBool(MARKDOWN_SUPPORT)
7404 //printf("handleParametersCommentBlock position=%d [%s]\n",position,qPrint(doc)+position);
7405 if (needsEntry) newEntry(yyscanner);
7409 newEntry(yyscanner);
7411 a.docs = yyextra->current->doc;
7414 yyextra->current->doc = orgDoc;
7415 yyextra->current->brief = orgBrief;
7416 yyextra->current->docLine = orgDocLine;
7417 yyextra->current->briefLine = orgBriefLine;
7423 //----------------------------------------------------------------------------
7425 static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
7427 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7428 //printf("parseCompounds(%s)\n",qPrint(rt->name));
7429 for (const auto &ce : rt->children())
7431 if (!ce->program.empty())
7433 //printf("-- %s ---------\n%s\n---------------\n",
7434 // qPrint(ce->name),qPrint(ce->program));
7435 // init scanner state
7436 yyextra->padCount=0;
7439 yyextra->programStr = ce->program.str();
7440 yyextra->inputString = yyextra->programStr.data();
7441 yyextra->inputPosition = 0;
7442 if (ce->section==Entry::ENUM_SEC || (ce->spec&Entry::Enum))
7443 BEGIN( FindFields ) ;
7445 BEGIN( FindMembers ) ;
7446 yyextra->current_root = ce;
7447 yyextra->yyFileName = ce->fileName;
7449 yyextra->yyLineNr = ce->bodyLine;
7450 yyextra->yyColNr = ce->bodyColumn;
7451 yyextra->insideObjC = ce->lang==SrcLangExt_ObjC;
7452 //printf("---> Inner block starts at line %d objC=%d\n",yyextra->yyLineNr,yyextra->insideObjC);
7453 yyextra->current = std::make_shared<Entry>();
7454 yyextra->stat = FALSE;
7455 initEntry(yyscanner);
7457 // deep copy group list from parent (see bug 727732)
7458 bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
7459 if (autoGroupNested && !rt->groups.empty() && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
7461 ce->groups = rt->groups;
7464 int ni=ce->name.findRev("::"); if (ni==-1) ni=0; else ni+=2;
7465 // set default protection based on the compound type
7466 if( ce->section==Entry::CLASS_SEC ) // class
7468 if (yyextra->insidePHP || yyextra->insideD || yyextra->insideJS || yyextra->insideIDL || yyextra->insideSlice)
7470 yyextra->current->protection = yyextra->protection = Public ;
7472 else if (yyextra->insideJava)
7474 yyextra->current->protection = yyextra->protection = (ce->spec & (Entry::Interface|Entry::Enum)) ? Public : Package;
7476 else if (ce->spec&(Entry::Interface | Entry::Ref | Entry::Value | Entry::Struct | Entry::Union))
7478 if (ce->lang==SrcLangExt_ObjC)
7480 yyextra->current->protection = yyextra->protection = Protected ;
7484 yyextra->current->protection = yyextra->protection = Public ;
7489 yyextra->current->protection = yyextra->protection = Private ;
7492 else if (ce->section == Entry::ENUM_SEC ) // enum
7494 yyextra->current->protection = yyextra->protection = ce->protection;
7496 else if (!ce->name.isEmpty() && ce->name.at(ni)=='@') // unnamed union or namespace
7498 if (ce->section == Entry::NAMESPACE_SEC ) // unnamed namespace
7500 yyextra->current->stat = yyextra->stat = TRUE;
7502 yyextra->current->protection = yyextra->protection = ce->protection;
7504 else // named struct, union, protocol, category
7506 yyextra->current->protection = yyextra->protection = Public ;
7508 yyextra->mtype = Method;
7509 yyextra->virt = Normal;
7510 //printf("name=%s yyextra->current->stat=%d yyextra->stat=%d\n",qPrint(ce->name),yyextra->current->stat,yyextra->stat);
7512 //memberGroupId = DOX_NOGROUP;
7513 //memberGroupRelates.resize(0);
7514 //memberGroupInside.resize(0);
7515 QCString name = ce->name;
7516 yyextra->commentScanner.enterCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
7518 scannerYYlex(yyscanner);
7519 yyextra->lexInit=TRUE;
7522 yyextra->commentScanner.leaveCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
7524 yyextra->programStr.resize(0);
7525 ce->program.str(std::string());
7530 // warn(yyextra->yyFileName,yyextra->yyLineNr,"Documentation block ended in the middle of a conditional section!");
7533 parseCompounds(yyscanner,ce);
7537 //----------------------------------------------------------------------------
7539 static void parseMain(yyscan_t yyscanner,
7540 const QCString &fileName,
7541 const char *fileBuf,
7542 const std::shared_ptr<Entry> &rt,
7543 ClangTUParser *clangParser)
7545 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7546 initParser(yyscanner);
7548 yyextra->inputString = fileBuf;
7549 yyextra->inputPosition = 0;
7550 yyextra->column = 0;
7551 scannerYYrestart(0,yyscanner);
7554 yyextra->protection = Public;
7555 yyextra->mtype = Method;
7556 yyextra->stat = FALSE;
7557 yyextra->virt = Normal;
7558 yyextra->current_root = rt;
7559 yyextra->yyLineNr = 1 ;
7560 yyextra->yyBegLineNr = 1;
7561 yyextra->yyBegColNr = 0;
7562 yyextra->yyFileName = fileName;
7563 yyextra->clangParser = clangParser;
7564 setContext(yyscanner);
7565 rt->lang = yyextra->language;
7566 msg("Parsing file %s...\n",qPrint(yyextra->yyFileName));
7568 yyextra->current_root = rt;
7569 initParser(yyscanner);
7570 yyextra->commentScanner.enterFile(yyextra->yyFileName,yyextra->yyLineNr);
7571 yyextra->current = std::make_shared<Entry>();
7572 //printf("yyextra->current=%p yyextra->current_root=%p\n",yyextra->current,yyextra->current_root);
7573 int sec=guessSection(yyextra->yyFileName);
7576 yyextra->current->name = yyextra->yyFileName;
7577 yyextra->current->section = sec;
7578 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7580 yyextra->current->reset();
7581 initEntry(yyscanner);
7582 if ( yyextra->insidePHP )
7584 BEGIN( FindMembersPHP );
7586 else if ( yyextra->insideJava ) // add default java.lang package scope
7588 yyextra->current->name="java::lang"; // '::' is used in doxygen's internal representation as a scope separator
7589 yyextra->current->fileName = yyextra->yyFileName;
7590 yyextra->current->section=Entry::USINGDIR_SEC;
7591 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7592 initEntry(yyscanner);
7593 BEGIN( FindMembers );
7597 BEGIN( FindMembers );
7600 scannerYYlex(yyscanner);
7601 yyextra->lexInit=TRUE;
7603 if (YY_START==Comment)
7605 warn(yyextra->yyFileName,yyextra->yyLineNr,"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
7609 yyextra->commentScanner.leaveFile(yyextra->yyFileName,yyextra->yyLineNr);
7611 yyextra->programStr.resize(0);
7612 rt->program.str(std::string());
7614 parseCompounds(yyscanner,rt);
7618 // add additional entries that were created during processing
7619 for (auto &kv: yyextra->outerScopeEntries)
7621 //printf(">>> adding '%s' to scope '%s'\n",qPrint(kv.second->name),qPrint(kv.first->name));
7622 kv.first->moveToSubEntryAndKeep(kv.second);
7624 yyextra->outerScopeEntries.clear();
7628 //----------------------------------------------------------------------------
7630 static void parsePrototype(yyscan_t yyscanner,const QCString &text)
7632 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
7633 //printf("**** parsePrototype(%s) begin\n",qPrint(text));
7636 warn(yyextra->yyFileName,yyextra->yyLineNr,"Empty prototype found!");
7639 if (!yyextra->current) // nothing to store (see bug683516)
7644 const char *orgInputString;
7645 int orgInputPosition;
7646 YY_BUFFER_STATE orgState;
7648 // save scanner state
7649 orgState = YY_CURRENT_BUFFER;
7650 yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner), yyscanner);
7651 orgInputString = yyextra->inputString;
7652 orgInputPosition = yyextra->inputPosition;
7655 yyextra->inputString = text.data();
7656 yyextra->inputPosition = 0;
7657 yyextra->column = 0;
7658 scannerYYrestart(0, yyscanner);
7660 scannerYYlex(yyscanner);
7661 yyextra->lexInit=TRUE;
7663 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7664 if (yyextra->current->section == Entry::MEMBERDOC_SEC && yyextra->current->args.isEmpty())
7665 yyextra->current->section = Entry::VARIABLEDOC_SEC;
7667 // restore original scanner state
7668 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
7669 yy_switch_to_buffer(orgState, yyscanner);
7670 yyextra->inputString = orgInputString;
7671 yyextra->inputPosition = orgInputPosition;
7674 //printf("**** parsePrototype end\n");
7677 //static void handleGroupStartCommand(const char *header)
7679 // memberGroupHeader=header;
7680 // startGroupInDoc();
7683 //static void handleGroupEndCommand()
7689 //----------------------------------------------------------------------------
7691 struct COutlineParser::Private
7694 scannerYY_state state;
7697 COutlineParser::COutlineParser() : p(std::make_unique<COutlineParser::Private>())
7699 scannerYYlex_init_extra(&p->state,&p->yyscanner);
7701 scannerYYset_debug(1,p->yyscanner);
7705 COutlineParser::~COutlineParser()
7707 scannerYYlex_destroy(p->yyscanner);
7710 void COutlineParser::parseInput(const QCString &fileName,
7711 const char *fileBuf,
7712 const std::shared_ptr<Entry> &root,
7713 ClangTUParser *clangParser)
7715 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
7716 yyextra->thisParser = this;
7718 printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
7720 ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
7722 printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
7726 bool COutlineParser::needsPreprocessing(const QCString &extension) const
7728 QCString fe=extension.lower();
7729 SrcLangExt lang = getLanguageFromFileName(extension);
7730 return (SrcLangExt_Cpp == lang) || (SrcLangExt_Lex == lang) ||
7731 !( fe==".java" || fe==".as" || fe==".d" || fe==".php" ||
7732 fe==".php4" || fe==".inc" || fe==".phtml"|| fe==".php5"
7736 void COutlineParser::parsePrototype(const QCString &text)
7738 ::parsePrototype(p->yyscanner,text);
7741 //----------------------------------------------------------------------------
7743 #if USE_STATE2STRING
7744 #include "scanner.l.h"