15%option never-interactive
16%option prefix="scannerYY"
18%option extra-type="struct scannerYY_state *"
22#define YY_TYPEDEF_YY_SCANNER_T
60#define YY_NO_UNISTD_H 1
228static inline size_t computeIndent(
const char *s,
size_t startIndent);
260#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.
#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 int yyread(yyscan_t yyscanner, char *buf, int max_size)
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 const char * getLexerFILE()
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.
275NOTopt (("!"{BNopt})|("not"{BN}+))?
277HEXDIGIT ({DIGIT}|[a-f]|[A-F])
278ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
279SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
280TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
281CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID})
284CHARLIT (("'"\\x[0-9a-fA-F]{1,2}"'")|("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
285PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
286PHPUSEKW ("public"|"private"|"protected")
287IDLATTR ("["[^\]]*"]"){BN}*
288TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
289RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
290RAWEND ")"[^ \t\(\)\\]{0,16}\"
291ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
292ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
293LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>"
294BITOP "&"|"|"|"^"|"<<"|">>"|"~"
295OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
296FUNCOP "operator"("()"|"[]"|{B}+[^;\n]+)
297MODULE_ID ({ID}".")*{ID}
298LINENR {B}*[1-9][0-9]*
299FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
300FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
301FILECHARS {FILEICHAR}*{FILEECHAR}+
302HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
303VFILEMASK {FILECHARS}("."{FILECHARS})*
304FILEMASK {VFILEMASK}|{HFILEMASK}
315DCOMMC ("/\*!"|"/\**")
317DCOMMCPP ("/\/!"|"/\/\/")
319DCOMM {DCOMMC}|{DCOMMCPP}
390%x TryFunctionBlockEnd
405%x SkipInterpVerbString
420%x UNOIDLAttributeBlock
450%x SpecializationSingleQuote
451%x SpecializationDoubleQuote
484%x SliceDictionaryName
515<*>"DEPRECATED_ATTRIBUTE" {
516 if (!yyextra->insideObjC) REJECT;
518<*>"DEPRECATED_MSG_ATTRIBUTE(\"" {
519 if (!yyextra->insideObjC) REJECT;
520 yyextra->lastDeprecatedContext=YY_START;
521 yyextra->lastStringContext=Deprecated_round;
524<Deprecated_round>")" {
525 BEGIN(yyextra->lastDeprecatedContext);
527<Deprecated_round>{BNopt} {
530<Deprecated_round>. { }
532 yyextra->curlyCount=0;
533 yyextra->needsSemi =
true;
534 BEGIN(SkipCurlyBlock);
537 yyextra->roundCount=0;
538 BEGIN(SkipRoundBlock);
541 ++yyextra->roundCount;
544 if (yyextra->roundCount )
545 --yyextra->roundCount ;
550 ++yyextra->curlyCount ;
553 if( yyextra->curlyCount )
555 --yyextra->curlyCount ;
557 else if (yyextra->needsSemi)
563 BEGIN( FindMembers );
567 if (yyextra->insidePHP)
569 yyextra->lastStringContext=NextSemi;
570 BEGIN(SkipPHPString);
573<NextSemi>{CHARLIT} {
if (yyextra->insidePHP) REJECT; }
575 yyextra->lastStringContext=NextSemi;
580 BEGIN( FindMembers );
584 BEGIN( FindMembers );
587 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
591<FindMembers>"<?php" {
592 yyextra->insidePHP =
true;
594<FindMembersPHP>"<?"("php"?) {
595 BEGIN( FindMembers );
597<FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" {
599 BEGIN( FindMembers );
601<FindMembers>"?>"|"</script>" {
602 if (yyextra->insidePHP)
603 BEGIN( FindMembersPHP );
607<FindMembersPHP>[^\n<]+ {
614<FindMembers>{PHPKW} {
if (yyextra->insidePHP)
619<FindMembers>"%{"[^\n]* {
620 if (!yyextra->insideIDL)
624 if (!yyextra->insideIDL)
627<FindMembers>{B}*("properties"){BN}*":"{BN}* {
629 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
632<FindMembers>{B}*"k_dcop"{BN}*":"{BN}* {
634 yyextra->current->mtype = yyextra->mtype = MethodTypes::DCOP;
637<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* {
639 yyextra->current->mtype = yyextra->mtype = MethodTypes::Signal;
642<FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
644 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
647<FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
649 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
652<FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
654 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
656<FindMembers>{B}*("public"|"methods"|"__published"){BN}*":"{BN}* {
659<FindMembers>{B}*"internal"{BN}*":"{BN}* {
660 if (yyextra->insideCli)
669<FindMembers>{B}*"protected"{BN}*":"{BN}* {
672<FindMembers>{B}*"private"{BN}*":"{BN}* {
675<FindMembers>{B}*("private"{BN}+"protected"|"protected"{BN}+"private")/{BN} {
676 if (!yyextra->insideCS) REJECT;
679 yyextra->current->protection = Protection::Package;
681<FindMembers>{B}*"public"/({BN}|{CCS}|{CPPC}) {
682 if (!yyextra->insideCpp) REJECT;
686<FindMembers>{B}*"protected"/({BN}|{CCS}|{CPPC}) {
687 if (!yyextra->insideCpp) REJECT;
691<FindMembers>{B}*"private"/({BN}|{CCS}|{CPPC}) {
692 if (!yyextra->insideCpp) REJECT;
704<CppProt>{CPPC}.*\n {
lineCount(yyscanner); }
705<CppProt>{CCS} { yyextra->lastCContext = YY_START ;
706 BEGIN( SkipComment ) ;
708<CppProt>("slots"|"Q_SLOTS") {
709 yyextra->current->mtype = yyextra->mtype = MethodTypes::Slot;
711<FindMembers>{B}*"event"{BN}+ {
712 if (yyextra->insideCli)
716 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
717 yyextra->current->bodyLine = yyextra->yyLineNr;
718 yyextra->current->bodyColumn = yyextra->yyColNr;
719 yyextra->curlyCount=0;
720 BEGIN( CliPropertyType );
722 else if (yyextra->insideCS)
725 yyextra->current->mtype = MethodTypes::Event;
726 yyextra->current->bodyLine = yyextra->yyLineNr;
727 yyextra->current->bodyColumn = yyextra->yyColNr;
734<FindMembers>{B}*"property"{BN}+ {
735 if (yyextra->insideCli)
739 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
740 yyextra->current->bodyLine = yyextra->yyLineNr;
741 yyextra->current->bodyColumn = yyextra->yyColNr;
742 yyextra->curlyCount=0;
743 BEGIN( CliPropertyType );
750<CliPropertyType>{ID} {
752 yyextra->current->name = yytext;
754<CliPropertyType>"[" {
755 yyextra->current->args =
"[";
756 BEGIN( CliPropertyIndex );
758<CliPropertyType>"{" {
759 yyextra->curlyCount=0;
761 BEGIN( CSAccessorDecl );
763<CliPropertyType>";" {
765 BEGIN( FindMembers );
770<CliPropertyType>{B}* {
774 yyextra->current->type += yytext;
776<CliPropertyIndex>"]" {
777 BEGIN( CliPropertyType );
778 yyextra->current->args+=yytext;
781 yyextra->current->args+=yytext;
796<FindMembers>{B}*"@private"{BN}+ {
799<FindMembers>{B}*"@protected"{BN}+ {
802<FindMembers>{B}*"@public"{BN}+ {
805<FindMembers>[\-+]{BN}* {
806 if (!yyextra->insideObjC)
812 yyextra->current->fileName = yyextra->fileName;
813 yyextra->current->startLine = yyextra->yyLineNr;
814 yyextra->current->startColumn = yyextra->yyColNr;
815 yyextra->current->bodyLine = yyextra->yyLineNr;
816 yyextra->current->bodyColumn = yyextra->yyColNr;
817 yyextra->current->section = EntryType::makeFunction();
818 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
819 yyextra->insideObjC =
true;
820 yyextra->yyBegColNr = yyextra->yyColNr;
821 yyextra->yyBegLineNr = yyextra->yyLineNr;
822 yyextra->current->virt = Specifier::Virtual;
824 yyextra->current->isStatic=yytext[0]==
'+';
830 BEGIN( ObjCReturnType );
831 yyextra->current->type.clear();
832 yyextra->roundCount=0;
835 if (yyextra->current->type.empty())
837 yyextra->current->type +=
"id";
839 yyextra->current->name = yytext;
843 yyextra->current->name +=
':';
845 yyextra->current->argList.push_back(a);
This class contains the information about the argument of a function or template.
848<ObjCReturnType>[^()]* {
849 yyextra->current->type += yytext;
851<ObjCReturnType>"(^)(" {
852 yyextra->current->type += yytext;
853 yyextra->roundCount++;
856 yyextra->current->type += yytext;
857 yyextra->roundCount++;
860 if (yyextra->roundCount<=0)
866 yyextra->current->type += yytext;
867 yyextra->roundCount--;
870<ObjCParams>({ID})?{BN}*":" {
875 yyextra->current->name +=
" :";
879 yyextra->current->name += keyw+
":";
881 if (yyextra->current->argList.back().type.empty())
883 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.
889<ObjCParams>{ID}{BN}* {
893<ObjCParams>","{BN}*"..." {
908 yyextra->roundCount=0;
909 yyextra->current->argList.back().type.clear();
910 BEGIN( ObjCParamType );
913 yyextra->roundCount++;
914 yyextra->current->argList.back().type+=yytext;
916<ObjCParamType>")"/{B}* {
917 if (yyextra->roundCount<=0)
923 yyextra->current->argList.back().type+=yytext;
924 yyextra->roundCount--;
927<ObjCParamType>[^()]* {
930<ObjCMethod,ObjCParams>";" {
931 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.empty())
933 yyextra->current->argList.back().type=
"id";
935 if (yyextra->current->argList.empty())
937 yyextra->current->argList.setNoParameters(
true);
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
944<ObjCMethod,ObjCParams>(";"{BN}+)?"{" {
949 if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.empty())
951 yyextra->current->argList.back().type=
"id";
953 if (yyextra->current->argList.empty())
955 yyextra->current->argList.setNoParameters(
true);
961<FindMembers>{B}*"sequence"{BN}*"<"{BN}* {
962 if (yyextra->insideSlice)
965 yyextra->current->bodyLine = yyextra->yyLineNr;
966 yyextra->current->bodyColumn = yyextra->yyColNr;
967 yyextra->current->fileName = yyextra->fileName ;
968 yyextra->current->startLine = yyextra->yyLineNr ;
969 yyextra->current->startColumn = yyextra->yyColNr;
970 yyextra->current->args.clear();
971 yyextra->current->section = EntryType::makeTypedef();
972 yyextra->isTypedef =
true;
973 BEGIN( SliceSequence );
978<FindMembers>{B}*"dictionary"{BN}*"<"{BN}* {
979 if (yyextra->insideSlice)
982 yyextra->current->bodyLine = yyextra->yyLineNr;
983 yyextra->current->bodyColumn = yyextra->yyColNr;
984 yyextra->current->fileName = yyextra->fileName ;
985 yyextra->current->startLine = yyextra->yyLineNr ;
986 yyextra->current->startColumn = yyextra->yyColNr;
987 yyextra->current->args.clear();
988 yyextra->current->section = EntryType::makeTypedef() ;
989 yyextra->isTypedef =
true;
990 BEGIN( SliceDictionary );
995<FindMembers>{BN}{1,80} {
998<FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
999 if (yyextra->insideJava)
1002 yyextra->lastSkipRoundContext = YY_START;
1003 yyextra->roundCount=0;
1008 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
1009 yyextra->current->spec.setReadable(
true).setWritable(
true).setAssign(
true);
1010 yyextra->current->protection = Protection::Public ;
1012 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
1019<ObjCPropAttr>"getter="{ID} {
1020 yyextra->current->read = yytext+7;
1022<ObjCPropAttr>"setter="{ID} {
1023 yyextra->current->write = yytext+7;
1025<ObjCPropAttr>"readonly" {
1026 yyextra->current->spec.setWritable(
false);
1028<ObjCPropAttr>"readwrite" {
1030<ObjCPropAttr>"assign" {
1032<ObjCPropAttr>"unsafe_unretained" {
1033 yyextra->current->spec.setAssign(
false);
1034 yyextra->current->spec.setUnretained(
true);
1036<ObjCPropAttr>"retain" {
1037 yyextra->current->spec.setAssign(
false);
1038 yyextra->current->spec.setRetain(
true);
1040<ObjCPropAttr>"copy" {
1041 yyextra->current->spec.setAssign(
false);
1042 yyextra->current->spec.setCopy(
true);
1044<ObjCPropAttr>"weak" {
1045 yyextra->current->spec.setAssign(
false);
1046 yyextra->current->spec.setWeak(
true);
1048<ObjCPropAttr>"strong" {
1049 yyextra->current->spec.setAssign(
false);
1050 yyextra->current->spec.setStrong(
true);
1052<ObjCPropAttr>"nonatomic" {
1053 yyextra->current->spec.setNonAtomic(
true);
1058<FindMembers>"@"{ID}("."{ID})+ {
1059 if (yyextra->insideJava)
1068<FindMembers>"@"{ID} {
1069 if (yyextra->insideJava)
1073 else if (
dstrcmp(yytext,
"@property")==0)
1075 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
1076 yyextra->current->spec.setWritable(
true).setReadable(
true);
1077 yyextra->current->protection = Protection::Public ;
1079 else if (
dstrcmp(yytext,
"@synthesize")==0)
1081 BEGIN( ObjCSkipStatement );
1083 else if (
dstrcmp(yytext,
"@dynamic")==0)
1085 BEGIN( ObjCSkipStatement );
int dstrcmp(const char *str1, const char *str2)
1092<ObjCSkipStatement>";" {
1095<PackageName>{ID}(("."|"\\"){ID})* {
1096 yyextra->isTypedef=
false;
1098 yyextra->current->name = yytext;
1099 yyextra->current->name =
substitute(yyextra->current->name,
".",
"::");
1100 yyextra->current->name =
substitute(yyextra->current->name,
"\\",
"::");
1101 yyextra->current->section = EntryType::makeNamespace();
1102 yyextra->current->type =
"namespace" ;
1103 yyextra->current->fileName = yyextra->fileName;
1104 yyextra->current->startLine = yyextra->yyLineNr;
1105 yyextra->current->startColumn = yyextra->yyColNr;
1106 yyextra->current->bodyLine = yyextra->yyLineNr;
1107 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
1111 std::shared_ptr<Entry> tmp = yyextra->current;
1112 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1113 yyextra->current_root = std::move(tmp);
1118 yyextra->curlyCount=0;
1119 BEGIN( ReadNSBody );
1121<FindMembers>{B}*"export"{BN}+"module"{BN}+ {
1122 if (!yyextra->insideCpp) REJECT;
1124 yyextra->current->exported =
true;
1126 BEGIN( ModuleName );
1128<FindMembers>{B}*"module"{BN}*";" {
1129 if (!yyextra->insideCpp) REJECT;
1130 if (!yyextra->current->type.empty() || !yyextra->current->name.empty()) REJECT;
1133 BEGIN( FindMembers );
1135<FindMembers>{B}*"module"{BN}+ {
1136 if (!yyextra->insideCpp) REJECT;
1138 yyextra->current->exported =
false;
1140 BEGIN( ModuleName );
1142<FindMembers>{B}*"export"{BN}+"import"{BN}+ {
1143 if (!yyextra->insideCpp) REJECT;
1144 yyextra->current->exported =
true;
1146 BEGIN( ModuleImport );
1148<FindMembers>{B}*"import"{BN}+ {
1149 if (!yyextra->insideCpp) REJECT;
1151 BEGIN( ModuleImport );
1153<ModuleName>{MODULE_ID}{BN}*":"{BN}*{MODULE_ID} {
1155 size_t i =
name.find(
':');
1156 DString partition =
name.mid(i+1).stripWhiteSpace();
1157 name =
name.left(i).stripWhiteSpace();
1161 yyextra->current->exported,
1164 yyextra->current->section = EntryType::makeModuleDoc();
1165 yyextra->isTypedef=
false;
1167 yyextra->current->type +=
" module";
1168 yyextra->current->fileName = yyextra->fileName;
1169 yyextra->current->startLine = yyextra->yyLineNr;
1170 yyextra->current->startColumn = yyextra->yyColNr;
1171 yyextra->current->bodyLine = yyextra->yyLineNr;
1172 yyextra->current->bodyColumn = yyextra->yyColNr;
1173 yyextra->current->name =
name+
":"+partition;
void createModuleDef(const DString &fileName, int line, size_t column, bool exported, const DString &moduleName, const DString &partitionName=DString())
static ModuleManager & instance()
const char * name(int level)
1176<ModuleName>{MODULE_ID} {
1180 yyextra->current->exported,
1182 yyextra->current->section = EntryType::makeModuleDoc();
1183 yyextra->isTypedef=
false;
1185 yyextra->current->type +=
" module";
1186 yyextra->current->fileName = yyextra->fileName;
1187 yyextra->current->startLine = yyextra->yyLineNr;
1188 yyextra->current->startColumn = yyextra->yyColNr;
1189 yyextra->current->bodyLine = yyextra->yyLineNr;
1190 yyextra->current->bodyColumn = yyextra->yyColNr;
1191 yyextra->current->name = yytext;
1194<ModuleName>":"{BN}+"private" {
1195 yyextra->current->exported = yyextra->exported =
false;
1198<ModuleName>";" { unput(
';');
1203<ModuleImport>"\""[^"\n]*"\"" {
1206 DString(yytext).mid(1,yyleng-2),
void addHeader(const DString &moduleFile, int line, const DString &headerName, bool isSystem)
1209<ModuleImport>"<"[^>\n]*">" {
1212 DString(yytext).mid(1,yyleng-2),
1215<ModuleImport>{MODULE_ID}?{BN}*":"{BN}*{MODULE_ID} {
1217 size_t i =
name.find(
':');
1218 DString partition =
name.mid(i+1).stripWhiteSpace();
1219 name =
name.left(i).stripWhiteSpace();
1223 yyextra->current->exported,
void addImport(const DString &moduleFile, int line, const DString &importName, bool isExported, const DString &partitionName=DString())
1227<ModuleImport>{MODULE_ID} {
1231 yyextra->current->exported);
1234<ModuleImport>";" { BEGIN(FindMembers); }
1235<ModuleImport>\n {
lineCount(yyscanner); }
1237<FindMembers>{B}*"export"{BN}+"{" {
1238 yyextra->current->exported = yyextra->exported =
true;
1240<FindMembers>{B}*"export"{BN}+ {
1241 if (!yyextra->insideCpp) REJECT;
1242 yyextra->current->exported=
true;
1244<FindMembers>{B}*"initonly"{BN}+ {
if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1245 yyextra->current->type +=
" initonly ";
1246 if (yyextra->insideCli) yyextra->current->spec.setInitonly(
true);
1249<FindMembers>{B}*"static"{BN}*/"{" { yyextra->current->type +=
" static ";
1250 yyextra->current->isStatic =
true;
1253<FindMembers>{B}*"static"{BN}+ { yyextra->current->type +=
" static ";
1254 yyextra->current->isStatic =
true;
1257<FindMembers>{B}*"extern"{BN}+ {
if (yyextra->insideJava) REJECT;
1258 yyextra->current->isStatic =
false;
1259 yyextra->current->explicitExternal =
true;
1262<FindMembers>{B}*"const"{BN}+ {
if (yyextra->insideCS)
1264 yyextra->current->type +=
" const ";
1265 if (yyextra->insideCS) yyextra->current->isStatic =
true;
1273<FindMembers>{B}*"virtual"{BN}+ {
if (yyextra->insideJava) REJECT;
1274 yyextra->current->type +=
" virtual ";
1275 yyextra->current->virt = Specifier::Virtual;
1278<FindMembers>{B}*"constexpr"{BN}+ {
1279 if (yyextra->insideCpp)
1281 yyextra->current->spec.setConstExpr(
true);
1285<FindMembers>{B}*"consteval"{BN}+ {
1286 if (yyextra->insideCpp)
1288 yyextra->current->spec.setConstEval(
true);
1292<FindMembers>{B}*"constinit"{BN}+ {
1293 if (yyextra->insideCpp)
1295 yyextra->current->spec.setConstInit(
true);
1299<FindMembers>{B}*"published"{BN}+ {
1300 if (yyextra->insideIDL)
1303 yyextra->current->spec.setPublished(
true);
1310<FindMembers>{B}*"sealed"{BN}+ {
1311 if (yyextra->insideCS)
1313 yyextra->current->spec.setSealed(
true);
1320<FindMembers>{B}*"abstract"{BN}+ {
1321 if (yyextra->insidePHP || yyextra->insideCS)
1323 yyextra->current->spec.setAbstract(
true);
1327 if (yyextra->insideCpp) REJECT;
1328 yyextra->current->type +=
" abstract ";
1329 if (!yyextra->insideJava)
1331 yyextra->current->virt = Specifier::Pure;
1335 yyextra->current->spec.setAbstract(
true);
1340<FindMembers>{B}*"inline"{BN}+ {
if (yyextra->insideJava) REJECT;
1341 yyextra->current->spec.setInline(
true);
1344<FindMembers>{B}*"mutable"{BN}+ {
if (yyextra->insideJava) REJECT;
1345 yyextra->current->spec.setMutable(
true);
1348<FindMembers>{B}*"thread_local"{BN}+ {
if (yyextra->insideJava) REJECT;
1349 yyextra->current->spec.setThreadLocal(
true);
1352<FindMembers>{B}*"explicit"{BN}+ {
if (yyextra->insideJava) REJECT;
1353 yyextra->current->spec.setExplicit(
true);
1356<FindMembers>{B}*"local"{BN}+ {
if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1357 yyextra->current->spec.setLocal(
true);
1360<FindMembers>{B}*"@required"{BN}+ {
1361 yyextra->current->spec.setOptional(
false).setRequired(
true);
1364<FindMembers>{B}*"@optional"{BN}+ {
1365 yyextra->current->spec.setRequired(
false).setOptional(
true);
1373<FindMembers>{B}*"typename"{BN}+ {
lineCount(yyscanner); }
1374<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] {
if (yyextra->insideJava) REJECT;
1375 yyextra->isTypedef=
false;
1376 yyextra->current->section = EntryType::makeNamespace();
1377 yyextra->current->type =
"namespace" ;
1378 yyextra->current->fileName = yyextra->fileName;
1379 yyextra->current->startLine = yyextra->yyLineNr;
1380 yyextra->current->startColumn = yyextra->yyColNr;
1381 yyextra->current->bodyLine = yyextra->yyLineNr;
1382 yyextra->current->bodyColumn = yyextra->yyColNr;
1384 if (yyextra->insidePHP)
1386 BEGIN( PackageName );
1390 BEGIN( CompoundName );
1393<FindMembers>{B}*"module"{BN}+ {
1395 if (yyextra->insideIDL || yyextra->insideSlice)
1397 yyextra->isTypedef=
false;
1398 yyextra->current->section = EntryType::makeNamespace();
1399 yyextra->current->type =
"module" ;
1400 yyextra->current->fileName = yyextra->fileName;
1401 yyextra->current->startLine = yyextra->yyLineNr;
1402 yyextra->current->startColumn = yyextra->yyColNr;
1403 yyextra->current->bodyLine = yyextra->yyLineNr;
1404 yyextra->current->bodyColumn = yyextra->yyColNr;
1405 BEGIN( CompoundName );
1407 else if (yyextra->insideD)
1418<FindMembers>{B}*"library"{BN}+ {
1420 if (yyextra->insideIDL)
1422 yyextra->isTypedef=
false;
1423 yyextra->current->section = EntryType::makeNamespace();
1424 yyextra->current->type =
"library" ;
1425 yyextra->current->fileName = yyextra->fileName;
1426 yyextra->current->startLine = yyextra->yyLineNr;
1427 yyextra->current->startColumn = yyextra->yyColNr;
1428 yyextra->current->bodyLine = yyextra->yyLineNr;
1429 yyextra->current->bodyColumn = yyextra->yyColNr;
1430 BEGIN( CompoundName );
1438<FindMembers>{B}*"constants"{BN}+ {
1440 if (yyextra->insideIDL)
1442 yyextra->isTypedef=
false;
1443 yyextra->current->section = EntryType::makeNamespace();
1444 yyextra->current->type =
"constants";
1445 yyextra->current->fileName = yyextra->fileName;
1446 yyextra->current->startLine = yyextra->yyLineNr;
1447 yyextra->current->startColumn = yyextra->yyColNr;
1448 yyextra->current->bodyLine = yyextra->yyLineNr;
1449 yyextra->current->bodyColumn = yyextra->yyColNr;
1450 BEGIN( CompoundName );
1458<FindMembers>{BN}*("service"){BN}+ {
1460 if (yyextra->insideIDL)
1462 yyextra->isTypedef=
false;
1463 yyextra->current->section = EntryType::makeClass();
1467 setOptional(spec.isOptional()).setPublished(spec.isPublished());
1469 yyextra->current->type +=
" service " ;
1470 yyextra->current->fileName = yyextra->fileName;
1471 yyextra->current->startLine = yyextra->yyLineNr;
1472 yyextra->current->bodyLine = yyextra->yyLineNr;
1473 yyextra->current->bodyColumn = yyextra->yyColNr;
1474 BEGIN( CompoundName );
Wrapper class for a number of boolean properties.
1482<FindMembers>{BN}*("singleton"){BN}+ {
1484 if (yyextra->insideIDL)
1486 yyextra->isTypedef=
false;
1487 yyextra->current->section = EntryType::makeClass();
1489 yyextra->current->spec =
TypeSpecifier().setSingleton(
true).
1490 setPublished(spec.isPublished());
1492 yyextra->current->type +=
" singleton " ;
1493 yyextra->current->fileName = yyextra->fileName;
1494 yyextra->current->startLine = yyextra->yyLineNr;
1495 yyextra->current->bodyLine = yyextra->yyLineNr;
1496 yyextra->current->bodyColumn = yyextra->yyColNr;
1497 BEGIN( CompoundName );
1505<FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+ {
1507 if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
1509 yyextra->isTypedef=
false;
1510 yyextra->current->section = EntryType::makeClass();
1512 yyextra->current->spec =
TypeSpecifier().setInterface(
true).
1514 setOptional(spec.isOptional()).
1515 setPublished(spec.isPublished()).
1516 setLocal(spec.isLocal());
1518 yyextra->current->type +=
" interface" ;
1519 yyextra->current->fileName = yyextra->fileName;
1520 yyextra->current->startLine = yyextra->yyLineNr;
1521 yyextra->current->startColumn = yyextra->yyColNr;
1522 yyextra->current->bodyLine = yyextra->yyLineNr;
1523 yyextra->current->bodyColumn = yyextra->yyColNr;
1525 BEGIN( CompoundName );
1533<FindMembers>{B}*"@implementation"{BN}+ {
1535 yyextra->isTypedef=
false;
1536 yyextra->current->section = EntryType::makeObjcImpl();
1537 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1538 yyextra->insideObjC =
true;
1539 yyextra->current->protection = yyextra->protection = Protection::Public ;
1541 yyextra->current->type +=
" implementation" ;
1542 yyextra->current->fileName = yyextra->fileName;
1543 yyextra->current->startLine = yyextra->yyLineNr;
1544 yyextra->current->bodyLine = yyextra->yyLineNr;
1545 yyextra->current->bodyColumn = yyextra->yyColNr;
1546 BEGIN( CompoundName );
1548<FindMembers>{B}*"@interface"{BN}+ {
1550 yyextra->isTypedef=
false;
1551 yyextra->current->section = EntryType::makeClass();
1552 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1553 if (!yyextra->insideJava)
1555 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1556 yyextra->insideObjC =
true;
1558 yyextra->current->protection = yyextra->protection = Protection::Public ;
1560 yyextra->current->type +=
" interface" ;
1561 yyextra->current->fileName = yyextra->fileName;
1562 yyextra->current->startLine = yyextra->yyLineNr;
1563 yyextra->current->startColumn = yyextra->yyColNr;
1564 yyextra->current->bodyLine = yyextra->yyLineNr;
1565 yyextra->current->bodyColumn = yyextra->yyColNr;
1566 BEGIN( CompoundName );
1568<FindMembers>{B}*"@protocol"{BN}+ {
1570 yyextra->isTypedef=
false;
1571 yyextra->current->section = EntryType::makeClass();
1573 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1574 yyextra->insideObjC =
true;
1575 yyextra->current->protection = yyextra->protection = Protection::Public ;
1577 yyextra->current->type +=
" protocol" ;
1578 yyextra->current->fileName = yyextra->fileName;
1579 yyextra->current->startLine = yyextra->yyLineNr;
1580 yyextra->current->startColumn = yyextra->yyColNr;
1581 yyextra->current->bodyLine = yyextra->yyLineNr;
1582 yyextra->current->bodyColumn = yyextra->yyColNr;
1583 BEGIN( CompoundName );
1585<FindMembers>{B}*"exception"{BN}+ {
1586 if (yyextra->insideJava || yyextra->insideCpp) REJECT;
1587 yyextra->isTypedef=
false;
1588 yyextra->current->section = EntryType::makeClass();
1591 yyextra->current->spec =
TypeSpecifier().setException(
true).
1592 setPublished(spec.isPublished()).setLocal(spec.isLocal());
1594 yyextra->current->type +=
" exception" ;
1595 yyextra->current->fileName = yyextra->fileName;
1596 yyextra->current->startLine = yyextra->yyLineNr;
1597 yyextra->current->startColumn = yyextra->yyColNr;
1598 yyextra->current->bodyLine = yyextra->yyLineNr;
1599 yyextra->current->bodyColumn = yyextra->yyColNr;
1601 BEGIN( CompoundName );
1603<FindMembers>"@class" |
1604<FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
1605<FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ {
1610 yyextra->current->section = EntryType::makeClass();
1612 if (yyextra->insidePHP && yyextra->current->spec.isAbstract())
1615 yyextra->current->spec.setAbstract(
false).setAbstractClass(
true);
1617 if (yyextra->insideSlice && yyextra->current->spec.isLocal())
1619 yyextra->current->spec.setLocal(
true);
1623 yyextra->current->type +=
" const";
1625 else if (isVolatile)
1627 yyextra->current->type +=
" volatile";
1629 yyextra->current->type +=
" class" ;
1630 yyextra->current->fileName = yyextra->fileName;
1631 yyextra->current->startLine = yyextra->yyLineNr;
1632 yyextra->current->startColumn = yyextra->yyColNr;
1633 yyextra->current->bodyLine = yyextra->yyLineNr;
1634 yyextra->current->bodyColumn = yyextra->yyColNr;
1637 yyextra->language = yyextra->current->lang = SrcLangExt::ObjC;
1638 yyextra->insideObjC =
true;
1641 if (yytext[yyleng-1]==
'{') unput(
'{');
1642 BEGIN( CompoundName ) ;
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
size_t find(char c, size_t pos=0) const
1644<FindMembers>{B}*"value class{" |
1645<FindMembers>{B}*"value class"{BN}+ {
1646 yyextra->isTypedef=
false;
1647 yyextra->current->section = EntryType::makeClass();
1650 yyextra->current->type +=
" value class" ;
1651 yyextra->current->fileName = yyextra->fileName;
1652 yyextra->current->startLine = yyextra->yyLineNr;
1653 yyextra->current->startColumn = yyextra->yyColNr;
1654 yyextra->current->bodyLine = yyextra->yyLineNr;
1655 yyextra->current->bodyColumn = yyextra->yyColNr;
1657 if (yytext[yyleng-1]==
'{') unput(
'{');
1658 BEGIN( CompoundName ) ;
1660<FindMembers>{B}*"ref class{" |
1661<FindMembers>{B}*"ref class"{BN}+ {
1662 yyextra->isTypedef=
false;
1663 yyextra->current->section = EntryType::makeClass();
1666 yyextra->current->type +=
" ref class" ;
1667 yyextra->current->fileName = yyextra->fileName;
1668 yyextra->current->startLine = yyextra->yyLineNr;
1669 yyextra->current->startColumn = yyextra->yyColNr;
1670 yyextra->current->bodyLine = yyextra->yyLineNr;
1671 yyextra->current->bodyColumn = yyextra->yyColNr;
1673 if (yytext[yyleng-1]==
'{') unput(
'{');
1674 BEGIN( CompoundName ) ;
1676<FindMembers>{B}*"interface class{" |
1677<FindMembers>{B}*"interface class"{BN}+ {
1678 yyextra->isTypedef=
false;
1679 yyextra->current->section = EntryType::makeClass();
1680 yyextra->current->spec =
TypeSpecifier().setInterface(
true);
1682 yyextra->current->type +=
" interface class" ;
1683 yyextra->current->fileName = yyextra->fileName;
1684 yyextra->current->startLine = yyextra->yyLineNr;
1685 yyextra->current->startColumn = yyextra->yyColNr;
1686 yyextra->current->bodyLine = yyextra->yyLineNr;
1687 yyextra->current->bodyColumn = yyextra->yyColNr;
1689 if (yytext[yyleng-1]==
'{') unput(
'{');
1690 BEGIN( CompoundName ) ;
1692<FindMembers>{B}*"coclass"{BN}+ {
1693 if (yyextra->insideIDL)
1695 yyextra->isTypedef=
false;
1696 yyextra->current->section = EntryType::makeClass();
1698 yyextra->current->type +=
" coclass" ;
1699 yyextra->current->fileName = yyextra->fileName;
1700 yyextra->current->startLine = yyextra->yyLineNr;
1701 yyextra->current->startColumn = yyextra->yyColNr;
1702 yyextra->current->bodyLine = yyextra->yyLineNr;
1703 yyextra->current->bodyColumn = yyextra->yyColNr;
1705 BEGIN( CompoundName ) ;
1710 yyextra->current->name = yytext;
1711 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1715<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1716<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1717 if (yyextra->insideJava) REJECT;
1722 yyextra->current->section = EntryType::makeClass() ;
1726 setPublished(spec.isPublished()).
1727 setInline(spec.isInline()).
1728 setLocal(spec.isLocal());
1734 yyextra->current->type +=
" const";
1736 else if (isVolatile)
1738 yyextra->current->type +=
" volatile";
1740 yyextra->current->type +=
" struct" ;
1741 yyextra->current->fileName = yyextra->fileName;
1742 yyextra->current->startLine = yyextra->yyLineNr;
1743 yyextra->current->startColumn = yyextra->yyColNr;
1744 yyextra->current->bodyLine = yyextra->yyLineNr;
1745 yyextra->current->bodyColumn = yyextra->yyColNr;
1747 if (yytext[yyleng-1]==
'{') unput(
'{');
1748 BEGIN( CompoundName ) ;
1750<FindMembers>{B}*"value struct{" |
1751<FindMembers>{B}*"value struct"{BN}+ {
1752 yyextra->isTypedef=
false;
1753 yyextra->current->section = EntryType::makeClass();
1754 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1756 yyextra->current->type +=
" value struct" ;
1757 yyextra->current->fileName = yyextra->fileName;
1758 yyextra->current->startLine = yyextra->yyLineNr;
1759 yyextra->current->startColumn = yyextra->yyColNr;
1760 yyextra->current->bodyLine = yyextra->yyLineNr;
1761 yyextra->current->bodyColumn = yyextra->yyColNr;
1763 if (yytext[yyleng-1]==
'{') unput(
'{');
1764 BEGIN( CompoundName ) ;
1766<FindMembers>{B}*"ref struct{" |
1767<FindMembers>{B}*"ref struct"{BN}+ {
1768 yyextra->isTypedef=
false;
1769 yyextra->current->section = EntryType::makeClass();
1770 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1772 yyextra->current->type +=
" ref struct" ;
1773 yyextra->current->fileName = yyextra->fileName;
1774 yyextra->current->startLine = yyextra->yyLineNr;
1775 yyextra->current->startColumn = yyextra->yyColNr;
1776 yyextra->current->bodyLine = yyextra->yyLineNr;
1777 yyextra->current->bodyColumn = yyextra->yyColNr;
1779 if (yytext[yyleng-1]==
'{') unput(
'{');
1780 BEGIN( CompoundName ) ;
1782<FindMembers>{B}*"interface struct{" |
1783<FindMembers>{B}*"interface struct"{BN}+ {
1784 yyextra->isTypedef=
false;
1785 yyextra->current->section = EntryType::makeClass();
1786 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1788 yyextra->current->type +=
" interface struct";
1789 yyextra->current->fileName = yyextra->fileName;
1790 yyextra->current->startLine = yyextra->yyLineNr;
1791 yyextra->current->startColumn = yyextra->yyColNr;
1792 yyextra->current->bodyLine = yyextra->yyLineNr;
1793 yyextra->current->bodyColumn = yyextra->yyColNr;
1795 if (yytext[yyleng-1]==
'{') unput(
'{');
1796 BEGIN( CompoundName ) ;
1798<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1799<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1800 if (yyextra->insideJava) REJECT;
1805 yyextra->current->section = EntryType::makeClass();
1812 yyextra->current->type +=
" const";
1814 else if (isVolatile)
1816 yyextra->current->type +=
" volatile";
1818 yyextra->current->type +=
" union" ;
1819 yyextra->current->fileName = yyextra->fileName;
1820 yyextra->current->startLine = yyextra->yyLineNr;
1821 yyextra->current->startColumn = yyextra->yyColNr;
1822 yyextra->current->bodyLine = yyextra->yyLineNr;
1823 yyextra->current->bodyColumn = yyextra->yyColNr;
1825 if (yytext[yyleng-1]==
'{') unput(
'{');
1826 BEGIN( CompoundName ) ;
1828<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1829<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ {
1834 if (yyextra->insideJava)
1836 yyextra->current->section = EntryType::makeClass();
1842 yyextra->current->section = EntryType::makeEnum() ;
1845 yyextra->current->type +=
" enum";
1848 yyextra->current->spec.setStrong(
true);
1852 yyextra->current->spec.setStrong(
true).setEnumStruct(
true);
1854 yyextra->current->fileName = yyextra->fileName;
1855 yyextra->current->startLine = yyextra->yyLineNr;
1856 yyextra->current->startColumn = yyextra->yyColNr;
1857 yyextra->current->bodyLine = yyextra->yyLineNr;
1858 yyextra->current->bodyColumn = yyextra->yyColNr;
1860 if (yytext[yyleng-1]==
'{') unput(
'{');
1861 BEGIN( CompoundName ) ;
1863<FindMembers>{B}*"concept"{BN}+ {
1864 if (yyextra->insideJava) REJECT;
1865 yyextra->isTypedef=
false;
1866 yyextra->current->section = EntryType::makeConcept();
1868 yyextra->current->type +=
" concept";
1869 yyextra->current->fileName = yyextra->fileName;
1870 yyextra->current->startLine = yyextra->yyLineNr;
1871 yyextra->current->startColumn = yyextra->yyColNr;
1872 yyextra->current->bodyLine = yyextra->yyLineNr;
1873 yyextra->current->bodyColumn = yyextra->yyColNr;
1874 yyextra->current->args = yyextra->fullArgString;
1875 yyextra->keepComment =
true;
1877 BEGIN( ConceptName ) ;
1879<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" {
1881 yyextra->current->name +=
"()";
1882 BEGIN( FindMembers );
1884<Operator>"("{BN}*")"{BNopt}/("[["[^\]]*"]]"){BNopt}"(" {
1886 yyextra->current->name += yytext ;
1887 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1888 BEGIN( FindMembers ) ;
1890<Operator>"("{BN}*")"{BNopt}/"(" {
1892 yyextra->current->name += yytext ;
1893 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1894 BEGIN( FindMembers ) ;
1898 BEGIN( FindMembers ) ;
1902 yyextra->current->name += *yytext ;
1904<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" {
1905 if (!yyextra->current->type.startsWith(
"friend "))
1907 yyextra->current->name += yytext;
1911 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1913 BEGIN( FindMembers ) ;
1915<FindMembers>("template"|"generic")({BN}*)"<"/[>]? {
1918 yyextra->current->tArgLists.
push_back(al);
1919 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1920 yyextra->templateStr=
"<";
1921 yyextra->fullArgString = yyextra->templateStr;
1922 yyextra->copyArgString = &yyextra->templateStr;
1923 yyextra->currentArgumentContext = FindMembers;
1924 BEGIN( ReadTempArgs );
void push_back(const Argument &a)
1926<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" {
1927 if (yyextra->insideJava) REJECT;
1929 BEGIN( NSAliasName );
1932 yyextra->aliasName = yytext;
1933 BEGIN( NSAliasArg );
1935<NSAliasArg>({ID}"::")*{ID} {
1937 std::string ctx = yyextra->current_root->name.str();
static NamespaceAliasInfoMap namespaceAliasMap
1948 BEGIN( FindMembers );
1950<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1952 yyextra->aliasName=yytext;
1955<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1959 yyextra->current->fileName = yyextra->fileName;
1961 yyextra->current->section = EntryType::makeUsingDecl();
1962 yyextra->current_root->copyToSubEntry(yyextra->current);
1964 yyextra->current->section = EntryType::makeUsingDir();
1965 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1967 yyextra->aliasName.clear();
DString removeRedundantWhiteSpace(const DString &s)
1969<PHPUseAs>{BN}+"as"{BN}+ {
1972<PHPUseAs>{PHPUSEKW} {
1976 if (!yyextra->aliasName.empty())
1981 yyextra->aliasName.clear();
const std::string & str() const
1983<PHPUse,PHPUseAs>[,;] {
1993<JavaImport>({ID}{BN}*"."{BN}*)+"*" {
1997 yyextra->current->fileName = yyextra->fileName;
2004 yyextra->current->section = EntryType::makeUsingDir();
2005 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.
2009<JavaImport>({ID}{BN}*"."{BN}*)+{ID} {
2013 yyextra->current->fileName = yyextra->fileName;
2025 if (yyextra->insideD)
2027 yyextra->current->section = EntryType::makeUsingDir();
2032 yyextra->current->section = EntryType::makeUsingDecl();
2034 yyextra->previous = yyextra->current;
2035 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
virtual const DString & docName() const =0
virtual void addIncludedByDependency(const FileDef *fd, const DString &incName, IncludeKind kind)=0
2039<IDLImport>"\""[^"]*"\"" {
2040 DString fileName(&yytext[1],yyleng-2);
2056<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2057 if (yyextra->insideJava) REJECT;
2058 yyextra->current->startLine=yyextra->yyLineNr;
2059 yyextra->current->startColumn = yyextra->yyColNr;
2063<Using>"namespace"{BN}+ {
lineCount(yyscanner); BEGIN(UsingDirective); }
2064<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2066 yyextra->current->name=yytext;
2067 yyextra->current->fileName = yyextra->fileName;
2068 yyextra->current->section = EntryType::makeUsingDecl();
2069 yyextra->current->startLine = yyextra->yyLineNr;
2070 yyextra->usingNewVarNeeded =
true;
2071 if (yyextra->insideCS)
2076 yyextra->current->name=yytext;
2077 yyextra->current->fileName = yyextra->fileName;
2078 yyextra->current->startLine = yyextra->yyLineNr;
2079 yyextra->current->startColumn = yyextra->yyColNr;
2080 yyextra->current->section = EntryType::makeUsingDir();
2081 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2086<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" {
2088 yyextra->current->fileName = yyextra->fileName;
2089 yyextra->current->section = EntryType::makeUsingDecl();
2090 yyextra->current->startLine = yyextra->yyLineNr;
2091 yyextra->current->bodyLine = yyextra->yyLineNr;
2092 yyextra->current->bodyColumn = yyextra->yyColNr;
2093 yyextra->lastInitializerContext = UsingAlias;
2094 yyextra->sharpCount=0;
2095 yyextra->initBracketCount=0;
2097 BEGIN(ReadInitializer);
2100 if (yyextra->usingNewVarNeeded)
2102 yyextra->previous = yyextra->current;
2103 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2105 yyextra->usingNewVarNeeded =
false;
2110 yyextra->lastInitializerContext = UsingAlias;
2111 yyextra->sharpCount=0;
2112 yyextra->initBracketCount=0;
2114 yyextra->usingNewVarNeeded =
false;
2115 BEGIN(ReadInitializer);
2118 yyextra->lastCContext = YY_START ;
2119 BEGIN( SkipComment ) ;
2122 yyextra->lastCContext = YY_START ;
2123 BEGIN( SkipCxxComment ) ;
2127 if (yyextra->usingNewVarNeeded)
2129 yyextra->previous = yyextra->current;
2130 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2132 yyextra->usingNewVarNeeded =
false;
2136 yyextra->current->section = EntryType::makeVariable();
2137 DString init = yyextra->current->initializer.str();
2138 init.stripPrefix(
"class ");
2139 init.stripPrefix(
"struct ");
2141 yyextra->current->type =
"typedef "+
init;
2142 yyextra->current->args.clear();
2143 yyextra->current->spec.setAlias(
true);
2144 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2149 yyextra->current->initializer << yytext;
2152 yyextra->current->initializer << yytext;
2156 yyextra->current->fileName = yyextra->fileName;
2157 yyextra->current->section = EntryType::makeUsingDir();
2158 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2160 yyextra->usingNewVarNeeded =
false;
2163<FindMembers>{SCOPENAME}{BN}*"<>" {
2168<FindMembers>{SCOPENAME}{BNopt}/"<" {
2170 if (yyextra->insideCpp && name==
"import") REJECT;
2171 yyextra->roundCount=0;
2172 yyextra->sharpCount=0;
2175 yyextra->current->name=
name;
2181 BEGIN( EndTemplate );
2183<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2184 yyextra->sharpCount=0;
2185 yyextra->roundCount=0;
2193 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...
2196 if (!yyextra->insidePHP)
2202 yyextra->lastHereDocContext = YY_START;
2206<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2207 yyextra->current->name+=yytext;
2211 if (yyextra->roundCount==0)
2214 yyextra->sharpCount++;
2216 yyextra->current->name+=yytext;
2218<ClassTemplSpec,EndTemplate>">=" {
2219 yyextra->current->name+=yytext;
2221<ClassTemplSpec,EndTemplate>(">>") {
2222 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2230 yyextra->current->name+=yytext;
2235 yyextra->current->name+=
'>';
2237 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2239 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2244<EndTemplate>">"{BN}*"(" {
2246 yyextra->current->name+=
'>';
2248 if (yyextra->roundCount==0)
2250 --yyextra->sharpCount;
2252 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2254 yyextra->current->bodyLine = yyextra->yyLineNr;
2255 yyextra->current->bodyColumn = yyextra->yyColNr;
2256 yyextra->current->args =
"(";
2257 yyextra->currentArgumentContext = FuncQual;
2258 yyextra->fullArgString = yyextra->current->args;
2259 yyextra->copyArgString = &yyextra->current->args;
2261 BEGIN( ReadFuncArgType ) ;
2265 yyextra->current->name+=
"(";
2266 yyextra->roundCount++;
2269<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ {
2271 yyextra->current->name+=
'>';
2272 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2277<EndTemplate>">"{BNopt}/"::" {
2279 yyextra->current->name+=
'>';
2281 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2283 BEGIN(FindMemberName);
2286<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2287 yyextra->roundCount++;
2289<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2290 if (yyextra->roundCount>0) yyextra->roundCount--;
2293 yyextra->current->name+=*yytext;
2296<FindMembers>"define"{BN}*"("{BN}*["'] {
2297 if (yyextra->insidePHP)
2299 yyextra->current->bodyLine = yyextra->yyLineNr;
2300 yyextra->current->bodyColumn = yyextra->yyColNr;
2307 yyextra->delimiter = yytext;
2308 *yyextra->pCopyHereDocGString << yytext;
2309 BEGIN(CopyHereDocEnd);
2311<CopyHereDoc>"\""{ID}/"\"" {
2312 yyextra->delimiter = &yytext[1];
2313 *yyextra->pCopyHereDocGString << yytext;
2314 BEGIN(CopyHereDocEnd);
2316<CopyHereDoc>"'"{ID}/"'" {
2317 yyextra->delimiter = &yytext[1];
2318 *yyextra->pCopyHereDocGString << yytext;
2319 BEGIN(CopyHereDocEnd);
2322 yyextra->delimiter = yytext;
2325<HereDoc>"\""{ID}/"\"" {
2326 yyextra->delimiter = &yytext[1];
2329<HereDoc>"'"{ID}/"'" {
2330 yyextra->delimiter = &yytext[1];
2333<HereDocEnd>^{Bopt}{ID} {
2336 BEGIN(yyextra->lastHereDocContext);
2340<CopyHereDocEnd>^{Bopt}{ID} {
2341 *yyextra->pCopyHereDocGString << yytext;
2344 BEGIN(yyextra->lastHereDocContext);
2349 *yyextra->pCopyHereDocGString << yytext;
2351<CopyHereDocEnd>{ID} {
2352 *yyextra->pCopyHereDocGString << yytext;
2355 *yyextra->pCopyHereDocGString << yytext;
2357<FindMembers>"Q_OBJECT"|"Q_GADGET" {
2359<FindMembers>"Q_PROPERTY" {
2360 yyextra->yyBegLineNr = yyextra->yyLineNr;
2361 yyextra->yyBegColNr = yyextra->yyColNr;
2362 yyextra->current->protection = Protection::Public ;
2363 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2364 yyextra->current->type.clear();
2374 yyextra->current->name+=yytext;
2377 yyextra->current->type+= yyextra->current->name;
2378 yyextra->current->type+= yytext;
2379 yyextra->current->name=
"";
2381<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2382 yyextra->current->type+= yyextra->current->name;
2383 yyextra->current->name=yytext;
2385<QtPropType,QtPropAttr>{BN}+"READ"{BN}+ {
2386 yyextra->current->spec.setReadable(
true);
2389<QtPropType,QtPropAttr>{BN}+"WRITE"{BN}+ {
2390 yyextra->current->spec.setWritable(
true);
2393<QtPropType,QtPropAttr>{BN}+"MEMBER"{BN}+{ID} |
2394<QtPropType,QtPropAttr>{BN}+"RESET"{BN}+{ID} |
2395<QtPropType,QtPropAttr>{BN}+"SCRIPTABLE"{BN}+{ID} |
2396<QtPropType,QtPropAttr>{BN}+"DESIGNABLE"{BN}+{ID} |
2397<QtPropType,QtPropAttr>{BN}+"NOTIFY"{BN}+{ID} |
2398<QtPropType,QtPropAttr>{BN}+"REVISION"{BN}+{ID} |
2399<QtPropType,QtPropAttr>{BN}+"STORED"{BN}+{ID} |
2400<QtPropType,QtPropAttr>{BN}+"USER"{BN}+{ID} |
2401<QtPropType,QtPropAttr>{BN}+"CONSTANT"{BN} |
2402<QtPropType,QtPropAttr>{BN}+"FINAL"{BN} {
2406 yyextra->current->read = yytext;
2410 yyextra->current->write = yytext;
2413<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2414 yyextra->current->name=yytext;
2418<FindMembers>"requires" {
2419 if (yyextra->insideJava) REJECT;
2420 yyextra->current->req.clear();
2421 yyextra->requiresContext = YY_START;
2422 BEGIN(RequiresClause);
2424<RequiresClause>"requires"{BN}*/"{" {
2425 if (yyextra->insideJava) REJECT;
2427 yyextra->current->req+=yytext;
2428 BEGIN( RequiresExpression ) ;
2430<RequiresClause>"requires"{BN}*"(" {
2431 if (yyextra->insideJava) REJECT;
2433 yyextra->current->req+=yytext;
2434 yyextra->lastRoundContext=RequiresExpression;
2435 yyextra->pCopyRoundString=&yyextra->current->req;
2436 yyextra->roundCount=0;
2437 BEGIN( CopyRound ) ;
2439<RequiresExpression>"{" {
2440 yyextra->current->req+=yytext;
2441 yyextra->lastCurlyContext=RequiresClause;
2442 yyextra->pCopyCurlyString=&yyextra->current->req;
2443 yyextra->curlyCount=0;
2444 BEGIN( CopyCurly ) ;
2446<RequiresExpression>\n {
2447 yyextra->current->req+=
' ';
2450<RequiresExpression>. {
2451 yyextra->current->req+=yytext;
2453<RequiresClause>"(" {
2454 yyextra->current->req+=yytext;
2455 yyextra->lastRoundContext=RequiresClause;
2456 yyextra->pCopyRoundString=&yyextra->current->req;
2457 yyextra->roundCount=0;
2458 BEGIN( CopyRound ) ;
2460<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" {
2464 yyextra->current->req+=yytext;
2465 yyextra->lastRoundContext=RequiresClause;
2466 yyextra->pCopyRoundString=&yyextra->current->req;
2467 yyextra->roundCount=0;
2475<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" {
2479 yyextra->current->req+=yytext;
2480 yyextra->lastSharpContext=RequiresClause;
2481 yyextra->pCopySharpString=&yyextra->current->req;
2482 yyextra->sharpCount=0;
2490<RequiresClause>{NOTopt}{SCOPENAME} {
2494 yyextra->current->req=yytext;
2495 BEGIN(yyextra->requiresContext);
2502<RequiresClause>{NOTopt}"::"{ID} {
2504 yyextra->current->req+=yytext;
2506<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) {
2508 yyextra->current->req+=yytext;
2510<RequiresClause>{BN}+ {
2511 yyextra->current->req+=
' ';
2516 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2517 BEGIN(yyextra->requiresContext);
2519<FindMembers,FindMemberName>{SCOPENAME} {
2521 yyextra->yyBegColNr=yyextra->yyColNr;
2522 yyextra->yyBegLineNr=yyextra->yyLineNr;
2524 if (yyextra->insideIDL && yyleng==9 &&
dstrcmp(yytext,
"cpp_quote")==0)
2528 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
dstrcmp(yytext,
"import")==0)
2530 if (yyextra->insideIDL)
2535 else if (yyextra->insidePHP &&
dstrcmp(yytext,
"use")==0)
2539 else if (yyextra->insideJava &&
dstrcmp(yytext,
"package")==0)
2544 else if (yyextra->insideIDL &&
dstrcmp(yytext,
"case")==0)
2546 BEGIN(IDLUnionCase);
2548 else if (yyextra->insideTryBlock &&
dstrcmp(yytext,
"catch")==0)
2550 yyextra->insideTryBlock=
false;
2551 BEGIN(TryFunctionBlock);
2553 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"alignas")==0)
2555 yyextra->lastAlignAsContext = YY_START;
2558 else if (yyextra->insideJS &&
dstrcmp(yytext,
"var")==0)
2560 yyextra->current->type=
"var";
2562 else if (yyextra->insideJS &&
dstrcmp(yytext,
"function")==0)
2564 yyextra->current->type=
"function";
2566 else if (yyextra->insideCS &&
dstrcmp(yytext,
"this")==0)
2570 yyextra->current->name=
"this";
2573 else if (yyextra->insideCpp && (
dstrcmp(yytext,
"static_assert")==0 ||
dstrcmp(yytext,
"_Static_assert")==0))
2576 BEGIN(StaticAssert);
2578 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"decltype")==0)
2582 if (!yyextra->current->type.empty()) yyextra->current->type+=
' ';
2583 yyextra->current->type+=yytext;
2586 else if (yyextra->insideSlice &&
dstrcmp(yytext,
"optional")==0)
2588 if (yyextra->current->type.empty())
2590 yyextra->current->type =
"optional";
2594 yyextra->current->type +=
" optional";
2596 yyextra->lastModifierContext = YY_START;
2597 BEGIN(SliceOptional);
2601 if (YY_START==FindMembers)
2605 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2606 if (javaLike &&
dstrcmp(yytext,
"public")==0)
2608 yyextra->current->protection = Protection::Public;
2610 else if (javaLike &&
dstrcmp(yytext,
"protected")==0)
2612 yyextra->current->protection = Protection::Protected;
2614 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
dstrcmp(yytext,
"internal")==0)
2617 if (!(yyextra->insideCS && yyextra->current->protection==Protection::Protected))
2619 yyextra->current->protection = Protection::Package;
2622 else if (javaLike &&
dstrcmp(yytext,
"private")==0)
2624 yyextra->current->protection = Protection::Private;
2626 else if (yyextra->insideCS && YY_START==FindMembers &&
dstrcmp(yytext,
"new")==0)
2629 yyextra->current->spec.setNew(
true);
2631 else if (javaLike &&
dstrcmp(yytext,
"static")==0)
2633 if (YY_START==FindMembers)
2634 yyextra->current->name = yytext;
2636 yyextra->current->name += yytext;
2637 yyextra->current->isStatic =
true;
2641 if (YY_START==FindMembers)
2642 yyextra->current->name = yytext;
2644 yyextra->current->name += yytext;
2645 if (yyextra->current->name.startsWith(
"static "))
2647 yyextra->current->isStatic =
true;
2648 yyextra->current->name= yyextra->current->name.mid(7);
2650 else if (yyextra->current->name.startsWith(
"inline "))
2652 if (yyextra->current->type.empty())
2654 yyextra->current->type=
"inline";
2658 yyextra->current->type+=
"inline ";
2660 yyextra->current->name= yyextra->current->name.mid(7);
2662 else if (yyextra->current->name.startsWith(
"constexpr "))
2664 if (yyextra->current->type.empty())
2666 yyextra->current->type=
"constexpr";
2670 yyextra->current->type+=
"constexpr ";
2672 yyextra->current->name=yyextra->current->name.mid(10);
2674 else if (yyextra->current->name.startsWith(
"consteval "))
2676 if (yyextra->current->type.empty())
2678 yyextra->current->type=
"consteval";
2682 yyextra->current->type+=
"consteval ";
2684 yyextra->current->name=yyextra->current->name.mid(10);
2686 else if (yyextra->current->name.startsWith(
"constinit "))
2688 if (yyextra->current->type.empty())
2690 yyextra->current->type=
"constinit";
2694 yyextra->current->type+=
"constinit ";
2696 yyextra->current->name=yyextra->current->name.mid(10);
2698 else if (yyextra->current->name.startsWith(
"const "))
2700 if (yyextra->current->type.empty())
2702 yyextra->current->type=
"const";
2706 yyextra->current->type+=
"const ";
2708 yyextra->current->name=yyextra->current->name.mid(6);
2710 else if (yyextra->current->name.startsWith(
"volatile "))
2712 if (yyextra->current->type.empty())
2714 yyextra->current->type=
"volatile";
2718 yyextra->current->type+=
"volatile ";
2720 yyextra->current->name=yyextra->current->name.mid(9);
2722 else if (yyextra->current->name.startsWith(
"typedef "))
2724 if (yyextra->current->type.empty())
2726 yyextra->current->type=
"typedef";
2730 yyextra->current->type+=
"typedef ";
2732 yyextra->current->name=yyextra->current->name.mid(8);
2742 yyextra->externLinkage=
false;
2746 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2749 yyextra->lastSkipRoundContext = FindMembers;
2750 yyextra->roundCount=0;
2753<StaticAssert>{BN}+ {
lineCount(yyscanner); }
2759 yyextra->current->type+=yytext;
2760 yyextra->lastRoundContext=FindMembers;
2761 yyextra->pCopyRoundString=&yyextra->current->type;
2762 yyextra->roundCount=0;
2765<DeclType>{BN}+ {
lineCount(yyscanner); }
2770<CSIndexer>"["[^\n\]]*"]" {
2774<FindMembers>[0-9]{ID} {
2777 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2779 yyextra->current->name+=
".";
2783 yyextra->current->name+=yytext;
2785<CppQuote>"("{B}*"\"" {
2786 yyextra->insideCppQuote=
true;
2790<IDLUnionCase>":" { BEGIN(FindMembers); }
2791<IDLUnionCase>\n {
lineCount(yyscanner); }
2793<TryFunctionBlock>\n {
lineCount(yyscanner); }
2794<TryFunctionBlock>"{" {
2795 yyextra->curlyCount=0;
2796 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2800<TryFunctionBlockEnd>{BN}*"catch" {
lineCount(yyscanner); BEGIN(TryFunctionBlock);
2802<TryFunctionBlockEnd>\n { unput(*yytext);
2803 BEGIN( FindMembers );
2805<TryFunctionBlockEnd>. { unput(*yytext);
2806 BEGIN( FindMembers );
2809 yyextra->insideCppQuote=
false;
2812<FindConceptParts>[^\/\n]* {
2813 yyextra->current->initializer << yytext;
2815<FindConceptParts>. {
2816 yyextra->current->initializer << yytext;
2818<FindConceptParts>\n {
2819 yyextra->current->initializer << yytext;
2820 yyextra->yyLineNr++;
2822<FindConceptParts>{CCS} {
2823 yyextra->current->initializer << yytext;
2825<FindConceptParts>{CPPC} {
2826 yyextra->current->initializer << yytext;
2828<FindConceptParts>^[ \t]*{CCS}[!*] {
2830 size_t indent = text.
find(
'/');
2832 if (!yyextra->current->initializer.empty())
2834 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2837 yyextra->current->section = EntryType::makeConceptDocPart();
2838 yyextra->current->startLine = yyextra->yyLineNr;
2839 yyextra->current->startColumn = indent;
2840 yyextra->current->initializer.clear();
2841 BEGIN(FindConceptDocs);
2843<FindConceptParts>^[ \t]*{CPPC}[!/].*\n {
2844 if (!yyextra->current->initializer.empty())
2846 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2850 size_t indent = line.find(
'/');
2851 yyextra->current->section = EntryType::makeConceptDocPart();
2852 yyextra->current->startLine = yyextra->yyLineNr;
2853 yyextra->current->startColumn = indent;
2854 yyextra->current->initializer.clear();
2855 yyextra->current->initializer << line.mid(indent+3);
2856 yyextra->yyLineNr++;
2857 BEGIN(FindConceptCxxDocs);
2859<FindConceptCxxDocs>^[ \t]*{CPPC}.*\n {
2861 size_t p = line.find(
'/');
2862 if (line.at(p+2)==
'!' || line.at(p+2)==
'/') p++;
2863 yyextra->current->initializer << line.mid(p+2);
2864 yyextra->yyLineNr++;
2866<FindConceptCxxDocs>{CCS}|{CCE}|{CPPC} {
2867 yyextra->current->initializer << yytext;
2869<FindConceptCxxDocs>. {
2870 if (!yyextra->current->initializer.empty())
2874 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2878 yyextra->current->section = EntryType::makeConceptCodePart();
2879 yyextra->current->startLine = yyextra->yyLineNr;
2880 BEGIN(FindConceptParts);
2882<FindConceptDocs>^[ \t]*"*"+/[^/] {
2884<FindConceptDocs>[^\*\n]+ {
2885 yyextra->current->initializer << yytext;
2887<FindConceptDocs>\n {
2888 yyextra->current->initializer << yytext;
2889 yyextra->yyLineNr++;
2891<FindConceptDocs>"*"*{CCE}[ t]*\n? {
2892 if (!yyextra->current->initializer.empty())
2896 yyextra->current->section = EntryType::makeConceptDocPart();
2897 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2901 yyextra->current->section = EntryType::makeConceptCodePart();
2902 yyextra->current->startLine = yyextra->yyLineNr;
2903 BEGIN(FindConceptParts);
2905<FindConceptDocs>"*"*{CCE} {
2906 if (!yyextra->current->initializer.empty())
2910 yyextra->current->section = EntryType::makeConceptDocPart();
2911 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2914 yyextra->current->section = EntryType::makeConceptCodePart();
2915 yyextra->current->startLine = yyextra->yyLineNr;
2916 BEGIN(FindConceptParts);
2918<FindConceptParts><<EOF>> {
2919 if (!yyextra->current->initializer.empty())
2921 if (!yyextra->current->section.isConceptCodePart())
2923 yyextra->current->section = EntryType::makeConceptDocPart();
2925 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2930<FindMembers,FindFields>{B}*"#" {
if (yyextra->insidePHP)
2932 yyextra->lastCPPContext = YY_START;
2935<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2936<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2937 if (yyextra->insidePHP)
2939 yyextra->current->bodyLine = yyextra->yyLineNr;
2940 yyextra->current->bodyColumn = yyextra->yyColNr;
2941 yyextra->current->fileName = yyextra->fileName;
2942 yyextra->current->startLine = yyextra->yyLineNr;
2943 yyextra->current->startColumn = yyextra->yyColNr;
2944 yyextra->current->type.clear();
2945 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2946 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2947 yyextra->current->section = EntryType::makeDefine();
2948 yyextra->lastDefineContext = YY_START;
2951<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" {
2952 yyextra->yyLineNr = atoi(&yytext[1]);
2954 yyextra->lastPreLineCtrlContext = YY_START;
2955 if (YY_START==ReadBody ||
2956 YY_START==ReadNSBody ||
2957 YY_START==ReadBodyIntf)
2959 yyextra->current->program << yytext;
2961 BEGIN( PreLineCtrl );
2963<PreLineCtrl>"\""[^\n\"]*"\"" {
2965 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2966 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2967 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2969 yyextra->current->program << yytext;
2973 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2974 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2975 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2977 yyextra->current->program << yytext;
2981 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2982 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2983 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2985 yyextra->current->program << yytext;
2988 BEGIN( yyextra->lastPreLineCtrlContext );
2991<SkipCPP>\\[\r]*"\n"[\r]* {
lineCount(yyscanner); }
2992<SkipCPP>[\r]*\n[\r]* {
lineCount(yyscanner);
2993 BEGIN( yyextra->lastCPPContext) ;
2995<SDefine>{ID}{B}*"(" {
2996 yyextra->current->name = yytext;
2997 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
2998 yyextra->current->args =
"(";
2999 yyextra->current->bodyLine = yyextra->yyLineNr;
3000 yyextra->current->bodyColumn = yyextra->yyColNr;
3001 yyextra->currentArgumentContext = DefineEnd;
3002 yyextra->fullArgString=yyextra->current->args;
3003 yyextra->copyArgString=&yyextra->current->args;
3004 BEGIN( ReadFuncArgType ) ;
3019 yyextra->current->bodyLine = yyextra->yyLineNr;
3020 yyextra->current->bodyColumn = yyextra->yyColNr;
3021 yyextra->current->name = yytext;
3028 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3030 BEGIN(yyextra->lastDefineContext);
3034 yyextra->current->fileName = yyextra->fileName;
3035 yyextra->current->startLine = yyextra->yyLineNr;
3036 yyextra->current->startColumn = yyextra->yyColNr;
3037 yyextra->current->type.clear();
3038 yyextra->current->type =
"const";
3039 DString init = yyextra->current->initializer.str();
3042 yyextra->current->initializer.str(
init.str());
3043 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3044 yyextra->current->section = EntryType::makeVariable();
3045 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3050<DefineEnd>\\[\r]?\n {
3052 yyextra->current->endBodyLine = yyextra->yyLineNr;
3055 if (yyextra->insideIDL && yyextra->insideCppQuote)
3061 yyextra->lastStringContext=DefineEnd;
3066<DefinePHP>{ID}["']{BN}*","{BN}* {
3067 yyextra->current->name = yytext;
3068 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3069 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3070 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
3071 yyextra->current->bodyLine = yyextra->yyLineNr;
3072 yyextra->current->bodyColumn = yyextra->yyColNr;
3073 yyextra->lastRoundContext = DefinePHPEnd;
3074 yyextra->pCopyRoundGString = &yyextra->current->initializer;
3075 yyextra->roundCount = 0;
3076 BEGIN( GCopyRound );
3080 if (yyextra->insideCli)
3083 yyextra->current->name = yytext ;
3091 yyextra->current->name += yytext ;
3094<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
3095 if (YY_START==ReadInitializer && yyextra->keepComment)
3101 if (yyextra->current->bodyLine==-1)
3103 yyextra->current->bodyLine=yyextra->yyLineNr;
3104 yyextra->current->bodyColumn = yyextra->yyColNr;
3106 yyextra->docBlockContext = YY_START;
3107 yyextra->docBlockInBody =
false;
3108 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3110 if (YY_START==MemberSpec && yyextra->memspecEntry && yyextra->memspecEntry->briefFile.empty())
3112 if (yytext[yyleng-3]==
'/')
3114 yyextra->memspecEntry->briefFile = yyextra->fileName;
3115 yyextra->memspecEntry->briefLine = yyextra->yyLineNr;
3119 yyextra->memspecEntry->docFile = yyextra->fileName;
3120 yyextra->memspecEntry->docLine = yyextra->yyLineNr;
3126 yyextra->docBlock.
str(indent.
str());
3130 yyextra->docBlockTerm =
';';
3131 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3133 yyextra->current->bitfields =
":"+yyextra->current->args;
3134 yyextra->current->args.clear();
3135 yyextra->current->section = EntryType::makeVariable();
3137 if (yytext[yyleng-3]==
'/')
DString fill(char c, size_t len)
Fills a string with a predefined character.
#define Config_getBool(name)
3149<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
3150 if (YY_START==ReadInitializer && yyextra->keepComment)
3156 yyextra->docBlockContext = YY_START;
3157 yyextra->docBlockInBody =
false;
3158 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3163 yyextra->docBlock.
str(indent.
str());
3166 yyextra->docBlockTerm =
',';
3167 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3169 yyextra->current->bitfields =
":"+yyextra->current->args;
3170 yyextra->current->args.clear();
3171 yyextra->current->section = EntryType::makeVariable();
3173 if (yytext[yyleng-3]==
'/')
3185<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
3186 if (YY_START==ReadInitializer && yyextra->keepComment)
3192 if (yyextra->current->bodyLine==-1)
3194 yyextra->current->bodyLine=yyextra->yyLineNr;
3195 yyextra->current->bodyColumn = yyextra->yyColNr;
3197 yyextra->docBlockContext = YY_START;
3198 yyextra->docBlockInBody =
false;
3199 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3203 yyextra->docBlock.
str(indent.
str());
3206 yyextra->docBlockTerm = 0;
3207 if (yytext[yyleng-3]==
'/')
3220<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
3222 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3225 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3230 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3236 if (yytext[2]==
'!' || yytext[2]==
'/')
3238 yyextra->docBlockContext = YY_START;
3239 yyextra->docBlockInBody =
false;
3240 yyextra->docBlockAutoBrief =
false;
3241 yyextra->docBlock.str(std::string());
3242 yyextra->docBlockTerm = 0;
3248 yyextra->lastCContext=YY_START;
3249 BEGIN(SkipCxxComment);
3254 if (yytext[2]==
'!' || yytext[2]==
'*')
3256 yyextra->docBlockContext = YY_START;
3257 yyextra->docBlockInBody =
false;
3258 yyextra->docBlock.str(std::string());
3259 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3261 yyextra->docBlockTerm = 0;
3267 yyextra->lastCContext=YY_START;
3272<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3273 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3274 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3278 if (!yyextra->insideCS) REJECT;
3279 yyextra->current->bodyLine = yyextra->yyLineNr;
3280 yyextra->current->bodyColumn = yyextra->yyColNr;
3281 yyextra->current->initializer.str(yytext);
3282 yyextra->lastInitializerContext = YY_START;
3283 yyextra->sharpCount=0;
3284 yyextra->initBracketCount=0;
3285 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3286 yyextra->current->spec.setGettable(
true);
3287 BEGIN(ReadInitializerPtr);
3290 yyextra->current->bodyLine = yyextra->yyLineNr;
3291 yyextra->current->bodyColumn = yyextra->yyColNr;
3292 yyextra->current->initializer.str(
" ");
3293 for (
size_t ii = 2 ; ii < yyextra->yyColNr; ii++)
3294 yyextra->current->initializer <<
" ";
3295 yyextra->current->initializer <<
"=";
3296 yyextra->lastInitializerContext = YY_START;
3297 yyextra->sharpCount=0;
3298 yyextra->initBracketCount=0;
3299 BEGIN(ReadInitializer);
3301<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3303 yyextra->current->exception +=
" ";
3306<UNOIDLAttributeBlock>"}" {
3307 yyextra->current->exception +=
" }";
3311<ReadInitializer,ReadInitializerPtr>"(" {
3312 yyextra->lastRoundContext=YY_START;
3313 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3314 yyextra->roundCount=0;
3315 yyextra->current->initializer << *yytext;
3318<ReadInitializer,ReadInitializerPtr>"[" {
3319 if (!yyextra->insidePHP) REJECT;
3320 yyextra->lastSquareContext=YY_START;
3321 yyextra->pCopySquareGString=&yyextra->current->initializer;
3322 yyextra->squareCount=0;
3323 yyextra->current->initializer << *yytext;
3326<ReadInitializer,ReadInitializerPtr>"{" {
3327 yyextra->lastCurlyContext=YY_START;
3328 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3329 yyextra->curlyCount=0;
3330 yyextra->current->initializer << *yytext;
3333<ReadInitializer,ReadInitializerPtr>[;,] {
3335 if (*yytext==
';' && yyextra->current_root->spec.isEnum())
3337 yyextra->current->fileName = yyextra->fileName;
3338 yyextra->current->startLine = yyextra->yyLineNr;
3339 yyextra->current->startColumn = yyextra->yyColNr;
3340 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3341 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3342 yyextra->current->section = EntryType::makeVariable();
3343 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3347 else if (*yytext==
';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3350 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3351 BEGIN(yyextra->lastInitializerContext);
3353 else if (*yytext==
',' && yyextra->initBracketCount==0)
3356 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3357 BEGIN(yyextra->lastInitializerContext);
3361 yyextra->current->initializer << *yytext;
3364<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} {
3365 if (!yyextra->insideCpp)
3371 yyextra->current->initializer << yytext;
3373 yyextra->lastRawStringContext = YY_START;
3374 yyextra->pCopyRawGString = &yyextra->current->initializer;
DString extractBeginRawStringDelimiter(const char *rawStart)
3379<ReadInitializer>{CPPC}.* {
3380 if (yyextra->keepComment)
3382 yyextra->current->initializer << yytext;
3389<ReadInitializer>{CCS} {
3390 if (yyextra->keepComment)
3392 yyextra->current->initializer << yytext;
3393 BEGIN(InitCopyComment);
3400<InitCopyComment>{CCE} {
3401 yyextra->current->initializer << yytext;
3402 BEGIN(ReadInitializer);
3404<InitCopyComment>\n {
3406 yyextra->current->initializer << yytext;
3409 yyextra->current->initializer << yytext;
3411<InitCopyComment><<EOF>> {
3412 warn(yyextra->fileName,yyextra->yyLineNr,
3413 "reached end of file while inside a C style comment block!");
#define warn(file, line, fmt,...)
3416<RawGString>{RAWEND} {
3419 *yyextra->pCopyRawGString << yytext;
3420 BEGIN(yyextra->lastRawStringContext);
DString extractEndRawStringDelimiter(const char *rawEnd)
3427<RawGString>[^)\n]+ {
3428 *yyextra->pCopyRawGString << yytext;
3431 *yyextra->pCopyRawGString << yytext;
3434 *yyextra->pCopyRawGString << yytext;
3437<RawString>{RAWEND} {
3438 *yyextra->pCopyRawString+=yytext;
3439 yyextra->fullArgString+=yytext;
3442 BEGIN(yyextra->lastRawStringContext);
3446 *yyextra->pCopyRawString += yytext;
3447 yyextra->fullArgString+=yytext;
3450 *yyextra->pCopyRawString += yytext;
3451 yyextra->fullArgString+=yytext;
3454 *yyextra->pCopyRawString += yytext;
3455 yyextra->fullArgString+=yytext;
3458<ReadInitializer,ReadInitializerPtr>\" {
3459 if (yyextra->insideIDL && yyextra->insideCppQuote)
3465 yyextra->lastStringContext=YY_START;
3466 yyextra->current->initializer << yytext;
3467 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3468 yyextra->stopAtInvalidString=
false;
3472<ReadInitializer,ReadInitializerPtr>"->" {
3473 yyextra->current->initializer << yytext;
3475<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3476 yyextra->current->initializer << yytext;
3478<ReadInitializer,ReadInitializerPtr>(">>") {
3479 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3482 yyextra->initBracketCount-=2;
3483 yyextra->sharpCount-=2;
3485 yyextra->current->initializer << yytext;
3487<ReadInitializer,ReadInitializerPtr>(">=") {
3488 yyextra->current->initializer << yytext;
3490<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3491 yyextra->initBracketCount++;
3492 yyextra->sharpCount++;
3493 yyextra->current->initializer << *yytext;
3495<ReadInitializer,ReadInitializerPtr>[>\]})] {
3496 yyextra->initBracketCount--;
3497 yyextra->sharpCount--;
3500 yyextra->current->endBodyLine=yyextra->yyLineNr;
3502 yyextra->current->initializer << *yytext;
3504<ReadInitializer,ReadInitializerPtr>\' {
3505 if (yyextra->insidePHP)
3507 yyextra->current->initializer << yytext;
3508 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3509 yyextra->lastStringContext=YY_START;
3510 BEGIN(CopyPHPGString);
3514 yyextra->current->initializer << yytext;
3517<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3518 if (yyextra->insidePHP)
3524 yyextra->current->initializer << yytext;
3527<ReadInitializer,ReadInitializerPtr>\n {
3528 yyextra->current->initializer << *yytext;
3531<ReadInitializer,ReadInitializerPtr>"@\"" {
3533 yyextra->current->initializer << yytext;
3534 if (!yyextra->insideCS && !yyextra->insideObjC)
3541 yyextra->lastSkipVerbStringContext=YY_START;
3542 yyextra->pSkipVerbString=&yyextra->current->initializer;
3543 BEGIN(SkipVerbString);
3546<SkipVerbString>[^\n"\\]+ {
3547 *yyextra->pSkipVerbString << yytext;
3549<SkipVerbString>"\\\\" {
3550 if (yyextra->insideCS) REJECT
3551 *yyextra->pSkipVerbString << yytext;
3553<SkipVerbString>"\\\"" {
3554 if (yyextra->insideCS) REJECT
3555 *yyextra->pSkipVerbString << yytext;
3557<SkipVerbString>"\"\"" {
3558 *yyextra->pSkipVerbString << yytext;
3560<SkipVerbString>"\"" {
3561 *yyextra->pSkipVerbString << *yytext;
3562 BEGIN(yyextra->lastSkipVerbStringContext);
3565 *yyextra->pSkipVerbString << *yytext;
3569 *yyextra->pSkipVerbString << *yytext;
3571<ReadInitializer,ReadInitializerPtr>"?>" {
3572 if (yyextra->insidePHP)
3573 BEGIN( FindMembersPHP );
3575 yyextra->current->initializer << yytext;
3577<ReadInitializer,ReadInitializerPtr>. {
3578 yyextra->current->initializer << *yytext;
3582<CopyString,CopyPHPString>\\. {
3583 *yyextra->pCopyQuotedString+=yytext;
3586 *yyextra->pCopyQuotedString+=*yytext;
3587 BEGIN( yyextra->lastStringContext );
3590 *yyextra->pCopyQuotedString+=*yytext;
3591 BEGIN( yyextra->lastStringContext );
3593<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3594 *yyextra->pCopyQuotedString+=yytext;
3596<CopyString,CopyPHPString>\n {
3597 *yyextra->pCopyQuotedString+=*yytext;
3600<CopyString,CopyPHPString>. {
3601 *yyextra->pCopyQuotedString+=*yytext;
3605<CopyGString,CopyPHPGString>\\. {
3606 *yyextra->pCopyQuotedGString << yytext;
3609 *yyextra->pCopyQuotedGString << *yytext;
3610 BEGIN( yyextra->lastStringContext );
3613 *yyextra->pCopyQuotedGString << *yytext;
3614 BEGIN( yyextra->lastStringContext );
3616<CopyGString,CopyPHPGString>"<?php" {
3617 *yyextra->pCopyQuotedGString << yytext;
3618 BEGIN( yyextra->lastStringContext );
3620<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3621 *yyextra->pCopyQuotedGString << yytext;
3623<CopyGString,CopyPHPGString>\n {
3624 *yyextra->pCopyQuotedGString << *yytext;
3625 if (yyextra->stopAtInvalidString)
3627 BEGIN( yyextra->lastStringContext );
3634<CopyGString,CopyPHPGString>. {
3635 *yyextra->pCopyQuotedGString << *yytext;
3639<CopyC11Attribute>\" {
3640 *yyextra->pCopyC11AttributeString += *yytext;
3641 yyextra->pCopyQuotedString=yyextra->pCopyC11AttributeString;
3642 yyextra->lastStringContext=YY_START;
3645<CopyC11Attribute>\n {
3647 *yyextra->pCopyC11AttributeString += *yytext;
3649<CopyC11Attribute>{ID} {
3650 if (
dstrcmp(yytext,
"nodiscard")==0)
3652 yyextra->current->spec.setNoDiscard(
true);
3654 *yyextra->pCopyC11AttributeString += yytext;
3656<CopyC11Attribute>. {
3657 *yyextra->pCopyC11AttributeString += *yytext;
3659<CopyC11Attribute>"]]" {
3660 yyextra->commentScanner.addDeprecatedDocs(yyextra->current.get(),
3663 yyextra->thisParser);
3664 BEGIN(yyextra->lastC11AttributeContext);
3670 *yyextra->pCopyRoundString += *yytext;
3671 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3672 yyextra->lastStringContext=YY_START;
3676 *yyextra->pCopyRoundString += *yytext;
3677 yyextra->roundCount++;
3680 *yyextra->pCopyRoundString += *yytext;
3681 if (--yyextra->roundCount<0)
3682 BEGIN(yyextra->lastRoundContext);
3686 *yyextra->pCopyRoundString += *yytext;
3689 if (yyextra->insidePHP)
3691 yyextra->current->initializer << yytext;
3692 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3693 yyextra->lastStringContext=YY_START;
3694 BEGIN(CopyPHPString);
3698 *yyextra->pCopyRoundString += yytext;
3701<CopyRound>{CHARLIT} {
3702 if (yyextra->insidePHP)
3708 *yyextra->pCopyRoundString+=yytext;
3711<CopyRound>[^"'()\n,]+ {
3712 *yyextra->pCopyRoundString+=yytext;
3715 *yyextra->pCopyRoundString+=*yytext;
3720 *yyextra->pCopySharpString += *yytext;
3721 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3722 yyextra->lastStringContext=YY_START;
3726 *yyextra->pCopySharpString += *yytext;
3727 yyextra->sharpCount++;
3730 *yyextra->pCopySharpString += *yytext;
3731 if (--yyextra->sharpCount<0)
3733 BEGIN(yyextra->lastSharpContext);
3738 *yyextra->pCopySharpString += *yytext;
3741 if (yyextra->insidePHP)
3743 yyextra->current->initializer << yytext;
3744 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3745 yyextra->lastStringContext=YY_START;
3746 BEGIN(CopyPHPString);
3750 *yyextra->pCopySharpString += yytext;
3753<CopySharp>{CHARLIT} {
3754 if (yyextra->insidePHP)
3760 *yyextra->pCopySharpString+=yytext;
3763<CopySharp>[^"'<>\n,]+ {
3764 *yyextra->pCopySharpString+=yytext;
3767 *yyextra->pCopySharpString+=*yytext;
3773 *yyextra->pCopyRoundGString << *yytext;
3774 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3775 yyextra->lastStringContext=YY_START;
3779 *yyextra->pCopyRoundGString << *yytext;
3780 yyextra->roundCount++;
3783 *yyextra->pCopyRoundGString << *yytext;
3784 if (--yyextra->roundCount<0)
3785 BEGIN(yyextra->lastRoundContext);
3789 *yyextra->pCopyRoundGString << *yytext;
3792 if (yyextra->insidePHP)
3794 yyextra->current->initializer << yytext;
3795 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3796 yyextra->lastStringContext=YY_START;
3797 BEGIN(CopyPHPGString);
3801 *yyextra->pCopyRoundGString << yytext;
3804<GCopyRound>{CHARLIT} {
3805 if (yyextra->insidePHP)
3811 *yyextra->pCopyRoundGString << yytext;
3815 if (!yyextra->insideCS) REJECT;
3816 *yyextra->pCopyRoundGString << yytext;
3817 yyextra->lastSkipVerbStringContext=YY_START;
3818 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3819 BEGIN(SkipVerbString);
3821<GCopyRound>[^"'()\n\/,R]+ {
3822 *yyextra->pCopyRoundGString << yytext;
3824<GCopyRound>{RAWBEGIN} {
3825 *yyextra->pCopyRoundGString << yytext;
3827 yyextra->lastRawStringContext = YY_START;
3828 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3832 *yyextra->pCopyRoundGString << *yytext;
3837 *yyextra->pCopySquareGString << *yytext;
3838 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3839 yyextra->lastStringContext=YY_START;
3843 *yyextra->pCopySquareGString << *yytext;
3844 if (yyextra->insidePHP)
3846 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3847 yyextra->lastStringContext=YY_START;
3848 BEGIN(CopyPHPGString);
3852 *yyextra->pCopySquareGString << *yytext;
3853 yyextra->squareCount++;
3856 *yyextra->pCopySquareGString << *yytext;
3857 if (--yyextra->squareCount<0)
3858 BEGIN(yyextra->lastSquareContext);
3862 *yyextra->pCopySquareGString << *yytext;
3865 if (yyextra->insidePHP)
3867 yyextra->current->initializer << yytext;
3868 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3869 yyextra->lastStringContext=YY_START;
3870 BEGIN(CopyPHPGString);
3874 *yyextra->pCopySquareGString << yytext;
3877<GCopySquare>{CHARLIT} {
3878 if (yyextra->insidePHP)
3884 *yyextra->pCopySquareGString << yytext;
3887<GCopySquare>[^"'\[\]\n\/,]+ {
3888 *yyextra->pCopySquareGString << yytext;
3891 *yyextra->pCopySquareGString << *yytext;
3896 *yyextra->pCopyCurlyString += *yytext;
3897 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3898 yyextra->lastStringContext=YY_START;
3899 yyextra->keepComment=
false;
3903 *yyextra->pCopyCurlyString += *yytext;
3904 if (yyextra->insidePHP)
3906 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3907 yyextra->lastStringContext=YY_START;
3908 yyextra->keepComment=
false;
3909 BEGIN(CopyPHPString);
3913 *yyextra->pCopyCurlyString += *yytext;
3914 yyextra->curlyCount++;
3917 *yyextra->pCopyCurlyString += *yytext;
3918 if (--yyextra->curlyCount<0)
3920 yyextra->keepComment=
false;
3921 BEGIN(yyextra->lastCurlyContext);
3924<CopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
3930 *yyextra->pCopyCurlyString += yytext;
3933<CopyCurly>[^"'{}\/\n,]+ {
3934 *yyextra->pCopyCurlyString += yytext;
3936<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3939 *yyextra->pCopyCurlyString += *yytext;
3942 *yyextra->pCopyCurlyString += *yytext;
3944<CopyCurly>{CPPC}[^\n]* {
3945 if (yyextra->keepComment)
3947 *yyextra->pCopyCurlyString += yytext;
3955 if (yyextra->keepComment)
3957 *yyextra->pCopyCurlyString += yytext;
3966 *yyextra->pCopyCurlyString += yytext;
3971 *yyextra->pCopyCurlyString += *yytext;
3974 *yyextra->pCopyCurlyString += *yytext;
3976<CopyComment><<EOF>> {
3977 warn(yyextra->fileName,yyextra->yyLineNr,
3978 "reached end of file while inside a C style comment block!");
3983<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? {
3985<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? {
3987 size_t s = line.
find(
' ');
3989 size_t e = line.
find(
'"',s);
3990 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
3991 if (yytext[yyleng-1]==
'\n')
DString mid(size_t index, size_t len=npos) const
int toInt(bool *ok=nullptr, int base=10) const
3998 *yyextra->pCopyCurlyGString << *yytext;
3999 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
4000 yyextra->lastStringContext=YY_START;
4001 yyextra->keepComment =
false;
4005 *yyextra->pCopyCurlyGString << *yytext;
4006 if (yyextra->insidePHP)
4008 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
4009 yyextra->lastStringContext=YY_START;
4010 yyextra->keepComment =
false;
4011 BEGIN(CopyPHPGString);
4015 *yyextra->pCopyCurlyGString << *yytext;
4016 yyextra->curlyCount++;
4018<GCopyCurly>"}"/{BN}*("||"|"&&") {
4019 *yyextra->pCopyCurlyGString << *yytext;
4020 if (--yyextra->curlyCount<0)
4022 yyextra->current->endBodyLine = yyextra->yyLineNr;
4023 BEGIN(yyextra->lastCurlyContext);
4027 *yyextra->pCopyCurlyGString << *yytext;
4028 if (--yyextra->curlyCount<0)
4030 yyextra->current->endBodyLine = yyextra->yyLineNr;
4031 yyextra->keepComment =
false;
4032 BEGIN(yyextra->lastCurlyContext);
4035<GCopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
4041 *yyextra->pCopyCurlyGString << yytext;
4044<GCopyCurly>[^"'{}\/\n,]+ {
4045 *yyextra->pCopyCurlyGString << yytext;
4048 *yyextra->pCopyCurlyGString << yytext;
4050<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
4053 *yyextra->pCopyCurlyGString << *yytext;
4056 *yyextra->pCopyCurlyGString << *yytext;
4058<GCopyCurly>{CPPC}[^\n]* {
4059 if (yyextra->keepComment)
4061 *yyextra->pCopyCurlyGString << yytext;
4069 if (yyextra->keepComment)
4071 *yyextra->pCopyCurlyGString << yytext;
4072 BEGIN(GCopyComment);
4079<GCopyComment>{CCE} {
4080 *yyextra->pCopyCurlyGString << yytext;
4085 *yyextra->pCopyCurlyGString << *yytext;
4088 *yyextra->pCopyCurlyGString << *yytext;
4090<GCopyComment><<EOF>> {
4091 warn(yyextra->fileName,yyextra->yyLineNr,
4092 "reached end of file while inside a C style comment block!");
4100 if (yyextra->current->type.empty() &&
4101 yyextra->current->name==
"enum")
4103 yyextra->current->section = EntryType::makeEnum();
4104 yyextra->current->name.clear();
4105 yyextra->current->args.clear();
4106 BEGIN(EnumBaseType);
4110 if (yyextra->current->type.empty())
4113 yyextra->current->name.sprintf(
"__pad%d__",yyextra->padCount++);
4116 yyextra->current->bitfields+=
":";
4120 yyextra->current->bitfields+=*yytext;
4123 yyextra->current->args+=*yytext;
4127 yyextra->current->args+=
' ';
4130 DString oldType = yyextra->current->type;
4131 if (yyextra->current->bodyLine==-1)
4133 yyextra->current->bodyLine = yyextra->yyLineNr;
4134 yyextra->current->bodyColumn = yyextra->yyColNr;
4136 if ( yyextra->insidePHP && yyextra->current->type.startsWith(
"var"))
4138 yyextra->current->type = yyextra->current->type.mid(3);
4140 if (yyextra->isTypedef && !yyextra->current->type.startsWith(
"typedef "))
4142 yyextra->current->type.prepend(
"typedef ");
4144 bool isStatic = yyextra->current->isStatic;
4145 Protection prot = yyextra->current->protection;
4146 bool isConcept = yyextra->current->section.isConcept();
4147 bool isModule = yyextra->current->section.isModuleDoc();
4150 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4155 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4158 else if (!yyextra->current->name.empty() && !yyextra->current->section.isEnum())
4160 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
4162 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
4163 if (yyextra->current->section.isClass())
4167 yyextra->current->section = EntryType::makeVariable() ;
4168 yyextra->current->fileName = yyextra->fileName;
4169 yyextra->current->startLine = yyextra->yyBegLineNr;
4170 yyextra->current->startColumn = yyextra->yyBegColNr;
4171 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4174 if ( *yytext ==
',')
4176 yyextra->current->isStatic = isStatic;
4177 yyextra->current->protection = prot;
4178 yyextra->current->name.clear();
4179 yyextra->current->args.clear();
4180 yyextra->current->brief.clear();
4181 yyextra->current->doc.clear();
4182 yyextra->current->initializer.str(std::string());
4183 yyextra->current->bitfields.clear();
4188 yyextra->mtype = MethodTypes::Method;
4189 yyextra->virt = Specifier::Normal;
4190 yyextra->current->bodyLine = -1;
4191 yyextra->current->bodyColumn = 1;
4192 yyextra->current->groups.clear();
4198 if (yyextra->insideSlice)
4200 yyextra->squareCount=1;
4201 yyextra->lastSquareContext = YY_START;
4202 yyextra->current->metaData +=
"[";
4203 BEGIN( SliceMetadata );
4205 else if (!yyextra->insideCS &&
4206 (yyextra->current->name.empty() ||
4207 yyextra->current->name==
"typedef"
4211 yyextra->squareCount=1;
4212 yyextra->lastSquareContext = YY_START;
4213 yyextra->idlAttr.clear();
4214 yyextra->idlProp.clear();
4215 yyextra->current->mtype = yyextra->mtype;
4218 yyextra->current->mtype == MethodTypes::Property)
4220 yyextra->odlProp =
true;
4221 yyextra->current->spec.setGettable(
true).setSettable(
true);
4224 BEGIN( IDLAttribute );
4226 else if (yyextra->insideCS &&
4227 yyextra->current->name.empty())
4229 yyextra->squareCount=1;
4230 yyextra->lastSquareContext = YY_START;
4233 yyextra->current->args.clear();
4234 BEGIN( SkipSquare );
4238 yyextra->current->args += yytext ;
4239 yyextra->squareCount=1;
4240 yyextra->externLinkage=
false;
4245 yyextra->squareCount++;
4246 yyextra->current->metaData +=
"[";
4248<SliceMetadata>{BN}* {
4251<SliceMetadata>\"[^\"]*\" {
4252 yyextra->current->metaData += yytext;
4255 yyextra->current->metaData += yytext;
4258 yyextra->current->metaData += yytext;
4259 if (--yyextra->squareCount<=0)
4261 BEGIN (yyextra->lastSquareContext);
4265 yyextra->current->type +=
"(";
4266 yyextra->roundCount++;
4268<SliceOptional>[0-9]+ {
4269 yyextra->current->type += yytext;
4272 yyextra->current->type +=
")";
4273 if(--yyextra->roundCount<=0)
4275 BEGIN (yyextra->lastModifierContext);
4280 if (--yyextra->squareCount<=0)
4283 if (yyextra->current->mtype == MethodTypes::Property)
4284 BEGIN( IDLPropName );
4286 BEGIN( yyextra->lastSquareContext );
4289<IDLAttribute>"propput" {
4292 yyextra->current->mtype = MethodTypes::Property;
4294 yyextra->current->spec.setSettable(
true);
4296<IDLAttribute>"propget" {
4299 yyextra->current->mtype = MethodTypes::Property;
4301 yyextra->current->spec.setGettable(
true);
4303<IDLAttribute>"property" {
4304 yyextra->current->spec.setProperty(
true);
4306<IDLAttribute>"attribute" {
4307 yyextra->current->spec.setAttribute(
true);
4309<IDLAttribute>"optional" {
4310 yyextra->current->spec.setOptional(
true);
4312<IDLAttribute>"readonly" {
4315 yyextra->current->spec.setSettable(
false);
4319 yyextra->current->spec.setReadonly(
true);
4322<IDLAttribute>"bound" {
4323 yyextra->current->spec.setBound(
true);
4325<IDLAttribute>"removable" {
4326 yyextra->current->spec.setRemovable(
true);
4328<IDLAttribute>"constrained" {
4329 yyextra->current->spec.setConstrained(
true);
4331<IDLAttribute>"transient" {
4332 yyextra->current->spec.setTransient(
true);
4334<IDLAttribute>"maybevoid" {
4335 yyextra->current->spec.setMaybeVoid(
true);
4337<IDLAttribute>"maybedefault" {
4338 yyextra->current->spec.setMaybeDefault(
true);
4340<IDLAttribute>"maybeambiguous" {
4341 yyextra->current->spec.setMaybeAmbiguous(
true);
4345<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
4348 if (yyextra->odlProp)
4350 yyextra->idlProp = yytext;
4353<IDLPropName>{ID}{BN}*"(" {
4354 yyextra->current->name = yytext;
4355 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
4356 yyextra->current->startLine = yyextra->yyLineNr;
4357 yyextra->current->startColumn = yyextra->yyColNr;
4360<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
4361 if (yyextra->odlProp)
4363 yyextra->idlProp += yytext;
4366<IDLPropName>{ID}{BNopt}/";" {
4367 if (yyextra->odlProp)
4369 yyextra->current->name = yytext;
4370 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
4371 yyextra->odlProp =
false;
4376<IDLProp>{BN}*"["[^\]]*"]"{BN}* {
4377 yyextra->idlAttr = yytext;
4378 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
4381 yyextra->idlProp = yytext;
4383<IDLProp>{BN}*{ID}{BN}*"," {
4384 if (yyextra->current->args.empty())
4385 yyextra->current->args =
"(";
4387 yyextra->current->args +=
", ";
4388 yyextra->current->args += yyextra->idlAttr;
4389 yyextra->current->args +=
" ";
4390 yyextra->current->args += yyextra->idlProp;
4391 yyextra->current->args +=
" ";
4392 yyextra->current->args += yytext;
4393 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4394 yyextra->idlProp.clear();
4395 yyextra->idlAttr.clear();
4398<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4402 yyextra->current->fileName = yyextra->fileName;
4403 yyextra->current->type = yyextra->idlProp;
4404 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4405 if (!yyextra->current->args.empty())
4406 yyextra->current->args +=
")";
4407 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4408 yyextra->current->section = EntryType::makeVariable();
4409 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4411 BEGIN( FindMembers );
4416<Array>"]" { yyextra->current->args += *yytext ;
4417 if (--yyextra->squareCount<=0)
4418 BEGIN( FindMembers ) ;
4420<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4421 if (--yyextra->squareCount<=0)
4422 BEGIN( SFunction ) ;
4424<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4425 yyextra->squareCount++;
4427<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4428<SkipSquare>"[" { yyextra->squareCount++; }
4430 if (--yyextra->squareCount<=0)
4431 BEGIN( yyextra->lastSquareContext );
4434 yyextra->lastStringContext=YY_START;
4435 BEGIN( SkipString );
4437<SkipSquare>[^\n\[\]\"]+
4438<FindMembers>"<" {
addType(yyscanner);
4439 yyextra->current->type += yytext ;
4442<Sharp>">" { yyextra->current->type += *yytext ;
4443 if (--yyextra->sharpCount<=0)
4444 BEGIN( FindMembers ) ;
4446<Sharp>"<" { yyextra->current->type += *yytext ;
4447 yyextra->sharpCount++;
4450 yyextra->current->type +=
' ';
4453<Sharp>. { yyextra->current->type += *yytext ; }
4456 yyextra->current->bodyLine = yyextra->yyLineNr;
4457 yyextra->current->bodyColumn = yyextra->yyColNr;
4458 yyextra->current->name = yytext;
4463 yyextra->lastInitializerContext = YY_START;
4464 yyextra->sharpCount=0;
4465 yyextra->initBracketCount=0;
4466 yyextra->current->initializer.str(
"=");
4467 BEGIN(ReadInitializer);
4470 yyextra->lastInitializerContext = YY_START;
4471 yyextra->sharpCount=0;
4472 yyextra->initBracketCount=0;
4473 yyextra->current->initializer.str(yytext);
4474 BEGIN(ReadInitializer);
4477 if (yyextra->insideJava)
4479 if (!yyextra->current->name.empty())
4481 yyextra->current->fileName = yyextra->fileName;
4482 yyextra->current->startLine = yyextra->yyLineNr;
4483 yyextra->current->startColumn = yyextra->yyColNr;
4484 if (!yyextra->current_root->spec.isEnum())
4486 yyextra->current->type =
"@";
4488 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4489 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4490 yyextra->current->section = EntryType::makeVariable();
4491 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4495 BEGIN( FindMembers );
4506 if (!yyextra->current->name.empty())
4508 yyextra->current->fileName = yyextra->fileName;
4509 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4511 yyextra->current->startLine = yyextra->current->bodyLine;
4512 yyextra->current->startColumn = yyextra->current->bodyColumn;
4516 yyextra->current->startLine = yyextra->yyLineNr;
4517 yyextra->current->startColumn = yyextra->yyColNr;
4519 if (!yyextra->current_root->spec.isEnum())
4521 yyextra->current->type =
"@";
4523 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4524 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4525 yyextra->current->section = EntryType::makeVariable();
4527 if (!yyextra->insideCS && !yyextra->insideJava &&
4528 !yyextra->current_root->spec.isStrong())
4535 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4537 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4542 yyextra->current->reset();
4547 yyextra->squareCount=1;
4548 yyextra->lastSquareContext = YY_START;
4551<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; }
4552<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4553<ReadBody,ReadNSBody,ReadBodyIntf>"#".* {
if (!yyextra->insidePHP)
4556 yyextra->current->program << yytext ;
4559<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$\" {
if (!yyextra->insideCS) REJECT
4560 yyextra->current->program << yytext ;
4561 yyextra->pSkipInterpString = &yyextra->current->program;
4562 yyextra->lastSkipInterpStringContext=YY_START;
4563 yyextra->strCurlyCount = 0;
4564 BEGIN( SkipInterpString );
4566<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})* {
4567 *yyextra->pSkipInterpString << yytext;
4569<SkipInterpString>"{" {
4570 *yyextra->pSkipInterpString << *yytext;
4571 yyextra->strCurlyCount++;
4573<SkipInterpString>"}" {
4574 *yyextra->pSkipInterpString << *yytext;
4575 yyextra->strCurlyCount--;
4577<SkipInterpString>\" {
4578 *yyextra->pSkipInterpString << *yytext;
4579 if (yyextra->strCurlyCount==0)
4581 BEGIN( yyextra->lastSkipInterpStringContext );
4584<SkipInterpString>. {
4585 *yyextra->pSkipInterpString << *yytext;
4588<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$@\" {
if (!yyextra->insideCS) REJECT
4589 yyextra->current->program << yytext ;
4590 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4591 yyextra->lastSkipInterpVerbStringContext=YY_START;
4592 yyextra->strCurlyCount = 0;
4593 BEGIN( SkipInterpVerbString );
4595<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4596 *yyextra->pSkipInterpVerbString << yytext;
4598<SkipInterpVerbString>"{" {
4599 *yyextra->pSkipInterpVerbString << *yytext;
4600 yyextra->strCurlyCount++;
4602<SkipInterpVerbString>"}" {
4603 *yyextra->pSkipInterpVerbString << *yytext;
4604 yyextra->strCurlyCount--;
4606<SkipInterpVerbString>\" {
4607 *yyextra->pSkipInterpVerbString << *yytext;
4608 if (yyextra->strCurlyCount==0)
4610 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4613<SkipInterpVerbString>. {
4614 *yyextra->pSkipInterpVerbString << *yytext;
4616<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4617<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4618 yyextra->pSkipVerbString = &yyextra->current->program;
4619 yyextra->lastSkipVerbStringContext=YY_START;
4620 BEGIN( SkipVerbString );
4622<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" {
if (yyextra->insidePHP)
4624 yyextra->current->program << yytext ;
4625 yyextra->pCopyHereDocGString = &yyextra->current->program;
4626 yyextra->lastHereDocContext=YY_START;
4627 BEGIN( CopyHereDoc );
4634<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4635 yyextra->current->program << yytext;
4637 yyextra->lastRawStringContext = YY_START;
4638 yyextra->pCopyRawGString = &yyextra->current->program;
4641<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4642 yyextra->pCopyQuotedGString = &yyextra->current->program;
4643 yyextra->lastStringContext=YY_START;
4644 yyextra->stopAtInvalidString=
false;
4645 BEGIN( CopyGString );
4647<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=
true; REJECT;}
4648<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4649 yyextra->lastContext = YY_START ;
4652<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4653 ++yyextra->yyLineNr ;
4654 yyextra->lastContext = YY_START ;
4657<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4658 if (!yyextra->insidePHP)
4660 yyextra->current->program << yytext;
4664 yyextra->current->program << yytext;
4665 yyextra->pCopyQuotedGString = &yyextra->current->program;
4666 yyextra->lastStringContext=YY_START;
4667 BEGIN(CopyPHPGString);
4670<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4671 if (yyextra->insidePHP)
4678 yyextra->current->program << yytext;
4681<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4682 ++yyextra->curlyCount ;
4685 yyextra->current->program << yytext ;
4686 --yyextra->curlyCount ;
4688<ReadBody,ReadNSBody>"}" {
4689 if ( yyextra->curlyCount>0 )
4691 yyextra->current->program << yytext ;
4692 --yyextra->curlyCount ;
4696 yyextra->current->endBodyLine = yyextra->yyLineNr;
4697 std::shared_ptr<Entry> original_root = yyextra->current_root;
4698 if (yyextra->current->section.isNamespace() && yyextra->current->type ==
"namespace")
4702 DString doc = yyextra->current->doc;
4703 int docLine = yyextra->current->docLine;
4704 DString docFile = yyextra->current->docFile;
4705 DString brief = yyextra->current->brief;
4706 int briefLine = yyextra->current->briefLine;
4707 DString briefFile = yyextra->current->briefFile;
4708 auto groups = yyextra->current->groups;
4709 auto anchors = yyextra->current->anchors;
4710 auto sli = yyextra->current->sli;
4711 auto rqli = yyextra->current->rqli;
4713 yyextra->current->doc =
"";
4714 yyextra->current->docLine = 0;
4715 yyextra->current->docFile =
"";
4716 yyextra->current->brief =
"";
4717 yyextra->current->briefLine = 0;
4718 yyextra->current->briefFile =
"";
4719 yyextra->current->groups.
clear();
4720 yyextra->current->anchors.clear();
4721 yyextra->current->sli.clear();
4722 yyextra->current->rqli.clear();
4724 while ((split_point = yyextra->current->name.find(
"::")) !=
DString::npos)
4726 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4727 yyextra->current->program.str(std::string());
4728 new_current->name = yyextra->current->name.mid(split_point + 2);
4729 yyextra->current->name = yyextra->current->name.left(split_point);
4730 if (yyextra->current->name.startsWith(
"inline "))
4732 yyextra->current->name = yyextra->current->name.mid(7);
4733 yyextra->current->spec.setInline(
true);
4735 if (!yyextra->current_root->name.empty()) yyextra->current->name.prepend(yyextra->current_root->name+
"::");
4737 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4738 yyextra->current_root = yyextra->current;
4739 yyextra->current = new_current;
4742 yyextra->current->doc = doc;
4743 yyextra->current->docLine = docLine;
4744 yyextra->current->docFile = docFile;
4745 yyextra->current->brief = brief;
4746 yyextra->current->briefLine = briefLine;
4747 yyextra->current->briefFile = briefFile;
4748 yyextra->current->groups = groups;
4749 yyextra->current->anchors = anchors;
4750 yyextra->current->sli = sli;
4751 yyextra->current->rqli = rqli;
4753 DString &cn = yyextra->current->name;
4757 yyextra->current->spec.setInline(
true);
4759 DString rn = yyextra->current_root->name;
4765 if (yyextra->isTypedef && cn.
empty())
4768 BEGIN( TypedefName );
4772 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4774 yyextra->current->program <<
',';
4779 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4780 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4782 if (yyextra->insideObjC &&
4783 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4786 BEGIN( ReadBodyIntf ) ;
4790 yyextra->memspecEntry = yyextra->current;
4791 if (yyextra->isTypedef)
4793 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4794 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4798 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4799 yyextra->current = std::make_shared<Entry>(*yyextra->memspecEntry);
4801 if (yyextra->current->section.isNamespace() ||
4802 yyextra->current->spec.isInterface() ||
4803 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4804 yyextra->insideSlice
4807 yyextra->current->reset();
4808 yyextra->current_root = std::move(original_root);
4810 yyextra->memspecEntry.reset();
4811 BEGIN( FindMembers ) ;
4815 if (!yyextra->isTypedef)
4817 yyextra->current->doc.clear();
4818 yyextra->current->brief.clear();
4820 BEGIN( MemberSpec ) ;
bool startsWith(const char *s) const
4826<ReadBody>"}"{BN}+"typedef"{BN}+ {
4828 if ( yyextra->curlyCount>0 )
4830 yyextra->current->program << yytext ;
4831 --yyextra->curlyCount ;
4835 yyextra->isTypedef =
true;
4836 yyextra->current->endBodyLine = yyextra->yyLineNr;
4837 DString &cn = yyextra->current->name;
4838 DString rn = yyextra->current_root->name;
4843 BEGIN( TypedefName );
4846<TypedefName>("const"|"volatile"){BN} {
4848 yyextra->current->type.prepend(yytext);
4851 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4853 yyextra->current->program <<
",";
4855 yyextra->current->name=yytext;
4857 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4858 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4860 if (!yyextra->firstTypedefEntry)
4862 yyextra->firstTypedefEntry = yyextra->current;
4864 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4866 yyextra->isTypedef=
true;
4867 BEGIN(MemberSpecSkip);
4871 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4873 yyextra->current->program <<
',';
4876 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4877 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4878 yyextra->memspecEntry = yyextra->current;
4879 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4882 BEGIN( MemberSpec ) ;
4884<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* {
4886 int i=0,l=(int)yyleng;
4887 while (i<l && (!
isId(yytext[i]))) i++;
4891 yyextra->msArgs=yyextra->msName.mid(j);
4892 yyextra->msName=yyextra->msName.left(j);
4897 if (yyextra->firstTypedefEntry)
4899 if (yyextra->firstTypedefEntry->spec.isStruct())
4901 yyextra->msType.prepend(
"struct "+yyextra->firstTypedefEntry->name);
4903 else if (yyextra->firstTypedefEntry->spec.isUnion())
4905 yyextra->msType.prepend(
"union "+yyextra->firstTypedefEntry->name);
4907 else if (yyextra->firstTypedefEntry->section.isEnum())
4909 yyextra->msType.prepend(
"enum "+yyextra->firstTypedefEntry->name);
4913 yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
DString right(size_t len) const
bool isId(char c)
Returns true if c is a valid character for an identifier.
4919 yyextra->current->name = yyextra->msName;
4926 if (yyextra->msName.empty() && !yyextra->current->name.empty())
4932 const Entry *p=yyextra->current.get();
4950 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4954 if (!yyextra->msName.empty()
4960 if (typedefHidesStruct &&
4961 yyextra->isTypedef &&
4962 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4963 yyextra->msType.stripWhiteSpace().empty() &&
4964 yyextra->memspecEntry)
4966 yyextra->memspecEntry->name=yyextra->msName;
4970 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4971 varEntry->lang = yyextra->language;
4972 varEntry->protection = yyextra->current->protection ;
4973 varEntry->mtype = yyextra->current->mtype;
4974 varEntry->virt = yyextra->current->virt;
4975 varEntry->isStatic = yyextra->current->isStatic;
4976 varEntry->section = EntryType::makeVariable();
4977 varEntry->name = yyextra->msName.stripWhiteSpace();
4978 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+
" ";
4979 varEntry->args = yyextra->msArgs;
4980 if (yyextra->isTypedef)
4982 varEntry->type.prepend(
"typedef ");
4985 if (typedefHidesStruct &&
4986 yyextra->isTypedef &&
4987 (yyextra->current->spec.isStruct() || yyextra->current->spec.isUnion()) &&
4988 yyextra->memspecEntry
4991 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
4995 varEntry->type+=yyextra->current->name+yyextra->msType;
4997 varEntry->fileName = yyextra->fileName;
4998 varEntry->startLine = yyextra->yyLineNr;
4999 varEntry->startColumn = yyextra->yyColNr;
5000 varEntry->doc = yyextra->current->doc;
5001 varEntry->brief = yyextra->current->brief;
5002 varEntry->mGrpId = yyextra->current->mGrpId;
5003 varEntry->initializer.str(yyextra->current->initializer.str());
5004 varEntry->groups = yyextra->current->groups;
5005 varEntry->sli = yyextra->current->sli;
5010 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
5015 if (!yyextra->isTypedef && yyextra->msName.empty() &&
5016 yyextra->memspecEntry && yyextra->current->section.isCompound())
5018 if (!yyextra->current->doc.empty())
5020 yyextra->memspecEntry->doc += yyextra->current->doc;
5022 if (!yyextra->current->brief.empty())
5024 yyextra->memspecEntry->brief += yyextra->current->brief;
5027 yyextra->msType.clear();
5028 yyextra->msName.clear();
5029 yyextra->msArgs.clear();
5030 yyextra->isTypedef=
false;
5031 yyextra->firstTypedefEntry.reset();
5032 yyextra->memspecEntry.reset();
5033 yyextra->current->reset();
5035 BEGIN( FindMembers );
5039 yyextra->current->doc.clear();
5040 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
5045 yyextra->lastInitializerContext=YY_START;
5046 yyextra->sharpCount=0;
5047 yyextra->initBracketCount=0;
5048 yyextra->current->initializer.str(yytext);
5049 BEGIN(ReadInitializer);
5060<MemberSpecSkip>"," { BEGIN(MemberSpec); }
5061<MemberSpecSkip>";" { unput(
';'); BEGIN(MemberSpec); }
5062<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
5065<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] {
5066 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5068 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
5069 yyextra->insideObjC=
false;
5070 BEGIN( FindMembers );
5072<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
5073<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
5075<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" |
5076<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ {
5077 if (yyextra->insidePHP)
5083 yyextra->current->bodyLine = yyextra->yyLineNr;
5084 yyextra->current->bodyColumn = yyextra->yyColNr;
5087 yyextra->funcPtrType=yytext;
5088 yyextra->roundCount=0;
5093<FuncPtr>{SCOPENAME} {
5094 yyextra->current->name = yytext;
5097 BEGIN( FuncPtrOperator );
5101 if (yyextra->current->name==
"const" || yyextra->current->name==
"volatile")
5103 yyextra->funcPtrType += yyextra->current->name;
5107 BEGIN( EndFuncPtr );
5114<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
5115 yyextra->current->name += yytext;
5116 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
5119<FuncPtrOperator>\n {
5121 yyextra->current->name += *yytext;
5123<FuncPtrOperator>"(" {
5125 BEGIN( EndFuncPtr );
5128 yyextra->current->name += *yytext;
5130<EndFuncPtr>")"{BNopt}/";" {
5132 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5135<EndFuncPtr>")"{BNopt}/"(" {
5137 if (yyextra->funcPtrType!=
"(")
5139 yyextra->current->type+=yyextra->funcPtrType+
")";
5143<EndFuncPtr>")"{BNopt}/"[" {
5145 yyextra->current->type+=yyextra->funcPtrType;
5146 yyextra->current->args +=
")";
5151 yyextra->current->args += *yytext ;
5154 yyextra->current->bodyLine = yyextra->yyLineNr;
5155 yyextra->current->bodyColumn = yyextra->yyColNr;
5156 yyextra->currentArgumentContext = FuncFuncEnd;
5157 yyextra->fullArgString=yyextra->current->args;
5158 yyextra->copyArgString=&yyextra->current->args;
5159 BEGIN( ReadFuncArgType ) ;
5161<EndFuncPtr>"["[^\n\]]*"]" {
5162 yyextra->funcPtrType+=yytext;
5168 yyextra->current->args += *yytext ;
5169 ++yyextra->roundCount;
5172 yyextra->current->args += *yytext ;
5173 if ( yyextra->roundCount )
5174 --yyextra->roundCount;
5180<FuncFuncEnd>")"{BN}*"(" {
5182 yyextra->current->type+=yyextra->funcPtrType+
")(";
5183 BEGIN(FuncFuncType);
5185<FuncFuncEnd>")"{BNopt}/[;{] {
5187 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5190<FuncFuncEnd>")"{BNopt}/"[" {
5192 yyextra->current->type+=yyextra->funcPtrType;
5193 yyextra->current->args+=
")";
5194 BEGIN(FuncFuncArray);
5197 yyextra->current->args += *yytext;
5200 yyextra->current->type += *yytext;
5201 yyextra->roundCount++;
5204 yyextra->current->type += *yytext;
5205 if (yyextra->roundCount)
5206 --yyextra->roundCount;
5210<FuncFuncType>{BN}*","{BN}* {
lineCount(yyscanner) ; yyextra->current->type +=
", " ; }
5211<FuncFuncType>{BN}+ {
lineCount(yyscanner) ; yyextra->current->type +=
' ' ; }
5213 yyextra->current->type += *yytext;
5215<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" {
5216 if (yyextra->current->type.startsWith(
"typedef") &&
5217 yyextra->current->bodyLine==-1)
5220 yyextra->current->bodyLine = yyextra->yyLineNr;
5221 yyextra->current->bodyColumn = yyextra->yyColNr;
5222 BEGIN( GetCallType );
5224 else if (!yyextra->current->name.empty())
5226 yyextra->current->args = yytext;
5227 yyextra->current->bodyLine = yyextra->yyLineNr;
5228 yyextra->current->bodyColumn = yyextra->yyColNr;
5229 yyextra->currentArgumentContext = FuncQual;
5230 yyextra->fullArgString=yyextra->current->args;
5231 yyextra->copyArgString=&yyextra->current->args;
5232 BEGIN( ReadFuncArgType ) ;
5236<GetCallType>{BN}*{ID}{BN}*"*" {
5239 yyextra->funcPtrType=
"(";
5240 yyextra->funcPtrType+=yytext;
5241 yyextra->roundCount=0;
5245 if (yyextra->insideCS && yyextra->current->name.empty())
5250 yyextra->current->type += *yytext;
5251 yyextra->lastRoundContext = FindMembers;
5252 yyextra->pCopyRoundString = &yyextra->current->type;
5253 yyextra->roundCount = 0;
5256 else if (!yyextra->current->name.empty())
5258 yyextra->current->args = yytext;
5259 yyextra->current->bodyLine = yyextra->yyLineNr;
5260 yyextra->current->bodyColumn = yyextra->yyColNr;
5261 yyextra->currentArgumentContext = FuncQual;
5262 yyextra->fullArgString=yyextra->current->args;
5263 yyextra->copyArgString=&yyextra->current->args;
5264 BEGIN( ReadFuncArgType ) ;
5271<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
5272 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
5273 else yyextra->fullArgString+=yytext;
5275<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
5276 yyextra->fullArgString+=yytext;
5278<CopyArgRound>[^\/\n\)\(\"\']+ {
5279 *yyextra->copyArgString+=yytext;
5280 yyextra->fullArgString+=yytext;
5282<CopyArgSquare>[^\/\n\]\[\"\']+ {
5283 *yyextra->copyArgString+=yytext;
5284 yyextra->fullArgString+=yytext;
5286<ReadFuncArgType,ReadTempArgs>{BN}* {
5287 *yyextra->copyArgString+=
" ";
5288 yyextra->fullArgString+=
" ";
5291<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
5293 yyextra->lastRawStringContext = YY_START;
5294 yyextra->pCopyRawString = yyextra->copyArgString;
5295 *yyextra->pCopyRawString+=yytext;
5296 yyextra->fullArgString+=yytext;
5299<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
5300 *yyextra->copyArgString+=*yytext;
5301 yyextra->fullArgString+=*yytext;
5302 yyextra->lastCopyArgStringContext = YY_START;
5303 BEGIN( CopyArgString );
5305<ReadFuncArgType>"[" {
5306 if (!yyextra->insidePHP) REJECT;
5307 *yyextra->copyArgString+=*yytext;
5308 yyextra->fullArgString+=*yytext;
5309 yyextra->argSquareCount=0;
5310 yyextra->lastCopyArgContext = YY_START;
5311 BEGIN( CopyArgSquare );
5313<ReadFuncArgType,ReadTempArgs>"(" {
5314 *yyextra->copyArgString+=*yytext;
5315 yyextra->fullArgString+=*yytext;
5316 yyextra->argRoundCount=0;
5317 yyextra->lastCopyArgContext = YY_START;
5318 BEGIN( CopyArgRound );
5320<ReadFuncArgType>")" {
5321 *yyextra->copyArgString+=*yytext;
5322 yyextra->fullArgString+=*yytext;
5324 if (yyextra->insideJS)
5335 yyextra->docBackup = yyextra->current->doc;
5336 yyextra->briefBackup = yyextra->current->brief;
5338 BEGIN( yyextra->currentArgumentContext );
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
5341<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
5342 if (yyextra->currentArgumentContext==DefineEnd)
5346 int i;
for (i=(
int)yyleng-1;i>=0;i--)
5352 BEGIN( yyextra->currentArgumentContext );
5358 yyextra->fullArgString+=yytext;
5359 yyextra->lastCopyArgChar=0;
5360 yyextra->lastCommentInArgContext=YY_START;
5362 BEGIN( CopyArgCommentLine );
5364 BEGIN( CopyArgComment );
5368<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { }
5369<ReadFuncArgType,ReadTempArgs>{CCS} {
5370 yyextra->lastCContext = YY_START;
5371 BEGIN( SkipComment );
5373<ReadFuncArgType,ReadTempArgs>{CPPC} {
5374 yyextra->lastCContext = YY_START;
5375 BEGIN( SkipCxxComment );
5391<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
5393 if (yyextra->currentArgumentContext==DefineEnd)
5397 int i;
for (i=(
int)yyleng-1;i>0;i--)
5401 *yyextra->copyArgString+=*yytext;
5402 yyextra->fullArgString+=*yytext;
5405 BEGIN( yyextra->currentArgumentContext );
5411 yyextra->lastCopyArgChar=*yytext;
5414 yyextra->lastCommentInArgContext=YY_START;
5415 yyextra->fullArgString+=text;
5417 BEGIN( CopyArgCommentLine );
5419 BEGIN( CopyArgComment );
5422<CopyArgComment>^{B}*"*"+/{BN}+
5423<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
5424<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
5425 if (yyextra->lastCopyArgChar!=0)
5426 unput(yyextra->lastCopyArgChar);
5427 BEGIN( yyextra->lastCommentInArgContext );
5429<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
5431 if (yyextra->lastCopyArgChar!=0)
5432 unput(yyextra->lastCopyArgChar);
5433 BEGIN( yyextra->lastCommentInArgContext );
5435<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
5436 yyextra->docBlockName=
"uml";
5437 yyextra->fullArgString+=yytext;
5438 BEGIN(CopyArgVerbatim);
5440<CopyArgCommentLine>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid"|"code")/[^a-z_A-Z0-9\-] {
5441 yyextra->docBlockName=&yytext[1];
5442 yyextra->fullArgString+=yytext;
5443 BEGIN(CopyArgVerbatim);
5445<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5446 yyextra->docBlockName=&yytext[1];
5447 if (yyextra->docBlockName.at(1)==
'[')
5449 yyextra->docBlockName.at(1)=
']';
5451 if (yyextra->docBlockName.at(1)==
'{')
5453 yyextra->docBlockName.at(1)=
'}';
5455 if (yyextra->docBlockName.at(1)==
'(')
5457 yyextra->docBlockName.at(1)=
')';
5459 yyextra->fullArgString+=yytext;
5460 BEGIN(CopyArgVerbatim);
5462<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] {
5463 yyextra->fullArgString+=yytext;
5464 if (&yytext[4]==yyextra->docBlockName)
5466 yyextra->docBlockName=
"";
5467 BEGIN(CopyArgCommentLine);
5470<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") {
5471 yyextra->fullArgString+=yytext;
5472 if (yyextra->docBlockName==&yytext[1])
5474 yyextra->docBlockName=
"";
5475 BEGIN(CopyArgCommentLine);
5478<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5479<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5480<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext;
lineCount(yyscanner); }
5481<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5482<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5483 warn(yyextra->fileName,yyextra->yyLineNr,
5484 "Ignoring {:c}brief command inside argument documentation",*yytext
5486 yyextra->fullArgString+=
' ';
5489 *yyextra->copyArgString+=*yytext;
5490 yyextra->fullArgString+=*yytext;
5491 yyextra->argSharpCount=1;
5492 BEGIN( CopyArgSharp );
5495 *yyextra->copyArgString+=*yytext;
5496 yyextra->fullArgString+=*yytext;
5498 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5500 BEGIN( yyextra->currentArgumentContext );
5503 yyextra->argRoundCount++;
5504 *yyextra->copyArgString+=*yytext;
5505 yyextra->fullArgString+=*yytext;
5508 *yyextra->copyArgString+=*yytext;
5509 yyextra->fullArgString+=*yytext;
5510 if (yyextra->argRoundCount>0)
5511 yyextra->argRoundCount--;
5513 BEGIN( yyextra->lastCopyArgContext );
5516 yyextra->argSquareCount++;
5517 *yyextra->copyArgString+=*yytext;
5518 yyextra->fullArgString+=*yytext;
5521 *yyextra->copyArgString+=*yytext;
5522 yyextra->fullArgString+=*yytext;
5523 if (yyextra->argSquareCount>0)
5524 yyextra->argSquareCount--;
5526 BEGIN( yyextra->lastCopyArgContext );
5529 *yyextra->copyArgString+=*yytext;
5530 yyextra->fullArgString+=*yytext;
5531 yyextra->argRoundCount=0;
5532 yyextra->lastCopyArgContext = YY_START;
5533 BEGIN( CopyArgRound );
5536 yyextra->argSharpCount++;
5538 *yyextra->copyArgString+=*yytext;
5539 yyextra->fullArgString+=*yytext;
5542 *yyextra->copyArgString+=*yytext;
5543 yyextra->fullArgString+=*yytext;
5544 yyextra->argSharpCount--;
5545 if (yyextra->argSharpCount>0)
5551 BEGIN( ReadTempArgs );
5555<CopyArgString,CopyArgPHPString>\\. {
5556 *yyextra->copyArgString+=yytext;
5557 yyextra->fullArgString+=yytext;
5560 *yyextra->copyArgString+=*yytext;
5561 yyextra->fullArgString+=*yytext;
5562 BEGIN( yyextra->lastCopyArgStringContext );
5564<CopyArgPHPString>\' {
5565 *yyextra->copyArgString+=*yytext;
5566 yyextra->fullArgString+=*yytext;
5567 BEGIN( yyextra->lastCopyArgStringContext );
5569<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5570 if (yyextra->insidePHP)
5576 *yyextra->copyArgString+=yytext;
5577 yyextra->fullArgString+=yytext;
5580<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5581 *yyextra->copyArgString+=yytext;
5582 yyextra->fullArgString+=yytext;
5583 if (yyextra->insidePHP)
5585 yyextra->lastCopyArgStringContext=YY_START;
5586 BEGIN(CopyArgPHPString);
5589<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5590 *yyextra->copyArgString+=yytext;
5591 yyextra->fullArgString+=yytext;
5593<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5595 *yyextra->copyArgString+=*yytext;
5596 yyextra->fullArgString+=*yytext;
5598<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5599 *yyextra->copyArgString+=yytext;
5600 yyextra->fullArgString+=yytext;
5602<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5603 *yyextra->copyArgString+=*yytext;
5604 yyextra->fullArgString+=*yytext;
5612<FuncRound>"(" { yyextra->current->args += *yytext ;
5613 ++yyextra->roundCount ;
5615<FuncRound>")" { yyextra->current->args += *yytext ;
5616 if ( yyextra->roundCount )
5617 --yyextra->roundCount ;
5629 if (
dstrcmp(yytext,
";")==0 &&
5630 ((yyextra->insideJS || yyextra->insidePHP) &&
5631 !yyextra->current->type.containsWord(
"function")) )
5633 yyextra->current->reset();
5635 BEGIN( FindMembers );
5639 unput(*yytext); BEGIN( SFunction );
5642<FuncQual>{BN}*"abstract"{BN}* {
5644 yyextra->current->virt = Specifier::Pure;
5645 yyextra->current->args +=
" override ";
5647<FuncQual,TrailingReturn>{BN}*"override"{BN}* {
5649 yyextra->current->spec.setOverride(
true);
5650 yyextra->current->args +=
" override ";
5651 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5654<FuncQual,TrailingReturn>{BN}*"final"{BN}* {
5656 yyextra->current->spec.setFinal(
true);
5657 yyextra->current->args +=
" final ";
5658 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5661<FuncQual>{BN}*"sealed"{BN}* {
5663 yyextra->current->spec.setSealed(
true);
5664 yyextra->current->args +=
" sealed ";
5666<FuncQual>{BN}*"new"{BN}* {
5668 yyextra->current->spec.setNew(
true);
5669 yyextra->current->args +=
" new ";
5671<FuncQual>{BN}*"const"{BN}* {
5673 yyextra->current->args +=
" const ";
5674 yyextra->current->argList.setConstSpecifier(
true);
5676<FuncQual>{BN}*"volatile"{BN}* {
5678 yyextra->current->args +=
" volatile ";
5679 yyextra->current->argList.setVolatileSpecifier(
true);
5681<FuncQual>{BN}*"noexcept"{BN}* {
5683 yyextra->current->args +=
" noexcept ";
5684 yyextra->current->spec.setNoExcept(
true);
5686<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* {
5688 yyextra->current->args +=
" noexcept(false)";
5690<FuncQual>{BN}*"noexcept"{BN}*"(" {
5692 yyextra->current->args +=
" noexcept(";
5693 yyextra->current->spec.setNoExcept(
true);
5694 yyextra->lastRoundContext=FuncQual;
5695 yyextra->pCopyRoundString=&yyextra->current->args;
5696 yyextra->roundCount=0;
5700 yyextra->current->args +=
" &";
5703<FuncQual>{BN}*"&&" {
5704 yyextra->current->args +=
" &&";
5708<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* {
5710 yyextra->current->args +=
" = 0";
5711 yyextra->current->virt = Specifier::Pure;
5712 yyextra->current->argList.setPureSpecifier(
true);
5713 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5716<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* {
5718 yyextra->current->args +=
" = delete";
5719 yyextra->current->spec.setDelete(
true);
5720 yyextra->current->argList.setIsDeleted(
true);
5721 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5724<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* {
5726 yyextra->current->args +=
" = default";
5727 yyextra->current->spec.setDefault(
true);
5728 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5731<FuncQual>{BN}*"->"{BN}* {
5733 yyextra->current->argList.setTrailingReturnType(
" -> ");
5734 yyextra->current->args +=
" -> ";
5735 yyextra->roundCount=0;
5736 BEGIN(TrailingReturn);
5738<TrailingReturn>[{;] {
5739 if (yyextra->roundCount>0) REJECT;
5741 yyextra->current->argList.finishTrailingReturnType();
5744<TrailingReturn>"requires"{BN}+ {
5745 if (yyextra->insideJava) REJECT;
5746 yyextra->requiresContext = FuncQual;
5747 yyextra->current->req+=
' ';
5748 yyextra->current->argList.finishTrailingReturnType();
5749 BEGIN(RequiresClause);
5751<TrailingReturn>"(" {
5752 yyextra->roundCount++;
5753 yyextra->current->argList.appendTrailingReturnType(yytext);
5754 yyextra->current->args+=yytext;
5756<TrailingReturn>")" {
5757 if (yyextra->roundCount>0)
5759 yyextra->roundCount--;
5763 warn(yyextra->fileName,yyextra->yyLineNr,
5764 "Found ')' without opening '(' for trailing return type '{})...'",
5765 yyextra->current->argList.trailingReturnType());
5767 yyextra->current->argList.appendTrailingReturnType(yytext);
5768 yyextra->current->args+=yytext;
5771 yyextra->current->argList.appendTrailingReturnType(yytext);
5772 yyextra->current->args+=yytext;
5776 yyextra->current->argList.appendTrailingReturnType(yytext);
5777 yyextra->current->args+=
' ';
5779<FuncRound,FuncFunc>{BN}*","{BN}* {
5781 yyextra->current->args +=
", " ;
5783<FuncQual,FuncRound,FuncFunc>{BN}+ {
5785 yyextra->current->args +=
' ' ;
5787<SFunction,FuncQual,FuncRound,FuncFunc>"#" {
if (yyextra->insidePHP)
5789 yyextra->lastCPPContext = YY_START;
5793 if (!yyextra->insideCS)
5800 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5807 yyextra->lastInitializerContext=YY_START;
5808 yyextra->sharpCount=0;
5809 yyextra->initBracketCount=0;
5810 yyextra->current->initializer.str(yytext);
5811 BEGIN(ReadInitializer);
5814<ReadExpressionBody>";" {
5815 if (!yyextra->current->sli.empty() && yyextra->previous)
5817 yyextra->previous->sli = yyextra->current->sli;
5818 yyextra->current->sli.clear();
5820 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5835 if (yyextra->insideCpp &&
dstrcmp(yytext,
"requires")==0)
5838 yyextra->requiresContext = YY_START;
5839 if (!yyextra->current->req.empty())
5841 yyextra->current->req+=
" && ";
5843 BEGIN(RequiresClause);
5845 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
5848 yyextra->current->typeConstr.clear();
5849 yyextra->current->typeConstr.push_back(
Argument());
5850 yyextra->lastCSConstraint = YY_START;
5851 BEGIN( CSConstraintName );
5855 yyextra->current->args = yytext;
5856 yyextra->oldStyleArgType.clear();
5857 BEGIN(OldStyleArgs);
5861 yyextra->current->args += yytext;
5867 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5869 if (yyextra->current->doc!=yyextra->docBackup)
5871 doc=yyextra->current->doc;
5872 yyextra->current->doc=yyextra->docBackup;
5874 if (yyextra->current->brief!=yyextra->briefBackup)
5876 brief=yyextra->current->brief;
5877 yyextra->current->brief=yyextra->briefBackup;
5879 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5880 oldStyleArgName,brief,doc);
5881 yyextra->current->args.clear();
5882 if (*yytext==
';') yyextra->oldStyleArgType.clear();
5884<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5886 if (yyextra->current->argList.empty())
5888 yyextra->current->argList.setNoParameters(
true);
5894<OldStyleArgs>. { yyextra->current->args += *yytext; }
5895<FuncQual,FuncRound,FuncFunc>\" {
5896 if (yyextra->insideIDL && yyextra->insideCppQuote)
5902 yyextra->current->args += *yytext;
5905<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5906<FuncQual>{BN}*"try:" |
5907<FuncQual>{BN}*"try"{BN}+ {
5908 yyextra->insideTryBlock=
true;
5910 if (yytext[yyleng-1]==
':')
5916<FuncQual>{BN}*"throw"{BN}*"(" {
5917 yyextra->current->exception =
" throw (" ;
5918 yyextra->roundCount=0;
5920 BEGIN( ExcpRound ) ;
5922<FuncQual>{BN}*"raises"{BN}*"(" {
5923 yyextra->current->exception =
" raises (" ;
5925 yyextra->roundCount=0;
5926 BEGIN( ExcpRound ) ;
5928<FuncQual>{BN}*"throws"{BN}+ {
5929 yyextra->current->exception =
" throws " ;
5933<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5934 ++yyextra->roundCount ;
5936<ExcpRound>")" { yyextra->current->exception += *yytext ;
5937 if ( yyextra->roundCount )
5938 --yyextra->roundCount ;
5943 yyextra->current->exception += *yytext;
5946 unput(
'{'); BEGIN( FuncQual );
5949 unput(
';'); BEGIN( FuncQual );
5952 yyextra->current->exception +=
' ';
5956 yyextra->current->exception += *yytext;
5958<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5959 yyextra->current->name = yyextra->current->args ;
5960 yyextra->current->args = yytext ;
5961 yyextra->roundCount=0;
5962 BEGIN( FuncRound ) ;
5965 if (!yyextra->insidePHP) BEGIN(SkipInits);
5971 yyextra->current->fileName = yyextra->fileName;
5972 yyextra->current->startLine = yyextra->yyBegLineNr;
5973 yyextra->current->startColumn = yyextra->yyBegColNr;
5974 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
5976 std::string type = yyextra->current->type.str();
5980 ti =
match.position();
5984 if (
size_t di = yyextra->current->type.find(
"decltype(");
5990 size_t ts=yyextra->current->type.find(
'<');
5991 size_t te=yyextra->current->type.rfind(
'>');
5994 bool startsWithTypedef = yyextra->current->type.startsWith(
"typedef ");
5997 bool isVariable = !yyextra->current->type.empty() &&
5998 (!isFunction || startsWithTypedef);
6003 if (*yytext!=
';' || yyextra->current_root->section.isCompound())
6008 if (yyextra->isTypedef && !startsWithTypedef)
6010 yyextra->current->type.prepend(
"typedef ");
6012 yyextra->current->section = EntryType::makeVariable() ;
6017 yyextra->current->section = EntryType::makeFunction() ;
6018 yyextra->current->proto = *yytext==
';';
6026 if (yyextra->isTypedef && !startsWithTypedef)
6028 yyextra->current->type.prepend(
"typedef ");
6031 yyextra->current->section = EntryType::makeVariable();
6036 yyextra->current->section = EntryType::makeFunction();
6037 yyextra->current->proto =
true;
6041 if ( yyextra->insidePHP)
6043 if (yyextra->current->type.findAndRemoveWord(
"final"))
6045 yyextra->current->spec.setFinal(
true);
6047 if (yyextra->current->type.findAndRemoveWord(
"abstract"))
6049 yyextra->current->spec.setAbstract(
true);
6052 if ( yyextra->insidePHP && !yyextra->current->type.containsWord(
"function"))
6055 if ( *yytext ==
'{' )
6057 yyextra->lastCurlyContext = FindMembers;
6058 yyextra->curlyCount=0;
6063 BEGIN( FindMembers );
6068 if ( yyextra->insidePHP)
6070 yyextra->current->type.findAndRemoveWord(
"function");
6072 yyextra->previous = yyextra->current;
6073 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6076 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
6078 yyextra->current->spec.setOptional(
true).setRequired(
true);
6080 yyextra->lastCurlyContext = FindMembers;
6081 if ( *yytext ==
',' )
6083 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
6085 if ( *yytext ==
'{' )
6087 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
6089 yyextra->previous->spec.setInline(
true);
6091 yyextra->curlyCount=0;
6092 BEGIN( SkipCurly ) ;
6094 else if ( *yytext ==
'=' )
6096 yyextra->previous->spec.setInline(
true);
6097 yyextra->curlyCount=0;
6098 BEGIN( ReadExpressionBody );
6102 if (!yyextra->previous->section.isVariable())
6103 yyextra->previous->bodyLine=-1;
6104 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.
6108<SkipInits>">"{BN}*"{" {
6110 yyextra->curlyCount=1;
6111 BEGIN(SkipC11Inits);
6113<SkipInits>{ID}{BN}*"{" {
6115 yyextra->curlyCount=1;
6116 BEGIN(SkipC11Inits);
6119 ++yyextra->curlyCount;
6122 if ( --yyextra->curlyCount<=0 )
6133 ++yyextra->curlyCount ;
6135<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | )
6138 if( yyextra->curlyCount )
6140 --yyextra->curlyCount ;
6144 if (!yyextra->current->sli.empty() && yyextra->previous)
6146 yyextra->previous->sli = yyextra->current->sli;
6147 yyextra->current->sli.clear();
6149 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
6150 BEGIN( yyextra->lastCurlyContext ) ;
6153<SkipCurly>"}"{BN}*{DCOMM}"<" {
6155 if ( yyextra->curlyCount )
6158 --yyextra->curlyCount ;
6162 yyextra->current->endBodyLine=yyextra->yyLineNr;
6163 yyextra->tempEntry = yyextra->current;
6164 yyextra->current = yyextra->previous;
6166 yyextra->docBlockContext = SkipCurlyEndDoc;
6167 yyextra->docBlockInBody =
false;
6168 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6170 yyextra->docBlock.str(std::string());
6171 yyextra->docBlockTerm =
'}';
6172 if (yytext[yyleng-3]==
'/')
6184<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" {
6185 yyextra->docBlockContext = SkipCurlyEndDoc;
6186 yyextra->docBlockInBody =
false;
6187 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6189 yyextra->docBlock.str(std::string());
6190 yyextra->docBlockTerm =
'}';
6191 if (yytext[yyleng-3]==
'/')
6202<SkipCurlyEndDoc>"}" {
6204 if (yyextra->tempEntry)
6206 yyextra->current = yyextra->tempEntry;
6207 yyextra->tempEntry.reset();
6209 BEGIN( yyextra->lastCurlyContext );
6211<SkipCurly,ReadExpressionBody>\" {
6213 yyextra->lastStringContext=YY_START;
6214 BEGIN( SkipString );
6216<SkipCurly>^{B}*"#" {
6217 if (yyextra->insidePHP)
6220 BEGIN( SkipCurlyCpp );
6222<SkipCurly,SkipC11Inits,SkipInits,ReadExpressionBody>\n {
6226<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
6227 if (!yyextra->insidePHP)
6233 yyextra->lastHereDocContext = YY_START;
6237<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
6239 yyextra->lastRawStringContext = YY_START;
6240 yyextra->dummyRawString.clear();
6241 yyextra->pCopyRawString = &yyextra->dummyRawString;
6242 *yyextra->pCopyRawString += yytext;
6245<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
6249<SkipCurly,SkipCurlyCpp>"\$" {}
6253 yyextra->lastCurlyContext = FindMembers;
6256<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
6260<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CCS} {
6262 yyextra->lastCContext = YY_START;
6265<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CPPC} {
6267 yyextra->lastCContext = YY_START;
6268 BEGIN(SkipCxxComment);
6270<SkipInits,SkipC11Inits>"(" {
6271 yyextra->roundCount=0;
6272 yyextra->lastSkipRoundContext=YY_START;
6275<SkipInits,SkipC11Inits>\" {
6276 yyextra->lastStringContext=YY_START;
6277 BEGIN( SkipString );
6280 warn(yyextra->fileName,yyextra->yyLineNr,
6281 "Found ';' while parsing initializer list! "
6282 "(doxygen could be confused by a macro call without semicolon)"
6284 BEGIN( FindMembers );
6286<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
6287 if (!yyextra->insidePHP)
6290 yyextra->lastCContext = YY_START;
6291 BEGIN(SkipCxxComment);
6293<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>@\" {
6294 if (!yyextra->insideCS) REJECT;
6297 yyextra->lastSkipVerbStringContext=YY_START;
6298 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
6299 yyextra->dummyTextStream.clear();
6300 BEGIN(SkipVerbString);
6302<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>{CHARLIT} {
6303 if (yyextra->insidePHP) REJECT;
6305<SkipInits,SkipCurly,SkipCurlyCpp>\' {
6306 if (yyextra->insidePHP)
6308 yyextra->lastStringContext=YY_START;
6309 BEGIN(SkipPHPString);
6312<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>. { }
6313<SkipString,SkipPHPString>\\. { }
6315 BEGIN( yyextra->lastStringContext );
6318 BEGIN( yyextra->lastStringContext );
6320<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
6321<SkipString,SkipPHPString>\n {
6325<SkipString,SkipPHPString>. { }
6331 yyextra->current->section = EntryType::makeEmpty() ;
6332 yyextra->current->type.clear() ;
6333 yyextra->current->name.clear() ;
6334 yyextra->current->args.clear() ;
6335 yyextra->current->argList.clear();
6336 BEGIN( FindMembers ) ;
6339 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
6343 if (!yyextra->current->name.empty() && !yyextra->current_root->name.empty())
6347 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6349 if (!yyextra->baseName.empty())
6351 yyextra->current->extends.emplace_back(
6352 yyextra->baseName,Protection::Public,Specifier::Normal);
6353 yyextra->baseName.clear();
6355 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
6360 yyextra->current->section = EntryType::makeEmpty() ;
6361 yyextra->current->type.clear() ;
6362 yyextra->current->name.clear() ;
6363 yyextra->current->args.clear() ;
6364 yyextra->current->argList.clear();
6366 BEGIN( FindMembers ) ;
6368<CompoundName>{SCOPENAME}/{BN}*"<" {
6369 yyextra->sharpCount = 0;
6370 yyextra->current->name = yytext ;
6372 if (yyextra->current->spec.isProtocol())
6374 yyextra->current->name+=
"-p";
6377 yyextra->lastClassTemplSpecContext = ClassVar;
6378 if (yyextra->insideObjC)
6380 BEGIN( ObjCProtocolList );
6382 else if (yyextra->insideCS)
6389 yyextra->roundCount=0;
6390 BEGIN( ClassTemplSpec );
6397 yyextra->current->tArgLists.
push_back(al);
6398 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
6399 yyextra->templateStr=
"<";
6400 yyextra->current->name +=
"<";
6401 yyextra->fullArgString = yyextra->templateStr;
6402 yyextra->copyArgString = &yyextra->current->name;
6404 yyextra->currentArgumentContext = ClassVar;
6405 BEGIN( ReadTempArgs );
6407<ObjCProtocolList>"<" {
6408 yyextra->insideProtocolList=
true;
6411<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
6412 yyextra->current->name += yytext;
6414 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6417 if (yyextra->current->spec.isProtocol())
6424 BEGIN( yyextra->lastClassTemplSpecContext );
6428<ClassTemplSpec>"<" {
6429 yyextra->current->name += yytext;
6430 if (yyextra->roundCount==0) yyextra->sharpCount++;
6433 yyextra->current->name += yytext;
6435<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" {
6436 if (yyextra->insideCS && yyextra->current->type ==
"namespace")
6440 yyextra->current->name =
substitute(yytext,
".",
"::");
6441 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6446 else if (!yyextra->current->tArgLists.empty())
6450 yyextra->current->name = yytext;
6451 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6454 DString rn = yyextra->current_root->name;
6456 if (!yyextra->current->name.empty() && !rn.
empty())
6460 yyextra->current->spec.setForwardDecl(
true);
6461 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6463 else if (yyextra->insideIDL &&
6464 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6465 yyextra->current->spec.isInterface()) ||
6466 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6467 yyextra->current->spec.isService())
6475 yyextra->current->name = yytext;
6476 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6477 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6480 yyextra->current->spec.setInterface(
false).setService(
false);
6484 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6487 if (!(yyextra->insideCS && yyextra->current->type ==
"namespace"))
6490 yyextra->current->reset();
6492 if (yyextra->insideObjC)
6494 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6495 yyextra->insideObjC =
false;
6497 if (yyextra->isTypedef)
6499 yyextra->current->type.prepend(
"typedef");
6501 BEGIN( FindMembers );
Wrapper class for the Entry type.
6504<CompoundName>{SCOPENAME}/{BN}*"(" {
6505 yyextra->current->name = yytext ;
6508 if (yyextra->insideCpp && yyextra->current->name==
"alignas")
6510 yyextra->lastAlignAsContext = YY_START;
6515 if (yyextra->current->spec.isProtocol())
6517 yyextra->current->name +=
"-p";
6522<AlignAs>"(" { yyextra->roundCount=0;
6523 BEGIN( AlignAsEnd );
6527<AlignAsEnd>"(" { yyextra->roundCount++; }
6528<AlignAsEnd>")" {
if (--yyextra->roundCount<0)
6530 BEGIN( yyextra->lastAlignAsContext );
6536 yyextra->current->name = yytext ;
6540 yyextra->current->bodyLine = yyextra->yyLineNr;
6541 yyextra->current->bodyColumn = yyextra->yyColNr;
6542 yyextra->current->initializer.str(std::string());
6543 yyextra->lastInitializerContext = FindMembers;
6544 yyextra->sharpCount=0;
6545 yyextra->initBracketCount=0;
6546 BEGIN(ReadInitializer);
6548<CompoundName>{SCOPENAME}/{BN}*"," {
6550 yyextra->current->reset();
6553<CompoundName>{SCOPENAME} {
6554 yyextra->current->name = yytext ;
6557 if (yyextra->current->spec.isProtocol())
6559 yyextra->current->name +=
"-p";
6561 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6567<CompoundName>({ID}{BN}*"::"{BN}*)+("inline"{BN}+({ID}{BN}*"::"{BN}*)*)+{ID} {
6568 if (yyextra->current->section.isNamespace())
DString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple internal white...
6580<CompoundName>{CSSCOPENAME} {
6581 yyextra->current->name =
substitute(yytext,
".",
"::");
6585<ClassVar>{SCOPENAME}{BNopt}/"(" {
6586 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6589 yyextra->roundCount=0;
6590 BEGIN(SkipUnionSwitch);
6595 yyextra->yyBegColNr=yyextra->yyColNr;
6596 yyextra->yyBegLineNr=yyextra->yyLineNr;
6597 yyextra->current->name = yytext;
6598 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6601 BEGIN( FindMembers );
6605 if (yyextra->isTypedef)
6609 yyextra->current->type.prepend(
"typedef ");
6617<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6618 if (yyextra->insideCli)
6621 yyextra->current->spec.setSealedClass(
true);
6623 yyextra->current->spec.setAbstractClass(
true);
6631<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6632 yyextra->yyBegColNr=yyextra->yyColNr;
6633 yyextra->yyBegLineNr=yyextra->yyLineNr;
6636 if (yyextra->current->section.isEnum())
6638 yyextra->current->section = EntryType::makeVariable() ;
6640 yyextra->current->type +=
' ' ;
6641 yyextra->current->type += yyextra->current->name ;
6650 yyextra->yyBegColNr=yyextra->yyColNr;
6651 yyextra->yyBegLineNr=yyextra->yyLineNr;
6653 if (yyextra->insideIDL &&
dstrcmp(yytext,
"switch")==0)
6656 yyextra->roundCount=0;
6657 BEGIN(SkipUnionSwitch);
6659 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
dstrcmp(yytext,
"implements")==0 ||
dstrcmp(yytext,
"extends")==0))
6661 yyextra->current->type.clear();
6662 yyextra->baseProt = Protection::Public;
6663 yyextra->baseVirt = Specifier::Normal;
6664 yyextra->baseName.clear();
6665 BEGIN( BasesProt ) ;
6667 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
6669 yyextra->current->typeConstr.clear();
6670 yyextra->current->typeConstr.push_back(
Argument());
6671 yyextra->lastCSConstraint = YY_START;
6672 BEGIN( CSConstraintName );
6674 else if (yyextra->insideCli &&
dstrcmp(yytext,
"abstract")==0)
6676 yyextra->current->spec.setAbstract(
true);
6678 else if (yyextra->insideCli &&
dstrcmp(yytext,
"sealed")==0)
6680 yyextra->current->spec.setSealed(
true);
6682 else if (
dstrcmp(yytext,
"final")==0)
6684 yyextra->current->spec.setFinal(
true);
6688 if (yyextra->current->section.isEnum())
6690 yyextra->current->section = EntryType::makeVariable() ;
6692 yyextra->current->type +=
' ' ;
6693 yyextra->current->type += yyextra->current->name ;
6694 yyextra->current->name = yytext ;
6703 if (yyextra->insideObjC && *yytext==
'(')
6705 yyextra->current->name+=
'(';
6706 yyextra->current->spec.setCategory(
true);
6707 BEGIN( ClassCategory );
6709 else if (yyextra->insideCS && *yytext==
'(')
6711 yyextra->current->args=yytext;
6712 yyextra->currentArgumentContext = ClassVar;
6713 yyextra->fullArgString = yyextra->current->args;
6714 yyextra->copyArgString = &yyextra->current->args;
6715 BEGIN( ReadFuncArgType ) ;
6721 BEGIN( FindMembers );
6724<CSConstraintType,CSConstraintName>{CCS}{CCE} { }
6725<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) {
6726 yyextra->fullArgString.clear();
6727 yyextra->lastCopyArgChar=
'#';
6728 yyextra->lastCommentInArgContext=YY_START;
6730 BEGIN( CopyArgCommentLine );
6732 BEGIN( CopyArgComment );
6734<CSConstraintType,CSConstraintName>"#" {
6735 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6737<CSConstraintType>"=>" {
6742 BEGIN( yyextra->lastCSConstraint );
6744<CSConstraintType>"{" {
6748 BEGIN( yyextra->lastCSConstraint );
6750<CSConstraintType,CSConstraintName>";" {
6753 BEGIN( yyextra->lastCSConstraint );
6755<CSConstraintName>":" {
6756 BEGIN( CSConstraintType );
6758<CSConstraintName>{ID} {
6760 yyextra->current->typeConstr.back().name=yytext;
6762<CSConstraintType>"where" {
6763 yyextra->current->typeConstr.push_back(
Argument());
6764 BEGIN( CSConstraintName );
6766<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6767 if (yyextra->current->typeConstr.back().type.empty())
6770 yyextra->current->typeConstr.back().type=yytext;
6774 DString name = yyextra->current->typeConstr.back().name;
6775 yyextra->current->typeConstr.push_back(
Argument());
6776 yyextra->current->typeConstr.back().name=
name;
6777 yyextra->current->typeConstr.back().type=yytext;
6780<CSConstraintName,CSConstraintType>\n {
6783<CSConstraintName,CSConstraintType>. {
6785<ClassCategory>{ID} {
6786 yyextra->current->name+=yytext;
6788<ClassCategory>")"/{BN}*"{" {
6789 yyextra->current->name+=
')';
6792<ClassCategory>")"/{BN}*"<" {
6793 yyextra->current->name+=
')';
6794 BEGIN( ObjCProtocolList );
6797 yyextra->current->name+=
')';
6798 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6810 if (yyextra->current->section.isVariable())
6812 yyextra->current->bitfields+=
":";
6813 yyextra->current->args.clear();
6816 else if (yyextra->current->section.isEnum())
6819 yyextra->current->args.clear();
6820 BEGIN(EnumBaseType);
6824 yyextra->current->type.clear();
6825 if (yyextra->current->spec.isInterface() ||
6826 yyextra->current->spec.isStruct() ||
6827 yyextra->current->spec.isRef() ||
6828 yyextra->current->spec.isValue() ||
6829 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6832 yyextra->baseProt = Protection::Public;
6836 yyextra->baseProt = Protection::Private;
6838 yyextra->baseVirt = Specifier::Normal;
6839 yyextra->baseName.clear();
6840 BEGIN( BasesProt ) ;
6844 if (yyextra->isTypedef)
6846 yyextra->current->type.prepend(
"typedef");
6848 if ((yytext[0]==
'*' || yytext[0]==
'&') && yyextra->current->section.isEnum())
6850 yyextra->current->section = EntryType::makeVariable() ;
6852 if (yytext[0]==
';' && yyextra->current->section.isEnum())
6854 yyextra->current->reset();
6861 BEGIN( FindMembers );
6863<Bases,ClassVar>{CPPC}"/"/[^/] {
6864 if (!yyextra->insideObjC)
6871 yyextra->current->program << yytext;
6872 yyextra->current->fileName = yyextra->fileName ;
6873 yyextra->current->startLine = yyextra->yyLineNr ;
6874 yyextra->current->startColumn = yyextra->yyColNr;
6875 yyextra->curlyCount=0;
6876 BEGIN( ReadBodyIntf );
6879<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6880<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6881<Bases,ClassVar>{CPPC}"!" |
6882<Bases,ClassVar>[\-+]{BN}* {
6883 if (!yyextra->insideObjC)
6890 yyextra->current->program << yytext;
6891 yyextra->current->fileName = yyextra->fileName ;
6892 yyextra->current->startLine = yyextra->yyLineNr ;
6893 yyextra->current->startColumn = yyextra->yyColNr;
6894 yyextra->curlyCount=0;
6895 BEGIN( ReadBodyIntf );
6898<CompoundName,ClassVar>{B}*"{"{B}* {
6899 yyextra->current->program.str(std::string());
6900 yyextra->current->fileName = yyextra->fileName ;
6901 yyextra->current->bodyLine = yyextra->yyLineNr;
6902 yyextra->current->bodyColumn = yyextra->yyColNr;
6904 if (yyextra->current->name.empty() && !yyextra->isTypedef)
6906 if (yyextra->current->section.isNamespace())
6910 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6922 yyextra->curlyCount=0;
6923 if (yyextra->current_root &&
6924 !yyextra->current_root->spec.isInterface() &&
6925 (yyextra->current->spec.isInterface() ||
6926 yyextra->current->spec.isProtocol() ||
6927 yyextra->current->spec.isCategory() ||
6928 yyextra->current->section.isObjcImpl()
6933 BEGIN( ReadBodyIntf );
6935 else if (yyextra->current->section.isNamespace())
6937 BEGIN( ReadNSBody );
DString stripPath(const DString &s)
6944<BasesProt>"virtual"{BN}+ {
lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6945<BasesProt>"public"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6946<BasesProt>"protected"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6947<BasesProt>"internal"{BN}+ {
if (!yyextra->insideCli) REJECT ;
lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6948<BasesProt>"private"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6949<BasesProt>{BN} {
lineCount(yyscanner); }
6950<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6951<Bases>"decltype"{BN}*"(" {
6953 yyextra->roundCount=0;
6954 yyextra->lastSkipRoundContext=YY_START;
6957<Bases>("\\")?({ID}"\\")*{ID} {
6958 if (!yyextra->insidePHP)
6967 yyextra->baseName += bn;
6968 yyextra->current->args +=
' ';
6969 yyextra->current->args += yytext;
6972<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
6978 yyextra->current->typeConstr.clear();
6979 yyextra->current->typeConstr.push_back(
Argument());
6980 yyextra->lastCSConstraint = YY_START;
6981 BEGIN( CSConstraintName );
6985 yyextra->baseName+=yytext;
6986 yyextra->current->args +=
' ';
6987 yyextra->current->args += yytext;
6990<Bases>{BN}*{ID}("."{ID})* {
6992 yyextra->baseName +=
name;
6993 yyextra->current->args +=
' ';
6994 yyextra->current->args +=
name;
6996<ClassVar,Bases>\n/{BN}*[^{, \t\n:] {
6997 if (!yyextra->insideObjC)
7007<ClassVar,Bases>"@end" {
7015<ClassVar>"<" { yyextra->current->name += *yytext;
7016 yyextra->sharpCount=1;
7017 yyextra->roundCount=0;
7018 yyextra->lastSkipSharpContext = YY_START;
7019 yyextra->specName = &yyextra->current->name;
7020 BEGIN ( Specialization );
7024 yyextra->sharpCount=1;
7025 yyextra->roundCount=0;
7026 yyextra->lastSkipSharpContext = YY_START;
7027 if (yyextra->insideObjC)
7037 yyextra->templateStr = yytext;
7038 yyextra->specName = &yyextra->templateStr;
7039 BEGIN ( Specialization );
7042<Specialization>"<" { *yyextra->specName += *yytext;
7043 if (yyextra->roundCount==0) yyextra->sharpCount++;
7045<Specialization>">" {
7046 *yyextra->specName += *yytext;
7047 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
7050 BEGIN(yyextra->lastSkipSharpContext);
7053<Specialization>{BN}+ {
lineCount(yyscanner); *yyextra->specName +=
' '; }
7054<Specialization>"<<" { *yyextra->specName += yytext; }
7055<Specialization>">>"/{B}*"::" {
7060<Specialization>">>" {
7061 if (yyextra->insideCS)
7071 if (yyextra->roundCount>0)
7073 *yyextra->specName += yytext;
7083<Specialization>"typename"{BN}+ {
lineCount(yyscanner); }
7084<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
7085<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
7087<Specialization>"\\\\" { *yyextra->specName += *yytext;}
7088<Specialization>"\\'" { *yyextra->specName += *yytext;}
7089<Specialization>"\\\"" { *yyextra->specName += *yytext;}
7090<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
7091<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
7092<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
7093<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
7094<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7095<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
7096<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7097<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
7100 *yyextra->specName += *yytext;
7102<SkipRound>"(" { ++yyextra->roundCount; }
7103<SkipRound>")" {
if (--yyextra->roundCount<0)
7104 BEGIN ( yyextra->lastSkipRoundContext );
7107 yyextra->lastStringContext=SkipRound;
7110<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) {
lineCount(yyscanner);
7111 if (yyextra->insideProtocolList)
7113 yyextra->baseName+=
"-p";
7117 yyextra->current->args +=
',' ;
7120 if (!yyextra->baseName.empty())
7122 yyextra->current->extends.emplace_back(
7123 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7126 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
7127 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
7128 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
7130 yyextra->baseProt=Protection::Public;
7134 yyextra->baseProt=Protection::Private;
7136 yyextra->baseVirt=Specifier::Normal;
7137 yyextra->baseName.clear();
7140 yyextra->insideProtocolList=
false;
7143 if (yyextra->insideObjC && !yyextra->current->spec.isProtocol())
7159 if (*yytext==
',' && yyextra->insideObjC)
7161 yyextra->insideProtocolList=
true;
7167 yyextra->current->program.str(std::string());
7168 yyextra->current->fileName = yyextra->fileName ;
7169 yyextra->current->bodyLine = yyextra->yyLineNr;
7170 yyextra->current->bodyColumn = yyextra->yyColNr;
7172 if (!yyextra->baseName.empty())
7174 yyextra->current->extends.emplace_back(
7175 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7177 yyextra->baseName.clear();
7179 yyextra->curlyCount=0;
7180 if (yyextra->insideObjC)
7182 BEGIN( ReadBodyIntf );
7189<SkipUnionSwitch>{B}*"(" {
7190 yyextra->roundCount++;
7192<SkipUnionSwitch>")" {
7193 if (--yyextra->roundCount==0)
7198<SkipUnionSwitch>\n {
lineCount(yyscanner); }
7200<Comment>{BN}+ { yyextra->current->program << yytext ;
7203<Comment>{CCS} { yyextra->current->program << yytext ; }
7204<Comment>{CPPC} { yyextra->current->program << yytext ; }
7205<Comment>{CMD}("code"|"verbatim"|"iliteral") {
7206 if (yyextra->doxygenComment) yyextra->insideCode=
true;
7207 yyextra->current->program << yytext ;
7209<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
7210 if (yyextra->doxygenComment) yyextra->insideCode=
false;
7211 yyextra->current->program << yytext ;
7213<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
7214<Comment>{CCE} { yyextra->current->program << yytext ;
7215 if (!yyextra->insideCode)
7217 yyextra->doxygenComment=
false;
7218 BEGIN( yyextra->lastContext );
7221<Comment>. { yyextra->current->program << *yytext ; }
7223<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,ReadExpressionBody,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
7225 if (!yyextra->current->doc.empty())
7227 yyextra->current->doc+=
"\n\n";
7231 yyextra->current->docLine = yyextra->yyLineNr;
7232 yyextra->current->docFile = yyextra->fileName;
7235 yyextra->lastDocContext = YY_START;
7236 if (yyextra->current_root->section.isScope())
7238 yyextra->current->inside = yyextra->current_root->name+
"::";
7240 yyextra->docBlockContext = YY_START;
7241 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7246 yyextra->docBlock.
str(indent.
str());
7248 if (yyextra->docBlockAutoBrief)
7250 yyextra->current->briefLine = yyextra->yyLineNr;
7251 yyextra->current->briefFile = yyextra->fileName;
7256<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,ReadExpressionBody,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
7262 yyextra->lastDocContext = YY_START;
7265 if (yyextra->current_root->section.isScope())
7267 yyextra->current->inside = yyextra->current_root->name+
"::";
7269 yyextra->current->docLine = yyextra->yyLineNr;
7270 yyextra->current->docFile = yyextra->fileName;
7271 yyextra->docBlockContext = YY_START;
7272 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7274 yyextra->docBlockAutoBrief = javadocAutoBrief;
7278 yyextra->docBlock.
str(indent.
str());
7280 if (yyextra->docBlockAutoBrief)
7282 yyextra->current->briefLine = yyextra->yyLineNr;
7283 yyextra->current->briefFile = yyextra->fileName;
7290 yyextra->current->program << yytext ;
7291 yyextra->lastContext = YY_START ;
7292 yyextra->doxygenComment=
true;
7296<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,ReadExpressionBody,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7301<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,ReadExpressionBody,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7302 yyextra->lastDocContext = YY_START;
7305 if (yyextra->current_root->section.isScope())
7307 yyextra->current->inside = yyextra->current_root->name+
"::";
7309 yyextra->current->docLine = yyextra->yyLineNr;
7310 yyextra->current->docFile = yyextra->fileName;
7311 yyextra->docBlockContext = YY_START;
7312 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7314 yyextra->docBlockAutoBrief = javadocAutoBrief;
7318 yyextra->docBlock.
str(indent.
str());
7320 if (yyextra->docBlockAutoBrief)
7322 yyextra->current->briefLine = yyextra->yyLineNr;
7323 yyextra->current->briefFile = yyextra->fileName;
7328<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
7329 yyextra->lastDocContext = YY_START;
7330 if (yyextra->current_root->section.isScope())
7332 yyextra->current->inside = yyextra->current_root->name+
"::";
7334 yyextra->docBlockContext = YY_START;
7335 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7336 yyextra->docBlockAutoBrief =
false;
7340 yyextra->docBlock.
str(indent.
str());
7345<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
7346 yyextra->lastDocContext = YY_START;
7347 if (yyextra->current_root->section.isScope())
7349 yyextra->current->inside = yyextra->current_root->name+
"::";
7351 yyextra->docBlockContext = YY_START;
7352 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7353 yyextra->docBlockAutoBrief =
false;
7356 yyextra->docBlock.
str(indent.
str());
7360<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
7362 yyextra->externLinkage=
true;
7365 if (yyextra->externLinkage)
7367 yyextra->externLinkage=
false;
7369 else if (yyextra->insideCS &&
7370 !yyextra->current->name.empty() &&
7371 !yyextra->current->type.empty())
7373 if (yyextra->current->mtype == MethodTypes::Event)
7375 yyextra->mtype = MethodTypes::Event;
7377 else if (yyextra->current->type.containsWord(
"event"))
7379 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
7383 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
7385 yyextra->current->bodyLine = yyextra->yyLineNr;
7386 yyextra->current->bodyColumn = yyextra->yyColNr;
7387 yyextra->curlyCount=0;
7388 BEGIN( CSAccessorDecl );
7390 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
7394 yyextra->current->exception =
" {";
7395 BEGIN(UNOIDLAttributeBlock);
7399 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
7400 yyextra->current->name.empty()
7404 yyextra->needsSemi =
false;
7405 if (yyextra->current->isStatic)
7407 yyextra->current->name=
"[static initializer]";
7408 yyextra->current->type.clear();
7412 yyextra->current->name=
"[instance initializer]";
7429 yyextra->current->bodyLine = yyextra->yyLineNr;
7430 yyextra->current->bodyColumn = yyextra->yyColNr;
7431 yyextra->current->initializer.str(yytext);
7432 yyextra->lastInitializerContext = YY_START;
7433 yyextra->sharpCount=0;
7434 yyextra->initBracketCount=1;
7435 BEGIN(ReadInitializer);
7439<CSAccessorDecl>"{" { yyextra->curlyCount++; }
7440<CSAccessorDecl>"}"{B}*"=" {
7442 if (yyextra->curlyCount != 0) REJECT;
7443 yyextra->current->initializer.str(
"=");
7444 yyextra->current->endBodyLine=yyextra->yyLineNr;
7445 yyextra->lastInitializerContext = FindMembers;
7446 BEGIN(ReadInitializer);
7448<CSAccessorDecl>"}" {
7449 if (yyextra->curlyCount)
7451 yyextra->curlyCount--;
7455 yyextra->mtype = MethodTypes::Method;
7456 yyextra->virt = Specifier::Normal;
7458 yyextra->current->endBodyLine=yyextra->yyLineNr;
7463<CSAccessorDecl>"private "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(
true); }
7464<CSAccessorDecl>"protected "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(
true); }
7465<CSAccessorDecl>"private "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(
true); }
7466<CSAccessorDecl>"protected "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(
true); }
7467<CSAccessorDecl>"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(
true); }
7468<CSAccessorDecl>"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(
true); }
7469<CSAccessorDecl>"init" {
if (yyextra->curlyCount==0) yyextra->current->spec.setInitonly(
true); }
7470<CSAccessorDecl>"add" {
if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(
true); }
7471<CSAccessorDecl>"remove" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(
true); }
7472<CSAccessorDecl>"raise" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(
true); }
7473<CSAccessorDecl>{CHARLIT} {}
7474<CSAccessorDecl>{ID} {}
7475<CSAccessorDecl>"\"" { BEGIN(CSString);}
7476<CSAccessorDecl>"." {}
7477<CSAccessorDecl>\n {
lineCount(yyscanner); }
7478<CSString>"\"" { BEGIN(CSAccessorDecl);}
7486<SliceSequence>{SCOPENAME} {
7487 if (yyextra->current->spec.isLocal())
7489 yyextra->current->type =
"local ";
7491 yyextra->current->type +=
"sequence<";
7492 yyextra->current->type += yytext;
7493 yyextra->current->type +=
">";
7496<SliceSequence>{BN}*">"{BN}* {
7498 BEGIN(SliceSequenceName);
7501<SliceSequenceName>{ID}{BN}* {
7503 yyextra->current->name = yytext ;
7504 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7507<SliceSequenceName>";" {
7508 yyextra->current->section = EntryType::makeVariable();
7509 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7514<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7516 if (yyextra->current->spec.isLocal())
7518 yyextra->current->type =
"local ";
7520 yyextra->current->type +=
"dictionary<";
7521 yyextra->current->type += yytext;
7522 yyextra->current->type +=
">";
7523 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7526<SliceDictionary>{BN}*">"{BN}* {
7528 BEGIN(SliceDictionaryName);
7531<SliceDictionaryName>{ID}{BN}* {
7533 yyextra->current->name = yytext ;
7534 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7537<SliceDictionaryName>";" {
7538 yyextra->current->section = EntryType::makeVariable();
7539 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7549<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? {
7550 int markerLen = yytext[yyleng-1]==
'<' ? 4 : 3;
7551 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7554<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" {
7555 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7556 BEGIN( yyextra->docBlockContext );
7558<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" {
7559 yyextra->docBlock << yytext;
7560 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7561 BEGIN( yyextra->docBlockContext );
7563<DocLine>{NONLopt}/"\n" {
7564 yyextra->docBlock << yytext;
7565 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7566 BEGIN( yyextra->docBlockContext );
7571<DocBlock>"*"*{CCE} {
7573 BEGIN(yyextra->docBlockContext);
7575<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7578 yyextra->docBlock <<
"\\ilinebr " << indent;
7580<DocBlock>^{B}*"*"+/[^/] {
7583 yyextra->docBlock << indent;
7585<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] {
7588 yyextra->docBlock << indent;
7590<DocBlock>^{B}*({CPPC}){B}* {
7593 yyextra->docBlock << yytext;
7597 yyextra->docBlock << yytext;
7599<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
7600 yyextra->docBlock << yytext;
7602<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7603 yyextra->docBlock << yytext;
7604 char blockName[] =
"f$";
7606 if (c==
'[') blockName[1]=
']';
7607 else if (c==
'{') blockName[1]=
'}';
7608 else if (c==
'(') blockName[1]=
')';
7610 BEGIN(DocCopyBlock);
7612<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7613 yyextra->fileName = &yytext[6];
7614 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7615 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7616 yyextra->docBlock << yytext;
7618<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7619 yyextra->fileName = &yytext[6];
7620 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7621 yyextra->docBlock << yytext;
7623<DocBlock>{CMD}"iline"{LINENR}{B} {
7628 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7632 yyextra->yyLineNr = nr;
7634 yyextra->docBlock << yytext;
7636<DocBlock>{B}*"<"{PRE}">" {
7637 yyextra->docBlock << yytext;
7639 BEGIN(DocCopyBlock);
7641<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
7642 yyextra->docBlock << yytext;
7644 BEGIN(DocCopyBlock);
7646<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid")/[^a-z_A-Z0-9\-] {
7647 yyextra->docBlock << yytext;
7649 BEGIN(DocCopyBlock);
7651<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] {
7652 yyextra->docBlock << yytext;
7654 BEGIN(DocCopyBlock);
7656<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7658 yyextra->docBlock <<
"\\ilinebr ";
7659 yyextra->docBlock << pat;
7661 BEGIN(DocCopyBlock);
7663<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7665 yyextra->docBlock << pat;
7667 BEGIN(DocCopyBlock);
7669<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7670<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7671<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7673 yyextra->docBlock <<
"\\ilinebr ";
7674 yyextra->docBlock << pat;
7676 BEGIN(DocCopyBlock);
7678<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7679<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7680<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7682 yyextra->docBlock << pat;
7684 BEGIN(DocCopyBlock);
7687 yyextra->docBlock <<
"```";
7690 yyextra->docBlock << yytext;
7693 yyextra->docBlock << yytext;
7695 BEGIN(DocCopyBlock);
7697<DocBlock>{B}*"<"{CODE}">" {
7698 if (yyextra->insideCS)
7700 yyextra->docBlock << yytext;
7702 BEGIN(DocCopyBlock);
7709<DocBlock>[^@*~`'\/\\\n]+ {
7710 yyextra->docBlock << yytext;
7714 yyextra->docBlock << *yytext;
7717 yyextra->docBlock << *yytext;
7722<DocCopyBlock>"</"{PRE}">" {
7727 yyextra->docBlock << yytext;
7729<DocCopyBlock>"</"{CODE}">" {
7734 yyextra->docBlock << yytext;
7736<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7741 yyextra->docBlock << yytext;
7743<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9] {
7748 yyextra->docBlock << yytext;
7750<DocCopyBlock>^{B}*"*"+/{BN}+ {
7751 if ((yyextra->docBlockName==
"verbatim") || (yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7759 yyextra->docBlock << indent;
7762<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* {
7763 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7767 yyextra->docBlock << indent;
7774<DocCopyBlock>^{B}*"*"+/({ID}|"(") {
7775 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7779 yyextra->docBlock << indent+
"*";
7786<DocCopyBlock>^{B}*"*"+/{BN}* {
7787 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7790 if (yyextra->nestedComment>0)
7793 yyextra->docBlock << indent+
"*";
7798 yyextra->docBlock << indent;
7806<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7812 yyextra->docBlock << pat;
7814<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7820 yyextra->docBlock << pat;
7822<DocCopyBlock>"```" {
7823 if (yyextra->docBlockName==
"``")
7825 yyextra->docBlock <<
"`";
7827 yyextra->docBlock <<
"``";
7832 yyextra->docBlock << yytext;
7835<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7840 yyextra->docBlock << yytext;
7842<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7847 yyextra->docBlock << yytext;
7849<DocCopyBlock>"`"{1,2} {
7854 yyextra->docBlock << yytext;
7856<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ {
7857 yyextra->docBlock << yytext;
7860 yyextra->docBlock << yytext;
7861 if (yyextra->docBlockName==
"code" || yyextra->docBlockName==
"iliteral")
7865 yyextra->lastStringContext=YY_START;
7866 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7867 yyextra->stopAtInvalidString=
true;
7871<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7874 yyextra->nestedComment++;
7876 else if (yytext[0]==
'*' && yyextra->nestedComment>0)
7878 yyextra->nestedComment--;
7880 else if (yytext[0]==
'*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7882 warn(yyextra->fileName,yyextra->yyLineNr,
7883 "Found end of C comment inside a '{}' block without matching start of the comment!"
7884 " Maybe the end marker for the block is missing?",
7885 yyextra->docBlockName);
7888 yyextra->docBlock << yytext;
7891 yyextra->docBlock << *yytext;
7895 yyextra->docBlock << *yytext;
7897<DocCopyBlock><<EOF>> {
7898 warn(yyextra->fileName,yyextra->yyLineNr,
7899 "reached end of file while inside a '{}' block!"
7900 " The command that should end the block seems to be missing!",
7901 yyextra->docBlockName);
7908<Prototype>"operator"{B}*"("{B}*")" {
7909 yyextra->current->name+=yytext;
7912 yyextra->current->args+=*yytext;
7913 yyextra->currentArgumentContext = PrototypeQual;
7914 yyextra->fullArgString = yyextra->current->args;
7915 yyextra->copyArgString = &yyextra->current->args;
7916 BEGIN( ReadFuncArgType ) ;
7918<Prototype>"("({ID}"::")*({B}*[&*])+ {
7919 if (yyextra->insidePHP)
7925 yyextra->current->type+=yyextra->current->name+yytext;
7926 yyextra->current->name.clear();
7927 BEGIN( PrototypePtr );
7930<PrototypePtr>{SCOPENAME} {
7931 yyextra->current->name+=yytext;
7934 yyextra->current->args+=*yytext;
7935 yyextra->currentArgumentContext = PrototypeQual;
7936 yyextra->fullArgString = yyextra->current->args;
7937 yyextra->copyArgString = &yyextra->current->args;
7938 BEGIN( ReadFuncArgType ) ;
7941 yyextra->current->type+=
')';
7945 yyextra->current->name+=yytext;
7948 BEGIN( PrototypeSkipLine);
7950<PrototypeQual>{B}*"const"{B}* {
7951 yyextra->current->args +=
" const ";
7952 yyextra->current->argList.setConstSpecifier(
true);
7954<PrototypeQual>{B}*"volatile"{B}* {
7955 yyextra->current->args +=
" volatile ";
7956 yyextra->current->argList.setVolatileSpecifier(
true);
7958<PrototypeQual>{B}*"="{B}*"0"{B}* {
7959 yyextra->current->args +=
" = 0";
7960 yyextra->current->virt = Specifier::Pure;
7961 yyextra->current->argList.setPureSpecifier(
true);
7963<PrototypeQual>"throw"{B}*"(" {
7964 yyextra->current->exception =
"throw(";
7965 BEGIN(PrototypeExc);
7968 yyextra->current->exception +=
')';
7969 BEGIN(PrototypeQual);
7972 yyextra->current->exception += *yytext;
7975 yyextra->current->args += *yytext;
7978 yyextra->current->name += *yytext;
7980<PrototypeSkipLine>. {
7986<SkipCxxComment>.*"\\\n" {
7987 if (yyextra->insideCS)
7996<SkipCxxComment>{ANYopt}/\n {
7997 BEGIN( yyextra->lastCContext ) ;
7999<SkipComment>[^\*\n]+
8004 if (!yyextra->insideCpp) REJECT;
8005 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
8006 yyextra->lastC11AttributeContext = YY_START;
8007 yyextra->pCopyC11AttributeString = &yyextra->current->attributes;
8008 BEGIN( CopyC11Attribute );
8013 if (yyextra->insideIDL && yyextra->insideCppQuote)
8017 else if (yyextra->insidePHP)
8019 yyextra->lastStringContext=YY_START;
8024 if (!yyextra->insidePHP)
8026 yyextra->lastCPPContext = YY_START;
8031 yyextra->lastCContext = YY_START ;
8032 BEGIN( SkipCxxComment ) ;
8036 if (!yyextra->insidePHP)
8038 yyextra->lastCContext = YY_START ;
8039 BEGIN( SkipCxxComment ) ;
8042 if (yyextra->insidePHP)
8044 yyextra->lastStringContext=YY_START;
8045 BEGIN(SkipPHPString);
8049 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
8051 if (yyextra->current->type.empty())
8053 if (yyextra->current->name.empty())
8054 yyextra->current->name=
"?";
8056 yyextra->current->name+=
"?";
8060 yyextra->current->type+=
"?";
8064<*>"}" { yyextra->exported=
false; }
8066<SkipComment>{CPPC}|{CCS}
8067<*>{CCS} { yyextra->lastCContext = YY_START ;
8068 BEGIN( SkipComment ) ;
8070<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
8072 yyextra->lastCContext = YY_START ;
8073 BEGIN( SkipCxxComment ) ;
8076 if (yyextra->insideCS && yyextra->fakeNS)
8080 BEGIN ( ReadNSBody);
8092 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8094 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
8096 *buf = yyextra->inputString[yyextra->inputPosition++] ;
8106 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8107 yyextra->outerScopeEntries.clear();
8108 yyextra->baseName.clear();
8109 yyextra->protection = Protection::Public;
8110 yyextra->baseProt = Protection::Public;
8111 yyextra->sharpCount = 0;
8112 yyextra->roundCount = 0;
8113 yyextra->curlyCount = 0;
8114 yyextra->mtype = MethodTypes::Method;
8115 yyextra->isStatic =
false;
8116 yyextra->virt = Specifier::Normal;
8117 yyextra->baseVirt = Specifier::Normal;
8118 yyextra->isTypedef =
false;
8119 yyextra->insideTryBlock =
false;
8120 yyextra->insideFormula =
false;
8121 yyextra->insideCode=
false;
8123 yyextra->previous = 0;
8124 yyextra->firstTypedefEntry.reset();
8125 yyextra->memspecEntry.reset();
8130 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8131 if (yyextra->insideJava)
8133 yyextra->protection = (yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isEnum()) ? Protection::Public : Protection::Package;
8135 yyextra->current->protection = yyextra->protection;
8136 yyextra->current->exported = yyextra->exported ;
8137 yyextra->current->mtype = yyextra->mtype;
8138 yyextra->current->virt = yyextra->virt;
8139 yyextra->current->isStatic = yyextra->isStatic;
8140 yyextra->current->lang = yyextra->language;
8142 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
8143 yyextra->isTypedef=
false;
8153 char result[md5_sig.size()*3+2];
8156 for (
size_t i=0;i<md5_sig.size();i++)
8158 static const char oct[]=
"01234567";
8159 uint8_t
byte = md5_sig[i];
8160 *p++=oct[(
byte>>6)&7];
8161 *p++=oct[(
byte>>3)&7];
8162 *p++=oct[(
byte>>0)&7];
8170 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8171 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
8173 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,
id);
8179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8182 for (p = yytext ; *p ; ++p )
8186 yyextra->yyLineNr++;
8192 yyextra->column+=tabSize - (yyextra->column%tabSize);
8193 yyextra->yyColNr=1+yyextra->column;
8206 size_t col=startIndent;
8212 if (c==
'\t') col+=tabSize-(col%tabSize);
8213 else if (c==
'\n') col=0;
8221 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8222 yyextra->current->
protection = yyextra->protection = prot;
8223 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
8224 yyextra->current->type.clear();
8225 yyextra->current->name.clear();
8226 yyextra->current->args.clear();
8227 yyextra->current->argList.clear();
8233 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8234 size_t tl=yyextra->current->type.length();
8235 if( tl>0 && !yyextra->current->name.empty() && yyextra->current->type.at(tl-1)!=
'.')
8237 yyextra->current->type +=
' ' ;
8239 yyextra->current->type += yyextra->current->name;
8240 yyextra->current->name.clear() ;
8241 tl=yyextra->current->type.length();
8242 if( tl>0 && !yyextra->current->args.empty() && yyextra->current->type.at(tl-1)!=
'.')
8244 yyextra->current->type +=
' ' ;
8246 yyextra->current->type += yyextra->current->args ;
8247 yyextra->current->args.clear() ;
8248 yyextra->current->argList.clear();
8255 if (s==
nullptr || *s==0)
return name;
8257 if (name.at(0)==
'"' && name.at(name.length()-1)==
'"')
8259 name=name.mid(1,name.length()-2);
8269 bool funcPtr = i>0 && type[i-1]==
')';
8271 while (i>0 && (type[i-1]==
'*' || type[i-1]==
'&' || type[i-1]==
' ')) i--;
8272 if (funcPtr && i>0 && type[i-1]==
'(') i--;
8273 return type.
left(i);
8279 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8282 yyextra->docBlock <<
"\\iskip";
8284 yyextra->docBlockName=blockName;
8285 yyextra->fencedSize=fencedSize;
8286 yyextra->isCodeBlock=codeBlock;
8287 yyextra->nestedComment=0;
8293 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8294 if (yyextra->docBlockName==blockName && (fencedSize==0 || fencedSize==yyextra->fencedSize))
8298 yyextra->docBlock <<
"\\endiskip";
8300 yyextra->docBlockName=
"";
8320 size_t i=name.find(
"operator");
8322 if (i==0 && !
isId(name.at(8)))
return true;
8323 if (i>0 && !
isId(name.at(i-1)) && !
isId(name.at(i+8)))
return true;
8331 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8333 yyextra->insideIDL = yyextra->language==SrcLangExt::IDL;
8334 yyextra->insideJava = yyextra->language==SrcLangExt::Java;
8335 yyextra->insideCS = yyextra->language==SrcLangExt::CSharp;
8336 yyextra->insideD = yyextra->language==SrcLangExt::D;
8337 yyextra->insidePHP = yyextra->language==SrcLangExt::PHP;
8338 yyextra->insideObjC = yyextra->language==SrcLangExt::ObjC;
8339 yyextra->insideJS = yyextra->language==SrcLangExt::JS;
8340 yyextra->insideSlice = yyextra->language==SrcLangExt::Slice;
8341 yyextra->insideCpp = (yyextra->language==SrcLangExt::Cpp ||
8342 yyextra->language==SrcLangExt::Lex);
8353 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8354 if (yyextra->current_root->section.isScope())
8357 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
8359 for (
const ArgumentList &srcAl : yyextra->current_root->tArgLists)
8361 yyextra->current->tArgLists.insert(yyextra->current->tArgLists.begin(),srcAl);
8371 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8372 if (!yyextra->fileName.lower().endsWith(
".c"))
return false;
8373 if (yyextra->current->argList.empty())
return false;
8374 for (
const Argument &a : yyextra->current->argList)
8385 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8386 if (yyextra->insideJava)
8389 yyextra->current->protection = Protection::Public;
8391 yyextra->current->protection = Protection::Protected;
8393 yyextra->current->protection = Protection::Private;
8395 yyextra->current->protection = Protection::Package;
8402 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8403 int si =
static_cast<int>(yyextra->current->args.length());
8404 if (yyextra->oldStyleArgType.empty())
8406 std::string args = yyextra->current->args.str();
8407 static const reg::Ex re(R
"(\([^)]*\).*)");
8413 bi1=(int)match.position();
8414 size_t secondMatchStart = match.position()+match.length();
8417 bi2=(int)match.position();
8421 if (bi1!=-1 && bi2!=-1)
8424 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8426 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8427 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8429 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8430 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8431 yyextra->oldStyleArgType+=yyextra->current->args.
mid(i);
8436 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8439 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8440 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8442 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8443 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8449 while (i>=0 &&
isId(yyextra->current->args.at(i))) i--;
8452 while (i>=0 && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i--;
8456 yyextra->oldStyleArgType=yyextra->current->args.left(i);
8457 oldStyleArgPtr=yyextra->current->args.
mid(i,j-i);
8470 while (j<l && ((c=yyextra->current->args.at(j))==
'*' || isspace((uint8_t)c))) j++;
8473 oldStyleArgPtr=yyextra->current->args.
left(j);
8492 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8493 for (
Argument &a : yyextra->current->argList)
8499 a.
name=name.stripWhiteSpace();
8502 a.
docs=brief+
"\n\n"+docs;
8504 else if (!brief.
empty())
8534 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8537 yyextra->current->briefFile = yyextra->fileName;
8538 yyextra->current->briefLine = yyextra->yyLineNr;
8542 yyextra->current->docFile = yyextra->fileName;
8543 yyextra->current->docLine = yyextra->yyLineNr;
8551 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8552 if (yyextra->tempEntry==0)
8557 yyextra->previous = yyextra->current;
8558 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8562 yyextra->previous = yyextra->current;
8563 yyextra->current = yyextra->tempEntry;
8564 yyextra->tempEntry.reset();
8571 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8574 if (yyextra->docBlockInBody && hideInBodyDocs)
return;
8575 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
8578 std::shared_ptr<Entry> docEntry = yyextra->docBlockInBody && yyextra->previous ? yyextra->previous : yyextra->current;
8579 if (yyextra->docBlockInBody && docEntry && docEntry->inbodyLine==-1)
8581 docEntry->inbodyFile = yyextra->fileName;
8582 docEntry->inbodyLine = lineNr;
8586 bool needsEntry=
false;
8588 Markdown markdown(yyextra->fileName,lineNr);
8591 while (yyextra->commentScanner.parseCommentBlock(
8592 yyextra->thisParser,
8593 yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(),
8597 yyextra->docBlockInBody ?
false : brief,
8598 yyextra->docBlockInBody ?
false : yyextra->docBlockAutoBrief,
8599 yyextra->docBlockInBody,
8600 yyextra->protection,
8611 DString docFile = yyextra->current->docFile;
8613 yyextra->current->docFile = docFile;
8614 yyextra->current->docLine = lineNr;
8622 if (yyextra->docBlockTerm)
8624 unput(yyextra->docBlockTerm);
8625 yyextra->docBlockTerm=0;
8632 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8643 DString orgDoc = yyextra->current->doc;
8644 DString orgBrief = yyextra->current->brief;
8645 int orgDocLine = yyextra->current->docLine;
8646 int orgBriefLine = yyextra->current->briefLine;
8648 yyextra->current->doc.
clear();
8649 yyextra->current->brief.clear();
8652 int lineNr = orgDocLine;
8654 Markdown markdown(yyextra->fileName,lineNr);
8657 while (yyextra->commentScanner.parseCommentBlock(
8658 yyextra->thisParser,
8659 yyextra->current.get(),
8666 yyextra->protection,
8675 if (needsEntry)
newEntry(yyscanner);
8681 a.
docs = yyextra->current->doc;
8684 yyextra->current->doc = orgDoc;
8685 yyextra->current->brief = orgBrief;
8686 yyextra->current->docLine = orgDocLine;
8687 yyextra->current->briefLine = orgBriefLine;
8698 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8699 for (
const auto &ce : rt->children())
8701 if (!ce->program.empty())
8705 yyextra->padCount=0;
8707 yyextra->programStr = ce->program.str();
8708 yyextra->inputString = yyextra->programStr.data();
8709 yyextra->inputPosition = 0;
8710 if (ce->section.isEnum() || ce->spec.isEnum())
8711 BEGIN( FindFields ) ;
8713 BEGIN( FindMembers ) ;
8714 yyextra->current_root = ce;
8715 yyextra->fileName = ce->fileName;
8717 yyextra->yyLineNr = ce->bodyLine;
8718 yyextra->yyColNr = ce->bodyColumn;
8719 yyextra->insideObjC = ce->lang==SrcLangExt::ObjC;
8721 yyextra->current = std::make_shared<Entry>();
8722 yyextra->isStatic =
false;
8727 if (autoGroupNested && !rt->groups.empty() && !ce->section.isEnum() && !ce->spec.isEnum())
8729 ce->groups = rt->groups;
8732 size_t ni=ce->name.rfind(
"::");
8735 if ( ce->section.isClass() )
8737 if (yyextra->insidePHP || yyextra->insideD || yyextra->insideJS || yyextra->insideIDL || yyextra->insideSlice)
8739 yyextra->current->protection = yyextra->protection = Protection::Public ;
8741 else if (yyextra->insideJava)
8743 yyextra->current->protection = yyextra->protection = (ce->spec.isInterface() || ce->spec.isEnum()) ? Protection::Public : Protection::Package;
8745 else if (ce->spec.isInterface() || ce->spec.isRef() || ce->spec.isValue() || ce->spec.isStruct() || ce->spec.isUnion())
8747 if (ce->lang==SrcLangExt::ObjC)
8749 yyextra->current->protection = yyextra->protection = Protection::Protected ;
8751 else if (!ce->name.empty() && ce->name.at(ni)==
'@' && (ce->spec.isStruct() || ce->spec.isUnion()))
8755 yyextra->current->protection = yyextra->protection = ce->protection;
8759 yyextra->current->protection = yyextra->protection = Protection::Public ;
8764 yyextra->current->protection = yyextra->protection = Protection::Private ;
8767 else if (ce->section.isEnum() )
8769 yyextra->current->protection = yyextra->protection = ce->protection;
8771 else if (!ce->name.empty() && ce->name.at(ni)==
'@')
8773 if (ce->section.isNamespace() )
8775 yyextra->current->isStatic = yyextra->isStatic =
true;
8777 yyextra->current->protection = yyextra->protection = ce->protection;
8778 yyextra->current->exported = yyextra->exported =
false;
8780 else if (ce->section.isNamespace() )
8782 yyextra->current->protection = yyextra->protection = Protection::Public ;
8783 yyextra->current->exported = yyextra->exported = ce->exported;
8787 yyextra->current->protection = yyextra->protection = Protection::Public ;
8788 yyextra->current->exported = yyextra->exported =
false;
8790 yyextra->mtype = MethodTypes::Method;
8791 yyextra->virt = Specifier::Normal;
8798 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
8800 scannerYYlex(yyscanner);
8803 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
8805 yyextra->programStr.clear();
8806 ce->program.str(std::string());
8820 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8821 for (
const auto &ce : rt->children())
8823 if (ce->section.isConcept())
8827 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8829 yyextra->padCount =0;
8831 yyextra->programStr = ce->initializer.str();
8832 yyextra->inputString = yyextra->programStr.data();
8833 yyextra->inputPosition = 0;
8834 yyextra->current_root = ce;
8835 yyextra->fileName = ce->fileName;
8836 yyextra->yyLineNr = ce->bodyLine;
8837 yyextra->yyColNr = ce->bodyColumn;
8838 yyextra->insideObjC =
false;
8839 yyextra->current = std::make_shared<Entry>();
8843 indent.
fill(
' ',ce->startColumn?ce->startColumn-1:0);
8845 if (!ce->args.empty())
8847 templArgs=indent+
"template"+ce->args+
"\n";
8849 yyextra->current->initializer.
str(
DString(templArgs+indent+
"concept "+ce->name+
" =").
str());
8851 yyextra->isStatic =
false;
8853 yyextra->current->section = EntryType::makeConceptCodePart();
8854 yyextra->current->startLine = yyextra->yyLineNr;
8855 BEGIN( FindConceptParts );
8856 scannerYYlex(yyscanner);
8857 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8868 const char *fileBuf,
8869 const std::shared_ptr<Entry> &rt,
8873 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8876 yyextra->inputString = fileBuf;
8877 yyextra->inputPosition = 0;
8878 yyextra->column = 0;
8879 scannerYYrestart(
nullptr,yyscanner);
8882 yyextra->protection = Protection::Public;
8883 yyextra->mtype = MethodTypes::Method;
8884 yyextra->isStatic =
false;
8885 yyextra->exported =
false;
8886 yyextra->virt = Specifier::Normal;
8887 yyextra->current_root = rt;
8888 yyextra->yyLineNr = 1 ;
8889 yyextra->yyBegLineNr = 1;
8890 yyextra->yyBegColNr = 0;
8891 yyextra->anonCount = 0;
8892 yyextra->anonNSCount = 0;
8893 yyextra->fileName = fileName;
8894 yyextra->clangParser = clangParser;
8896 rt->lang = yyextra->language;
8897 msg(
"Parsing file {}...\n",yyextra->fileName);
8899 yyextra->current_root = rt;
8901 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
8902 yyextra->current = std::make_shared<Entry>();
8907 yyextra->current->name = yyextra->fileName;
8908 yyextra->current->section = sec;
8909 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8911 yyextra->current->reset();
8913 if ( yyextra->insidePHP )
8915 BEGIN( FindMembersPHP );
8917 else if ( yyextra->insideJava )
8919 yyextra->current->name=
"java::lang";
8920 yyextra->current->fileName = yyextra->fileName;
8921 yyextra->current->section = EntryType::makeUsingDir();
8922 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8924 BEGIN( FindMembers );
8928 BEGIN( FindMembers );
8931 scannerYYlex(yyscanner);
8933 if (YY_START==Comment)
8935 warn(yyextra->fileName,yyextra->yyLineNr,
"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
8939 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
8941 yyextra->programStr.clear();
8942 rt->program.str(std::string());
8947 yyextra->anonNSCount++;
8950 for (
auto &[
parent,child]: yyextra->outerScopeEntries)
8953 parent->moveToSubEntryAndKeep(child);
8955 yyextra->outerScopeEntries.clear();
8964 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8967 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
8970 if (!yyextra->current)
8975 const char *orgInputString;
8976 int orgInputPosition;
8977 YY_BUFFER_STATE orgState;
8980 orgState = YY_CURRENT_BUFFER;
8981 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
8982 orgInputString = yyextra->inputString;
8983 orgInputPosition = yyextra->inputPosition;
8986 yyextra->inputString = text.
data();
8987 yyextra->inputPosition = 0;
8988 yyextra->column = 0;
8989 scannerYYrestart(
nullptr, yyscanner);
8991 scannerYYlex(yyscanner);
8993 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
8994 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.empty())
8996 yyextra->current->section = EntryType::makeVariableDoc();
9000 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
9001 yy_switch_to_buffer(orgState, yyscanner);
9002 yyextra->inputString = orgInputString;
9003 yyextra->inputPosition = orgInputPosition;
9019 scannerYYlex_init_extra(&
p->state,&
p->yyscanner);
9027 scannerYYlex_destroy(
p->yyscanner);
9031 const char *fileBuf,
9032 const std::shared_ptr<Entry> &root,
9036 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
9037 yyextra->thisParser =
this;
9041 ::parseMain(
p->yyscanner,fileName,fileBuf,root,clangParser);
9049 return (SrcLangExt::Cpp == lang) || (SrcLangExt::Lex == lang) ||
9050 !( fe==
".java" || fe==
".as" || fe==
".d" || fe==
".php" ||
9051 fe==
".php4" || fe==
".inc" || fe==
".phtml"|| fe==
".php5"
9062#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)
Protection protection
class protection
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)