15%option never-interactive
16%option prefix="scannerYY"
18%option extra-type="struct scannerYY_state *"
22#define YY_TYPEDEF_YY_SCANNER_T
64#define YY_NO_UNISTD_H 1
232static inline size_t computeIndent(
const char *s,
size_t startIndent);
264#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
This class represents an function or template argument list.
Clang parser object for a single translation unit, which consists of a source file and the directly o...
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Abstract interface for outline parsers.
Text streaming class that buffers data.
static const char * getLexerFILE()
#define lineCount(s, len)
static DString generateAnonymousAnchor(const DString &fileName, int count)
static void startVerbatimBlock(yyscan_t yyscanner, const DString &blockName, size_t fencedSize=0, bool codeBlock=false)
static void storeClangId(yyscan_t yyscanner, const char *id)
static bool endVerbatimBlock(yyscan_t yyscanner, const DString &blockName, size_t fencedSize=0)
static void startCommentBlock(yyscan_t yyscanner, bool)
static void setContext(yyscan_t yyscanner)
static bool startOfRequiresExpression(const DString &req)
static void initParser(yyscan_t yyscanner)
static DString stripFuncPtr(const DString &type)
static bool checkForKnRstyleC(yyscan_t yyscanner)
static void addKnRArgInfo(yyscan_t yyscanner, const DString &type, const DString &name, const DString &brief, const DString &docs)
static void initMethodProtection(yyscan_t yyscanner, Protection prot)
static const char * stateToString(int state)
void fixArgumentListForJavaScript(ArgumentList &al)
static void splitKnRArg(yyscan_t yyscanner, DString &oldStyleArgPtr, DString &oldStyleArgName)
static bool nameIsOperator(DString &name)
static void handleParametersCommentBlocks(yyscan_t yyscanner, ArgumentList &al)
static void prependScope(yyscan_t yyscanner)
static void setJavaProtection(yyscan_t yyscanner)
static void addType(yyscan_t yyscanner)
static DString stripQuotes(const char *s)
static size_t computeIndent(const char *s, size_t startIndent)
static void handleCommentBlock(yyscan_t yyscanner, const DString &doc, bool brief)
static void initEntry(yyscan_t yyscanner)
Some helper functions for std::string.
TextStream * pSkipInterpString
EntryRelations outerScopeEntries
int lastCopyArgStringContext
std::shared_ptr< Entry > firstTypedefEntry
int lastDeprecatedContext
bool insideJS
processing JavaScript code?
OutlineParserInterface * thisParser
std::shared_ptr< Entry > tempEntry
std::shared_ptr< Entry > memspecEntry
TextStream * pCopySquareGString
int lastInitializerContext
std::shared_ptr< Entry > previous
int lastPreLineCtrlContext
ClangTUParser * clangParser
bool insideCS
processing C# code?
ArgumentList * currentArgumentList
DString * pCopyC11AttributeString
TextStream * pCopyCurlyGString
int lastCommentInArgContext
DString * pCopyRoundString
int lastSkipInterpVerbStringContext
TextStream * pSkipVerbString
std::pair< Entry *, std::shared_ptr< Entry > > EntryRelation
int lastC11AttributeContext
DString * pCopyCurlyString
bool insidePHP
processing PHP code?
std::shared_ptr< Entry > current_root
CommentScanner commentScanner
bool insideIDL
processing IDL code?
bool insideSlice
processing Slice code?
TextStream * pCopyHereDocGString
bool insideObjC
processing Objective C code?
bool insideCli
processing C++/CLI code?
int currentArgumentContext
DString * pCopySharpString
DString * pCopyQuotedString
int lastSkipVerbStringContext
TextStream * pCopyRawGString
TextStream * pCopyQuotedGString
TextStream * pSkipInterpVerbString
std::shared_ptr< Entry > current
int lastSkipInterpStringContext
bool insideD
processing D code?
std::vector< EntryRelation > EntryRelations
TextStream * pCopyRoundGString
bool insideCpp
processing C/C++ code
TextStream dummyTextStream
int lastClassTemplSpecContext
bool insideJava
processing Java code?
A bunch of utility functions.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
279NOTopt (("!"{BNopt})|("not"{BN}+))?
281HEXDIGIT ({DIGIT}|[a-f]|[A-F])
282ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
283SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
284TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
285CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID})
288CHARLIT (("'"\\x[0-9a-fA-F]{1,2}"'")|("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
289PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
290PHPUSEKW ("public"|"private"|"protected")
291IDLATTR ("["[^\]]*"]"){BN}*
292TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
293RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
294RAWEND ")"[^ \t\(\)\\]{0,16}\"
295ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
296ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
297LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>"
298BITOP "&"|"|"|"^"|"<<"|">>"|"~"
299OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
300FUNCOP "operator"("()"|"[]"|{B}+[^;\n]+)
301MODULE_ID ({ID}".")*{ID}
302LINENR {B}*[1-9][0-9]*
303FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
304FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
305FILECHARS {FILEICHAR}*{FILEECHAR}+
306HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
307VFILEMASK {FILECHARS}("."{FILECHARS})*
308FILEMASK {VFILEMASK}|{HFILEMASK}
319DCOMMC ("/\*!"|"/\**")
321DCOMMCPP ("/\/!"|"/\/\/")
323DCOMM {DCOMMC}|{DCOMMCPP}
394%x TryFunctionBlockEnd
409%x SkipInterpVerbString
424%x UNOIDLAttributeBlock
454%x SpecializationSingleQuote
455%x SpecializationDoubleQuote
488%x SliceDictionaryName
519<*>"DEPRECATED_ATTRIBUTE" {
520 if (!yyextra->insideObjC) REJECT;
522<*>"DEPRECATED_MSG_ATTRIBUTE(\"" {
523 if (!yyextra->insideObjC) REJECT;
524 yyextra->lastDeprecatedContext=YY_START;
525 yyextra->lastStringContext=Deprecated_round;
528<Deprecated_round>")" {
529 BEGIN(yyextra->lastDeprecatedContext);
531<Deprecated_round>{BNopt} {
534<Deprecated_round>. { }
536 yyextra->curlyCount=0;
537 yyextra->needsSemi =
true;
538 BEGIN(SkipCurlyBlock);
541 yyextra->roundCount=0;
542 BEGIN(SkipRoundBlock);
545 ++yyextra->roundCount;
548 if (yyextra->roundCount )
549 --yyextra->roundCount ;
554 ++yyextra->curlyCount ;
557 if( yyextra->curlyCount )
559 --yyextra->curlyCount ;
561 else if (yyextra->needsSemi)
567 BEGIN( FindMembers );
571 if (yyextra->insidePHP)
573 yyextra->lastStringContext=NextSemi;
574 BEGIN(SkipPHPString);
577<NextSemi>{CHARLIT} {
if (yyextra->insidePHP) REJECT; }
579 yyextra->lastStringContext=NextSemi;
584 BEGIN( FindMembers );
588 BEGIN( FindMembers );
591 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
595<FindMembers>"<?php" {
596 yyextra->insidePHP =
true;
598<FindMembersPHP>"<?"("php"?) {
599 BEGIN( FindMembers );
601<FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" {
603 BEGIN( FindMembers );
605<FindMembers>"?>"|"</script>" {
606 if (yyextra->insidePHP)
607 BEGIN( FindMembersPHP );
611<FindMembersPHP>[^\n<]+ {
618<FindMembers>{PHPKW} {
if (yyextra->insidePHP)
623<FindMembers>"%{"[^\n]* {
624 if (!yyextra->insideIDL)
628 if (!yyextra->insideIDL)
631<FindMembers>{B}*("properties"){BN}*":"{BN}* {
633 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
636<FindMembers>{B}*"k_dcop"{BN}*":"{BN}* {
638 yyextra->current->mtype = yyextra->mtype = MethodTypes::DCOP;
641<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* {
643 yyextra->current->mtype = yyextra->mtype = MethodTypes::Signal;
646<FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
648 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
651<FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
653 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
656<FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
658 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
660<FindMembers>{B}*("public"|"methods"|"__published"){BN}*":"{BN}* {
663<FindMembers>{B}*"internal"{BN}*":"{BN}* {
664 if (yyextra->insideCli)
673<FindMembers>{B}*"protected"{BN}*":"{BN}* {
676<FindMembers>{B}*"private"{BN}*":"{BN}* {
679<FindMembers>{B}*"public"/({BN}|{CCS}|{CPPC}) {
680 if (!yyextra->insideCpp) REJECT;
684<FindMembers>{B}*"protected"/({BN}|{CCS}|{CPPC}) {
685 if (!yyextra->insideCpp) REJECT;
689<FindMembers>{B}*"private"/({BN}|{CCS}|{CPPC}) {
690 if (!yyextra->insideCpp) REJECT;
702<CppProt>{CPPC}.*\n {
lineCount(yyscanner); }
703<CppProt>{CCS} { yyextra->lastCContext = YY_START ;
704 BEGIN( SkipComment ) ;
706<CppProt>("slots"|"Q_SLOTS") {
707 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
709<FindMembers>{B}*"event"{BN}+ {
710 if (yyextra->insideCli)
714 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
715 yyextra->current->bodyLine = yyextra->yyLineNr;
716 yyextra->current->bodyColumn = yyextra->yyColNr;
717 yyextra->curlyCount=0;
718 BEGIN( CliPropertyType );
720 else if (yyextra->insideCS)
723 yyextra->current->mtype = MethodTypes::Event;
724 yyextra->current->bodyLine = yyextra->yyLineNr;
725 yyextra->current->bodyColumn = yyextra->yyColNr;
732<FindMembers>{B}*"property"{BN}+ {
733 if (yyextra->insideCli)
737 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
738 yyextra->current->bodyLine = yyextra->yyLineNr;
739 yyextra->current->bodyColumn = yyextra->yyColNr;
740 yyextra->curlyCount=0;
741 BEGIN( CliPropertyType );
748<CliPropertyType>{ID} {
750 yyextra->current->name = yytext;
752<CliPropertyType>"[" {
753 yyextra->current->args =
"[";
754 BEGIN( CliPropertyIndex );
756<CliPropertyType>"{" {
757 yyextra->curlyCount=0;
759 BEGIN( CSAccessorDecl );
761<CliPropertyType>";" {
763 BEGIN( FindMembers );
768<CliPropertyType>{B}* {
772 yyextra->current->type += yytext;
774<CliPropertyIndex>"]" {
775 BEGIN( CliPropertyType );
776 yyextra->current->args+=yytext;
779 yyextra->current->args+=yytext;
794<FindMembers>{B}*"@private"{BN}+ {
797<FindMembers>{B}*"@protected"{BN}+ {
800<FindMembers>{B}*"@public"{BN}+ {
803<FindMembers>[\-+]{BN}* {
804 if (!yyextra->insideObjC)
810 yyextra->current->fileName = yyextra->fileName;
811 yyextra->current->startLine = yyextra->yyLineNr;
812 yyextra->current->startColumn = yyextra->yyColNr;
813 yyextra->current->bodyLine = yyextra->yyLineNr;
814 yyextra->current->bodyColumn = yyextra->yyColNr;
815 yyextra->current->section = EntryType::makeFunction();
816 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
817 yyextra->insideObjC =
true;
818 yyextra->yyBegColNr = yyextra->yyColNr;
819 yyextra->yyBegLineNr = yyextra->yyLineNr;
820 yyextra->current->virt = Specifier::Virtual;
822 yyextra->current->isStatic=yytext[0]==
'+';
828 BEGIN( ObjCReturnType );
829 yyextra->current->type.clear();
830 yyextra->roundCount=0;
833 if (yyextra->current->type.empty())
835 yyextra->current->type +=
"id";
837 yyextra->current->name = yytext;
841 yyextra->current->name +=
':';
843 yyextra->current->argList.push_back(a);
This class contains the information about the argument of a function or template.
846<ObjCReturnType>[^()]* {
847 yyextra->current->type += yytext;
849<ObjCReturnType>"(^)(" {
850 yyextra->current->type += yytext;
851 yyextra->roundCount++;
854 yyextra->current->type += yytext;
855 yyextra->roundCount++;
858 if (yyextra->roundCount<=0)
864 yyextra->current->type += yytext;
865 yyextra->roundCount--;
868<ObjCParams>({ID})?{BN}*":" {
873 yyextra->current->name +=
" :";
877 yyextra->current->name += keyw+
":";
879 if (yyextra->current->argList.back().type.empty())
881 yyextra->current->argList.back().type=
"id";
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
887<ObjCParams>{ID}{BN}* {
889 yyextra->current->argList.back().name=
DString(yytext).stripWhiteSpace();
891<ObjCParams>","{BN}*"..." {
906 yyextra->roundCount=0;
907 yyextra->current->argList.back().type.clear();
908 BEGIN( ObjCParamType );
911 yyextra->roundCount++;
912 yyextra->current->argList.back().type+=yytext;
914<ObjCParamType>")"/{B}* {
915 if (yyextra->roundCount<=0)
921 yyextra->current->argList.back().type+=yytext;
922 yyextra->roundCount--;
925<ObjCParamType>[^()]* {
926 yyextra->current->argList.back().type+=
DString(yytext).stripWhiteSpace();
928<ObjCMethod,ObjCParams>";" {
929 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.empty())
931 yyextra->current->argList.back().type=
"id";
933 if (yyextra->current->argList.empty())
935 yyextra->current->argList.setNoParameters(
true);
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
942<ObjCMethod,ObjCParams>(";"{BN}+)?"{" {
947 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.empty())
949 yyextra->current->argList.back().type=
"id";
951 if (yyextra->current->argList.empty())
953 yyextra->current->argList.setNoParameters(
true);
959<FindMembers>{B}*"sequence"{BN}*"<"{BN}* {
960 if (yyextra->insideSlice)
963 yyextra->current->bodyLine = yyextra->yyLineNr;
964 yyextra->current->bodyColumn = yyextra->yyColNr;
965 yyextra->current->fileName = yyextra->fileName ;
966 yyextra->current->startLine = yyextra->yyLineNr ;
967 yyextra->current->startColumn = yyextra->yyColNr;
968 yyextra->current->args.clear();
969 yyextra->current->section = EntryType::makeTypedef();
970 yyextra->isTypedef =
true;
971 BEGIN( SliceSequence );
976<FindMembers>{B}*"dictionary"{BN}*"<"{BN}* {
977 if (yyextra->insideSlice)
980 yyextra->current->bodyLine = yyextra->yyLineNr;
981 yyextra->current->bodyColumn = yyextra->yyColNr;
982 yyextra->current->fileName = yyextra->fileName ;
983 yyextra->current->startLine = yyextra->yyLineNr ;
984 yyextra->current->startColumn = yyextra->yyColNr;
985 yyextra->current->args.clear();
986 yyextra->current->section = EntryType::makeTypedef() ;
987 yyextra->isTypedef =
true;
988 BEGIN( SliceDictionary );
993<FindMembers>{BN}{1,80} {
996<FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
997 if (yyextra->insideJava)
1000 yyextra->lastSkipRoundContext = YY_START;
1001 yyextra->roundCount=0;
1006 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
1007 yyextra->current->spec.setReadable(
true).setWritable(
true).setAssign(
true);
1008 yyextra->current->protection = Protection::Public ;
1010 BEGIN( ObjCPropAttr );
bool literal_at(const char *data, const char(&str)[N])
returns true iff data points to a substring that matches string literal str
1017<ObjCPropAttr>"getter="{ID} {
1018 yyextra->current->read = yytext+7;
1020<ObjCPropAttr>"setter="{ID} {
1021 yyextra->current->write = yytext+7;
1023<ObjCPropAttr>"readonly" {
1024 yyextra->current->spec.setWritable(
false);
1026<ObjCPropAttr>"readwrite" {
1028<ObjCPropAttr>"assign" {
1030<ObjCPropAttr>"unsafe_unretained" {
1031 yyextra->current->spec.setAssign(
false);
1032 yyextra->current->spec.setUnretained(
true);
1034<ObjCPropAttr>"retain" {
1035 yyextra->current->spec.setAssign(
false);
1036 yyextra->current->spec.setRetain(
true);
1038<ObjCPropAttr>"copy" {
1039 yyextra->current->spec.setAssign(
false);
1040 yyextra->current->spec.setCopy(
true);
1042<ObjCPropAttr>"weak" {
1043 yyextra->current->spec.setAssign(
false);
1044 yyextra->current->spec.setWeak(
true);
1046<ObjCPropAttr>"strong" {
1047 yyextra->current->spec.setAssign(
false);
1048 yyextra->current->spec.setStrong(
true);
1050<ObjCPropAttr>"nonatomic" {
1051 yyextra->current->spec.setNonAtomic(
true);
1056<FindMembers>"@"{ID}("."{ID})+ {
1057 if (yyextra->insideJava)
1066<FindMembers>"@"{ID} {
1067 if (yyextra->insideJava)
1071 else if (
dstrcmp(yytext,
"@property")==0)
1073 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
1074 yyextra->current->spec.setWritable(
true).setReadable(
true);
1075 yyextra->current->protection = Protection::Public ;
1077 else if (
dstrcmp(yytext,
"@synthesize")==0)
1079 BEGIN( ObjCSkipStatement );
1081 else if (
dstrcmp(yytext,
"@dynamic")==0)
1083 BEGIN( ObjCSkipStatement );
int dstrcmp(const char *str1, const char *str2)
1090<ObjCSkipStatement>";" {
1093<PackageName>{ID}(("."|"\\"){ID})* {
1094 yyextra->isTypedef=
false;
1096 yyextra->current->name = yytext;
1097 yyextra->current->name =
substitute(yyextra->current->name,
".",
"::");
1098 yyextra->current->name =
substitute(yyextra->current->name,
"\\",
"::");
1099 yyextra->current->section = EntryType::makeNamespace();
1100 yyextra->current->type =
"namespace" ;
1101 yyextra->current->fileName = yyextra->fileName;
1102 yyextra->current->startLine = yyextra->yyLineNr;
1103 yyextra->current->startColumn = yyextra->yyColNr;
1104 yyextra->current->bodyLine = yyextra->yyLineNr;
1105 yyextra->current->bodyColumn = yyextra->yyColNr;
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
1109 std::shared_ptr<Entry> tmp = yyextra->current;
1110 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1111 yyextra->current_root = std::move(tmp);
1116 yyextra->curlyCount=0;
1117 BEGIN( ReadNSBody );
1119<FindMembers>{B}*"export"{BN}+"module"{BN}+ {
1120 if (!yyextra->insideCpp) REJECT;
1122 yyextra->current->exported =
true;
1124 BEGIN( ModuleName );
1126<FindMembers>{B}*"module"{BN}*";" {
1127 if (!yyextra->insideCpp) REJECT;
1128 if (!yyextra->current->type.empty() || !yyextra->current->name.empty()) REJECT;
1131 BEGIN( FindMembers );
1133<FindMembers>{B}*"module"{BN}+ {
1134 if (!yyextra->insideCpp) REJECT;
1136 yyextra->current->exported =
false;
1138 BEGIN( ModuleName );
1140<FindMembers>{B}*"export"{BN}+"import"{BN}+ {
1141 if (!yyextra->insideCpp) REJECT;
1142 yyextra->current->exported =
true;
1144 BEGIN( ModuleImport );
1146<FindMembers>{B}*"import"{BN}+ {
1147 if (!yyextra->insideCpp) REJECT;
1149 BEGIN( ModuleImport );
1151<ModuleName>{MODULE_ID}{BN}*":"{BN}*{MODULE_ID} {
1153 size_t i = name.
find(
':');
1159 yyextra->current->exported,
1162 yyextra->current->section = EntryType::makeModuleDoc();
1163 yyextra->isTypedef=
false;
1165 yyextra->current->type +=
" module";
1166 yyextra->current->fileName = yyextra->fileName;
1167 yyextra->current->startLine = yyextra->yyLineNr;
1168 yyextra->current->startColumn = yyextra->yyColNr;
1169 yyextra->current->bodyLine = yyextra->yyLineNr;
1170 yyextra->current->bodyColumn = yyextra->yyColNr;
1171 yyextra->current->name = name+
":"+partition;
DString mid(size_t index, size_t len=npos) const
size_t find(char c, size_t pos=0) const
void createModuleDef(const DString &fileName, int line, size_t column, bool exported, const DString &moduleName, const DString &partitionName=DString())
static ModuleManager & instance()
1174<ModuleName>{MODULE_ID} {
1178 yyextra->current->exported,
1180 yyextra->current->section = EntryType::makeModuleDoc();
1181 yyextra->isTypedef=
false;
1183 yyextra->current->type +=
" module";
1184 yyextra->current->fileName = yyextra->fileName;
1185 yyextra->current->startLine = yyextra->yyLineNr;
1186 yyextra->current->startColumn = yyextra->yyColNr;
1187 yyextra->current->bodyLine = yyextra->yyLineNr;
1188 yyextra->current->bodyColumn = yyextra->yyColNr;
1189 yyextra->current->name = yytext;
1192<ModuleName>":"{BN}+"private" {
1193 yyextra->current->exported = yyextra->exported =
false;
1196<ModuleName>";" { unput(
';');
1201<ModuleImport>"\""[^"\n]*"\"" {
1204 DString(yytext).mid(1,yyleng-2),
void addHeader(const DString &moduleFile, int line, const DString &headerName, bool isSystem)
1207<ModuleImport>"<"[^>\n]*">" {
1210 DString(yytext).mid(1,yyleng-2),
1213<ModuleImport>{MODULE_ID}?{BN}*":"{BN}*{MODULE_ID} {
1215 size_t i = name.
find(
':');
1221 yyextra->current->exported,
void addImport(const DString &moduleFile, int line, const DString &importName, bool isExported, const DString &partitionName=DString())
1225<ModuleImport>{MODULE_ID} {
1229 yyextra->current->exported);
1232<ModuleImport>";" { BEGIN(FindMembers); }
1233<ModuleImport>\n {
lineCount(yyscanner); }
1235<FindMembers>{B}*"export"{BN}+"{" {
1236 yyextra->current->exported = yyextra->exported =
true;
1238<FindMembers>{B}*"export"{BN}+ {
1239 if (!yyextra->insideCpp) REJECT;
1240 yyextra->current->exported=
true;
1242<FindMembers>{B}*"initonly"{BN}+ {
if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1243 yyextra->current->type +=
" initonly ";
1244 if (yyextra->insideCli) yyextra->current->spec.setInitonly(
true);
1247<FindMembers>{B}*"static"{BN}*/"{" { yyextra->current->type +=
" static ";
1248 yyextra->current->isStatic =
true;
1251<FindMembers>{B}*"static"{BN}+ { yyextra->current->type +=
" static ";
1252 yyextra->current->isStatic =
true;
1255<FindMembers>{B}*"extern"{BN}+ {
if (yyextra->insideJava) REJECT;
1256 yyextra->current->isStatic =
false;
1257 yyextra->current->explicitExternal =
true;
1260<FindMembers>{B}*"const"{BN}+ {
if (yyextra->insideCS)
1262 yyextra->current->type +=
" const ";
1263 if (yyextra->insideCS) yyextra->current->isStatic =
true;
1271<FindMembers>{B}*"virtual"{BN}+ {
if (yyextra->insideJava) REJECT;
1272 yyextra->current->type +=
" virtual ";
1273 yyextra->current->virt = Specifier::Virtual;
1276<FindMembers>{B}*"constexpr"{BN}+ {
1277 if (yyextra->insideCpp)
1279 yyextra->current->spec.setConstExpr(
true);
1283<FindMembers>{B}*"consteval"{BN}+ {
1284 if (yyextra->insideCpp)
1286 yyextra->current->spec.setConstEval(
true);
1290<FindMembers>{B}*"constinit"{BN}+ {
1291 if (yyextra->insideCpp)
1293 yyextra->current->spec.setConstInit(
true);
1297<FindMembers>{B}*"published"{BN}+ {
1298 if (yyextra->insideIDL)
1301 yyextra->current->spec.setPublished(
true);
1308<FindMembers>{B}*"sealed"{BN}+ {
1309 if (yyextra->insideCS)
1311 yyextra->current->spec.setSealed(
true);
1318<FindMembers>{B}*"abstract"{BN}+ {
1319 if (yyextra->insidePHP || yyextra->insideCS)
1321 yyextra->current->spec.setAbstract(
true);
1325 if (yyextra->insideCpp) REJECT;
1326 yyextra->current->type +=
" abstract ";
1327 if (!yyextra->insideJava)
1329 yyextra->current->virt = Specifier::Pure;
1333 yyextra->current->spec.setAbstract(
true);
1338<FindMembers>{B}*"inline"{BN}+ {
if (yyextra->insideJava) REJECT;
1339 yyextra->current->spec.setInline(
true);
1342<FindMembers>{B}*"mutable"{BN}+ {
if (yyextra->insideJava) REJECT;
1343 yyextra->current->spec.setMutable(
true);
1346<FindMembers>{B}*"thread_local"{BN}+ {
if (yyextra->insideJava) REJECT;
1347 yyextra->current->spec.setThreadLocal(
true);
1350<FindMembers>{B}*"explicit"{BN}+ {
if (yyextra->insideJava) REJECT;
1351 yyextra->current->spec.setExplicit(
true);
1354<FindMembers>{B}*"local"{BN}+ {
if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1355 yyextra->current->spec.setLocal(
true);
1358<FindMembers>{B}*"@required"{BN}+ {
1359 yyextra->current->spec.setOptional(
false).setRequired(
true);
1362<FindMembers>{B}*"@optional"{BN}+ {
1363 yyextra->current->spec.setRequired(
false).setOptional(
true);
1371<FindMembers>{B}*"typename"{BN}+ {
lineCount(yyscanner); }
1372<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] {
if (yyextra->insideJava) REJECT;
1373 yyextra->isTypedef=
false;
1374 yyextra->current->section = EntryType::makeNamespace();
1375 yyextra->current->type =
"namespace" ;
1376 yyextra->current->fileName = yyextra->fileName;
1377 yyextra->current->startLine = yyextra->yyLineNr;
1378 yyextra->current->startColumn = yyextra->yyColNr;
1379 yyextra->current->bodyLine = yyextra->yyLineNr;
1380 yyextra->current->bodyColumn = yyextra->yyColNr;
1382 if (yyextra->insidePHP)
1384 BEGIN( PackageName );
1388 BEGIN( CompoundName );
1391<FindMembers>{B}*"module"{BN}+ {
1393 if (yyextra->insideIDL || yyextra->insideSlice)
1395 yyextra->isTypedef=
false;
1396 yyextra->current->section = EntryType::makeNamespace();
1397 yyextra->current->type =
"module" ;
1398 yyextra->current->fileName = yyextra->fileName;
1399 yyextra->current->startLine = yyextra->yyLineNr;
1400 yyextra->current->startColumn = yyextra->yyColNr;
1401 yyextra->current->bodyLine = yyextra->yyLineNr;
1402 yyextra->current->bodyColumn = yyextra->yyColNr;
1403 BEGIN( CompoundName );
1405 else if (yyextra->insideD)
1413 yyextra->current->name =
DString(yytext).stripWhiteSpace();
1416<FindMembers>{B}*"library"{BN}+ {
1418 if (yyextra->insideIDL)
1420 yyextra->isTypedef=
false;
1421 yyextra->current->section = EntryType::makeNamespace();
1422 yyextra->current->type =
"library" ;
1423 yyextra->current->fileName = yyextra->fileName;
1424 yyextra->current->startLine = yyextra->yyLineNr;
1425 yyextra->current->startColumn = yyextra->yyColNr;
1426 yyextra->current->bodyLine = yyextra->yyLineNr;
1427 yyextra->current->bodyColumn = yyextra->yyColNr;
1428 BEGIN( CompoundName );
1433 yyextra->current->name =
DString(yytext).stripWhiteSpace();
1436<FindMembers>{B}*"constants"{BN}+ {
1438 if (yyextra->insideIDL)
1440 yyextra->isTypedef=
false;
1441 yyextra->current->section = EntryType::makeNamespace();
1442 yyextra->current->type =
"constants";
1443 yyextra->current->fileName = yyextra->fileName;
1444 yyextra->current->startLine = yyextra->yyLineNr;
1445 yyextra->current->startColumn = yyextra->yyColNr;
1446 yyextra->current->bodyLine = yyextra->yyLineNr;
1447 yyextra->current->bodyColumn = yyextra->yyColNr;
1448 BEGIN( CompoundName );
1453 yyextra->current->name =
DString(yytext).stripWhiteSpace();
1456<FindMembers>{BN}*("service"){BN}+ {
1458 if (yyextra->insideIDL)
1460 yyextra->isTypedef=
false;
1461 yyextra->current->section = EntryType::makeClass();
1465 setOptional(spec.isOptional()).setPublished(spec.isPublished());
1467 yyextra->current->type +=
" service " ;
1468 yyextra->current->fileName = yyextra->fileName;
1469 yyextra->current->startLine = yyextra->yyLineNr;
1470 yyextra->current->bodyLine = yyextra->yyLineNr;
1471 yyextra->current->bodyColumn = yyextra->yyColNr;
1472 BEGIN( CompoundName );
1477 yyextra->current->name =
DString(yytext).stripWhiteSpace();
Wrapper class for a number of boolean properties.
constexpr TypeSpecifier() noexcept
1480<FindMembers>{BN}*("singleton"){BN}+ {
1482 if (yyextra->insideIDL)
1484 yyextra->isTypedef=
false;
1485 yyextra->current->section = EntryType::makeClass();
1487 yyextra->current->spec =
TypeSpecifier().setSingleton(
true).
1488 setPublished(spec.isPublished());
1490 yyextra->current->type +=
" singleton " ;
1491 yyextra->current->fileName = yyextra->fileName;
1492 yyextra->current->startLine = yyextra->yyLineNr;
1493 yyextra->current->bodyLine = yyextra->yyLineNr;
1494 yyextra->current->bodyColumn = yyextra->yyColNr;
1495 BEGIN( CompoundName );
1500 yyextra->current->name =
DString(yytext).stripWhiteSpace();
1503<FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ {
1505 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1507 yyextra->isTypedef=
false;
1508 yyextra->current->section = EntryType::makeClass();
1510 yyextra->current->spec =
TypeSpecifier().setInterface(
true).
1512 setOptional(spec.isOptional()).
1513 setPublished(spec.isPublished()).
1514 setLocal(spec.isLocal());
1516 yyextra->current->type +=
" interface" ;
1517 yyextra->current->fileName = yyextra->fileName;
1518 yyextra->current->startLine = yyextra->yyLineNr;
1519 yyextra->current->startColumn = yyextra->yyColNr;
1520 yyextra->current->bodyLine = yyextra->yyLineNr;
1521 yyextra->current->bodyColumn = yyextra->yyColNr;
1523 BEGIN( CompoundName );
1528 yyextra->current->name =
DString(yytext).stripWhiteSpace();
1531<FindMembers>{B}*"@implementation"{BN}+ {
1533 yyextra->isTypedef=
false;
1534 yyextra->current->section = EntryType::makeObjcImpl();
1535 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1536 yyextra->insideObjC =
true;
1537 yyextra->current->protection = yyextra->protection = Protection::Public ;
1539 yyextra->current->type +=
" implementation" ;
1540 yyextra->current->fileName = yyextra->fileName;
1541 yyextra->current->startLine = yyextra->yyLineNr;
1542 yyextra->current->bodyLine = yyextra->yyLineNr;
1543 yyextra->current->bodyColumn = yyextra->yyColNr;
1544 BEGIN( CompoundName );
1546<FindMembers>{B}*"@interface"{BN}+ {
1548 yyextra->isTypedef=
false;
1549 yyextra->current->section = EntryType::makeClass();
1550 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1551 if (!yyextra->insideJava)
1553 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1554 yyextra->insideObjC =
true;
1556 yyextra->current->protection = yyextra->protection = Protection::Public ;
1558 yyextra->current->type +=
" interface" ;
1559 yyextra->current->fileName = yyextra->fileName;
1560 yyextra->current->startLine = yyextra->yyLineNr;
1561 yyextra->current->startColumn = yyextra->yyColNr;
1562 yyextra->current->bodyLine = yyextra->yyLineNr;
1563 yyextra->current->bodyColumn = yyextra->yyColNr;
1564 BEGIN( CompoundName );
1566<FindMembers>{B}*"@protocol"{BN}+ {
1568 yyextra->isTypedef=
false;
1569 yyextra->current->section = EntryType::makeClass();
1571 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1572 yyextra->insideObjC =
true;
1573 yyextra->current->protection = yyextra->protection = Protection::Public ;
1575 yyextra->current->type +=
" protocol" ;
1576 yyextra->current->fileName = yyextra->fileName;
1577 yyextra->current->startLine = yyextra->yyLineNr;
1578 yyextra->current->startColumn = yyextra->yyColNr;
1579 yyextra->current->bodyLine = yyextra->yyLineNr;
1580 yyextra->current->bodyColumn = yyextra->yyColNr;
1581 BEGIN( CompoundName );
1583<FindMembers>{B}*"exception"{BN}+ {
1584 if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1585 yyextra->isTypedef=
false;
1586 yyextra->current->section = EntryType::makeClass();
1589 yyextra->current->spec =
TypeSpecifier().setException(
true).
1590 setPublished(spec.isPublished()).setLocal(spec.isLocal());
1592 yyextra->current->type +=
" exception" ;
1593 yyextra->current->fileName = yyextra->fileName;
1594 yyextra->current->startLine = yyextra->yyLineNr;
1595 yyextra->current->startColumn = yyextra->yyColNr;
1596 yyextra->current->bodyLine = yyextra->yyLineNr;
1597 yyextra->current->bodyColumn = yyextra->yyColNr;
1599 BEGIN( CompoundName );
1601<FindMembers>"@class" |
1602<FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1603<FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1608 yyextra->current->section = EntryType::makeClass();
1610 if (yyextra->insidePHP && yyextra->current->spec.isAbstract())
1613 yyextra->current->spec.setAbstract(
false).setAbstractClass(
true);
1615 if (yyextra->insideSlice && yyextra->current->spec.isLocal())
1617 yyextra->current->spec.setLocal(
true);
1621 yyextra->current->type +=
" const";
1623 else if (isVolatile)
1625 yyextra->current->type +=
" volatile";
1627 yyextra->current->type +=
" class" ;
1628 yyextra->current->fileName = yyextra->fileName;
1629 yyextra->current->startLine = yyextra->yyLineNr;
1630 yyextra->current->startColumn = yyextra->yyColNr;
1631 yyextra->current->bodyLine = yyextra->yyLineNr;
1632 yyextra->current->bodyColumn = yyextra->yyColNr;
1635 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1636 yyextra->insideObjC =
true;
1639 if (yytext[yyleng-1]==
'{') unput(
'{');
1640 BEGIN( CompoundName ) ;
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
1642<FindMembers>{B}*"value class{" |
1643<FindMembers>{B}*"value class"{BN}+ {
1644 yyextra->isTypedef=
false;
1645 yyextra->current->section = EntryType::makeClass();
1648 yyextra->current->type +=
" value class" ;
1649 yyextra->current->fileName = yyextra->fileName;
1650 yyextra->current->startLine = yyextra->yyLineNr;
1651 yyextra->current->startColumn = yyextra->yyColNr;
1652 yyextra->current->bodyLine = yyextra->yyLineNr;
1653 yyextra->current->bodyColumn = yyextra->yyColNr;
1655 if (yytext[yyleng-1]==
'{') unput(
'{');
1656 BEGIN( CompoundName ) ;
1658<FindMembers>{B}*"ref class{" |
1659<FindMembers>{B}*"ref class"{BN}+ {
1660 yyextra->isTypedef=
false;
1661 yyextra->current->section = EntryType::makeClass();
1664 yyextra->current->type +=
" ref class" ;
1665 yyextra->current->fileName = yyextra->fileName;
1666 yyextra->current->startLine = yyextra->yyLineNr;
1667 yyextra->current->startColumn = yyextra->yyColNr;
1668 yyextra->current->bodyLine = yyextra->yyLineNr;
1669 yyextra->current->bodyColumn = yyextra->yyColNr;
1671 if (yytext[yyleng-1]==
'{') unput(
'{');
1672 BEGIN( CompoundName ) ;
1674<FindMembers>{B}*"interface class{" |
1675<FindMembers>{B}*"interface class"{BN}+ {
1676 yyextra->isTypedef=
false;
1677 yyextra->current->section = EntryType::makeClass();
1678 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1680 yyextra->current->type +=
" interface class" ;
1681 yyextra->current->fileName = yyextra->fileName;
1682 yyextra->current->startLine = yyextra->yyLineNr;
1683 yyextra->current->startColumn = yyextra->yyColNr;
1684 yyextra->current->bodyLine = yyextra->yyLineNr;
1685 yyextra->current->bodyColumn = yyextra->yyColNr;
1687 if (yytext[yyleng-1]==
'{') unput(
'{');
1688 BEGIN( CompoundName ) ;
1690<FindMembers>{B}*"coclass"{BN}+ {
1691 if (yyextra->insideIDL)
1693 yyextra->isTypedef=
false;
1694 yyextra->current->section = EntryType::makeClass();
1696 yyextra->current->type +=
" coclass" ;
1697 yyextra->current->fileName = yyextra->fileName;
1698 yyextra->current->startLine = yyextra->yyLineNr;
1699 yyextra->current->startColumn = yyextra->yyColNr;
1700 yyextra->current->bodyLine = yyextra->yyLineNr;
1701 yyextra->current->bodyColumn = yyextra->yyColNr;
1703 BEGIN( CompoundName ) ;
1708 yyextra->current->name = yytext;
1709 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1713<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1714<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1715 if (yyextra->insideJava) REJECT;
1720 yyextra->current->section = EntryType::makeClass() ;
1724 setPublished(spec.isPublished()).
1725 setInline(spec.isInline()).
1726 setLocal(spec.isLocal());
1732 yyextra->current->type +=
" const";
1734 else if (isVolatile)
1736 yyextra->current->type +=
" volatile";
1738 yyextra->current->type +=
" struct" ;
1739 yyextra->current->fileName = yyextra->fileName;
1740 yyextra->current->startLine = yyextra->yyLineNr;
1741 yyextra->current->startColumn = yyextra->yyColNr;
1742 yyextra->current->bodyLine = yyextra->yyLineNr;
1743 yyextra->current->bodyColumn = yyextra->yyColNr;
1745 if (yytext[yyleng-1]==
'{') unput(
'{');
1746 BEGIN( CompoundName ) ;
1748<FindMembers>{B}*"value struct{" |
1749<FindMembers>{B}*"value struct"{BN}+ {
1750 yyextra->isTypedef=
false;
1751 yyextra->current->section = EntryType::makeClass();
1752 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1754 yyextra->current->type +=
" value struct" ;
1755 yyextra->current->fileName = yyextra->fileName;
1756 yyextra->current->startLine = yyextra->yyLineNr;
1757 yyextra->current->startColumn = yyextra->yyColNr;
1758 yyextra->current->bodyLine = yyextra->yyLineNr;
1759 yyextra->current->bodyColumn = yyextra->yyColNr;
1761 if (yytext[yyleng-1]==
'{') unput(
'{');
1762 BEGIN( CompoundName ) ;
1764<FindMembers>{B}*"ref struct{" |
1765<FindMembers>{B}*"ref struct"{BN}+ {
1766 yyextra->isTypedef=
false;
1767 yyextra->current->section = EntryType::makeClass();
1768 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1770 yyextra->current->type +=
" ref struct" ;
1771 yyextra->current->fileName = yyextra->fileName;
1772 yyextra->current->startLine = yyextra->yyLineNr;
1773 yyextra->current->startColumn = yyextra->yyColNr;
1774 yyextra->current->bodyLine = yyextra->yyLineNr;
1775 yyextra->current->bodyColumn = yyextra->yyColNr;
1777 if (yytext[yyleng-1]==
'{') unput(
'{');
1778 BEGIN( CompoundName ) ;
1780<FindMembers>{B}*"interface struct{" |
1781<FindMembers>{B}*"interface struct"{BN}+ {
1782 yyextra->isTypedef=
false;
1783 yyextra->current->section = EntryType::makeClass();
1784 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1786 yyextra->current->type +=
" interface struct";
1787 yyextra->current->fileName = yyextra->fileName;
1788 yyextra->current->startLine = yyextra->yyLineNr;
1789 yyextra->current->startColumn = yyextra->yyColNr;
1790 yyextra->current->bodyLine = yyextra->yyLineNr;
1791 yyextra->current->bodyColumn = yyextra->yyColNr;
1793 if (yytext[yyleng-1]==
'{') unput(
'{');
1794 BEGIN( CompoundName ) ;
1796<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1797<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1798 if (yyextra->insideJava) REJECT;
1803 yyextra->current->section = EntryType::makeClass();
1810 yyextra->current->type +=
" const";
1812 else if (isVolatile)
1814 yyextra->current->type +=
" volatile";
1816 yyextra->current->type +=
" union" ;
1817 yyextra->current->fileName = yyextra->fileName;
1818 yyextra->current->startLine = yyextra->yyLineNr;
1819 yyextra->current->startColumn = yyextra->yyColNr;
1820 yyextra->current->bodyLine = yyextra->yyLineNr;
1821 yyextra->current->bodyColumn = yyextra->yyColNr;
1823 if (yytext[yyleng-1]==
'{') unput(
'{');
1824 BEGIN( CompoundName ) ;
1826<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1827<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ {
1832 if (yyextra->insideJava)
1834 yyextra->current->section = EntryType::makeClass();
1840 yyextra->current->section = EntryType::makeEnum() ;
1843 yyextra->current->type +=
" enum";
1846 yyextra->current->spec.setStrong(
true);
1850 yyextra->current->spec.setStrong(
true).setEnumStruct(
true);
1852 yyextra->current->fileName = yyextra->fileName;
1853 yyextra->current->startLine = yyextra->yyLineNr;
1854 yyextra->current->startColumn = yyextra->yyColNr;
1855 yyextra->current->bodyLine = yyextra->yyLineNr;
1856 yyextra->current->bodyColumn = yyextra->yyColNr;
1858 if (yytext[yyleng-1]==
'{') unput(
'{');
1859 BEGIN( CompoundName ) ;
1861<FindMembers>{B}*"concept"{BN}+ {
1862 if (yyextra->insideJava) REJECT;
1863 yyextra->isTypedef=
false;
1864 yyextra->current->section = EntryType::makeConcept();
1866 yyextra->current->type +=
" concept";
1867 yyextra->current->fileName = yyextra->fileName;
1868 yyextra->current->startLine = yyextra->yyLineNr;
1869 yyextra->current->startColumn = yyextra->yyColNr;
1870 yyextra->current->bodyLine = yyextra->yyLineNr;
1871 yyextra->current->bodyColumn = yyextra->yyColNr;
1872 yyextra->current->args = yyextra->fullArgString;
1873 yyextra->keepComment =
true;
1875 BEGIN( ConceptName ) ;
1877<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" {
1879 yyextra->current->name +=
"()";
1880 BEGIN( FindMembers );
1882<Operator>"("{BN}*")"{BNopt}/("[["[^\]]*"]]"){BNopt}"(" {
1884 yyextra->current->name += yytext ;
1885 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1886 BEGIN( FindMembers ) ;
1888<Operator>"("{BN}*")"{BNopt}/"(" {
1890 yyextra->current->name += yytext ;
1891 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1892 BEGIN( FindMembers ) ;
1896 BEGIN( FindMembers ) ;
1900 yyextra->current->name += *yytext ;
1902<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" {
1903 if (!yyextra->current->type.startsWith(
"friend "))
1905 yyextra->current->name += yytext;
1909 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1911 BEGIN( FindMembers ) ;
1913<FindMembers>("template"|"generic")({BN}*)"<"/[>]? {
1916 yyextra->current->tArgLists.
push_back(al);
1917 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1918 yyextra->templateStr=
"<";
1919 yyextra->fullArgString = yyextra->templateStr;
1920 yyextra->copyArgString = &yyextra->templateStr;
1921 yyextra->currentArgumentContext = FindMembers;
1922 BEGIN( ReadTempArgs );
void push_back(const Argument &a)
1924<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" {
1925 if (yyextra->insideJava) REJECT;
1927 BEGIN( NSAliasName );
1930 yyextra->aliasName = yytext;
1931 BEGIN( NSAliasArg );
1933<NSAliasArg>({ID}"::")*{ID} {
1935 std::string ctx = yyextra->current_root->name.str();
static NamespaceAliasInfoMap namespaceAliasMap
1946 BEGIN( FindMembers );
1948<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1950 yyextra->aliasName=yytext;
1953<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1957 yyextra->current->fileName = yyextra->fileName;
1959 yyextra->current->section = EntryType::makeUsingDecl();
1960 yyextra->current_root->copyToSubEntry(yyextra->current);
1962 yyextra->current->section = EntryType::makeUsingDir();
1963 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1965 yyextra->aliasName.clear();
DString removeRedundantWhiteSpace(const DString &s)
1967<PHPUseAs>{BN}+"as"{BN}+ {
1970<PHPUseAs>{PHPUSEKW} {
1974 if (!yyextra->aliasName.empty())
1979 yyextra->aliasName.clear();
const std::string & str() const
NamespaceAliasInfo(const std::string &a, const std::string &ctx=std::string())
1981<PHPUse,PHPUseAs>[,;] {
1991<JavaImport>({ID}{BN}*"."{BN}*)+"*" {
1995 yyextra->current->fileName = yyextra->fileName;
2002 yyextra->current->section = EntryType::makeUsingDir();
2003 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
static FileNameLinkedMap * inputNameLinkedMap
A model of a file symbol.
virtual void addIncludeDependency(const FileDef *fd, const DString &incName, IncludeKind kind)=0
FileDef * findFileDef(const DString &n, bool &ambig) const
Returns the file definition in fnMap that matches the file name n.
2007<JavaImport>({ID}{BN}*"."{BN}*)+{ID} {
2011 yyextra->current->fileName = yyextra->fileName;
2023 if (yyextra->insideD)
2025 yyextra->current->section = EntryType::makeUsingDir();
2030 yyextra->current->section = EntryType::makeUsingDecl();
2032 yyextra->previous = yyextra->current;
2033 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
virtual const DString & docName() const =0
virtual void addIncludedByDependency(const FileDef *fd, const DString &incName, IncludeKind kind)=0
2037<IDLImport>"\""[^"]*"\"" {
2038 DString fileName(&yytext[1],yyleng-2);
2054<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2055 if (yyextra->insideJava) REJECT;
2056 yyextra->current->startLine=yyextra->yyLineNr;
2057 yyextra->current->startColumn = yyextra->yyColNr;
2061<Using>"namespace"{BN}+ {
lineCount(yyscanner); BEGIN(UsingDirective); }
2062<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2064 yyextra->current->name=yytext;
2065 yyextra->current->fileName = yyextra->fileName;
2066 yyextra->current->section = EntryType::makeUsingDecl();
2067 yyextra->current->startLine = yyextra->yyLineNr;
2068 yyextra->usingNewVarNeeded =
true;
2069 if (yyextra->insideCS)
2074 yyextra->current->name=yytext;
2075 yyextra->current->fileName = yyextra->fileName;
2076 yyextra->current->startLine = yyextra->yyLineNr;
2077 yyextra->current->startColumn = yyextra->yyColNr;
2078 yyextra->current->section = EntryType::makeUsingDir();
2079 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2084<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" {
2085 yyextra->current->name=
DString(yytext).left(yyleng-1).stripWhiteSpace();
2086 yyextra->current->fileName = yyextra->fileName;
2087 yyextra->current->section = EntryType::makeUsingDecl();
2088 yyextra->current->startLine = yyextra->yyLineNr;
2089 yyextra->current->bodyLine = yyextra->yyLineNr;
2090 yyextra->current->bodyColumn = yyextra->yyColNr;
2091 yyextra->lastInitializerContext = UsingAlias;
2092 yyextra->sharpCount=0;
2093 yyextra->initBracketCount=0;
2095 BEGIN(ReadInitializer);
2098 if (yyextra->usingNewVarNeeded)
2100 yyextra->previous = yyextra->current;
2101 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2103 yyextra->usingNewVarNeeded =
false;
2108 yyextra->lastInitializerContext = UsingAlias;
2109 yyextra->sharpCount=0;
2110 yyextra->initBracketCount=0;
2112 yyextra->usingNewVarNeeded =
false;
2113 BEGIN(ReadInitializer);
2116 yyextra->lastCContext = YY_START ;
2117 BEGIN( SkipComment ) ;
2120 yyextra->lastCContext = YY_START ;
2121 BEGIN( SkipCxxComment ) ;
2125 if (yyextra->usingNewVarNeeded)
2127 yyextra->previous = yyextra->current;
2128 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2130 yyextra->usingNewVarNeeded =
false;
2134 yyextra->current->section = EntryType::makeVariable();
2135 DString init = yyextra->current->initializer.str();
2136 init.stripPrefix(
"class ");
2137 init.stripPrefix(
"struct ");
2139 yyextra->current->type =
"typedef "+
init;
2140 yyextra->current->args.clear();
2141 yyextra->current->spec.setAlias(
true);
2142 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2147 yyextra->current->initializer << yytext;
2150 yyextra->current->initializer << yytext;
2154 yyextra->current->fileName = yyextra->fileName;
2155 yyextra->current->section = EntryType::makeUsingDir();
2156 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2158 yyextra->usingNewVarNeeded =
false;
2161<FindMembers>{SCOPENAME}{BN}*"<>" {
2166<FindMembers>{SCOPENAME}{BNopt}/"<" {
2168 if (yyextra->insideCpp && name==
"import") REJECT;
2169 yyextra->roundCount=0;
2170 yyextra->sharpCount=0;
2173 yyextra->current->name=name;
2179 BEGIN( EndTemplate );
2181<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2182 yyextra->sharpCount=0;
2183 yyextra->roundCount=0;
2191 BEGIN( EndTemplate );
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
2194 if (!yyextra->insidePHP)
2200 yyextra->lastHereDocContext = YY_START;
2204<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2205 yyextra->current->name+=yytext;
2209 if (yyextra->roundCount==0)
2212 yyextra->sharpCount++;
2214 yyextra->current->name+=yytext;
2216<ClassTemplSpec,EndTemplate>">=" {
2217 yyextra->current->name+=yytext;
2219<ClassTemplSpec,EndTemplate>(">>") {
2220 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2228 yyextra->current->name+=yytext;
2233 yyextra->current->name+=
'>';
2235 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2237 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2242<EndTemplate>">"{BN}*"(" {
2244 yyextra->current->name+=
'>';
2246 if (yyextra->roundCount==0)
2248 --yyextra->sharpCount;
2250 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2252 yyextra->current->bodyLine = yyextra->yyLineNr;
2253 yyextra->current->bodyColumn = yyextra->yyColNr;
2254 yyextra->current->args =
"(";
2255 yyextra->currentArgumentContext = FuncQual;
2256 yyextra->fullArgString = yyextra->current->args;
2257 yyextra->copyArgString = &yyextra->current->args;
2259 BEGIN( ReadFuncArgType ) ;
2263 yyextra->current->name+=
"(";
2264 yyextra->roundCount++;
2267<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ {
2269 yyextra->current->name+=
'>';
2270 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2275<EndTemplate>">"{BNopt}/"::" {
2277 yyextra->current->name+=
'>';
2279 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2281 BEGIN(FindMemberName);
2284<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2285 yyextra->roundCount++;
2287<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2288 if (yyextra->roundCount>0) yyextra->roundCount--;
2291 yyextra->current->name+=*yytext;
2294<FindMembers>"define"{BN}*"("{BN}*["'] {
2295 if (yyextra->insidePHP)
2297 yyextra->current->bodyLine = yyextra->yyLineNr;
2298 yyextra->current->bodyColumn = yyextra->yyColNr;
2305 yyextra->delimiter = yytext;
2306 *yyextra->pCopyHereDocGString << yytext;
2307 BEGIN(CopyHereDocEnd);
2309<CopyHereDoc>"\""{ID}/"\"" {
2310 yyextra->delimiter = &yytext[1];
2311 *yyextra->pCopyHereDocGString << yytext;
2312 BEGIN(CopyHereDocEnd);
2314<CopyHereDoc>"'"{ID}/"'" {
2315 yyextra->delimiter = &yytext[1];
2316 *yyextra->pCopyHereDocGString << yytext;
2317 BEGIN(CopyHereDocEnd);
2320 yyextra->delimiter = yytext;
2323<HereDoc>"\""{ID}/"\"" {
2324 yyextra->delimiter = &yytext[1];
2327<HereDoc>"'"{ID}/"'" {
2328 yyextra->delimiter = &yytext[1];
2331<HereDocEnd>^{Bopt}{ID} {
2334 BEGIN(yyextra->lastHereDocContext);
2338<CopyHereDocEnd>^{Bopt}{ID} {
2339 *yyextra->pCopyHereDocGString << yytext;
2342 BEGIN(yyextra->lastHereDocContext);
2347 *yyextra->pCopyHereDocGString << yytext;
2349<CopyHereDocEnd>{ID} {
2350 *yyextra->pCopyHereDocGString << yytext;
2353 *yyextra->pCopyHereDocGString << yytext;
2355<FindMembers>"Q_OBJECT"|"Q_GADGET" {
2357<FindMembers>"Q_PROPERTY" {
2358 yyextra->yyBegLineNr = yyextra->yyLineNr;
2359 yyextra->yyBegColNr = yyextra->yyColNr;
2360 yyextra->current->protection = Protection::Public ;
2361 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2362 yyextra->current->type.clear();
2372 yyextra->current->name+=yytext;
2375 yyextra->current->type+= yyextra->current->name;
2376 yyextra->current->type+= yytext;
2377 yyextra->current->name=
"";
2379<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2380 yyextra->current->type+= yyextra->current->name;
2381 yyextra->current->name=yytext;
2383<QtPropType,QtPropAttr>{BN}+"READ"{BN}+ {
2384 yyextra->current->spec.setReadable(
true);
2387<QtPropType,QtPropAttr>{BN}+"WRITE"{BN}+ {
2388 yyextra->current->spec.setWritable(
true);
2391<QtPropType,QtPropAttr>{BN}+"MEMBER"{BN}+{ID} |
2392<QtPropType,QtPropAttr>{BN}+"RESET"{BN}+{ID} |
2393<QtPropType,QtPropAttr>{BN}+"SCRIPTABLE"{BN}+{ID} |
2394<QtPropType,QtPropAttr>{BN}+"DESIGNABLE"{BN}+{ID} |
2395<QtPropType,QtPropAttr>{BN}+"NOTIFY"{BN}+{ID} |
2396<QtPropType,QtPropAttr>{BN}+"REVISION"{BN}+{ID} |
2397<QtPropType,QtPropAttr>{BN}+"STORED"{BN}+{ID} |
2398<QtPropType,QtPropAttr>{BN}+"USER"{BN}+{ID} |
2399<QtPropType,QtPropAttr>{BN}+"CONSTANT"{BN} |
2400<QtPropType,QtPropAttr>{BN}+"FINAL"{BN} {
2404 yyextra->current->read = yytext;
2408 yyextra->current->write = yytext;
2411<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2412 yyextra->current->name=yytext;
2416<FindMembers>"requires" {
2417 if (yyextra->insideJava) REJECT;
2418 yyextra->current->req.clear();
2419 yyextra->requiresContext = YY_START;
2420 BEGIN(RequiresClause);
2422<RequiresClause>"requires"{BN}*/"{" {
2423 if (yyextra->insideJava) REJECT;
2425 yyextra->current->req+=yytext;
2426 BEGIN( RequiresExpression ) ;
2428<RequiresClause>"requires"{BN}*"(" {
2429 if (yyextra->insideJava) REJECT;
2431 yyextra->current->req+=yytext;
2432 yyextra->lastRoundContext=RequiresExpression;
2433 yyextra->pCopyRoundString=&yyextra->current->req;
2434 yyextra->roundCount=0;
2435 BEGIN( CopyRound ) ;
2437<RequiresExpression>"{" {
2438 yyextra->current->req+=yytext;
2439 yyextra->lastCurlyContext=RequiresClause;
2440 yyextra->pCopyCurlyString=&yyextra->current->req;
2441 yyextra->curlyCount=0;
2442 BEGIN( CopyCurly ) ;
2444<RequiresExpression>\n {
2445 yyextra->current->req+=
' ';
2448<RequiresExpression>. {
2449 yyextra->current->req+=yytext;
2451<RequiresClause>"(" {
2452 yyextra->current->req+=yytext;
2453 yyextra->lastRoundContext=RequiresClause;
2454 yyextra->pCopyRoundString=&yyextra->current->req;
2455 yyextra->roundCount=0;
2456 BEGIN( CopyRound ) ;
2458<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" {
2462 yyextra->current->req+=yytext;
2463 yyextra->lastRoundContext=RequiresClause;
2464 yyextra->pCopyRoundString=&yyextra->current->req;
2465 yyextra->roundCount=0;
2473<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" {
2477 yyextra->current->req+=yytext;
2478 yyextra->lastSharpContext=RequiresClause;
2479 yyextra->pCopySharpString=&yyextra->current->req;
2480 yyextra->sharpCount=0;
2488<RequiresClause>{NOTopt}{SCOPENAME} {
2492 yyextra->current->req=yytext;
2493 BEGIN(yyextra->requiresContext);
2500<RequiresClause>{NOTopt}"::"{ID} {
2502 yyextra->current->req+=yytext;
2504<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) {
2506 yyextra->current->req+=yytext;
2508<RequiresClause>{BN}+ {
2509 yyextra->current->req+=
' ';
2514 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2515 BEGIN(yyextra->requiresContext);
2517<FindMembers,FindMemberName>{SCOPENAME} {
2519 yyextra->yyBegColNr=yyextra->yyColNr;
2520 yyextra->yyBegLineNr=yyextra->yyLineNr;
2522 if (yyextra->insideIDL && yyleng==9 &&
dstrcmp(yytext,
"cpp_quote")==0)
2526 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
dstrcmp(yytext,
"import")==0)
2528 if (yyextra->insideIDL)
2533 else if (yyextra->insidePHP &&
dstrcmp(yytext,
"use")==0)
2537 else if (yyextra->insideJava &&
dstrcmp(yytext,
"package")==0)
2542 else if (yyextra->insideIDL &&
dstrcmp(yytext,
"case")==0)
2544 BEGIN(IDLUnionCase);
2546 else if (yyextra->insideTryBlock &&
dstrcmp(yytext,
"catch")==0)
2548 yyextra->insideTryBlock=
false;
2549 BEGIN(TryFunctionBlock);
2551 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"alignas")==0)
2553 yyextra->lastAlignAsContext = YY_START;
2556 else if (yyextra->insideJS &&
dstrcmp(yytext,
"var")==0)
2558 yyextra->current->type=
"var";
2560 else if (yyextra->insideJS &&
dstrcmp(yytext,
"function")==0)
2562 yyextra->current->type=
"function";
2564 else if (yyextra->insideCS &&
dstrcmp(yytext,
"this")==0)
2568 yyextra->current->name=
"this";
2571 else if (yyextra->insideCpp && (
dstrcmp(yytext,
"static_assert")==0 ||
dstrcmp(yytext,
"_Static_assert")==0))
2574 BEGIN(StaticAssert);
2576 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"decltype")==0)
2580 if (!yyextra->current->type.empty()) yyextra->current->type+=
' ';
2581 yyextra->current->type+=yytext;
2584 else if (yyextra->insideSlice &&
dstrcmp(yytext,
"optional")==0)
2586 if (yyextra->current->type.empty())
2588 yyextra->current->type =
"optional";
2592 yyextra->current->type +=
" optional";
2594 yyextra->lastModifierContext = YY_START;
2595 BEGIN(SliceOptional);
2599 if (YY_START==FindMembers)
2603 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2604 if (javaLike &&
dstrcmp(yytext,
"public")==0)
2606 yyextra->current->protection = Protection::Public;
2608 else if (javaLike &&
dstrcmp(yytext,
"protected")==0)
2610 yyextra->current->protection = Protection::Protected;
2612 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
dstrcmp(yytext,
"internal")==0)
2614 yyextra->current->protection = Protection::Package;
2616 else if (javaLike &&
dstrcmp(yytext,
"private")==0)
2618 yyextra->current->protection = Protection::Private;
2620 else if (javaLike &&
dstrcmp(yytext,
"static")==0)
2622 if (YY_START==FindMembers)
2623 yyextra->current->name = yytext;
2625 yyextra->current->name += yytext;
2626 yyextra->current->isStatic =
true;
2630 if (YY_START==FindMembers)
2631 yyextra->current->name = yytext;
2633 yyextra->current->name += yytext;
2634 if (yyextra->current->name.startsWith(
"static "))
2636 yyextra->current->isStatic =
true;
2637 yyextra->current->name= yyextra->current->name.mid(7);
2639 else if (yyextra->current->name.startsWith(
"inline "))
2641 if (yyextra->current->type.empty())
2643 yyextra->current->type=
"inline";
2647 yyextra->current->type+=
"inline ";
2649 yyextra->current->name= yyextra->current->name.mid(7);
2651 else if (yyextra->current->name.startsWith(
"constexpr "))
2653 if (yyextra->current->type.empty())
2655 yyextra->current->type=
"constexpr";
2659 yyextra->current->type+=
"constexpr ";
2661 yyextra->current->name=yyextra->current->name.mid(10);
2663 else if (yyextra->current->name.startsWith(
"consteval "))
2665 if (yyextra->current->type.empty())
2667 yyextra->current->type=
"consteval";
2671 yyextra->current->type+=
"consteval ";
2673 yyextra->current->name=yyextra->current->name.mid(10);
2675 else if (yyextra->current->name.startsWith(
"constinit "))
2677 if (yyextra->current->type.empty())
2679 yyextra->current->type=
"constinit";
2683 yyextra->current->type+=
"constinit ";
2685 yyextra->current->name=yyextra->current->name.mid(10);
2687 else if (yyextra->current->name.startsWith(
"const "))
2689 if (yyextra->current->type.empty())
2691 yyextra->current->type=
"const";
2695 yyextra->current->type+=
"const ";
2697 yyextra->current->name=yyextra->current->name.mid(6);
2699 else if (yyextra->current->name.startsWith(
"volatile "))
2701 if (yyextra->current->type.empty())
2703 yyextra->current->type=
"volatile";
2707 yyextra->current->type+=
"volatile ";
2709 yyextra->current->name=yyextra->current->name.mid(9);
2711 else if (yyextra->current->name.startsWith(
"typedef "))
2713 if (yyextra->current->type.empty())
2715 yyextra->current->type=
"typedef";
2719 yyextra->current->type+=
"typedef ";
2721 yyextra->current->name=yyextra->current->name.mid(8);
2731 yyextra->externLinkage=
false;
2735 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2738 yyextra->lastSkipRoundContext = FindMembers;
2739 yyextra->roundCount=0;
2742<StaticAssert>{BN}+ {
lineCount(yyscanner); }
2748 yyextra->current->type+=yytext;
2749 yyextra->lastRoundContext=FindMembers;
2750 yyextra->pCopyRoundString=&yyextra->current->type;
2751 yyextra->roundCount=0;
2754<DeclType>{BN}+ {
lineCount(yyscanner); }
2759<CSIndexer>"["[^\n\]]*"]" {
2763<FindMembers>[0-9]{ID} {
2766 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2768 yyextra->current->name+=
".";
2772 yyextra->current->name+=yytext;
2774<CppQuote>"("{B}*"\"" {
2775 yyextra->insideCppQuote=
true;
2779<IDLUnionCase>":" { BEGIN(FindMembers); }
2780<IDLUnionCase>\n {
lineCount(yyscanner); }
2782<TryFunctionBlock>\n {
lineCount(yyscanner); }
2783<TryFunctionBlock>"{" {
2784 yyextra->curlyCount=0;
2785 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2789<TryFunctionBlockEnd>{BN}*"catch" {
lineCount(yyscanner); BEGIN(TryFunctionBlock);
2791<TryFunctionBlockEnd>\n { unput(*yytext);
2792 BEGIN( FindMembers );
2794<TryFunctionBlockEnd>. { unput(*yytext);
2795 BEGIN( FindMembers );
2798 yyextra->insideCppQuote=
false;
2801<FindConceptParts>[^\/\n]* {
2802 yyextra->current->initializer << yytext;
2804<FindConceptParts>. {
2805 yyextra->current->initializer << yytext;
2807<FindConceptParts>\n {
2808 yyextra->current->initializer << yytext;
2809 yyextra->yyLineNr++;
2811<FindConceptParts>{CCS} {
2812 yyextra->current->initializer << yytext;
2814<FindConceptParts>{CPPC} {
2815 yyextra->current->initializer << yytext;
2817<FindConceptParts>^[ \t]*{CCS}[!*] {
2819 size_t indent = text.
find(
'/');
2821 if (!yyextra->current->initializer.empty())
2823 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2826 yyextra->current->section = EntryType::makeConceptDocPart();
2827 yyextra->current->startLine = yyextra->yyLineNr;
2828 yyextra->current->startColumn = indent;
2829 yyextra->current->initializer.clear();
2830 BEGIN(FindConceptDocs);
2832<FindConceptParts>^[ \t]*{CPPC}[!/].*\n {
2833 if (!yyextra->current->initializer.empty())
2835 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2839 size_t indent = line.find(
'/');
2840 yyextra->current->section = EntryType::makeConceptDocPart();
2841 yyextra->current->startLine = yyextra->yyLineNr;
2842 yyextra->current->startColumn = indent;
2843 yyextra->current->initializer.clear();
2844 yyextra->current->initializer << line.mid(indent+3);
2845 yyextra->yyLineNr++;
2846 BEGIN(FindConceptCxxDocs);
2848<FindConceptCxxDocs>^[ \t]*{CPPC}.*\n {
2850 size_t p = line.find(
'/');
2851 if (line.at(p+2)==
'!' || line.at(p+2)==
'/') p++;
2852 yyextra->current->initializer << line.mid(p+2);
2853 yyextra->yyLineNr++;
2855<FindConceptCxxDocs>{CCS}|{CCE}|{CPPC} {
2856 yyextra->current->initializer << yytext;
2858<FindConceptCxxDocs>. {
2859 if (!yyextra->current->initializer.empty())
2863 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2867 yyextra->current->section = EntryType::makeConceptCodePart();
2868 yyextra->current->startLine = yyextra->yyLineNr;
2869 BEGIN(FindConceptParts);
2871<FindConceptDocs>^[ \t]*"*"+/[^/] {
2873<FindConceptDocs>[^\*\n]+ {
2874 yyextra->current->initializer << yytext;
2876<FindConceptDocs>\n {
2877 yyextra->current->initializer << yytext;
2878 yyextra->yyLineNr++;
2880<FindConceptDocs>"*"*{CCE}[ t]*\n? {
2881 if (!yyextra->current->initializer.empty())
2885 yyextra->current->section = EntryType::makeConceptDocPart();
2886 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2890 yyextra->current->section = EntryType::makeConceptCodePart();
2891 yyextra->current->startLine = yyextra->yyLineNr;
2892 BEGIN(FindConceptParts);
2894<FindConceptDocs>"*"*{CCE} {
2895 if (!yyextra->current->initializer.empty())
2899 yyextra->current->section = EntryType::makeConceptDocPart();
2900 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2903 yyextra->current->section = EntryType::makeConceptCodePart();
2904 yyextra->current->startLine = yyextra->yyLineNr;
2905 BEGIN(FindConceptParts);
2907<FindConceptParts><<EOF>> {
2908 if (!yyextra->current->initializer.empty())
2910 if (!yyextra->current->section.isConceptCodePart())
2912 yyextra->current->section = EntryType::makeConceptDocPart();
2914 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2919<FindMembers,FindFields>{B}*"#" {
if (yyextra->insidePHP)
2921 yyextra->lastCPPContext = YY_START;
2924<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2925<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2926 if (yyextra->insidePHP)
2928 yyextra->current->bodyLine = yyextra->yyLineNr;
2929 yyextra->current->bodyColumn = yyextra->yyColNr;
2930 yyextra->current->fileName = yyextra->fileName;
2931 yyextra->current->startLine = yyextra->yyLineNr;
2932 yyextra->current->startColumn = yyextra->yyColNr;
2933 yyextra->current->type.clear();
2934 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2935 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2936 yyextra->current->section = EntryType::makeDefine();
2937 yyextra->lastDefineContext = YY_START;
2940<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" {
2941 yyextra->yyLineNr = atoi(&yytext[1]);
2943 yyextra->lastPreLineCtrlContext = YY_START;
2944 if (YY_START==ReadBody ||
2945 YY_START==ReadNSBody ||
2946 YY_START==ReadBodyIntf)
2948 yyextra->current->program << yytext;
2950 BEGIN( PreLineCtrl );
2952<PreLineCtrl>"\""[^\n\"]*"\"" {
2954 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2955 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2956 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2958 yyextra->current->program << yytext;
2962 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2963 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2964 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2966 yyextra->current->program << yytext;
2970 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2971 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2972 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2974 yyextra->current->program << yytext;
2977 BEGIN( yyextra->lastPreLineCtrlContext );
2980<SkipCPP>\\[\r]*"\n"[\r]* {
lineCount(yyscanner); }
2981<SkipCPP>[\r]*\n[\r]* {
lineCount(yyscanner);
2982 BEGIN( yyextra->lastCPPContext) ;
2984<SDefine>{ID}{B}*"(" {
2985 yyextra->current->name = yytext;
2986 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2987 yyextra->current->args =
"(";
2988 yyextra->current->bodyLine = yyextra->yyLineNr;
2989 yyextra->current->bodyColumn = yyextra->yyColNr;
2990 yyextra->currentArgumentContext = DefineEnd;
2991 yyextra->fullArgString=yyextra->current->args;
2992 yyextra->copyArgString=&yyextra->current->args;
2993 BEGIN( ReadFuncArgType ) ;
3008 yyextra->current->bodyLine = yyextra->yyLineNr;
3009 yyextra->current->bodyColumn = yyextra->yyColNr;
3010 yyextra->current->name = yytext;
3017 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3019 BEGIN(yyextra->lastDefineContext);
3023 yyextra->current->fileName = yyextra->fileName;
3024 yyextra->current->startLine = yyextra->yyLineNr;
3025 yyextra->current->startColumn = yyextra->yyColNr;
3026 yyextra->current->type.clear();
3027 yyextra->current->type =
"const";
3028 DString init = yyextra->current->initializer.str();
3031 yyextra->current->initializer.str(
init.str());
3032 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3033 yyextra->current->section = EntryType::makeVariable();
3034 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3039<DefineEnd>\\[\r]?\n {
3041 yyextra->current->endBodyLine = yyextra->yyLineNr;
3044 if (yyextra->insideIDL && yyextra->insideCppQuote)
3050 yyextra->lastStringContext=DefineEnd;
3055<DefinePHP>{ID}["']{BN}*","{BN}* {
3056 yyextra->current->name = yytext;
3057 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3058 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3059 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
3060 yyextra->current->bodyLine = yyextra->yyLineNr;
3061 yyextra->current->bodyColumn = yyextra->yyColNr;
3062 yyextra->lastRoundContext = DefinePHPEnd;
3063 yyextra->pCopyRoundGString = &yyextra->current->initializer;
3064 yyextra->roundCount = 0;
3065 BEGIN( GCopyRound );
3069 if (yyextra->insideCli)
3072 yyextra->current->name = yytext ;
3080 yyextra->current->name += yytext ;
3083<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
3084 if (YY_START==ReadInitializer && yyextra->keepComment)
3090 if (yyextra->current->bodyLine==-1)
3092 yyextra->current->bodyLine=yyextra->yyLineNr;
3093 yyextra->current->bodyColumn = yyextra->yyColNr;
3095 yyextra->docBlockContext = YY_START;
3096 yyextra->docBlockInBody =
false;
3097 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3099 if (YY_START==MemberSpec && yyextra->memspecEntry && yyextra->memspecEntry->briefFile.empty())
3101 if (yytext[yyleng-3]==
'/')
3103 yyextra->memspecEntry->briefFile = yyextra->fileName;
3104 yyextra->memspecEntry->briefLine = yyextra->yyLineNr;
3108 yyextra->memspecEntry->docFile = yyextra->fileName;
3109 yyextra->memspecEntry->docLine = yyextra->yyLineNr;
3115 yyextra->docBlock.
str(indent.
str());
3119 yyextra->docBlockTerm =
';';
3120 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3122 yyextra->current->bitfields =
":"+yyextra->current->args;
3123 yyextra->current->args.clear();
3124 yyextra->current->section = EntryType::makeVariable();
3126 if (yytext[yyleng-3]==
'/')
DString fill(char c, size_t len)
Fills a string with a predefined character.
#define Config_getBool(name)
3138<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
3139 if (YY_START==ReadInitializer && yyextra->keepComment)
3145 yyextra->docBlockContext = YY_START;
3146 yyextra->docBlockInBody =
false;
3147 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3152 yyextra->docBlock.
str(indent.
str());
3155 yyextra->docBlockTerm =
',';
3156 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3158 yyextra->current->bitfields =
":"+yyextra->current->args;
3159 yyextra->current->args.clear();
3160 yyextra->current->section = EntryType::makeVariable();
3162 if (yytext[yyleng-3]==
'/')
3174<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
3175 if (YY_START==ReadInitializer && yyextra->keepComment)
3181 if (yyextra->current->bodyLine==-1)
3183 yyextra->current->bodyLine=yyextra->yyLineNr;
3184 yyextra->current->bodyColumn = yyextra->yyColNr;
3186 yyextra->docBlockContext = YY_START;
3187 yyextra->docBlockInBody =
false;
3188 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3192 yyextra->docBlock.
str(indent.
str());
3195 yyextra->docBlockTerm = 0;
3196 if (yytext[yyleng-3]==
'/')
3209<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
3211 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3214 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3219 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3225 if (yytext[2]==
'!' || yytext[2]==
'/')
3227 yyextra->docBlockContext = YY_START;
3228 yyextra->docBlockInBody =
false;
3229 yyextra->docBlockAutoBrief =
false;
3230 yyextra->docBlock.str(std::string());
3231 yyextra->docBlockTerm = 0;
3237 yyextra->lastCContext=YY_START;
3238 BEGIN(SkipCxxComment);
3243 if (yytext[2]==
'!' || yytext[2]==
'*')
3245 yyextra->docBlockContext = YY_START;
3246 yyextra->docBlockInBody =
false;
3247 yyextra->docBlock.str(std::string());
3248 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3250 yyextra->docBlockTerm = 0;
3256 yyextra->lastCContext=YY_START;
3261<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3262 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3263 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3267 if (!yyextra->insideCS) REJECT;
3268 yyextra->current->bodyLine = yyextra->yyLineNr;
3269 yyextra->current->bodyColumn = yyextra->yyColNr;
3270 yyextra->current->initializer.str(yytext);
3271 yyextra->lastInitializerContext = YY_START;
3272 yyextra->sharpCount=0;
3273 yyextra->initBracketCount=0;
3274 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3275 yyextra->current->spec.setGettable(
true);
3276 BEGIN(ReadInitializerPtr);
3279 yyextra->current->bodyLine = yyextra->yyLineNr;
3280 yyextra->current->bodyColumn = yyextra->yyColNr;
3281 yyextra->current->initializer.str(
" ");
3282 for (
size_t ii = 2 ; ii < yyextra->yyColNr; ii++)
3283 yyextra->current->initializer <<
" ";
3284 yyextra->current->initializer <<
"=";
3285 yyextra->lastInitializerContext = YY_START;
3286 yyextra->sharpCount=0;
3287 yyextra->initBracketCount=0;
3288 BEGIN(ReadInitializer);
3290<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3292 yyextra->current->exception +=
" ";
3295<UNOIDLAttributeBlock>"}" {
3296 yyextra->current->exception +=
" }";
3300<ReadInitializer,ReadInitializerPtr>"(" {
3301 yyextra->lastRoundContext=YY_START;
3302 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3303 yyextra->roundCount=0;
3304 yyextra->current->initializer << *yytext;
3307<ReadInitializer,ReadInitializerPtr>"[" {
3308 if (!yyextra->insidePHP) REJECT;
3309 yyextra->lastSquareContext=YY_START;
3310 yyextra->pCopySquareGString=&yyextra->current->initializer;
3311 yyextra->squareCount=0;
3312 yyextra->current->initializer << *yytext;
3315<ReadInitializer,ReadInitializerPtr>"{" {
3316 yyextra->lastCurlyContext=YY_START;
3317 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3318 yyextra->curlyCount=0;
3319 yyextra->current->initializer << *yytext;
3322<ReadInitializer,ReadInitializerPtr>[;,] {
3324 if (*yytext==
';' && yyextra->current_root->spec.isEnum())
3326 yyextra->current->fileName = yyextra->fileName;
3327 yyextra->current->startLine = yyextra->yyLineNr;
3328 yyextra->current->startColumn = yyextra->yyColNr;
3329 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3330 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3331 yyextra->current->section = EntryType::makeVariable();
3332 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3336 else if (*yytext==
';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3339 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3340 BEGIN(yyextra->lastInitializerContext);
3342 else if (*yytext==
',' && yyextra->initBracketCount==0)
3345 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3346 BEGIN(yyextra->lastInitializerContext);
3350 yyextra->current->initializer << *yytext;
3353<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} {
3354 if (!yyextra->insideCpp)
3360 yyextra->current->initializer << yytext;
3362 yyextra->lastRawStringContext = YY_START;
3363 yyextra->pCopyRawGString = &yyextra->current->initializer;
DString extractBeginRawStringDelimiter(const char *rawStart)
3368<ReadInitializer>{CPPC}.* {
3369 if (yyextra->keepComment)
3371 yyextra->current->initializer << yytext;
3378<ReadInitializer>{CCS} {
3379 if (yyextra->keepComment)
3381 yyextra->current->initializer << yytext;
3382 BEGIN(InitCopyComment);
3389<InitCopyComment>{CCE} {
3390 yyextra->current->initializer << yytext;
3391 BEGIN(ReadInitializer);
3393<InitCopyComment>\n {
3395 yyextra->current->initializer << yytext;
3398 yyextra->current->initializer << yytext;
3400<InitCopyComment><<EOF>> {
3401 warn(yyextra->fileName,yyextra->yyLineNr,
3402 "reached end of file while inside a C style comment block!");
#define warn(file, line, fmt,...)
3405<RawGString>{RAWEND} {
3408 *yyextra->pCopyRawGString << yytext;
3409 BEGIN(yyextra->lastRawStringContext);
DString extractEndRawStringDelimiter(const char *rawEnd)
3416<RawGString>[^)\n]+ {
3417 *yyextra->pCopyRawGString << yytext;
3420 *yyextra->pCopyRawGString << yytext;
3423 *yyextra->pCopyRawGString << yytext;
3426<RawString>{RAWEND} {
3427 *yyextra->pCopyRawString+=yytext;
3428 yyextra->fullArgString+=yytext;
3431 BEGIN(yyextra->lastRawStringContext);
3435 *yyextra->pCopyRawString += yytext;
3436 yyextra->fullArgString+=yytext;
3439 *yyextra->pCopyRawString += yytext;
3440 yyextra->fullArgString+=yytext;
3443 *yyextra->pCopyRawString += yytext;
3444 yyextra->fullArgString+=yytext;
3447<ReadInitializer,ReadInitializerPtr>\" {
3448 if (yyextra->insideIDL && yyextra->insideCppQuote)
3454 yyextra->lastStringContext=YY_START;
3455 yyextra->current->initializer << yytext;
3456 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3457 yyextra->stopAtInvalidString=
false;
3461<ReadInitializer,ReadInitializerPtr>"->" {
3462 yyextra->current->initializer << yytext;
3464<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3465 yyextra->current->initializer << yytext;
3467<ReadInitializer,ReadInitializerPtr>(">>") {
3468 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3471 yyextra->initBracketCount-=2;
3472 yyextra->sharpCount-=2;
3474 yyextra->current->initializer << yytext;
3476<ReadInitializer,ReadInitializerPtr>(">=") {
3477 yyextra->current->initializer << yytext;
3479<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3480 yyextra->initBracketCount++;
3481 yyextra->sharpCount++;
3482 yyextra->current->initializer << *yytext;
3484<ReadInitializer,ReadInitializerPtr>[>\]})] {
3485 yyextra->initBracketCount--;
3486 yyextra->sharpCount--;
3489 yyextra->current->endBodyLine=yyextra->yyLineNr;
3491 yyextra->current->initializer << *yytext;
3493<ReadInitializer,ReadInitializerPtr>\' {
3494 if (yyextra->insidePHP)
3496 yyextra->current->initializer << yytext;
3497 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3498 yyextra->lastStringContext=YY_START;
3499 BEGIN(CopyPHPGString);
3503 yyextra->current->initializer << yytext;
3506<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3507 if (yyextra->insidePHP)
3513 yyextra->current->initializer << yytext;
3516<ReadInitializer,ReadInitializerPtr>\n {
3517 yyextra->current->initializer << *yytext;
3520<ReadInitializer,ReadInitializerPtr>"@\"" {
3522 yyextra->current->initializer << yytext;
3523 if (!yyextra->insideCS && !yyextra->insideObjC)
3530 yyextra->lastSkipVerbStringContext=YY_START;
3531 yyextra->pSkipVerbString=&yyextra->current->initializer;
3532 BEGIN(SkipVerbString);
3535<SkipVerbString>[^\n"\\]+ {
3536 *yyextra->pSkipVerbString << yytext;
3538<SkipVerbString>"\\\\" {
3539 if (yyextra->insideCS) REJECT
3540 *yyextra->pSkipVerbString << yytext;
3542<SkipVerbString>"\\\"" {
3543 if (yyextra->insideCS) REJECT
3544 *yyextra->pSkipVerbString << yytext;
3546<SkipVerbString>"\"\"" {
3547 *yyextra->pSkipVerbString << yytext;
3549<SkipVerbString>"\"" {
3550 *yyextra->pSkipVerbString << *yytext;
3551 BEGIN(yyextra->lastSkipVerbStringContext);
3554 *yyextra->pSkipVerbString << *yytext;
3558 *yyextra->pSkipVerbString << *yytext;
3560<ReadInitializer,ReadInitializerPtr>"?>" {
3561 if (yyextra->insidePHP)
3562 BEGIN( FindMembersPHP );
3564 yyextra->current->initializer << yytext;
3566<ReadInitializer,ReadInitializerPtr>. {
3567 yyextra->current->initializer << *yytext;
3571<CopyString,CopyPHPString>\\. {
3572 *yyextra->pCopyQuotedString+=yytext;
3575 *yyextra->pCopyQuotedString+=*yytext;
3576 BEGIN( yyextra->lastStringContext );
3579 *yyextra->pCopyQuotedString+=*yytext;
3580 BEGIN( yyextra->lastStringContext );
3582<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3583 *yyextra->pCopyQuotedString+=yytext;
3585<CopyString,CopyPHPString>\n {
3586 *yyextra->pCopyQuotedString+=*yytext;
3589<CopyString,CopyPHPString>. {
3590 *yyextra->pCopyQuotedString+=*yytext;
3594<CopyGString,CopyPHPGString>\\. {
3595 *yyextra->pCopyQuotedGString << yytext;
3598 *yyextra->pCopyQuotedGString << *yytext;
3599 BEGIN( yyextra->lastStringContext );
3602 *yyextra->pCopyQuotedGString << *yytext;
3603 BEGIN( yyextra->lastStringContext );
3605<CopyGString,CopyPHPGString>"<?php" {
3606 *yyextra->pCopyQuotedGString << yytext;
3607 BEGIN( yyextra->lastStringContext );
3609<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3610 *yyextra->pCopyQuotedGString << yytext;
3612<CopyGString,CopyPHPGString>\n {
3613 *yyextra->pCopyQuotedGString << *yytext;
3614 if (yyextra->stopAtInvalidString)
3616 BEGIN( yyextra->lastStringContext );
3623<CopyGString,CopyPHPGString>. {
3624 *yyextra->pCopyQuotedGString << *yytext;
3628<CopyC11Attribute>\" {
3629 *yyextra->pCopyC11AttributeString += *yytext;
3630 yyextra->pCopyQuotedString=yyextra->pCopyC11AttributeString;
3631 yyextra->lastStringContext=YY_START;
3634<CopyC11Attribute>\n {
3636 *yyextra->pCopyC11AttributeString += *yytext;
3638<CopyC11Attribute>{ID} {
3639 if (
dstrcmp(yytext,
"nodiscard")==0)
3641 yyextra->current->spec.setNoDiscard(
true);
3643 *yyextra->pCopyC11AttributeString += yytext;
3645<CopyC11Attribute>. {
3646 *yyextra->pCopyC11AttributeString += *yytext;
3648<CopyC11Attribute>"]]" {
3649 yyextra->commentScanner.addDeprecatedDocs(yyextra->current.get(),
3652 yyextra->thisParser);
3653 BEGIN(yyextra->lastC11AttributeContext);
3659 *yyextra->pCopyRoundString += *yytext;
3660 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3661 yyextra->lastStringContext=YY_START;
3665 *yyextra->pCopyRoundString += *yytext;
3666 yyextra->roundCount++;
3669 *yyextra->pCopyRoundString += *yytext;
3670 if (--yyextra->roundCount<0)
3671 BEGIN(yyextra->lastRoundContext);
3675 *yyextra->pCopyRoundString += *yytext;
3678 if (yyextra->insidePHP)
3680 yyextra->current->initializer << yytext;
3681 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3682 yyextra->lastStringContext=YY_START;
3683 BEGIN(CopyPHPString);
3687 *yyextra->pCopyRoundString += yytext;
3690<CopyRound>{CHARLIT} {
3691 if (yyextra->insidePHP)
3697 *yyextra->pCopyRoundString+=yytext;
3700<CopyRound>[^"'()\n,]+ {
3701 *yyextra->pCopyRoundString+=yytext;
3704 *yyextra->pCopyRoundString+=*yytext;
3709 *yyextra->pCopySharpString += *yytext;
3710 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3711 yyextra->lastStringContext=YY_START;
3715 *yyextra->pCopySharpString += *yytext;
3716 yyextra->sharpCount++;
3719 *yyextra->pCopySharpString += *yytext;
3720 if (--yyextra->sharpCount<0)
3722 BEGIN(yyextra->lastSharpContext);
3727 *yyextra->pCopySharpString += *yytext;
3730 if (yyextra->insidePHP)
3732 yyextra->current->initializer << yytext;
3733 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3734 yyextra->lastStringContext=YY_START;
3735 BEGIN(CopyPHPString);
3739 *yyextra->pCopySharpString += yytext;
3742<CopySharp>{CHARLIT} {
3743 if (yyextra->insidePHP)
3749 *yyextra->pCopySharpString+=yytext;
3752<CopySharp>[^"'<>\n,]+ {
3753 *yyextra->pCopySharpString+=yytext;
3756 *yyextra->pCopySharpString+=*yytext;
3762 *yyextra->pCopyRoundGString << *yytext;
3763 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3764 yyextra->lastStringContext=YY_START;
3768 *yyextra->pCopyRoundGString << *yytext;
3769 yyextra->roundCount++;
3772 *yyextra->pCopyRoundGString << *yytext;
3773 if (--yyextra->roundCount<0)
3774 BEGIN(yyextra->lastRoundContext);
3778 *yyextra->pCopyRoundGString << *yytext;
3781 if (yyextra->insidePHP)
3783 yyextra->current->initializer << yytext;
3784 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3785 yyextra->lastStringContext=YY_START;
3786 BEGIN(CopyPHPGString);
3790 *yyextra->pCopyRoundGString << yytext;
3793<GCopyRound>{CHARLIT} {
3794 if (yyextra->insidePHP)
3800 *yyextra->pCopyRoundGString << yytext;
3804 if (!yyextra->insideCS) REJECT;
3805 *yyextra->pCopyRoundGString << yytext;
3806 yyextra->lastSkipVerbStringContext=YY_START;
3807 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3808 BEGIN(SkipVerbString);
3810<GCopyRound>[^"'()\n\/,R]+ {
3811 *yyextra->pCopyRoundGString << yytext;
3813<GCopyRound>{RAWBEGIN} {
3814 *yyextra->pCopyRoundGString << yytext;
3816 yyextra->lastRawStringContext = YY_START;
3817 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3821 *yyextra->pCopyRoundGString << *yytext;
3826 *yyextra->pCopySquareGString << *yytext;
3827 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3828 yyextra->lastStringContext=YY_START;
3832 *yyextra->pCopySquareGString << *yytext;
3833 if (yyextra->insidePHP)
3835 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3836 yyextra->lastStringContext=YY_START;
3837 BEGIN(CopyPHPGString);
3841 *yyextra->pCopySquareGString << *yytext;
3842 yyextra->squareCount++;
3845 *yyextra->pCopySquareGString << *yytext;
3846 if (--yyextra->squareCount<0)
3847 BEGIN(yyextra->lastSquareContext);
3851 *yyextra->pCopySquareGString << *yytext;
3854 if (yyextra->insidePHP)
3856 yyextra->current->initializer << yytext;
3857 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3858 yyextra->lastStringContext=YY_START;
3859 BEGIN(CopyPHPGString);
3863 *yyextra->pCopySquareGString << yytext;
3866<GCopySquare>{CHARLIT} {
3867 if (yyextra->insidePHP)
3873 *yyextra->pCopySquareGString << yytext;
3876<GCopySquare>[^"'\[\]\n\/,]+ {
3877 *yyextra->pCopySquareGString << yytext;
3880 *yyextra->pCopySquareGString << *yytext;
3885 *yyextra->pCopyCurlyString += *yytext;
3886 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3887 yyextra->lastStringContext=YY_START;
3888 yyextra->keepComment=
false;
3892 *yyextra->pCopyCurlyString += *yytext;
3893 if (yyextra->insidePHP)
3895 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3896 yyextra->lastStringContext=YY_START;
3897 yyextra->keepComment=
false;
3898 BEGIN(CopyPHPString);
3902 *yyextra->pCopyCurlyString += *yytext;
3903 yyextra->curlyCount++;
3906 *yyextra->pCopyCurlyString += *yytext;
3907 if (--yyextra->curlyCount<0)
3909 yyextra->keepComment=
false;
3910 BEGIN(yyextra->lastCurlyContext);
3913<CopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
3919 *yyextra->pCopyCurlyString += yytext;
3922<CopyCurly>[^"'{}\/\n,]+ {
3923 *yyextra->pCopyCurlyString += yytext;
3925<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3928 *yyextra->pCopyCurlyString += *yytext;
3931 *yyextra->pCopyCurlyString += *yytext;
3933<CopyCurly>{CPPC}[^\n]* {
3934 if (yyextra->keepComment)
3936 *yyextra->pCopyCurlyString += yytext;
3944 if (yyextra->keepComment)
3946 *yyextra->pCopyCurlyString += yytext;
3955 *yyextra->pCopyCurlyString += yytext;
3960 *yyextra->pCopyCurlyString += *yytext;
3963 *yyextra->pCopyCurlyString += *yytext;
3965<CopyComment><<EOF>> {
3966 warn(yyextra->fileName,yyextra->yyLineNr,
3967 "reached end of file while inside a C style comment block!");
3972<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? {
3974<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? {
3976 size_t s = line.
find(
' ');
3977 size_t e = line.
find(
'"',s);
3978 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3979 if (yytext[yyleng-1]==
'\n')
int toInt(bool *ok=nullptr, int base=10) const
3986 *yyextra->pCopyCurlyGString << *yytext;
3987 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3988 yyextra->lastStringContext=YY_START;
3989 yyextra->keepComment =
false;
3993 *yyextra->pCopyCurlyGString << *yytext;
3994 if (yyextra->insidePHP)
3996 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
3997 yyextra->lastStringContext=YY_START;
3998 yyextra->keepComment =
false;
3999 BEGIN(CopyPHPGString);
4003 *yyextra->pCopyCurlyGString << *yytext;
4004 yyextra->curlyCount++;
4007 *yyextra->pCopyCurlyGString << *yytext;
4008 if (--yyextra->curlyCount<0)
4010 yyextra->current->endBodyLine = yyextra->yyLineNr;
4011 yyextra->keepComment =
false;
4012 BEGIN(yyextra->lastCurlyContext);
4015<GCopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
4021 *yyextra->pCopyCurlyGString << yytext;
4024<GCopyCurly>[^"'{}\/\n,]+ {
4025 *yyextra->pCopyCurlyGString << yytext;
4028 *yyextra->pCopyCurlyGString << yytext;
4030<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
4033 *yyextra->pCopyCurlyGString << *yytext;
4036 *yyextra->pCopyCurlyGString << *yytext;
4038<GCopyCurly>{CPPC}[^\n]* {
4039 if (yyextra->keepComment)
4041 *yyextra->pCopyCurlyGString << yytext;
4049 if (yyextra->keepComment)
4051 *yyextra->pCopyCurlyGString << yytext;
4052 BEGIN(GCopyComment);
4059<GCopyComment>{CCE} {
4060 *yyextra->pCopyCurlyGString << yytext;
4065 *yyextra->pCopyCurlyGString << *yytext;
4068 *yyextra->pCopyCurlyGString << *yytext;
4070<GCopyComment><<EOF>> {
4071 warn(yyextra->fileName,yyextra->yyLineNr,
4072 "reached end of file while inside a C style comment block!");
4080 if (yyextra->current->type.empty() &&
4081 yyextra->current->name==
"enum")
4083 yyextra->current->section = EntryType::makeEnum();
4084 yyextra->current->name.clear();
4085 yyextra->current->args.clear();
4086 BEGIN(EnumBaseType);
4090 if (yyextra->current->type.empty())
4093 yyextra->current->name.sprintf(
"__pad%d__",yyextra->padCount++);
4096 yyextra->current->bitfields+=
":";
4100 yyextra->current->bitfields+=*yytext;
4103 yyextra->current->args+=*yytext;
4107 yyextra->current->args+=
' ';
4110 DString oldType = yyextra->current->type;
4111 if (yyextra->current->bodyLine==-1)
4113 yyextra->current->bodyLine = yyextra->yyLineNr;
4114 yyextra->current->bodyColumn = yyextra->yyColNr;
4116 if ( yyextra->insidePHP && yyextra->current->type.startsWith(
"var"))
4118 yyextra->current->type = yyextra->current->type.mid(3);
4120 if (yyextra->isTypedef && !yyextra->current->type.startsWith(
"typedef "))
4122 yyextra->current->type.prepend(
"typedef ");
4124 bool isStatic = yyextra->current->isStatic;
4125 Protection prot = yyextra->current->protection;
4126 bool isConcept = yyextra->current->section.isConcept();
4127 bool isModule = yyextra->current->section.isModuleDoc();
4130 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4135 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4138 else if (!yyextra->current->name.empty() && !yyextra->current->section.isEnum())
4140 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
4142 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
4143 if (yyextra->current->section.isClass())
4147 yyextra->current->section = EntryType::makeVariable() ;
4148 yyextra->current->fileName = yyextra->fileName;
4149 yyextra->current->startLine = yyextra->yyBegLineNr;
4150 yyextra->current->startColumn = yyextra->yyBegColNr;
4151 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4154 if ( *yytext ==
',')
4156 yyextra->current->isStatic = isStatic;
4157 yyextra->current->protection = prot;
4158 yyextra->current->name.clear();
4159 yyextra->current->args.clear();
4160 yyextra->current->brief.clear();
4161 yyextra->current->doc.clear();
4162 yyextra->current->initializer.str(std::string());
4163 yyextra->current->bitfields.clear();
4168 yyextra->mtype = MethodTypes::Method;
4169 yyextra->virt = Specifier::Normal;
4170 yyextra->current->bodyLine = -1;
4171 yyextra->current->bodyColumn = 1;
4172 yyextra->current->groups.clear();
4178 if (yyextra->insideSlice)
4180 yyextra->squareCount=1;
4181 yyextra->lastSquareContext = YY_START;
4182 yyextra->current->metaData +=
"[";
4183 BEGIN( SliceMetadata );
4185 else if (!yyextra->insideCS &&
4186 (yyextra->current->name.empty() ||
4187 yyextra->current->name==
"typedef"
4191 yyextra->squareCount=1;
4192 yyextra->lastSquareContext = YY_START;
4193 yyextra->idlAttr.clear();
4194 yyextra->idlProp.clear();
4195 yyextra->current->mtype = yyextra->mtype;
4198 yyextra->current->mtype == MethodTypes::Property)
4200 yyextra->odlProp =
true;
4201 yyextra->current->spec.setGettable(
true).setSettable(
true);
4204 BEGIN( IDLAttribute );
4206 else if (yyextra->insideCS &&
4207 yyextra->current->name.empty())
4209 yyextra->squareCount=1;
4210 yyextra->lastSquareContext = YY_START;
4213 yyextra->current->args.clear();
4214 BEGIN( SkipSquare );
4218 yyextra->current->args += yytext ;
4219 yyextra->squareCount=1;
4220 yyextra->externLinkage=
false;
4225 yyextra->squareCount++;
4226 yyextra->current->metaData +=
"[";
4228<SliceMetadata>{BN}* {
4231<SliceMetadata>\"[^\"]*\" {
4232 yyextra->current->metaData += yytext;
4235 yyextra->current->metaData += yytext;
4238 yyextra->current->metaData += yytext;
4239 if (--yyextra->squareCount<=0)
4241 BEGIN (yyextra->lastSquareContext);
4245 yyextra->current->type +=
"(";
4246 yyextra->roundCount++;
4248<SliceOptional>[0-9]+ {
4249 yyextra->current->type += yytext;
4252 yyextra->current->type +=
")";
4253 if(--yyextra->roundCount<=0)
4255 BEGIN (yyextra->lastModifierContext);
4260 if (--yyextra->squareCount<=0)
4263 if (yyextra->current->mtype == MethodTypes::Property)
4264 BEGIN( IDLPropName );
4266 BEGIN( yyextra->lastSquareContext );
4269<IDLAttribute>"propput" {
4272 yyextra->current->mtype = MethodTypes::Property;
4274 yyextra->current->spec.setSettable(
true);
4276<IDLAttribute>"propget" {
4279 yyextra->current->mtype = MethodTypes::Property;
4281 yyextra->current->spec.setGettable(
true);
4283<IDLAttribute>"property" {
4284 yyextra->current->spec.setProperty(
true);
4286<IDLAttribute>"attribute" {
4287 yyextra->current->spec.setAttribute(
true);
4289<IDLAttribute>"optional" {
4290 yyextra->current->spec.setOptional(
true);
4292<IDLAttribute>"readonly" {
4295 yyextra->current->spec.setSettable(
false);
4299 yyextra->current->spec.setReadonly(
true);
4302<IDLAttribute>"bound" {
4303 yyextra->current->spec.setBound(
true);
4305<IDLAttribute>"removable" {
4306 yyextra->current->spec.setRemovable(
true);
4308<IDLAttribute>"constrained" {
4309 yyextra->current->spec.setConstrained(
true);
4311<IDLAttribute>"transient" {
4312 yyextra->current->spec.setTransient(
true);
4314<IDLAttribute>"maybevoid" {
4315 yyextra->current->spec.setMaybeVoid(
true);
4317<IDLAttribute>"maybedefault" {
4318 yyextra->current->spec.setMaybeDefault(
true);
4320<IDLAttribute>"maybeambiguous" {
4321 yyextra->current->spec.setMaybeAmbiguous(
true);
4325<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
4328 if (yyextra->odlProp)
4330 yyextra->idlProp = yytext;
4333<IDLPropName>{ID}{BN}*"(" {
4334 yyextra->current->name = yytext;
4335 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
4336 yyextra->current->startLine = yyextra->yyLineNr;
4337 yyextra->current->startColumn = yyextra->yyColNr;
4340<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
4341 if (yyextra->odlProp)
4343 yyextra->idlProp += yytext;
4346<IDLPropName>{ID}{BNopt}/";" {
4347 if (yyextra->odlProp)
4349 yyextra->current->name = yytext;
4350 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
4351 yyextra->odlProp =
false;
4356<IDLProp>{BN}*"["[^\]]*"]"{BN}* {
4357 yyextra->idlAttr = yytext;
4358 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
4361 yyextra->idlProp = yytext;
4363<IDLProp>{BN}*{ID}{BN}*"," {
4364 if (yyextra->current->args.empty())
4365 yyextra->current->args =
"(";
4367 yyextra->current->args +=
", ";
4368 yyextra->current->args += yyextra->idlAttr;
4369 yyextra->current->args +=
" ";
4370 yyextra->current->args += yyextra->idlProp;
4371 yyextra->current->args +=
" ";
4372 yyextra->current->args += yytext;
4373 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4374 yyextra->idlProp.clear();
4375 yyextra->idlAttr.clear();
4378<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4382 yyextra->current->fileName = yyextra->fileName;
4383 yyextra->current->type = yyextra->idlProp;
4384 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4385 if (!yyextra->current->args.empty())
4386 yyextra->current->args +=
")";
4387 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4388 yyextra->current->section = EntryType::makeVariable();
4389 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4391 BEGIN( FindMembers );
4396<Array>"]" { yyextra->current->args += *yytext ;
4397 if (--yyextra->squareCount<=0)
4398 BEGIN( FindMembers ) ;
4400<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4401 if (--yyextra->squareCount<=0)
4402 BEGIN( SFunction ) ;
4404<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4405 yyextra->squareCount++;
4407<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4408<SkipSquare>"[" { yyextra->squareCount++; }
4410 if (--yyextra->squareCount<=0)
4411 BEGIN( yyextra->lastSquareContext );
4414 yyextra->lastStringContext=YY_START;
4415 BEGIN( SkipString );
4417<SkipSquare>[^\n\[\]\"]+
4418<FindMembers>"<" {
addType(yyscanner);
4419 yyextra->current->type += yytext ;
4422<Sharp>">" { yyextra->current->type += *yytext ;
4423 if (--yyextra->sharpCount<=0)
4424 BEGIN( FindMembers ) ;
4426<Sharp>"<" { yyextra->current->type += *yytext ;
4427 yyextra->sharpCount++;
4430 yyextra->current->type +=
' ';
4433<Sharp>. { yyextra->current->type += *yytext ; }
4436 yyextra->current->bodyLine = yyextra->yyLineNr;
4437 yyextra->current->bodyColumn = yyextra->yyColNr;
4438 yyextra->current->name = yytext;
4443 yyextra->lastInitializerContext = YY_START;
4444 yyextra->sharpCount=0;
4445 yyextra->initBracketCount=0;
4446 yyextra->current->initializer.str(
"=");
4447 BEGIN(ReadInitializer);
4450 yyextra->lastInitializerContext = YY_START;
4451 yyextra->sharpCount=0;
4452 yyextra->initBracketCount=0;
4453 yyextra->current->initializer.str(yytext);
4454 BEGIN(ReadInitializer);
4457 if (yyextra->insideJava)
4459 if (!yyextra->current->name.empty())
4461 yyextra->current->fileName = yyextra->fileName;
4462 yyextra->current->startLine = yyextra->yyLineNr;
4463 yyextra->current->startColumn = yyextra->yyColNr;
4464 if (!yyextra->current_root->spec.isEnum())
4466 yyextra->current->type =
"@";
4468 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4469 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4470 yyextra->current->section = EntryType::makeVariable();
4471 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4475 BEGIN( FindMembers );
4486 if (!yyextra->current->name.empty())
4488 yyextra->current->fileName = yyextra->fileName;
4489 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4491 yyextra->current->startLine = yyextra->current->bodyLine;
4492 yyextra->current->startColumn = yyextra->current->bodyColumn;
4496 yyextra->current->startLine = yyextra->yyLineNr;
4497 yyextra->current->startColumn = yyextra->yyColNr;
4499 if (!yyextra->current_root->spec.isEnum())
4501 yyextra->current->type =
"@";
4503 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4504 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4505 yyextra->current->section = EntryType::makeVariable();
4507 if (!yyextra->insideCS && !yyextra->insideJava &&
4508 !yyextra->current_root->spec.isStrong())
4515 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4517 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4522 yyextra->current->reset();
4527 yyextra->squareCount=1;
4528 yyextra->lastSquareContext = YY_START;
4531<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; }
4532<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4533<ReadBody,ReadNSBody,ReadBodyIntf>"#".* {
if (!yyextra->insidePHP)
4536 yyextra->current->program << yytext ;
4539<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$\" {
if (!yyextra->insideCS) REJECT
4540 yyextra->current->program << yytext ;
4541 yyextra->pSkipInterpString = &yyextra->current->program;
4542 yyextra->lastSkipInterpStringContext=YY_START;
4543 yyextra->strCurlyCount = 0;
4544 BEGIN( SkipInterpString );
4546<SkipInterpString>([^"\\{}\x000D\x000A\x0085\x2028\x2029]|"{{"|"}}"|"\\'"|"\\\""|"\\\\"|"\\0"|"\\a"|"\\b"|"\\f"|"\\n"|"\\r"|"\\t"|"\\v"|"\\x"{HEXDIGIT}{HEXDIGIT}?{HEXDIGIT}?{HEXDIGIT}?|"\\"[uU]{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT})* {
4547 *yyextra->pSkipInterpString << yytext;
4549<SkipInterpString>"{" {
4550 *yyextra->pSkipInterpString << *yytext;
4551 yyextra->strCurlyCount++;
4553<SkipInterpString>"}" {
4554 *yyextra->pSkipInterpString << *yytext;
4555 yyextra->strCurlyCount--;
4557<SkipInterpString>\" {
4558 *yyextra->pSkipInterpString << *yytext;
4559 if (yyextra->strCurlyCount==0)
4561 BEGIN( yyextra->lastSkipInterpStringContext );
4564<SkipInterpString>. {
4565 *yyextra->pSkipInterpString << *yytext;
4568<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$@\" {
if (!yyextra->insideCS) REJECT
4569 yyextra->current->program << yytext ;
4570 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4571 yyextra->lastSkipInterpVerbStringContext=YY_START;
4572 yyextra->strCurlyCount = 0;
4573 BEGIN( SkipInterpVerbString );
4575<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4576 *yyextra->pSkipInterpVerbString << yytext;
4578<SkipInterpVerbString>"{" {
4579 *yyextra->pSkipInterpVerbString << *yytext;
4580 yyextra->strCurlyCount++;
4582<SkipInterpVerbString>"}" {
4583 *yyextra->pSkipInterpVerbString << *yytext;
4584 yyextra->strCurlyCount--;
4586<SkipInterpVerbString>\" {
4587 *yyextra->pSkipInterpVerbString << *yytext;
4588 if (yyextra->strCurlyCount==0)
4590 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4593<SkipInterpVerbString>. {
4594 *yyextra->pSkipInterpVerbString << *yytext;
4596<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4597<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4598 yyextra->pSkipVerbString = &yyextra->current->program;
4599 yyextra->lastSkipVerbStringContext=YY_START;
4600 BEGIN( SkipVerbString );
4602<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" {
if (yyextra->insidePHP)
4604 yyextra->current->program << yytext ;
4605 yyextra->pCopyHereDocGString = &yyextra->current->program;
4606 yyextra->lastHereDocContext=YY_START;
4607 BEGIN( CopyHereDoc );
4614<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4615 yyextra->current->program << yytext;
4617 yyextra->lastRawStringContext = YY_START;
4618 yyextra->pCopyRawGString = &yyextra->current->program;
4621<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4622 yyextra->pCopyQuotedGString = &yyextra->current->program;
4623 yyextra->lastStringContext=YY_START;
4624 yyextra->stopAtInvalidString=
false;
4625 BEGIN( CopyGString );
4627<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=
true; REJECT;}
4628<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4629 yyextra->lastContext = YY_START ;
4632<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4633 ++yyextra->yyLineNr ;
4634 yyextra->lastContext = YY_START ;
4637<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4638 if (!yyextra->insidePHP)
4640 yyextra->current->program << yytext;
4644 yyextra->current->program << yytext;
4645 yyextra->pCopyQuotedGString = &yyextra->current->program;
4646 yyextra->lastStringContext=YY_START;
4647 BEGIN(CopyPHPGString);
4650<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4651 if (yyextra->insidePHP)
4658 yyextra->current->program << yytext;
4661<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4662 ++yyextra->curlyCount ;
4665 yyextra->current->program << yytext ;
4666 --yyextra->curlyCount ;
4668<ReadBody,ReadNSBody>"}" {
4669 if ( yyextra->curlyCount>0 )
4671 yyextra->current->program << yytext ;
4672 --yyextra->curlyCount ;
4676 yyextra->current->endBodyLine = yyextra->yyLineNr;
4677 std::shared_ptr<Entry> original_root = yyextra->current_root;
4678 if (yyextra->current->section.isNamespace() && yyextra->current->type ==
"namespace")
4682 DString doc = yyextra->current->doc;
4683 int docLine = yyextra->current->docLine;
4684 DString docFile = yyextra->current->docFile;
4685 DString brief = yyextra->current->brief;
4686 int briefLine = yyextra->current->briefLine;
4687 DString briefFile = yyextra->current->briefFile;
4688 auto groups = yyextra->current->groups;
4689 auto anchors = yyextra->current->anchors;
4690 auto sli = yyextra->current->sli;
4691 auto rqli = yyextra->current->rqli;
4693 yyextra->current->doc =
"";
4694 yyextra->current->docLine = 0;
4695 yyextra->current->docFile =
"";
4696 yyextra->current->brief =
"";
4697 yyextra->current->briefLine = 0;
4698 yyextra->current->briefFile =
"";
4699 yyextra->current->groups.
clear();
4700 yyextra->current->anchors.clear();
4701 yyextra->current->sli.clear();
4702 yyextra->current->rqli.clear();
4704 while ((split_point = yyextra->current->name.find(
"::")) !=
DString::npos)
4706 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4707 yyextra->current->program.str(std::string());
4708 new_current->name = yyextra->current->name.mid(split_point + 2);
4709 yyextra->current->name = yyextra->current->name.left(split_point);
4710 if (yyextra->current->name.startsWith(
"inline "))
4712 yyextra->current->name = yyextra->current->name.mid(7);
4713 yyextra->current->spec.setInline(
true);
4715 if (!yyextra->current_root->name.empty()) yyextra->current->name.prepend(yyextra->current_root->name+
"::");
4717 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4718 yyextra->current_root = yyextra->current;
4719 yyextra->current = new_current;
4722 yyextra->current->doc = doc;
4723 yyextra->current->docLine = docLine;
4724 yyextra->current->docFile = docFile;
4725 yyextra->current->brief = brief;
4726 yyextra->current->briefLine = briefLine;
4727 yyextra->current->briefFile = briefFile;
4728 yyextra->current->groups = groups;
4729 yyextra->current->anchors = anchors;
4730 yyextra->current->sli = sli;
4731 yyextra->current->rqli = rqli;
4733 DString &cn = yyextra->current->name;
4737 yyextra->current->spec.setInline(
true);
4739 DString rn = yyextra->current_root->name;
4745 if (yyextra->isTypedef && cn.
empty())
4748 BEGIN( TypedefName );
4752 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4754 yyextra->current->program <<
',';
4759 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4760 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4762 if (yyextra->insideObjC &&
4763 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4766 BEGIN( ReadBodyIntf ) ;
4770 yyextra->memspecEntry = yyextra->current;
4771 if (yyextra->isTypedef)
4773 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4774 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4778 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4779 yyextra->current = std::make_shared<Entry>(*yyextra->memspecEntry);
4781 if (yyextra->current->section.isNamespace() ||
4782 yyextra->current->spec.isInterface() ||
4783 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4784 yyextra->insideSlice
4787 yyextra->current->reset();
4788 yyextra->current_root = std::move(original_root);
4790 yyextra->memspecEntry.reset();
4791 BEGIN( FindMembers ) ;
4795 if (!yyextra->isTypedef)
4797 yyextra->current->doc.clear();
4798 yyextra->current->brief.clear();
4800 BEGIN( MemberSpec ) ;
bool startsWith(const char *s) const
4806<ReadBody>"}"{BN}+"typedef"{BN}+ {
4808 if ( yyextra->curlyCount>0 )
4810 yyextra->current->program << yytext ;
4811 --yyextra->curlyCount ;
4815 yyextra->isTypedef =
true;
4816 yyextra->current->endBodyLine = yyextra->yyLineNr;
4817 DString &cn = yyextra->current->name;
4818 DString rn = yyextra->current_root->name;
4823 BEGIN( TypedefName );
4826<TypedefName>("const"|"volatile"){BN} {
4828 yyextra->current->type.prepend(yytext);
4831 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4833 yyextra->current->program <<
",";
4835 yyextra->current->name=yytext;
4837 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4838 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4840 if (!yyextra->firstTypedefEntry)
4842 yyextra->firstTypedefEntry = yyextra->current;
4844 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4846 yyextra->isTypedef=
true;
4847 BEGIN(MemberSpecSkip);
4851 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4853 yyextra->current->program <<
',';
4856 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4857 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4858 yyextra->memspecEntry = yyextra->current;
4859 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4862 BEGIN( MemberSpec ) ;
4864<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* {
4866 int i=0,l=(int)yyleng;
4867 while (i<l && (!
isId(yytext[i]))) i++;
4868 yyextra->msName =
DString(yytext).right(l-i).stripWhiteSpace();
4871 yyextra->msArgs=yyextra->msName.mid(j);
4872 yyextra->msName=yyextra->msName.left(j);
4874 yyextra->msType=
DString(yytext).left(i);
4877 if (yyextra->firstTypedefEntry)
4879 if (yyextra->firstTypedefEntry->spec.isStruct())
4881 yyextra->msType.prepend(
"struct "+yyextra->firstTypedefEntry->name);
4883 else if (yyextra->firstTypedefEntry->spec.isUnion())
4885 yyextra->msType.prepend(
"union "+yyextra->firstTypedefEntry->name);
4887 else if (yyextra->firstTypedefEntry->section.isEnum())
4889 yyextra->msType.prepend(
"enum "+yyextra->firstTypedefEntry->name);
4893 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
bool isId(int c)
Returns true if c is a valid character for an identifier.
4899 yyextra->current->name = yyextra->msName;
4906 if (yyextra->msName.empty() && !yyextra->current->name.empty())
4912 const Entry *p=yyextra->current.get();
4930 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4934 if (!yyextra->msName.empty()
4940 if (typedefHidesStruct &&
4941 yyextra->isTypedef &&
4942 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4943 yyextra->msType.stripWhiteSpace().empty() &&
4944 yyextra->memspecEntry)
4946 yyextra->memspecEntry->name=yyextra->msName;
4950 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4951 varEntry->lang = yyextra->language;
4952 varEntry->protection = yyextra->current->protection ;
4953 varEntry->mtype = yyextra->current->mtype;
4954 varEntry->virt = yyextra->current->virt;
4955 varEntry->isStatic = yyextra->current->isStatic;
4956 varEntry->section = EntryType::makeVariable();
4957 varEntry->name = yyextra->msName.stripWhiteSpace();
4958 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+
" ";
4959 varEntry->args = yyextra->msArgs;
4960 if (yyextra->isTypedef)
4962 varEntry->type.prepend(
"typedef ");
4965 if (typedefHidesStruct &&
4966 yyextra->isTypedef &&
4967 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4968 yyextra->memspecEntry
4971 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4975 varEntry->type+=yyextra->current->name+yyextra->msType;
4977 varEntry->fileName = yyextra->fileName;
4978 varEntry->startLine = yyextra->yyLineNr;
4979 varEntry->startColumn = yyextra->yyColNr;
4980 varEntry->doc = yyextra->current->doc;
4981 varEntry->brief = yyextra->current->brief;
4982 varEntry->mGrpId = yyextra->current->mGrpId;
4983 varEntry->initializer.str(yyextra->current->initializer.str());
4984 varEntry->groups = yyextra->current->groups;
4985 varEntry->sli = yyextra->current->sli;
4990 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
4995 if (!yyextra->isTypedef && yyextra->msName.empty() &&
4996 yyextra->memspecEntry && yyextra->current->section.isCompound())
4998 if (!yyextra->current->doc.empty())
5000 yyextra->memspecEntry->doc += yyextra->current->doc;
5002 if (!yyextra->current->brief.empty())
5004 yyextra->memspecEntry->brief += yyextra->current->brief;
5007 yyextra->msType.clear();
5008 yyextra->msName.clear();
5009 yyextra->msArgs.clear();
5010 yyextra->isTypedef=
false;
5011 yyextra->firstTypedefEntry.reset();
5012 yyextra->memspecEntry.reset();
5013 yyextra->current->reset();
5015 BEGIN( FindMembers );
5019 yyextra->current->doc.clear();
5020 yyextra->current->brief.clear();
size_t rfind(char c, size_t pos=npos) const
char & at(size_t i)
Returns a reference to the character at index i.
Represents an unstructured piece of information, about an entity found in the sources.
EntryType section
entry type (see Sections);
ENTRY_TYPES constexpr bool isCompound() const noexcept
5025 yyextra->lastInitializerContext=YY_START;
5026 yyextra->sharpCount=0;
5027 yyextra->initBracketCount=0;
5028 yyextra->current->initializer.str(yytext);
5029 BEGIN(ReadInitializer);
5040<MemberSpecSkip>"," { BEGIN(MemberSpec); }
5041<MemberSpecSkip>";" { unput(
';'); BEGIN(MemberSpec); }
5042<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
5045<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] {
5046 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5048 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
5049 yyextra->insideObjC=
false;
5050 BEGIN( FindMembers );
5052<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
5053<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
5055<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" |
5056<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ {
5057 if (yyextra->insidePHP)
5063 yyextra->current->bodyLine = yyextra->yyLineNr;
5064 yyextra->current->bodyColumn = yyextra->yyColNr;
5067 yyextra->funcPtrType=yytext;
5068 yyextra->roundCount=0;
5073<FuncPtr>{SCOPENAME} {
5074 yyextra->current->name = yytext;
5077 BEGIN( FuncPtrOperator );
5081 if (yyextra->current->name==
"const" || yyextra->current->name==
"volatile")
5083 yyextra->funcPtrType += yyextra->current->name;
5087 BEGIN( EndFuncPtr );
5094<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
5095 yyextra->current->name += yytext;
5096 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
5099<FuncPtrOperator>\n {
5101 yyextra->current->name += *yytext;
5103<FuncPtrOperator>"(" {
5105 BEGIN( EndFuncPtr );
5108 yyextra->current->name += *yytext;
5110<EndFuncPtr>")"{BNopt}/";" {
5112 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5115<EndFuncPtr>")"{BNopt}/"(" {
5117 if (yyextra->funcPtrType!=
"(")
5119 yyextra->current->type+=yyextra->funcPtrType+
")";
5123<EndFuncPtr>")"{BNopt}/"[" {
5125 yyextra->current->type+=yyextra->funcPtrType;
5126 yyextra->current->args +=
")";
5131 yyextra->current->args += *yytext ;
5134 yyextra->current->bodyLine = yyextra->yyLineNr;
5135 yyextra->current->bodyColumn = yyextra->yyColNr;
5136 yyextra->currentArgumentContext = FuncFuncEnd;
5137 yyextra->fullArgString=yyextra->current->args;
5138 yyextra->copyArgString=&yyextra->current->args;
5139 BEGIN( ReadFuncArgType ) ;
5141<EndFuncPtr>"["[^\n\]]*"]" {
5142 yyextra->funcPtrType+=yytext;
5148 yyextra->current->args += *yytext ;
5149 ++yyextra->roundCount;
5152 yyextra->current->args += *yytext ;
5153 if ( yyextra->roundCount )
5154 --yyextra->roundCount;
5160<FuncFuncEnd>")"{BN}*"(" {
5162 yyextra->current->type+=yyextra->funcPtrType+
")(";
5163 BEGIN(FuncFuncType);
5165<FuncFuncEnd>")"{BNopt}/[;{] {
5167 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5170<FuncFuncEnd>")"{BNopt}/"[" {
5172 yyextra->current->type+=yyextra->funcPtrType;
5173 yyextra->current->args+=
")";
5174 BEGIN(FuncFuncArray);
5177 yyextra->current->args += *yytext;
5180 yyextra->current->type += *yytext;
5181 yyextra->roundCount++;
5184 yyextra->current->type += *yytext;
5185 if (yyextra->roundCount)
5186 --yyextra->roundCount;
5190<FuncFuncType>{BN}*","{BN}* {
lineCount(yyscanner) ; yyextra->current->type +=
", " ; }
5191<FuncFuncType>{BN}+ {
lineCount(yyscanner) ; yyextra->current->type +=
' ' ; }
5193 yyextra->current->type += *yytext;
5195<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" {
5196 if (yyextra->current->type.startsWith(
"typedef") &&
5197 yyextra->current->bodyLine==-1)
5200 yyextra->current->bodyLine = yyextra->yyLineNr;
5201 yyextra->current->bodyColumn = yyextra->yyColNr;
5202 BEGIN( GetCallType );
5204 else if (!yyextra->current->name.empty())
5206 yyextra->current->args = yytext;
5207 yyextra->current->bodyLine = yyextra->yyLineNr;
5208 yyextra->current->bodyColumn = yyextra->yyColNr;
5209 yyextra->currentArgumentContext = FuncQual;
5210 yyextra->fullArgString=yyextra->current->args;
5211 yyextra->copyArgString=&yyextra->current->args;
5212 BEGIN( ReadFuncArgType ) ;
5216<GetCallType>{BN}*{ID}{BN}*"*" {
5219 yyextra->funcPtrType=
"(";
5220 yyextra->funcPtrType+=yytext;
5221 yyextra->roundCount=0;
5225 if (!yyextra->current->name.empty())
5227 yyextra->current->args = yytext;
5228 yyextra->current->bodyLine = yyextra->yyLineNr;
5229 yyextra->current->bodyColumn = yyextra->yyColNr;
5230 yyextra->currentArgumentContext = FuncQual;
5231 yyextra->fullArgString=yyextra->current->args;
5232 yyextra->copyArgString=&yyextra->current->args;
5233 BEGIN( ReadFuncArgType ) ;
5240<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
5241 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
5242 else yyextra->fullArgString+=yytext;
5244<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
5245 yyextra->fullArgString+=yytext;
5247<CopyArgRound>[^\/\n\)\(\"\']+ {
5248 *yyextra->copyArgString+=yytext;
5249 yyextra->fullArgString+=yytext;
5251<CopyArgSquare>[^\/\n\]\[\"\']+ {
5252 *yyextra->copyArgString+=yytext;
5253 yyextra->fullArgString+=yytext;
5255<ReadFuncArgType,ReadTempArgs>{BN}* {
5256 *yyextra->copyArgString+=
" ";
5257 yyextra->fullArgString+=
" ";
5260<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
5262 yyextra->lastRawStringContext = YY_START;
5263 yyextra->pCopyRawString = yyextra->copyArgString;
5264 *yyextra->pCopyRawString+=yytext;
5265 yyextra->fullArgString+=yytext;
5268<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
5269 *yyextra->copyArgString+=*yytext;
5270 yyextra->fullArgString+=*yytext;
5271 yyextra->lastCopyArgStringContext = YY_START;
5272 BEGIN( CopyArgString );
5274<ReadFuncArgType>"[" {
5275 if (!yyextra->insidePHP) REJECT;
5276 *yyextra->copyArgString+=*yytext;
5277 yyextra->fullArgString+=*yytext;
5278 yyextra->argSquareCount=0;
5279 yyextra->lastCopyArgContext = YY_START;
5280 BEGIN( CopyArgSquare );
5282<ReadFuncArgType,ReadTempArgs>"(" {
5283 *yyextra->copyArgString+=*yytext;
5284 yyextra->fullArgString+=*yytext;
5285 yyextra->argRoundCount=0;
5286 yyextra->lastCopyArgContext = YY_START;
5287 BEGIN( CopyArgRound );
5289<ReadFuncArgType>")" {
5290 *yyextra->copyArgString+=*yytext;
5291 yyextra->fullArgString+=*yytext;
5293 if (yyextra->insideJS)
5304 yyextra->docBackup = yyextra->current->doc;
5305 yyextra->briefBackup = yyextra->current->brief;
5307 BEGIN( yyextra->currentArgumentContext );
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
5310<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
5311 if (yyextra->currentArgumentContext==DefineEnd)
5315 int i;
for (i=(
int)yyleng-1;i>=0;i--)
5321 BEGIN( yyextra->currentArgumentContext );
5327 yyextra->fullArgString+=yytext;
5328 yyextra->lastCopyArgChar=0;
5329 yyextra->lastCommentInArgContext=YY_START;
5331 BEGIN( CopyArgCommentLine );
5333 BEGIN( CopyArgComment );
5337<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { }
5338<ReadFuncArgType,ReadTempArgs>{CCS} {
5339 yyextra->lastCContext = YY_START;
5340 BEGIN( SkipComment );
5342<ReadFuncArgType,ReadTempArgs>{CPPC} {
5343 yyextra->lastCContext = YY_START;
5344 BEGIN( SkipCxxComment );
5360<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
5362 if (yyextra->currentArgumentContext==DefineEnd)
5366 int i;
for (i=(
int)yyleng-1;i>0;i--)
5370 *yyextra->copyArgString+=*yytext;
5371 yyextra->fullArgString+=*yytext;
5374 BEGIN( yyextra->currentArgumentContext );
5380 yyextra->lastCopyArgChar=*yytext;
5383 yyextra->lastCommentInArgContext=YY_START;
5384 yyextra->fullArgString+=text;
5386 BEGIN( CopyArgCommentLine );
5388 BEGIN( CopyArgComment );
5391<CopyArgComment>^{B}*"*"+/{BN}+
5392<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
5393<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
5394 if (yyextra->lastCopyArgChar!=0)
5395 unput(yyextra->lastCopyArgChar);
5396 BEGIN( yyextra->lastCommentInArgContext );
5398<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
5400 if (yyextra->lastCopyArgChar!=0)
5401 unput(yyextra->lastCopyArgChar);
5402 BEGIN( yyextra->lastCommentInArgContext );
5404<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
5405 yyextra->docBlockName=
"uml";
5406 yyextra->fullArgString+=yytext;
5407 BEGIN(CopyArgVerbatim);
5409<CopyArgCommentLine>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid"|"code")/[^a-z_A-Z0-9\-] {
5410 yyextra->docBlockName=&yytext[1];
5411 yyextra->fullArgString+=yytext;
5412 BEGIN(CopyArgVerbatim);
5414<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5415 yyextra->docBlockName=&yytext[1];
5416 if (yyextra->docBlockName.at(1)==
'[')
5418 yyextra->docBlockName.at(1)=
']';
5420 if (yyextra->docBlockName.at(1)==
'{')
5422 yyextra->docBlockName.at(1)=
'}';
5424 if (yyextra->docBlockName.at(1)==
'(')
5426 yyextra->docBlockName.at(1)=
')';
5428 yyextra->fullArgString+=yytext;
5429 BEGIN(CopyArgVerbatim);
5431<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] {
5432 yyextra->fullArgString+=yytext;
5433 if (&yytext[4]==yyextra->docBlockName)
5435 yyextra->docBlockName=
"";
5436 BEGIN(CopyArgCommentLine);
5439<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") {
5440 yyextra->fullArgString+=yytext;
5441 if (yyextra->docBlockName==&yytext[1])
5443 yyextra->docBlockName=
"";
5444 BEGIN(CopyArgCommentLine);
5447<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5448<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5449<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext;
lineCount(yyscanner); }
5450<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5451<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5452 warn(yyextra->fileName,yyextra->yyLineNr,
5453 "Ignoring {:c}brief command inside argument documentation",*yytext
5455 yyextra->fullArgString+=
' ';
5458 *yyextra->copyArgString+=*yytext;
5459 yyextra->fullArgString+=*yytext;
5460 yyextra->argSharpCount=1;
5461 BEGIN( CopyArgSharp );
5464 *yyextra->copyArgString+=*yytext;
5465 yyextra->fullArgString+=*yytext;
5467 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5469 BEGIN( yyextra->currentArgumentContext );
5472 yyextra->argRoundCount++;
5473 *yyextra->copyArgString+=*yytext;
5474 yyextra->fullArgString+=*yytext;
5477 *yyextra->copyArgString+=*yytext;
5478 yyextra->fullArgString+=*yytext;
5479 if (yyextra->argRoundCount>0)
5480 yyextra->argRoundCount--;
5482 BEGIN( yyextra->lastCopyArgContext );
5485 yyextra->argSquareCount++;
5486 *yyextra->copyArgString+=*yytext;
5487 yyextra->fullArgString+=*yytext;
5490 *yyextra->copyArgString+=*yytext;
5491 yyextra->fullArgString+=*yytext;
5492 if (yyextra->argSquareCount>0)
5493 yyextra->argSquareCount--;
5495 BEGIN( yyextra->lastCopyArgContext );
5498 *yyextra->copyArgString+=*yytext;
5499 yyextra->fullArgString+=*yytext;
5500 yyextra->argRoundCount=0;
5501 yyextra->lastCopyArgContext = YY_START;
5502 BEGIN( CopyArgRound );
5505 yyextra->argSharpCount++;
5507 *yyextra->copyArgString+=*yytext;
5508 yyextra->fullArgString+=*yytext;
5511 *yyextra->copyArgString+=*yytext;
5512 yyextra->fullArgString+=*yytext;
5513 yyextra->argSharpCount--;
5514 if (yyextra->argSharpCount>0)
5520 BEGIN( ReadTempArgs );
5524<CopyArgString,CopyArgPHPString>\\. {
5525 *yyextra->copyArgString+=yytext;
5526 yyextra->fullArgString+=yytext;
5529 *yyextra->copyArgString+=*yytext;
5530 yyextra->fullArgString+=*yytext;
5531 BEGIN( yyextra->lastCopyArgStringContext );
5533<CopyArgPHPString>\' {
5534 *yyextra->copyArgString+=*yytext;
5535 yyextra->fullArgString+=*yytext;
5536 BEGIN( yyextra->lastCopyArgStringContext );
5538<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5539 if (yyextra->insidePHP)
5545 *yyextra->copyArgString+=yytext;
5546 yyextra->fullArgString+=yytext;
5549<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5550 *yyextra->copyArgString+=yytext;
5551 yyextra->fullArgString+=yytext;
5552 if (yyextra->insidePHP)
5554 yyextra->lastCopyArgStringContext=YY_START;
5555 BEGIN(CopyArgPHPString);
5558<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5559 *yyextra->copyArgString+=yytext;
5560 yyextra->fullArgString+=yytext;
5562<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5564 *yyextra->copyArgString+=*yytext;
5565 yyextra->fullArgString+=*yytext;
5567<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5568 *yyextra->copyArgString+=yytext;
5569 yyextra->fullArgString+=yytext;
5571<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5572 *yyextra->copyArgString+=*yytext;
5573 yyextra->fullArgString+=*yytext;
5581<FuncRound>"(" { yyextra->current->args += *yytext ;
5582 ++yyextra->roundCount ;
5584<FuncRound>")" { yyextra->current->args += *yytext ;
5585 if ( yyextra->roundCount )
5586 --yyextra->roundCount ;
5598 if (
dstrcmp(yytext,
";")==0 &&
5599 ((yyextra->insideJS || yyextra->insidePHP) &&
5600 !yyextra->current->type.containsWord(
"function")) )
5602 yyextra->current->reset();
5604 BEGIN( FindMembers );
5608 unput(*yytext); BEGIN( SFunction );
5611<FuncQual>{BN}*"abstract"{BN}* {
5613 yyextra->current->virt = Specifier::Pure;
5614 yyextra->current->args +=
" override ";
5616<FuncQual,TrailingReturn>{BN}*"override"{BN}* {
5618 yyextra->current->spec.setOverride(
true);
5619 yyextra->current->args +=
" override ";
5620 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5623<FuncQual,TrailingReturn>{BN}*"final"{BN}* {
5625 yyextra->current->spec.setFinal(
true);
5626 yyextra->current->args +=
" final ";
5627 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5630<FuncQual>{BN}*"sealed"{BN}* {
5632 yyextra->current->spec.setSealed(
true);
5633 yyextra->current->args +=
" sealed ";
5635<FuncQual>{BN}*"new"{BN}* {
5637 yyextra->current->spec.setNew(
true);
5638 yyextra->current->args +=
" new ";
5640<FuncQual>{BN}*"const"{BN}* {
5642 yyextra->current->args +=
" const ";
5643 yyextra->current->argList.setConstSpecifier(
true);
5645<FuncQual>{BN}*"volatile"{BN}* {
5647 yyextra->current->args +=
" volatile ";
5648 yyextra->current->argList.setVolatileSpecifier(
true);
5650<FuncQual>{BN}*"noexcept"{BN}* {
5652 yyextra->current->args +=
" noexcept ";
5653 yyextra->current->spec.setNoExcept(
true);
5655<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* {
5657 yyextra->current->args +=
" noexcept(false)";
5659<FuncQual>{BN}*"noexcept"{BN}*"(" {
5661 yyextra->current->args +=
" noexcept(";
5662 yyextra->current->spec.setNoExcept(
true);
5663 yyextra->lastRoundContext=FuncQual;
5664 yyextra->pCopyRoundString=&yyextra->current->args;
5665 yyextra->roundCount=0;
5669 yyextra->current->args +=
" &";
5672<FuncQual>{BN}*"&&" {
5673 yyextra->current->args +=
" &&";
5677<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* {
5679 yyextra->current->args +=
" = 0";
5680 yyextra->current->virt = Specifier::Pure;
5681 yyextra->current->argList.setPureSpecifier(
true);
5682 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5685<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* {
5687 yyextra->current->args +=
" = delete";
5688 yyextra->current->spec.setDelete(
true);
5689 yyextra->current->argList.setIsDeleted(
true);
5690 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5693<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* {
5695 yyextra->current->args +=
" = default";
5696 yyextra->current->spec.setDefault(
true);
5697 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5700<FuncQual>{BN}*"->"{BN}* {
5702 yyextra->current->argList.setTrailingReturnType(
" -> ");
5703 yyextra->current->args +=
" -> ";
5704 yyextra->roundCount=0;
5705 BEGIN(TrailingReturn);
5707<TrailingReturn>[{;] {
5708 if (yyextra->roundCount>0) REJECT;
5710 yyextra->current->argList.finishTrailingReturnType();
5713<TrailingReturn>"requires"{BN}+ {
5714 if (yyextra->insideJava) REJECT;
5715 yyextra->requiresContext = FuncQual;
5716 yyextra->current->req+=
' ';
5717 yyextra->current->argList.finishTrailingReturnType();
5718 BEGIN(RequiresClause);
5720<TrailingReturn>"(" {
5721 yyextra->roundCount++;
5722 yyextra->current->argList.appendTrailingReturnType(yytext);
5723 yyextra->current->args+=yytext;
5725<TrailingReturn>")" {
5726 if (yyextra->roundCount>0)
5728 yyextra->roundCount--;
5732 warn(yyextra->fileName,yyextra->yyLineNr,
5733 "Found ')' without opening '(' for trailing return type '{})...'",
5734 yyextra->current->argList.trailingReturnType());
5736 yyextra->current->argList.appendTrailingReturnType(yytext);
5737 yyextra->current->args+=yytext;
5740 yyextra->current->argList.appendTrailingReturnType(yytext);
5741 yyextra->current->args+=yytext;
5745 yyextra->current->argList.appendTrailingReturnType(yytext);
5746 yyextra->current->args+=
' ';
5748<FuncRound,FuncFunc>{BN}*","{BN}* {
5750 yyextra->current->args +=
", " ;
5752<FuncQual,FuncRound,FuncFunc>{BN}+ {
5754 yyextra->current->args +=
' ' ;
5756<SFunction,FuncQual,FuncRound,FuncFunc>"#" {
if (yyextra->insidePHP)
5758 yyextra->lastCPPContext = YY_START;
5762 if (!yyextra->insideCS)
5769 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5776 yyextra->lastInitializerContext=YY_START;
5777 yyextra->sharpCount=0;
5778 yyextra->initBracketCount=0;
5779 yyextra->current->initializer.str(yytext);
5780 BEGIN(ReadInitializer);
5783<ReadExpressionBody>";" {
5784 if (!yyextra->current->sli.empty() && yyextra->previous)
5786 yyextra->previous->sli = yyextra->current->sli;
5787 yyextra->current->sli.clear();
5789 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5804 if (yyextra->insideCpp &&
dstrcmp(yytext,
"requires")==0)
5807 yyextra->requiresContext = YY_START;
5808 if (!yyextra->current->req.empty())
5810 yyextra->current->req+=
" && ";
5812 BEGIN(RequiresClause);
5814 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
5817 yyextra->current->typeConstr.clear();
5818 yyextra->current->typeConstr.push_back(
Argument());
5819 yyextra->lastCSConstraint = YY_START;
5820 BEGIN( CSConstraintName );
5824 yyextra->current->args = yytext;
5825 yyextra->oldStyleArgType.clear();
5826 BEGIN(OldStyleArgs);
5830 yyextra->current->args += yytext;
5836 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5838 if (yyextra->current->doc!=yyextra->docBackup)
5840 doc=yyextra->current->doc;
5841 yyextra->current->doc=yyextra->docBackup;
5843 if (yyextra->current->brief!=yyextra->briefBackup)
5845 brief=yyextra->current->brief;
5846 yyextra->current->brief=yyextra->briefBackup;
5848 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5849 oldStyleArgName,brief,doc);
5850 yyextra->current->args.clear();
5851 if (*yytext==
';') yyextra->oldStyleArgType.clear();
5853<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5855 if (yyextra->current->argList.empty())
5857 yyextra->current->argList.setNoParameters(
true);
5863<OldStyleArgs>. { yyextra->current->args += *yytext; }
5864<FuncQual,FuncRound,FuncFunc>\" {
5865 if (yyextra->insideIDL && yyextra->insideCppQuote)
5871 yyextra->current->args += *yytext;
5874<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5875<FuncQual>{BN}*"try:" |
5876<FuncQual>{BN}*"try"{BN}+ {
5877 yyextra->insideTryBlock=
true;
5879 if (yytext[yyleng-1]==
':')
5885<FuncQual>{BN}*"throw"{BN}*"(" {
5886 yyextra->current->exception =
" throw (" ;
5887 yyextra->roundCount=0;
5889 BEGIN( ExcpRound ) ;
5891<FuncQual>{BN}*"raises"{BN}*"(" {
5892 yyextra->current->exception =
" raises (" ;
5894 yyextra->roundCount=0;
5895 BEGIN( ExcpRound ) ;
5897<FuncQual>{BN}*"throws"{BN}+ {
5898 yyextra->current->exception =
" throws " ;
5902<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5903 ++yyextra->roundCount ;
5905<ExcpRound>")" { yyextra->current->exception += *yytext ;
5906 if ( yyextra->roundCount )
5907 --yyextra->roundCount ;
5912 yyextra->current->exception += *yytext;
5915 unput(
'{'); BEGIN( FuncQual );
5918 unput(
';'); BEGIN( FuncQual );
5921 yyextra->current->exception +=
' ';
5925 yyextra->current->exception += *yytext;
5927<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5928 yyextra->current->name = yyextra->current->args ;
5929 yyextra->current->args = yytext ;
5930 yyextra->roundCount=0;
5931 BEGIN( FuncRound ) ;
5934 if (!yyextra->insidePHP) BEGIN(SkipInits);
5940 yyextra->current->fileName = yyextra->fileName;
5941 yyextra->current->startLine = yyextra->yyBegLineNr;
5942 yyextra->current->startColumn = yyextra->yyBegColNr;
5943 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5945 std::string type = yyextra->current->type.str();
5949 ti =
match.position();
5953 if (
size_t di = yyextra->current->type.find(
"decltype(");
5959 size_t ts=yyextra->current->type.find(
'<');
5960 size_t te=yyextra->current->type.rfind(
'>');
5963 bool startsWithTypedef = yyextra->current->type.startsWith(
"typedef ");
5966 bool isVariable = !yyextra->current->type.empty() &&
5967 (!isFunction || startsWithTypedef);
5972 if (*yytext!=
';' || yyextra->current_root->section.isCompound())
5977 if (yyextra->isTypedef && !startsWithTypedef)
5979 yyextra->current->type.prepend(
"typedef ");
5981 yyextra->current->section = EntryType::makeVariable() ;
5986 yyextra->current->section = EntryType::makeFunction() ;
5987 yyextra->current->proto = *yytext==
';';
5995 if (yyextra->isTypedef && !startsWithTypedef)
5997 yyextra->current->type.prepend(
"typedef ");
6000 yyextra->current->section = EntryType::makeVariable();
6005 yyextra->current->section = EntryType::makeFunction();
6006 yyextra->current->proto =
true;
6010 if ( yyextra->insidePHP)
6012 if (yyextra->current->type.findAndRemoveWord(
"final"))
6014 yyextra->current->spec.setFinal(
true);
6016 if (yyextra->current->type.findAndRemoveWord(
"abstract"))
6018 yyextra->current->spec.setAbstract(
true);
6021 if ( yyextra->insidePHP && !yyextra->current->type.containsWord(
"function"))
6024 if ( *yytext ==
'{' )
6026 yyextra->lastCurlyContext = FindMembers;
6027 yyextra->curlyCount=0;
6032 BEGIN( FindMembers );
6037 if ( yyextra->insidePHP)
6039 yyextra->current->type.findAndRemoveWord(
"function");
6041 yyextra->previous = yyextra->current;
6042 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6045 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
6047 yyextra->current->spec.setOptional(
true).setRequired(
true);
6049 yyextra->lastCurlyContext = FindMembers;
6050 if ( *yytext ==
',' )
6052 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
6054 if ( *yytext ==
'{' )
6056 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
6058 yyextra->previous->spec.setInline(
true);
6060 yyextra->curlyCount=0;
6061 BEGIN( SkipCurly ) ;
6063 else if ( *yytext ==
'=' )
6065 yyextra->previous->spec.setInline(
true);
6066 yyextra->curlyCount=0;
6067 BEGIN( ReadExpressionBody );
6071 if (!yyextra->previous->section.isVariable())
6072 yyextra->previous->bodyLine=-1;
6073 BEGIN( FindMembers ) ;
Class representing a regular expression.
Object representing the matching results.
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
6077<SkipInits>">"{BN}*"{" {
6079 yyextra->curlyCount=1;
6080 BEGIN(SkipC11Inits);
6082<SkipInits>{ID}{BN}*"{" {
6084 yyextra->curlyCount=1;
6085 BEGIN(SkipC11Inits);
6088 ++yyextra->curlyCount;
6091 if ( --yyextra->curlyCount<=0 )
6102 ++yyextra->curlyCount ;
6104<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | )
6107 if( yyextra->curlyCount )
6109 --yyextra->curlyCount ;
6113 if (!yyextra->current->sli.empty() && yyextra->previous)
6115 yyextra->previous->sli = yyextra->current->sli;
6116 yyextra->current->sli.clear();
6118 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
6119 BEGIN( yyextra->lastCurlyContext ) ;
6122<SkipCurly>"}"{BN}*{DCOMM}"<" {
6124 if ( yyextra->curlyCount )
6127 --yyextra->curlyCount ;
6131 yyextra->current->endBodyLine=yyextra->yyLineNr;
6132 yyextra->tempEntry = yyextra->current;
6133 yyextra->current = yyextra->previous;
6135 yyextra->docBlockContext = SkipCurlyEndDoc;
6136 yyextra->docBlockInBody =
false;
6137 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6139 yyextra->docBlock.str(std::string());
6140 yyextra->docBlockTerm =
'}';
6141 if (yytext[yyleng-3]==
'/')
6153<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" {
6154 yyextra->docBlockContext = SkipCurlyEndDoc;
6155 yyextra->docBlockInBody =
false;
6156 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6158 yyextra->docBlock.str(std::string());
6159 yyextra->docBlockTerm =
'}';
6160 if (yytext[yyleng-3]==
'/')
6171<SkipCurlyEndDoc>"}" {
6173 if (yyextra->tempEntry)
6175 yyextra->current = yyextra->tempEntry;
6176 yyextra->tempEntry.reset();
6178 BEGIN( yyextra->lastCurlyContext );
6180<SkipCurly,ReadExpressionBody>\" {
6182 yyextra->lastStringContext=YY_START;
6183 BEGIN( SkipString );
6185<SkipCurly>^{B}*"#" {
6186 if (yyextra->insidePHP)
6189 BEGIN( SkipCurlyCpp );
6191<SkipCurly,SkipC11Inits,SkipInits,ReadExpressionBody>\n {
6195<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
6196 if (!yyextra->insidePHP)
6202 yyextra->lastHereDocContext = YY_START;
6206<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
6208 yyextra->lastRawStringContext = YY_START;
6209 yyextra->dummyRawString.clear();
6210 yyextra->pCopyRawString = &yyextra->dummyRawString;
6211 *yyextra->pCopyRawString += yytext;
6214<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
6218<SkipCurly,SkipCurlyCpp>"\$" {}
6222 yyextra->lastCurlyContext = FindMembers;
6225<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
6229<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CCS} {
6231 yyextra->lastCContext = YY_START;
6234<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CPPC} {
6236 yyextra->lastCContext = YY_START;
6237 BEGIN(SkipCxxComment);
6239<SkipInits,SkipC11Inits>"(" {
6240 yyextra->roundCount=0;
6241 yyextra->lastSkipRoundContext=YY_START;
6244<SkipInits,SkipC11Inits>\" {
6245 yyextra->lastStringContext=YY_START;
6246 BEGIN( SkipString );
6249 warn(yyextra->fileName,yyextra->yyLineNr,
6250 "Found ';' while parsing initializer list! "
6251 "(doxygen could be confused by a macro call without semicolon)"
6253 BEGIN( FindMembers );
6255<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
6256 if (!yyextra->insidePHP)
6259 yyextra->lastCContext = YY_START;
6260 BEGIN(SkipCxxComment);
6262<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>@\" {
6263 if (!yyextra->insideCS) REJECT;
6266 yyextra->lastSkipVerbStringContext=YY_START;
6267 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
6268 yyextra->dummyTextStream.clear();
6269 BEGIN(SkipVerbString);
6271<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>{CHARLIT} {
6272 if (yyextra->insidePHP) REJECT;
6274<SkipInits,SkipCurly,SkipCurlyCpp>\' {
6275 if (yyextra->insidePHP)
6277 yyextra->lastStringContext=YY_START;
6278 BEGIN(SkipPHPString);
6281<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>. { }
6282<SkipString,SkipPHPString>\\. { }
6284 BEGIN( yyextra->lastStringContext );
6287 BEGIN( yyextra->lastStringContext );
6289<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
6290<SkipString,SkipPHPString>\n {
6294<SkipString,SkipPHPString>. { }
6300 yyextra->current->section = EntryType::makeEmpty() ;
6301 yyextra->current->type.clear() ;
6302 yyextra->current->name.clear() ;
6303 yyextra->current->args.clear() ;
6304 yyextra->current->argList.clear();
6305 BEGIN( FindMembers ) ;
6308 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
6312 if (!yyextra->current->name.empty() && !yyextra->current_root->name.empty())
6316 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6318 if (!yyextra->baseName.empty())
6320 yyextra->current->extends.emplace_back(
6321 yyextra->baseName,Protection::Public,Specifier::Normal);
6322 yyextra->baseName.clear();
6324 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
6329 yyextra->current->section = EntryType::makeEmpty() ;
6330 yyextra->current->type.clear() ;
6331 yyextra->current->name.clear() ;
6332 yyextra->current->args.clear() ;
6333 yyextra->current->argList.clear();
6335 BEGIN( FindMembers ) ;
6337<CompoundName>{SCOPENAME}/{BN}*"<" {
6338 yyextra->sharpCount = 0;
6339 yyextra->current->name = yytext ;
6341 if (yyextra->current->spec.isProtocol())
6343 yyextra->current->name+=
"-p";
6346 yyextra->lastClassTemplSpecContext = ClassVar;
6347 if (yyextra->insideObjC)
6349 BEGIN( ObjCProtocolList );
6351 else if (yyextra->insideCS)
6358 yyextra->roundCount=0;
6359 BEGIN( ClassTemplSpec );
6366 yyextra->current->tArgLists.
push_back(al);
6367 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
6368 yyextra->templateStr=
"<";
6369 yyextra->current->name +=
"<";
6370 yyextra->fullArgString = yyextra->templateStr;
6371 yyextra->copyArgString = &yyextra->current->name;
6373 yyextra->currentArgumentContext = ClassVar;
6374 BEGIN( ReadTempArgs );
6376<ObjCProtocolList>"<" {
6377 yyextra->insideProtocolList=
true;
6380<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
6381 yyextra->current->name += yytext;
6383 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6386 if (yyextra->current->spec.isProtocol())
6393 BEGIN( yyextra->lastClassTemplSpecContext );
6397<ClassTemplSpec>"<" {
6398 yyextra->current->name += yytext;
6399 if (yyextra->roundCount==0) yyextra->sharpCount++;
6402 yyextra->current->name += yytext;
6404<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" {
6405 if (yyextra->insideCS && yyextra->current->type ==
"namespace")
6409 yyextra->current->name =
substitute(yytext,
".",
"::");
6410 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6415 else if (!yyextra->current->tArgLists.empty())
6419 yyextra->current->name = yytext;
6420 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6423 DString rn = yyextra->current_root->name;
6425 if (!yyextra->current->name.empty() && !rn.
empty())
6429 yyextra->current->spec.setForwardDecl(
true);
6430 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6432 else if (yyextra->insideIDL &&
6433 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6434 yyextra->current->spec.isInterface()) ||
6435 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6436 yyextra->current->spec.isService())
6444 yyextra->current->name = yytext;
6445 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6446 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6449 yyextra->current->spec.setInterface(
false).setService(
false);
6453 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6456 if (!(yyextra->insideCS && yyextra->current->type ==
"namespace"))
6459 yyextra->current->reset();
6461 if (yyextra->insideObjC)
6463 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6464 yyextra->insideObjC =
false;
6466 if (yyextra->isTypedef)
6468 yyextra->current->type.prepend(
"typedef");
6470 BEGIN( FindMembers );
Wrapper class for the Entry type.
6473<CompoundName>{SCOPENAME}/{BN}*"(" {
6474 yyextra->current->name = yytext ;
6477 if (yyextra->insideCpp && yyextra->current->name==
"alignas")
6479 yyextra->lastAlignAsContext = YY_START;
6484 if (yyextra->current->spec.isProtocol())
6486 yyextra->current->name +=
"-p";
6491<AlignAs>"(" { yyextra->roundCount=0;
6492 BEGIN( AlignAsEnd );
6496<AlignAsEnd>"(" { yyextra->roundCount++; }
6497<AlignAsEnd>")" {
if (--yyextra->roundCount<0)
6499 BEGIN( yyextra->lastAlignAsContext );
6505 yyextra->current->name = yytext ;
6509 yyextra->current->bodyLine = yyextra->yyLineNr;
6510 yyextra->current->bodyColumn = yyextra->yyColNr;
6511 yyextra->current->initializer.str(std::string());
6512 yyextra->lastInitializerContext = FindMembers;
6513 yyextra->sharpCount=0;
6514 yyextra->initBracketCount=0;
6515 BEGIN(ReadInitializer);
6517<CompoundName>{SCOPENAME}/{BN}*"," {
6519 yyextra->current->reset();
6522<CompoundName>{SCOPENAME} {
6523 yyextra->current->name = yytext ;
6526 if (yyextra->current->spec.isProtocol())
6528 yyextra->current->name +=
"-p";
6530 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6536<CompoundName>({ID}{BN}*"::"{BN}*)+("inline"{BN}+({ID}{BN}*"::"{BN}*)*)+{ID} {
6537 if (yyextra->current->section.isNamespace())
6539 yyextra->current->name =
DString(yytext).simplifyWhiteSpace();
6549<CompoundName>{CSSCOPENAME} {
6550 yyextra->current->name =
substitute(yytext,
".",
"::");
6554<ClassVar>{SCOPENAME}{BNopt}/"(" {
6555 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6558 yyextra->roundCount=0;
6559 BEGIN(SkipUnionSwitch);
6564 yyextra->yyBegColNr=yyextra->yyColNr;
6565 yyextra->yyBegLineNr=yyextra->yyLineNr;
6566 yyextra->current->name = yytext;
6567 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6570 BEGIN( FindMembers );
6574 if (yyextra->isTypedef)
6578 yyextra->current->type.prepend(
"typedef ");
6586<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6587 if (yyextra->insideCli)
6590 yyextra->current->spec.setSealedClass(
true);
6592 yyextra->current->spec.setAbstractClass(
true);
6600<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6601 yyextra->yyBegColNr=yyextra->yyColNr;
6602 yyextra->yyBegLineNr=yyextra->yyLineNr;
6605 if (yyextra->current->section.isEnum())
6607 yyextra->current->section = EntryType::makeVariable() ;
6609 yyextra->current->type +=
' ' ;
6610 yyextra->current->type += yyextra->current->name ;
6611 yyextra->current->name =
DString(yytext).simplifyWhiteSpace();
6619 yyextra->yyBegColNr=yyextra->yyColNr;
6620 yyextra->yyBegLineNr=yyextra->yyLineNr;
6622 if (yyextra->insideIDL &&
dstrcmp(yytext,
"switch")==0)
6625 yyextra->roundCount=0;
6626 BEGIN(SkipUnionSwitch);
6628 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
dstrcmp(yytext,
"implements")==0 ||
dstrcmp(yytext,
"extends")==0))
6630 yyextra->current->type.clear();
6631 yyextra->baseProt = Protection::Public;
6632 yyextra->baseVirt = Specifier::Normal;
6633 yyextra->baseName.clear();
6634 BEGIN( BasesProt ) ;
6636 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
6638 yyextra->current->typeConstr.clear();
6639 yyextra->current->typeConstr.push_back(
Argument());
6640 yyextra->lastCSConstraint = YY_START;
6641 BEGIN( CSConstraintName );
6643 else if (yyextra->insideCli &&
dstrcmp(yytext,
"abstract")==0)
6645 yyextra->current->spec.setAbstract(
true);
6647 else if (yyextra->insideCli &&
dstrcmp(yytext,
"sealed")==0)
6649 yyextra->current->spec.setSealed(
true);
6651 else if (
dstrcmp(yytext,
"final")==0)
6653 yyextra->current->spec.setFinal(
true);
6657 if (yyextra->current->section.isEnum())
6659 yyextra->current->section = EntryType::makeVariable() ;
6661 yyextra->current->type +=
' ' ;
6662 yyextra->current->type += yyextra->current->name ;
6663 yyextra->current->name = yytext ;
6672 if (yyextra->insideObjC && *yytext==
'(')
6674 yyextra->current->name+=
'(';
6675 yyextra->current->spec.setCategory(
true);
6676 BEGIN( ClassCategory );
6678 else if (yyextra->insideCS && *yytext==
'(')
6680 yyextra->current->args=yytext;
6681 yyextra->currentArgumentContext = ClassVar;
6682 yyextra->fullArgString = yyextra->current->args;
6683 yyextra->copyArgString = &yyextra->current->args;
6684 BEGIN( ReadFuncArgType ) ;
6690 BEGIN( FindMembers );
6693<CSConstraintType,CSConstraintName>{CCS}{CCE} { }
6694<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) {
6695 yyextra->fullArgString.clear();
6696 yyextra->lastCopyArgChar=
'#';
6697 yyextra->lastCommentInArgContext=YY_START;
6699 BEGIN( CopyArgCommentLine );
6701 BEGIN( CopyArgComment );
6703<CSConstraintType,CSConstraintName>"#" {
6704 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6706<CSConstraintType>"=>" {
6711 BEGIN( yyextra->lastCSConstraint );
6713<CSConstraintType>"{" {
6717 BEGIN( yyextra->lastCSConstraint );
6719<CSConstraintType,CSConstraintName>";" {
6722 BEGIN( yyextra->lastCSConstraint );
6724<CSConstraintName>":" {
6725 BEGIN( CSConstraintType );
6727<CSConstraintName>{ID} {
6729 yyextra->current->typeConstr.back().name=yytext;
6731<CSConstraintType>"where" {
6732 yyextra->current->typeConstr.push_back(
Argument());
6733 BEGIN( CSConstraintName );
6735<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6736 if (yyextra->current->typeConstr.back().type.empty())
6739 yyextra->current->typeConstr.back().type=yytext;
6743 DString name = yyextra->current->typeConstr.
back().name;
6744 yyextra->current->typeConstr.push_back(
Argument());
6745 yyextra->current->typeConstr.back().name=name;
6746 yyextra->current->typeConstr.
back().type=yytext;
char & back()
Returns a reference to the last character.
6749<CSConstraintName,CSConstraintType>\n {
6752<CSConstraintName,CSConstraintType>. {
6754<ClassCategory>{ID} {
6755 yyextra->current->name+=yytext;
6757<ClassCategory>")"/{BN}*"{" {
6758 yyextra->current->name+=
')';
6761<ClassCategory>")"/{BN}*"<" {
6762 yyextra->current->name+=
')';
6763 BEGIN( ObjCProtocolList );
6766 yyextra->current->name+=
')';
6767 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6779 if (yyextra->current->section.isVariable())
6781 yyextra->current->bitfields+=
":";
6782 yyextra->current->args.clear();
6785 else if (yyextra->current->section.isEnum())
6788 yyextra->current->args.clear();
6789 BEGIN(EnumBaseType);
6793 yyextra->current->type.clear();
6794 if (yyextra->current->spec.isInterface() ||
6795 yyextra->current->spec.isStruct() ||
6796 yyextra->current->spec.isRef() ||
6797 yyextra->current->spec.isValue() ||
6798 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6801 yyextra->baseProt = Protection::Public;
6805 yyextra->baseProt = Protection::Private;
6807 yyextra->baseVirt = Specifier::Normal;
6808 yyextra->baseName.clear();
6809 BEGIN( BasesProt ) ;
6813 if (yyextra->isTypedef)
6815 yyextra->current->type.prepend(
"typedef");
6817 if ((yytext[0]==
'*' || yytext[0]==
'&') && yyextra->current->section.isEnum())
6819 yyextra->current->section = EntryType::makeVariable() ;
6821 if (yytext[0]==
';' && yyextra->current->section.isEnum())
6823 yyextra->current->reset();
6830 BEGIN( FindMembers );
6832<Bases,ClassVar>{CPPC}"/"/[^/] {
6833 if (!yyextra->insideObjC)
6840 yyextra->current->program << yytext;
6841 yyextra->current->fileName = yyextra->fileName ;
6842 yyextra->current->startLine = yyextra->yyLineNr ;
6843 yyextra->current->startColumn = yyextra->yyColNr;
6844 yyextra->curlyCount=0;
6845 BEGIN( ReadBodyIntf );
6848<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6849<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6850<Bases,ClassVar>{CPPC}"!" |
6851<Bases,ClassVar>[\-+]{BN}* {
6852 if (!yyextra->insideObjC)
6859 yyextra->current->program << yytext;
6860 yyextra->current->fileName = yyextra->fileName ;
6861 yyextra->current->startLine = yyextra->yyLineNr ;
6862 yyextra->current->startColumn = yyextra->yyColNr;
6863 yyextra->curlyCount=0;
6864 BEGIN( ReadBodyIntf );
6867<CompoundName,ClassVar>{B}*"{"{B}* {
6868 yyextra->current->program.str(std::string());
6869 yyextra->current->fileName = yyextra->fileName ;
6870 yyextra->current->bodyLine = yyextra->yyLineNr;
6871 yyextra->current->bodyColumn = yyextra->yyColNr;
6873 if (yyextra->current->name.empty() && !yyextra->isTypedef)
6875 if (yyextra->current->section.isNamespace())
6879 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6891 yyextra->curlyCount=0;
6892 if (yyextra->current_root &&
6893 !yyextra->current_root->spec.isInterface() &&
6894 (yyextra->current->spec.isInterface() ||
6895 yyextra->current->spec.isProtocol() ||
6896 yyextra->current->spec.isCategory() ||
6897 yyextra->current->section.isObjcImpl()
6902 BEGIN( ReadBodyIntf );
6904 else if (yyextra->current->section.isNamespace())
6906 BEGIN( ReadNSBody );
DString stripPath(const DString &s)
6913<BasesProt>"virtual"{BN}+ {
lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6914<BasesProt>"public"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6915<BasesProt>"protected"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6916<BasesProt>"internal"{BN}+ {
if (!yyextra->insideCli) REJECT ;
lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6917<BasesProt>"private"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6918<BasesProt>{BN} {
lineCount(yyscanner); }
6919<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6920<Bases>"decltype"{BN}*"(" {
6922 yyextra->roundCount=0;
6923 yyextra->lastSkipRoundContext=YY_START;
6926<Bases>("\\")?({ID}"\\")*{ID} {
6927 if (!yyextra->insidePHP)
6936 yyextra->baseName += bn;
6937 yyextra->current->args +=
' ';
6938 yyextra->current->args += yytext;
6941<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6947 yyextra->current->typeConstr.clear();
6948 yyextra->current->typeConstr.push_back(
Argument());
6949 yyextra->lastCSConstraint = YY_START;
6950 BEGIN( CSConstraintName );
6954 yyextra->baseName+=yytext;
6955 yyextra->current->args +=
' ';
6956 yyextra->current->args += yytext;
6959<Bases>{BN}*{ID}("."{ID})* {
6961 yyextra->baseName += name;
6962 yyextra->current->args +=
' ';
6963 yyextra->current->args += name;
6965<ClassVar,Bases>\n/{BN}*[^{, \t\n:] {
6966 if (!yyextra->insideObjC)
6976<ClassVar,Bases>"@end" {
6984<ClassVar>"<" { yyextra->current->name += *yytext;
6985 yyextra->sharpCount=1;
6986 yyextra->roundCount=0;
6987 yyextra->lastSkipSharpContext = YY_START;
6988 yyextra->specName = &yyextra->current->name;
6989 BEGIN ( Specialization );
6993 yyextra->sharpCount=1;
6994 yyextra->roundCount=0;
6995 yyextra->lastSkipSharpContext = YY_START;
6996 if (yyextra->insideObjC)
7006 yyextra->templateStr = yytext;
7007 yyextra->specName = &yyextra->templateStr;
7008 BEGIN ( Specialization );
7011<Specialization>"<" { *yyextra->specName += *yytext;
7012 if (yyextra->roundCount==0) yyextra->sharpCount++;
7014<Specialization>">" {
7015 *yyextra->specName += *yytext;
7016 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
7019 BEGIN(yyextra->lastSkipSharpContext);
7022<Specialization>{BN}+ {
lineCount(yyscanner); *yyextra->specName +=
' '; }
7023<Specialization>"<<" { *yyextra->specName += yytext; }
7024<Specialization>">>"/{B}*"::" {
7029<Specialization>">>" {
7030 if (yyextra->insideCS)
7040 if (yyextra->roundCount>0)
7042 *yyextra->specName += yytext;
7052<Specialization>"typename"{BN}+ {
lineCount(yyscanner); }
7053<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
7054<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
7056<Specialization>"\\\\" { *yyextra->specName += *yytext;}
7057<Specialization>"\\'" { *yyextra->specName += *yytext;}
7058<Specialization>"\\\"" { *yyextra->specName += *yytext;}
7059<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
7060<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
7061<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
7062<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
7063<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7064<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
7065<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7066<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
7069 *yyextra->specName += *yytext;
7071<SkipRound>"(" { ++yyextra->roundCount; }
7072<SkipRound>")" {
if (--yyextra->roundCount<0)
7073 BEGIN ( yyextra->lastSkipRoundContext );
7076 yyextra->lastStringContext=SkipRound;
7079<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) {
lineCount(yyscanner);
7080 if (yyextra->insideProtocolList)
7082 yyextra->baseName+=
"-p";
7086 yyextra->current->args +=
',' ;
7089 if (!yyextra->baseName.empty())
7091 yyextra->current->extends.emplace_back(
7092 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7095 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
7096 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
7097 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
7099 yyextra->baseProt=Protection::Public;
7103 yyextra->baseProt=Protection::Private;
7105 yyextra->baseVirt=Specifier::Normal;
7106 yyextra->baseName.clear();
7109 yyextra->insideProtocolList=
false;
7112 if (yyextra->insideObjC && !yyextra->current->spec.isProtocol())
7128 if (*yytext==
',' && yyextra->insideObjC)
7130 yyextra->insideProtocolList=
true;
7136 yyextra->current->program.str(std::string());
7137 yyextra->current->fileName = yyextra->fileName ;
7138 yyextra->current->bodyLine = yyextra->yyLineNr;
7139 yyextra->current->bodyColumn = yyextra->yyColNr;
7141 if (!yyextra->baseName.empty())
7143 yyextra->current->extends.emplace_back(
7144 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7146 yyextra->baseName.clear();
7148 yyextra->curlyCount=0;
7149 if (yyextra->insideObjC)
7151 BEGIN( ReadBodyIntf );
7158<SkipUnionSwitch>{B}*"(" {
7159 yyextra->roundCount++;
7161<SkipUnionSwitch>")" {
7162 if (--yyextra->roundCount==0)
7167<SkipUnionSwitch>\n {
lineCount(yyscanner); }
7169<Comment>{BN}+ { yyextra->current->program << yytext ;
7172<Comment>{CCS} { yyextra->current->program << yytext ; }
7173<Comment>{CPPC} { yyextra->current->program << yytext ; }
7174<Comment>{CMD}("code"|"verbatim"|"iliteral") {
7175 if (yyextra->doxygenComment) yyextra->insideCode=
true;
7176 yyextra->current->program << yytext ;
7178<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
7179 if (yyextra->doxygenComment) yyextra->insideCode=
false;
7180 yyextra->current->program << yytext ;
7182<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
7183<Comment>{CCE} { yyextra->current->program << yytext ;
7184 if (!yyextra->insideCode)
7186 yyextra->doxygenComment=
false;
7187 BEGIN( yyextra->lastContext );
7190<Comment>. { yyextra->current->program << *yytext ; }
7192<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,ReadExpressionBody,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
7194 if (!yyextra->current->doc.empty())
7196 yyextra->current->doc+=
"\n\n";
7200 yyextra->current->docLine = yyextra->yyLineNr;
7201 yyextra->current->docFile = yyextra->fileName;
7204 yyextra->lastDocContext = YY_START;
7205 if (yyextra->current_root->section.isScope())
7207 yyextra->current->inside = yyextra->current_root->name+
"::";
7209 yyextra->docBlockContext = YY_START;
7210 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7215 yyextra->docBlock.
str(indent.
str());
7217 if (yyextra->docBlockAutoBrief)
7219 yyextra->current->briefLine = yyextra->yyLineNr;
7220 yyextra->current->briefFile = yyextra->fileName;
7225<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,ReadExpressionBody,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
7231 yyextra->lastDocContext = YY_START;
7234 if (yyextra->current_root->section.isScope())
7236 yyextra->current->inside = yyextra->current_root->name+
"::";
7238 yyextra->current->docLine = yyextra->yyLineNr;
7239 yyextra->current->docFile = yyextra->fileName;
7240 yyextra->docBlockContext = YY_START;
7241 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7243 yyextra->docBlockAutoBrief = javadocAutoBrief;
7247 yyextra->docBlock.
str(indent.
str());
7249 if (yyextra->docBlockAutoBrief)
7251 yyextra->current->briefLine = yyextra->yyLineNr;
7252 yyextra->current->briefFile = yyextra->fileName;
7259 yyextra->current->program << yytext ;
7260 yyextra->lastContext = YY_START ;
7261 yyextra->doxygenComment=
true;
7265<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,ReadExpressionBody,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7270<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,ReadExpressionBody,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7271 yyextra->lastDocContext = YY_START;
7274 if (yyextra->current_root->section.isScope())
7276 yyextra->current->inside = yyextra->current_root->name+
"::";
7278 yyextra->current->docLine = yyextra->yyLineNr;
7279 yyextra->current->docFile = yyextra->fileName;
7280 yyextra->docBlockContext = YY_START;
7281 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7283 yyextra->docBlockAutoBrief = javadocAutoBrief;
7287 yyextra->docBlock.
str(indent.
str());
7289 if (yyextra->docBlockAutoBrief)
7291 yyextra->current->briefLine = yyextra->yyLineNr;
7292 yyextra->current->briefFile = yyextra->fileName;
7297<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
7298 yyextra->lastDocContext = YY_START;
7299 if (yyextra->current_root->section.isScope())
7301 yyextra->current->inside = yyextra->current_root->name+
"::";
7303 yyextra->docBlockContext = YY_START;
7304 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7305 yyextra->docBlockAutoBrief =
false;
7309 yyextra->docBlock.
str(indent.
str());
7314<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
7315 yyextra->lastDocContext = YY_START;
7316 if (yyextra->current_root->section.isScope())
7318 yyextra->current->inside = yyextra->current_root->name+
"::";
7320 yyextra->docBlockContext = YY_START;
7321 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7322 yyextra->docBlockAutoBrief =
false;
7325 yyextra->docBlock.
str(indent.
str());
7329<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
7331 yyextra->externLinkage=
true;
7334 if (yyextra->externLinkage)
7336 yyextra->externLinkage=
false;
7338 else if (yyextra->insideCS &&
7339 !yyextra->current->name.empty() &&
7340 !yyextra->current->type.empty())
7342 if (yyextra->current->mtype == MethodTypes::Event)
7344 yyextra->mtype = MethodTypes::Event;
7346 else if (yyextra->current->type.containsWord(
"event"))
7348 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
7352 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
7354 yyextra->current->bodyLine = yyextra->yyLineNr;
7355 yyextra->current->bodyColumn = yyextra->yyColNr;
7356 yyextra->curlyCount=0;
7357 BEGIN( CSAccessorDecl );
7359 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
7363 yyextra->current->exception =
" {";
7364 BEGIN(UNOIDLAttributeBlock);
7368 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
7369 yyextra->current->name.empty()
7373 yyextra->needsSemi =
false;
7374 if (yyextra->current->isStatic)
7376 yyextra->current->name=
"[static initializer]";
7377 yyextra->current->type.clear();
7381 yyextra->current->name=
"[instance initializer]";
7398 yyextra->current->bodyLine = yyextra->yyLineNr;
7399 yyextra->current->bodyColumn = yyextra->yyColNr;
7400 yyextra->current->initializer.str(yytext);
7401 yyextra->lastInitializerContext = YY_START;
7402 yyextra->sharpCount=0;
7403 yyextra->initBracketCount=1;
7404 BEGIN(ReadInitializer);
7408<CSAccessorDecl>"{" { yyextra->curlyCount++; }
7409<CSAccessorDecl>"}"{B}*"=" {
7411 if (yyextra->curlyCount != 0) REJECT;
7412 yyextra->current->initializer.str(
"=");
7413 yyextra->current->endBodyLine=yyextra->yyLineNr;
7414 yyextra->lastInitializerContext = FindMembers;
7415 BEGIN(ReadInitializer);
7417<CSAccessorDecl>"}" {
7418 if (yyextra->curlyCount)
7420 yyextra->curlyCount--;
7424 yyextra->mtype = MethodTypes::Method;
7425 yyextra->virt = Specifier::Normal;
7427 yyextra->current->endBodyLine=yyextra->yyLineNr;
7432<CSAccessorDecl>"private "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(
true); }
7433<CSAccessorDecl>"protected "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(
true); }
7434<CSAccessorDecl>"private "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(
true); }
7435<CSAccessorDecl>"protected "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(
true); }
7436<CSAccessorDecl>"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(
true); }
7437<CSAccessorDecl>"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(
true); }
7438<CSAccessorDecl>"add" {
if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(
true); }
7439<CSAccessorDecl>"remove" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(
true); }
7440<CSAccessorDecl>"raise" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(
true); }
7441<CSAccessorDecl>{CHARLIT} {}
7442<CSAccessorDecl>"\"" { BEGIN(CSString);}
7443<CSAccessorDecl>"." {}
7444<CSAccessorDecl>\n {
lineCount(yyscanner); }
7445<CSString>"\"" { BEGIN(CSAccessorDecl);}
7453<SliceSequence>{SCOPENAME} {
7454 if (yyextra->current->spec.isLocal())
7456 yyextra->current->type =
"local ";
7458 yyextra->current->type +=
"sequence<";
7459 yyextra->current->type += yytext;
7460 yyextra->current->type +=
">";
7463<SliceSequence>{BN}*">"{BN}* {
7465 BEGIN(SliceSequenceName);
7468<SliceSequenceName>{ID}{BN}* {
7470 yyextra->current->name = yytext ;
7471 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7474<SliceSequenceName>";" {
7475 yyextra->current->section = EntryType::makeVariable();
7476 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7481<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7483 if (yyextra->current->spec.isLocal())
7485 yyextra->current->type =
"local ";
7487 yyextra->current->type +=
"dictionary<";
7488 yyextra->current->type += yytext;
7489 yyextra->current->type +=
">";
7490 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7493<SliceDictionary>{BN}*">"{BN}* {
7495 BEGIN(SliceDictionaryName);
7498<SliceDictionaryName>{ID}{BN}* {
7500 yyextra->current->name = yytext ;
7501 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7504<SliceDictionaryName>";" {
7505 yyextra->current->section = EntryType::makeVariable();
7506 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7516<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? {
7517 int markerLen = yytext[yyleng-1]==
'<' ? 4 : 3;
7518 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7521<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" {
7522 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7523 BEGIN( yyextra->docBlockContext );
7525<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" {
7526 yyextra->docBlock << yytext;
7527 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7528 BEGIN( yyextra->docBlockContext );
7530<DocLine>{NONLopt}/"\n" {
7531 yyextra->docBlock << yytext;
7532 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7533 BEGIN( yyextra->docBlockContext );
7538<DocBlock>"*"*{CCE} {
7540 BEGIN(yyextra->docBlockContext);
7542<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7545 yyextra->docBlock <<
"\\ilinebr " << indent;
7547<DocBlock>^{B}*"*"+/[^/] {
7550 yyextra->docBlock << indent;
7552<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] {
7555 yyextra->docBlock << indent;
7557<DocBlock>^{B}*({CPPC}){B}* {
7560 yyextra->docBlock << yytext;
7564 yyextra->docBlock << yytext;
7566<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
7567 yyextra->docBlock << yytext;
7569<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7570 yyextra->docBlock << yytext;
7571 char blockName[] =
"f$";
7573 if (c==
'[') blockName[1]=
']';
7574 else if (c==
'{') blockName[1]=
'}';
7575 else if (c==
'(') blockName[1]=
')';
7577 BEGIN(DocCopyBlock);
7579<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7580 yyextra->fileName = &yytext[6];
7581 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7582 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7583 yyextra->docBlock << yytext;
7585<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7586 yyextra->fileName = &yytext[6];
7587 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7588 yyextra->docBlock << yytext;
7590<DocBlock>{CMD}"iline"{LINENR}{B} {
7592 int nr =
DString(&yytext[6]).toInt(&ok);
7595 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7599 yyextra->yyLineNr = nr;
7601 yyextra->docBlock << yytext;
7603<DocBlock>{B}*"<"{PRE}">" {
7604 yyextra->docBlock << yytext;
7606 BEGIN(DocCopyBlock);
7608<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
7609 yyextra->docBlock << yytext;
7611 BEGIN(DocCopyBlock);
7613<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid")/[^a-z_A-Z0-9\-] {
7614 yyextra->docBlock << yytext;
7616 BEGIN(DocCopyBlock);
7618<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] {
7619 yyextra->docBlock << yytext;
7621 BEGIN(DocCopyBlock);
7623<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7625 yyextra->docBlock <<
"\\ilinebr ";
7626 yyextra->docBlock << pat;
7628 BEGIN(DocCopyBlock);
7630<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7632 yyextra->docBlock << pat;
7634 BEGIN(DocCopyBlock);
7636<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7637<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7638<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7640 yyextra->docBlock <<
"\\ilinebr ";
7641 yyextra->docBlock << pat;
7643 BEGIN(DocCopyBlock);
7645<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7646<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7647<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7649 yyextra->docBlock << pat;
7651 BEGIN(DocCopyBlock);
7654 yyextra->docBlock <<
"```";
7657 yyextra->docBlock << yytext;
7660 yyextra->docBlock << yytext;
7662 BEGIN(DocCopyBlock);
7664<DocBlock>{B}*"<"{CODE}">" {
7665 if (yyextra->insideCS)
7667 yyextra->docBlock << yytext;
7669 BEGIN(DocCopyBlock);
7676<DocBlock>[^@*~`'\/\\\n]+ {
7677 yyextra->docBlock << yytext;
7681 yyextra->docBlock << *yytext;
7684 yyextra->docBlock << *yytext;
7689<DocCopyBlock>"</"{PRE}">" {
7694 yyextra->docBlock << yytext;
7696<DocCopyBlock>"</"{CODE}">" {
7701 yyextra->docBlock << yytext;
7703<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7708 yyextra->docBlock << yytext;
7710<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9] {
7715 yyextra->docBlock << yytext;
7717<DocCopyBlock>^{B}*"*"+/{BN}+ {
7718 if ((yyextra->docBlockName==
"verbatim") || (yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7726 yyextra->docBlock << indent;
7729<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* {
7730 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7734 yyextra->docBlock << indent;
7741<DocCopyBlock>^{B}*"*"+/({ID}|"(") {
7742 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7746 yyextra->docBlock << indent+
"*";
7753<DocCopyBlock>^{B}*"*"+/{BN}* {
7754 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7757 if (yyextra->nestedComment>0)
7760 yyextra->docBlock << indent+
"*";
7765 yyextra->docBlock << indent;
7773<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7779 yyextra->docBlock << pat;
7781<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7787 yyextra->docBlock << pat;
7789<DocCopyBlock>"```" {
7790 if (yyextra->docBlockName==
"``")
7792 yyextra->docBlock <<
"`";
7794 yyextra->docBlock <<
"``";
7799 yyextra->docBlock << yytext;
7802<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7807 yyextra->docBlock << yytext;
7809<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7814 yyextra->docBlock << yytext;
7816<DocCopyBlock>"`"{1,2} {
7821 yyextra->docBlock << yytext;
7823<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ {
7824 yyextra->docBlock << yytext;
7827 yyextra->docBlock << yytext;
7828 if (yyextra->docBlockName==
"code" || yyextra->docBlockName==
"iliteral")
7832 yyextra->lastStringContext=YY_START;
7833 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7834 yyextra->stopAtInvalidString=
true;
7838<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7841 yyextra->nestedComment++;
7843 else if (yytext[0]==
'*' && yyextra->nestedComment>0)
7845 yyextra->nestedComment--;
7847 else if (yytext[0]==
'*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7849 warn(yyextra->fileName,yyextra->yyLineNr,
7850 "Found end of C comment inside a '{}' block without matching start of the comment!"
7851 " Maybe the end marker for the block is missing?",
7852 yyextra->docBlockName);
7855 yyextra->docBlock << yytext;
7858 yyextra->docBlock << *yytext;
7862 yyextra->docBlock << *yytext;
7864<DocCopyBlock><<EOF>> {
7865 warn(yyextra->fileName,yyextra->yyLineNr,
7866 "reached end of file while inside a '{}' block!"
7867 " The command that should end the block seems to be missing!",
7868 yyextra->docBlockName);
7875<Prototype>"operator"{B}*"("{B}*")" {
7876 yyextra->current->name+=yytext;
7879 yyextra->current->args+=*yytext;
7880 yyextra->currentArgumentContext = PrototypeQual;
7881 yyextra->fullArgString = yyextra->current->args;
7882 yyextra->copyArgString = &yyextra->current->args;
7883 BEGIN( ReadFuncArgType ) ;
7885<Prototype>"("({ID}"::")*({B}*[&*])+ {
7886 if (yyextra->insidePHP)
7892 yyextra->current->type+=yyextra->current->name+yytext;
7893 yyextra->current->name.clear();
7894 BEGIN( PrototypePtr );
7897<PrototypePtr>{SCOPENAME} {
7898 yyextra->current->name+=yytext;
7901 yyextra->current->args+=*yytext;
7902 yyextra->currentArgumentContext = PrototypeQual;
7903 yyextra->fullArgString = yyextra->current->args;
7904 yyextra->copyArgString = &yyextra->current->args;
7905 BEGIN( ReadFuncArgType ) ;
7908 yyextra->current->type+=
')';
7912 yyextra->current->name+=yytext;
7915 BEGIN( PrototypeSkipLine);
7917<PrototypeQual>{B}*"const"{B}* {
7918 yyextra->current->args +=
" const ";
7919 yyextra->current->argList.setConstSpecifier(
true);
7921<PrototypeQual>{B}*"volatile"{B}* {
7922 yyextra->current->args +=
" volatile ";
7923 yyextra->current->argList.setVolatileSpecifier(
true);
7925<PrototypeQual>{B}*"="{B}*"0"{B}* {
7926 yyextra->current->args +=
" = 0";
7927 yyextra->current->virt = Specifier::Pure;
7928 yyextra->current->argList.setPureSpecifier(
true);
7930<PrototypeQual>"throw"{B}*"(" {
7931 yyextra->current->exception =
"throw(";
7932 BEGIN(PrototypeExc);
7935 yyextra->current->exception +=
')';
7936 BEGIN(PrototypeQual);
7939 yyextra->current->exception += *yytext;
7942 yyextra->current->args += *yytext;
7945 yyextra->current->name += *yytext;
7947<PrototypeSkipLine>. {
7953<SkipCxxComment>.*"\\\n" {
7954 if (yyextra->insideCS)
7963<SkipCxxComment>{ANYopt}/\n {
7964 BEGIN( yyextra->lastCContext ) ;
7966<SkipComment>[^\*\n]+
7971 if (!yyextra->insideCpp) REJECT;
7972 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
7973 yyextra->lastC11AttributeContext = YY_START;
7974 yyextra->pCopyC11AttributeString = &yyextra->current->attributes;
7975 BEGIN( CopyC11Attribute );
7980 if (yyextra->insideIDL && yyextra->insideCppQuote)
7984 else if (yyextra->insidePHP)
7986 yyextra->lastStringContext=YY_START;
7991 if (!yyextra->insidePHP)
7993 yyextra->lastCPPContext = YY_START;
7998 yyextra->lastCContext = YY_START ;
7999 BEGIN( SkipCxxComment ) ;
8003 if (!yyextra->insidePHP)
8005 yyextra->lastCContext = YY_START ;
8006 BEGIN( SkipCxxComment ) ;
8009 if (yyextra->insidePHP)
8011 yyextra->lastStringContext=YY_START;
8012 BEGIN(SkipPHPString);
8016 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
8018 if (yyextra->current->type.empty())
8020 if (yyextra->current->name.empty())
8021 yyextra->current->name=
"?";
8023 yyextra->current->name+=
"?";
8027 yyextra->current->type+=
"?";
8031<*>"}" { yyextra->exported=
false; }
8033<SkipComment>{CPPC}|{CCS}
8034<*>{CCS} { yyextra->lastCContext = YY_START ;
8035 BEGIN( SkipComment ) ;
8037<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
8039 yyextra->lastCContext = YY_START ;
8040 BEGIN( SkipCxxComment ) ;
8043 if (yyextra->insideCS && yyextra->fakeNS)
8047 BEGIN ( ReadNSBody);
8059 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8061 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
8063 *buf = yyextra->inputString[yyextra->inputPosition++] ;
8073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8074 yyextra->outerScopeEntries.clear();
8075 yyextra->baseName.clear();
8076 yyextra->protection = Protection::Public;
8077 yyextra->baseProt = Protection::Public;
8078 yyextra->sharpCount = 0;
8079 yyextra->roundCount = 0;
8080 yyextra->curlyCount = 0;
8081 yyextra->mtype = MethodTypes::Method;
8082 yyextra->isStatic =
false;
8083 yyextra->virt = Specifier::Normal;
8084 yyextra->baseVirt = Specifier::Normal;
8085 yyextra->isTypedef =
false;
8086 yyextra->insideTryBlock =
false;
8087 yyextra->insideFormula =
false;
8088 yyextra->insideCode=
false;
8090 yyextra->previous = 0;
8091 yyextra->firstTypedefEntry.reset();
8092 yyextra->memspecEntry.reset();
8097 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8098 if (yyextra->insideJava)
8100 yyextra->protection = (yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isEnum()) ? Protection::Public : Protection::Package;
8102 yyextra->current->protection = yyextra->protection;
8103 yyextra->current->exported = yyextra->exported ;
8104 yyextra->current->mtype = yyextra->mtype;
8105 yyextra->current->virt = yyextra->virt;
8106 yyextra->current->isStatic = yyextra->isStatic;
8107 yyextra->current->lang = yyextra->language;
8109 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
8110 yyextra->isTypedef=
false;
8120 char result[md5_sig.size()*3+2];
8123 for (
size_t i=0;i<md5_sig.size();i++)
8125 static const char oct[]=
"01234567";
8126 uint8_t
byte = md5_sig[i];
8127 *p++=oct[(
byte>>6)&7];
8128 *p++=oct[(
byte>>3)&7];
8129 *p++=oct[(
byte>>0)&7];
8137 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8138 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
8140 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,
id);
8146 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8149 for (p = yytext ; *p ; ++p )
8153 yyextra->yyLineNr++;
8159 yyextra->column+=tabSize - (yyextra->column%tabSize);
8160 yyextra->yyColNr=1+yyextra->column;
8173 size_t col=startIndent;
8179 if (c==
'\t') col+=tabSize-(col%tabSize);
8180 else if (c==
'\n') col=0;
8188 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8189 yyextra->current->protection = yyextra->protection = prot;
8190 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
8191 yyextra->current->type.clear();
8192 yyextra->current->name.clear();
8193 yyextra->current->args.clear();
8194 yyextra->current->argList.clear();
8200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8201 size_t tl=yyextra->current->type.length();
8202 if( tl>0 && !yyextra->current->name.empty() && yyextra->current->type.at(tl-1)!=
'.')
8204 yyextra->current->type +=
' ' ;
8206 yyextra->current->type += yyextra->current->name;
8207 yyextra->current->name.clear() ;
8208 tl=yyextra->current->type.length();
8209 if( tl>0 && !yyextra->current->args.empty() && yyextra->current->type.at(tl-1)!=
'.')
8211 yyextra->current->type +=
' ' ;
8213 yyextra->current->type += yyextra->current->args ;
8214 yyextra->current->args.clear() ;
8215 yyextra->current->argList.clear();
8222 if (s==
nullptr || *s==0)
return name;
8224 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
8236 bool funcPtr = i>0 && type[i-1]==
')';
8238 while (i>0 && (type[i-1]==
'*' || type[i-1]==
'&' || type[i-1]==
' ')) i--;
8239 if (funcPtr && i>0 && type[i-1]==
'(') i--;
8240 return type.
left(i);
8246 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8249 yyextra->docBlock <<
"\\iskip";
8251 yyextra->docBlockName=blockName;
8252 yyextra->fencedSize=fencedSize;
8253 yyextra->isCodeBlock=codeBlock;
8254 yyextra->nestedComment=0;
8260 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8261 if (yyextra->docBlockName==blockName && (fencedSize==0 || fencedSize==yyextra->fencedSize))
8265 yyextra->docBlock <<
"\\endiskip";
8267 yyextra->docBlockName=
"";
8287 size_t i=name.
find(
"operator");
8289 if (i==0 && !
isId(name.
at(8)))
return true;
8290 if (i>0 && !
isId(name.
at(i-1)) && !
isId(name.
at(i+8)))
return true;
8298 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8300 yyextra->insideIDL = yyextra->language==SrcLangExt::IDL;
8301 yyextra->insideJava = yyextra->language==SrcLangExt::Java;
8302 yyextra->insideCS = yyextra->language==SrcLangExt::CSharp;
8303 yyextra->insideD = yyextra->language==SrcLangExt::D;
8304 yyextra->insidePHP = yyextra->language==SrcLangExt::PHP;
8305 yyextra->insideObjC = yyextra->language==SrcLangExt::ObjC;
8306 yyextra->insideJS = yyextra->language==SrcLangExt::JS;
8307 yyextra->insideSlice = yyextra->language==SrcLangExt::Slice;
8308 yyextra->insideCpp = (yyextra->language==SrcLangExt::Cpp ||
8309 yyextra->language==SrcLangExt::Lex);
8320 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8321 if (yyextra->current_root->section.isScope())
8324 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
8326 for (
const ArgumentList &srcAl : yyextra->current_root->tArgLists)
8328 yyextra->current->tArgLists.insert(yyextra->current->tArgLists.begin(),srcAl);
8338 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8339 if (!yyextra->fileName.lower().endsWith(
".c"))
return false;
8340 if (yyextra->current->argList.empty())
return false;
8341 for (
const Argument &a : yyextra->current->argList)
8352 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8353 if (yyextra->insideJava)
8356 yyextra->current->protection = Protection::Public;
8358 yyextra->current->protection = Protection::Protected;
8360 yyextra->current->protection = Protection::Private;
8362 yyextra->current->protection = Protection::Package;
8369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8370 int si =
static_cast<int>(yyextra->current->args.length());
8371 if (yyextra->oldStyleArgType.empty())
8373 std::string args = yyextra->current->args.str();
8374 static const reg::Ex re(R
"(\([^)]*\).*)");
8380 bi1=(int)match.position();
8381 size_t secondMatchStart = match.position()+match.length();
8384 bi2=(int)match.position();
8388 if (bi1!=-1 && bi2!=-1)
8391 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8393 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8394 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8396 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8397 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8398 yyextra->oldStyleArgType+=yyextra->current->args.
mid(i);
8403 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8406 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8407 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8409 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8410 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8416 while (i>=0 &&
isId(yyextra->current->args.at(i))) i--;
8419 while (i>=0 && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i--;
8423 yyextra->oldStyleArgType=yyextra->current->args.left(i);
8424 oldStyleArgPtr=yyextra->current->args.
mid(i,j-i);
8437 while (j<l && ((c=yyextra->current->args.at(j))==
'*' || isspace((uint8_t)c))) j++;
8440 oldStyleArgPtr=yyextra->current->args.
left(j);
8459 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8460 for (
Argument &a : yyextra->current->argList)
8469 a.
docs=brief+
"\n\n"+docs;
8471 else if (!brief.
empty())
8501 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8504 yyextra->current->briefFile = yyextra->fileName;
8505 yyextra->current->briefLine = yyextra->yyLineNr;
8509 yyextra->current->docFile = yyextra->fileName;
8510 yyextra->current->docLine = yyextra->yyLineNr;
8518 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8519 if (yyextra->tempEntry==0)
8524 yyextra->previous = yyextra->current;
8525 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8529 yyextra->previous = yyextra->current;
8530 yyextra->current = yyextra->tempEntry;
8531 yyextra->tempEntry.reset();
8538 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8541 if (yyextra->docBlockInBody && hideInBodyDocs)
return;
8542 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
8545 std::shared_ptr<Entry> docEntry = yyextra->docBlockInBody && yyextra->previous ? yyextra->previous : yyextra->current;
8546 if (yyextra->docBlockInBody && docEntry && docEntry->inbodyLine==-1)
8548 docEntry->inbodyFile = yyextra->fileName;
8549 docEntry->inbodyLine = lineNr;
8553 bool needsEntry=
false;
8555 Markdown markdown(yyextra->fileName,lineNr);
8558 while (yyextra->commentScanner.parseCommentBlock(
8559 yyextra->thisParser,
8560 yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(),
8564 yyextra->docBlockInBody ?
false : brief,
8565 yyextra->docBlockInBody ?
false : yyextra->docBlockAutoBrief,
8566 yyextra->docBlockInBody,
8567 yyextra->protection,
8578 DString docFile = yyextra->current->docFile;
8580 yyextra->current->docFile = docFile;
8581 yyextra->current->docLine = lineNr;
8589 if (yyextra->docBlockTerm)
8591 unput(yyextra->docBlockTerm);
8592 yyextra->docBlockTerm=0;
8599 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8610 DString orgDoc = yyextra->current->doc;
8611 DString orgBrief = yyextra->current->brief;
8612 int orgDocLine = yyextra->current->docLine;
8613 int orgBriefLine = yyextra->current->briefLine;
8615 yyextra->current->doc.
clear();
8616 yyextra->current->brief.clear();
8619 int lineNr = orgDocLine;
8621 Markdown markdown(yyextra->fileName,lineNr);
8624 while (yyextra->commentScanner.parseCommentBlock(
8625 yyextra->thisParser,
8626 yyextra->current.get(),
8633 yyextra->protection,
8642 if (needsEntry)
newEntry(yyscanner);
8648 a.
docs = yyextra->current->doc;
8651 yyextra->current->doc = orgDoc;
8652 yyextra->current->brief = orgBrief;
8653 yyextra->current->docLine = orgDocLine;
8654 yyextra->current->briefLine = orgBriefLine;
8665 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8666 for (
const auto &ce : rt->children())
8668 if (!ce->program.empty())
8672 yyextra->padCount=0;
8674 yyextra->programStr = ce->program.str();
8675 yyextra->inputString = yyextra->programStr.data();
8676 yyextra->inputPosition = 0;
8677 if (ce->section.isEnum() || ce->spec.isEnum())
8678 BEGIN( FindFields ) ;
8680 BEGIN( FindMembers ) ;
8681 yyextra->current_root = ce;
8682 yyextra->fileName = ce->fileName;
8684 yyextra->yyLineNr = ce->bodyLine;
8685 yyextra->yyColNr = ce->bodyColumn;
8686 yyextra->insideObjC = ce->lang==SrcLangExt::ObjC;
8688 yyextra->current = std::make_shared<Entry>();
8689 yyextra->isStatic =
false;
8694 if (autoGroupNested && !rt->groups.empty() && !ce->section.isEnum() && !ce->spec.isEnum())
8696 ce->groups = rt->groups;
8699 size_t ni=ce->name.rfind(
"::");
8702 if ( ce->section.isClass() )
8704 if (yyextra->insidePHP || yyextra->insideD || yyextra->insideJS || yyextra->insideIDL || yyextra->insideSlice)
8706 yyextra->current->protection = yyextra->protection = Protection::Public ;
8708 else if (yyextra->insideJava)
8710 yyextra->current->protection = yyextra->protection = (ce->spec.isInterface() || ce->spec.isEnum()) ? Protection::Public : Protection::Package;
8712 else if (ce->spec.isInterface() || ce->spec.isRef() || ce->spec.isValue() || ce->spec.isStruct() || ce->spec.isUnion())
8714 if (ce->lang==SrcLangExt::ObjC)
8716 yyextra->current->protection = yyextra->protection = Protection::Protected ;
8720 yyextra->current->protection = yyextra->protection = Protection::Public ;
8725 yyextra->current->protection = yyextra->protection = Protection::Private ;
8728 else if (ce->section.isEnum() )
8730 yyextra->current->protection = yyextra->protection = ce->protection;
8732 else if (!ce->name.empty() && ce->name.at(ni)==
'@')
8734 if (ce->section.isNamespace() )
8736 yyextra->current->isStatic = yyextra->isStatic =
true;
8738 yyextra->current->protection = yyextra->protection = ce->protection;
8739 yyextra->current->exported = yyextra->exported =
false;
8741 else if (ce->section.isNamespace() )
8743 yyextra->current->protection = yyextra->protection = Protection::Public ;
8744 yyextra->current->exported = yyextra->exported = ce->exported;
8748 yyextra->current->protection = yyextra->protection = Protection::Public ;
8749 yyextra->current->exported = yyextra->exported =
false;
8751 yyextra->mtype = MethodTypes::Method;
8752 yyextra->virt = Specifier::Normal;
8759 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
8761 scannerYYlex(yyscanner);
8764 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
8766 yyextra->programStr.clear();
8767 ce->program.str(std::string());
8781 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8782 for (
const auto &ce : rt->children())
8784 if (ce->section.isConcept())
8788 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8790 yyextra->padCount =0;
8792 yyextra->programStr = ce->initializer.str();
8793 yyextra->inputString = yyextra->programStr.data();
8794 yyextra->inputPosition = 0;
8795 yyextra->current_root = ce;
8796 yyextra->fileName = ce->fileName;
8797 yyextra->yyLineNr = ce->bodyLine;
8798 yyextra->yyColNr = ce->bodyColumn;
8799 yyextra->insideObjC =
false;
8800 yyextra->current = std::make_shared<Entry>();
8804 indent.
fill(
' ',ce->startColumn?ce->startColumn-1:0);
8806 if (!ce->args.empty())
8808 templArgs=indent+
"template"+ce->args+
"\n";
8810 yyextra->current->initializer.
str(
DString(templArgs+indent+
"concept "+ce->name+
" =").str());
8812 yyextra->isStatic =
false;
8814 yyextra->current->section = EntryType::makeConceptCodePart();
8815 yyextra->current->startLine = yyextra->yyLineNr;
8816 BEGIN( FindConceptParts );
8817 scannerYYlex(yyscanner);
8818 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8829 const char *fileBuf,
8830 const std::shared_ptr<Entry> &rt,
8834 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8837 yyextra->inputString = fileBuf;
8838 yyextra->inputPosition = 0;
8839 yyextra->column = 0;
8840 scannerYYrestart(
nullptr,yyscanner);
8843 yyextra->protection = Protection::Public;
8844 yyextra->mtype = MethodTypes::Method;
8845 yyextra->isStatic =
false;
8846 yyextra->exported =
false;
8847 yyextra->virt = Specifier::Normal;
8848 yyextra->current_root = rt;
8849 yyextra->yyLineNr = 1 ;
8850 yyextra->yyBegLineNr = 1;
8851 yyextra->yyBegColNr = 0;
8852 yyextra->anonCount = 0;
8853 yyextra->anonNSCount = 0;
8854 yyextra->fileName = fileName;
8855 yyextra->clangParser = clangParser;
8857 rt->lang = yyextra->language;
8858 msg(
"Parsing file {}...\n",yyextra->fileName);
8860 yyextra->current_root = rt;
8862 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
8863 yyextra->current = std::make_shared<Entry>();
8868 yyextra->current->name = yyextra->fileName;
8869 yyextra->current->section = sec;
8870 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8872 yyextra->current->reset();
8874 if ( yyextra->insidePHP )
8876 BEGIN( FindMembersPHP );
8878 else if ( yyextra->insideJava )
8880 yyextra->current->name=
"java::lang";
8881 yyextra->current->fileName = yyextra->fileName;
8882 yyextra->current->section = EntryType::makeUsingDir();
8883 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8885 BEGIN( FindMembers );
8889 BEGIN( FindMembers );
8892 scannerYYlex(yyscanner);
8894 if (YY_START==Comment)
8896 warn(yyextra->fileName,yyextra->yyLineNr,
"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
8900 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
8902 yyextra->programStr.clear();
8903 rt->program.str(std::string());
8908 yyextra->anonNSCount++;
8911 for (
auto &[
parent,child]: yyextra->outerScopeEntries)
8914 parent->moveToSubEntryAndKeep(child);
8916 yyextra->outerScopeEntries.clear();
8925 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8928 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
8931 if (!yyextra->current)
8936 const char *orgInputString;
8937 int orgInputPosition;
8938 YY_BUFFER_STATE orgState;
8941 orgState = YY_CURRENT_BUFFER;
8942 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
8943 orgInputString = yyextra->inputString;
8944 orgInputPosition = yyextra->inputPosition;
8947 yyextra->inputString = text.
data();
8948 yyextra->inputPosition = 0;
8949 yyextra->column = 0;
8950 scannerYYrestart(
nullptr, yyscanner);
8952 scannerYYlex(yyscanner);
8954 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
8955 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.empty())
8957 yyextra->current->section = EntryType::makeVariableDoc();
8961 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
8962 yy_switch_to_buffer(orgState, yyscanner);
8963 yyextra->inputString = orgInputString;
8964 yyextra->inputPosition = orgInputPosition;
8980 scannerYYlex_init_extra(&
p->state,&
p->yyscanner);
8988 scannerYYlex_destroy(
p->yyscanner);
8992 const char *fileBuf,
8993 const std::shared_ptr<Entry> &root,
8997 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
8998 yyextra->thisParser =
this;
9002 ::parseMain(
p->yyscanner,fileName,fileBuf,root,clangParser);
9010 return (SrcLangExt::Cpp == lang) || (SrcLangExt::Lex == lang) ||
9011 !( fe==
".java" || fe==
".as" || fe==
".d" || fe==
".php" ||
9012 fe==
".php4" || fe==
".inc" || fe==
".phtml"|| fe==
".php5"
9023#include "scanner.l.h"
void parsePrototype(const DString &text) override
Callback function called by the comment block scanner.
bool needsPreprocessing(const DString &extension) const override
Returns true if the language identified by extension needs the C preprocessor to be run before feed t...
void parseInput(const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser) override
Parses a single input file with the goal to build an Entry tree.
std::unique_ptr< Private > p
~COutlineParser() override
DString & setNum(short n)
std::string_view view() const
bool stripPrefix(const DString &prefix)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
bool endsWith(const char *s) const
static bool isFlagSet(const DebugMask mask)
static EntryType guessSection(const DString &name)
Helper class to process markdown formatted text.
DString process(const DString &input, int &startNewlines, bool fromParseInput=false)
#define Config_getInt(name)
#define AUTO_TRACE_ADD(...)
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
const char * qPrint(const char *s)
std::array< uint8_t, 16 > md5hash(const std::string_view &str)
DString trunc(const DString &s, size_t numChars=15)
static void newEntry(yyscan_t yyscanner)
static void parseMain(yyscan_t yyscanner, const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, ClangTUParser *clangParser)
static void parseCompounds(yyscan_t yyscanner, const std::shared_ptr< Entry > &rt)
static void parsePrototype(yyscan_t yyscanner, const DString &text)
static void parseConcepts(yyscan_t yyscanner, const std::shared_ptr< Entry > &rt)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
DString stripIndentation(const DString &s, bool skipFirstLine)
DString stripFromPath(const DString &path)