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}"record"{BN}* |
1716<FindMembers>{B}*{TYPEDEFPREFIX}"struct{" |
1717<FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ {
1730 yyextra->current->section = EntryType::makeClass() ;
1736 setPublished(spec.isPublished()).
1737 setInline(spec.isInline()).
1738 setLocal(spec.isLocal());
1744 setPublished(spec.isPublished()).
1745 setInline(spec.isInline()).
1746 setLocal(spec.isLocal());
1753 yyextra->current->type +=
" const";
1755 else if (isVolatile)
1757 yyextra->current->type +=
" volatile";
1759 yyextra->current->type +=
" struct" ;
1761 yyextra->current->fileName = yyextra->fileName;
1762 yyextra->current->startLine = yyextra->yyLineNr;
1763 yyextra->current->startColumn = yyextra->yyColNr;
1764 yyextra->current->bodyLine = yyextra->yyLineNr;
1765 yyextra->current->bodyColumn = yyextra->yyColNr;
1767 if (yytext[yyleng-1]==
'{') unput(
'{');
1768 BEGIN( CompoundName ) ;
1770<FindMembers>{B}*"value struct{" |
1771<FindMembers>{B}*"value struct"{BN}+ {
1772 yyextra->isTypedef=
false;
1773 yyextra->current->section = EntryType::makeClass();
1774 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setValue(
true);
1776 yyextra->current->type +=
" value struct" ;
1777 yyextra->current->fileName = yyextra->fileName;
1778 yyextra->current->startLine = yyextra->yyLineNr;
1779 yyextra->current->startColumn = yyextra->yyColNr;
1780 yyextra->current->bodyLine = yyextra->yyLineNr;
1781 yyextra->current->bodyColumn = yyextra->yyColNr;
1783 if (yytext[yyleng-1]==
'{') unput(
'{');
1784 BEGIN( CompoundName ) ;
1786<FindMembers>{B}*"ref struct{" |
1787<FindMembers>{B}*"ref struct"{BN}+ {
1788 yyextra->isTypedef=
false;
1789 yyextra->current->section = EntryType::makeClass();
1790 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setRef(
true);
1792 yyextra->current->type +=
" ref struct" ;
1793 yyextra->current->fileName = yyextra->fileName;
1794 yyextra->current->startLine = yyextra->yyLineNr;
1795 yyextra->current->startColumn = yyextra->yyColNr;
1796 yyextra->current->bodyLine = yyextra->yyLineNr;
1797 yyextra->current->bodyColumn = yyextra->yyColNr;
1799 if (yytext[yyleng-1]==
'{') unput(
'{');
1800 BEGIN( CompoundName ) ;
1802<FindMembers>{B}*"interface struct{" |
1803<FindMembers>{B}*"interface struct"{BN}+ {
1804 yyextra->isTypedef=
false;
1805 yyextra->current->section = EntryType::makeClass();
1806 yyextra->current->spec =
TypeSpecifier().setStruct(
true).setInterface(
true);
1808 yyextra->current->type +=
" interface struct";
1809 yyextra->current->fileName = yyextra->fileName;
1810 yyextra->current->startLine = yyextra->yyLineNr;
1811 yyextra->current->startColumn = yyextra->yyColNr;
1812 yyextra->current->bodyLine = yyextra->yyLineNr;
1813 yyextra->current->bodyColumn = yyextra->yyColNr;
1815 if (yytext[yyleng-1]==
'{') unput(
'{');
1816 BEGIN( CompoundName ) ;
1818<FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
1819<FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ {
1820 if (yyextra->insideJava) REJECT;
1825 yyextra->current->section = EntryType::makeClass();
1832 yyextra->current->type +=
" const";
1834 else if (isVolatile)
1836 yyextra->current->type +=
" volatile";
1838 yyextra->current->type +=
" union" ;
1839 yyextra->current->fileName = yyextra->fileName;
1840 yyextra->current->startLine = yyextra->yyLineNr;
1841 yyextra->current->startColumn = yyextra->yyColNr;
1842 yyextra->current->bodyLine = yyextra->yyLineNr;
1843 yyextra->current->bodyColumn = yyextra->yyColNr;
1845 if (yytext[yyleng-1]==
'{') unput(
'{');
1846 BEGIN( CompoundName ) ;
1848<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
1849<FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ {
1854 if (yyextra->insideJava)
1856 yyextra->current->section = EntryType::makeClass();
1862 yyextra->current->section = EntryType::makeEnum() ;
1865 yyextra->current->type +=
" enum";
1868 yyextra->current->spec.setStrong(
true);
1872 yyextra->current->spec.setStrong(
true).setEnumStruct(
true);
1874 yyextra->current->fileName = yyextra->fileName;
1875 yyextra->current->startLine = yyextra->yyLineNr;
1876 yyextra->current->startColumn = yyextra->yyColNr;
1877 yyextra->current->bodyLine = yyextra->yyLineNr;
1878 yyextra->current->bodyColumn = yyextra->yyColNr;
1880 if (yytext[yyleng-1]==
'{') unput(
'{');
1881 BEGIN( CompoundName ) ;
1883<FindMembers>{B}*"concept"{BN}+ {
1884 if (yyextra->insideJava) REJECT;
1885 yyextra->isTypedef=
false;
1886 yyextra->current->section = EntryType::makeConcept();
1888 yyextra->current->type +=
" concept";
1889 yyextra->current->fileName = yyextra->fileName;
1890 yyextra->current->startLine = yyextra->yyLineNr;
1891 yyextra->current->startColumn = yyextra->yyColNr;
1892 yyextra->current->bodyLine = yyextra->yyLineNr;
1893 yyextra->current->bodyColumn = yyextra->yyColNr;
1894 yyextra->current->args = yyextra->fullArgString;
1895 yyextra->keepComment =
true;
1897 BEGIN( ConceptName ) ;
1899<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" {
1901 yyextra->current->name +=
"()";
1902 BEGIN( FindMembers );
1904<Operator>"("{BN}*")"{BNopt}/("[["[^\]]*"]]"){BNopt}"(" {
1906 yyextra->current->name += yytext ;
1907 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1908 BEGIN( FindMembers ) ;
1910<Operator>"("{BN}*")"{BNopt}/"(" {
1912 yyextra->current->name += yytext ;
1913 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1914 BEGIN( FindMembers ) ;
1918 BEGIN( FindMembers ) ;
1922 yyextra->current->name += *yytext ;
1924<Operator>"<"({B}*{ID}{B}*(","{B}*{BN})*{B}*)?">" {
1925 if (!yyextra->current->type.startsWith(
"friend "))
1927 yyextra->current->name += yytext;
1931 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
1933 BEGIN( FindMembers ) ;
1935<FindMembers>("template"|"generic")({BN}*)"<"/[>]? {
1938 yyextra->current->tArgLists.
push_back(al);
1939 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
1940 yyextra->templateStr=
"<";
1941 yyextra->fullArgString = yyextra->templateStr;
1942 yyextra->copyArgString = &yyextra->templateStr;
1943 yyextra->currentArgumentContext = FindMembers;
1944 BEGIN( ReadTempArgs );
void push_back(const Argument &a)
1946<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" {
1947 if (yyextra->insideJava) REJECT;
1949 BEGIN( NSAliasName );
1952 yyextra->aliasName = yytext;
1953 BEGIN( NSAliasArg );
1955<NSAliasArg>({ID}"::")*{ID} {
1957 std::string ctx = yyextra->current_root->name.str();
static NamespaceAliasInfoMap namespaceAliasMap
1968 BEGIN( FindMembers );
1970<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
1972 yyextra->aliasName=yytext;
1975<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
1979 yyextra->current->fileName = yyextra->fileName;
1981 yyextra->current->section = EntryType::makeUsingDecl();
1982 yyextra->current_root->copyToSubEntry(yyextra->current);
1984 yyextra->current->section = EntryType::makeUsingDir();
1985 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1987 yyextra->aliasName.clear();
DString removeRedundantWhiteSpace(const DString &s)
1989<PHPUseAs>{BN}+"as"{BN}+ {
1992<PHPUseAs>{PHPUSEKW} {
1996 if (!yyextra->aliasName.empty())
2001 yyextra->aliasName.clear();
const std::string & str() const
2003<PHPUse,PHPUseAs>[,;] {
2013<JavaImport>({ID}{BN}*"."{BN}*)+"*" {
2017 yyextra->current->fileName = yyextra->fileName;
2024 yyextra->current->section = EntryType::makeUsingDir();
2025 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.
2029<JavaImport>({ID}{BN}*"."{BN}*)+{ID} {
2033 yyextra->current->fileName = yyextra->fileName;
2045 if (yyextra->insideD)
2047 yyextra->current->section = EntryType::makeUsingDir();
2052 yyextra->current->section = EntryType::makeUsingDecl();
2054 yyextra->previous = yyextra->current;
2055 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
virtual const DString & docName() const =0
virtual void addIncludedByDependency(const FileDef *fd, const DString &incName, IncludeKind kind)=0
2059<IDLImport>"\""[^"]*"\"" {
2060 DString fileName(&yytext[1],yyleng-2);
2076<FindMembers>"using"{BN}+/("::"{ID}("::"{ID})*)? {
2077 if (yyextra->insideJava) REJECT;
2078 yyextra->current->startLine=yyextra->yyLineNr;
2079 yyextra->current->startColumn = yyextra->yyColNr;
2083<Using>"namespace"{BN}+ {
lineCount(yyscanner); BEGIN(UsingDirective); }
2084<Using>("::")?({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}|{FUNCOP}) {
2086 yyextra->current->name=yytext;
2087 yyextra->current->fileName = yyextra->fileName;
2088 yyextra->current->section = EntryType::makeUsingDecl();
2089 yyextra->current->startLine = yyextra->yyLineNr;
2090 yyextra->usingNewVarNeeded =
true;
2091 if (yyextra->insideCS)
2096 yyextra->current->name=yytext;
2097 yyextra->current->fileName = yyextra->fileName;
2098 yyextra->current->startLine = yyextra->yyLineNr;
2099 yyextra->current->startColumn = yyextra->yyColNr;
2100 yyextra->current->section = EntryType::makeUsingDir();
2101 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2106<Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}){BN}*"=" {
2108 yyextra->current->fileName = yyextra->fileName;
2109 yyextra->current->section = EntryType::makeUsingDecl();
2110 yyextra->current->startLine = yyextra->yyLineNr;
2111 yyextra->current->bodyLine = yyextra->yyLineNr;
2112 yyextra->current->bodyColumn = yyextra->yyColNr;
2113 yyextra->lastInitializerContext = UsingAlias;
2114 yyextra->sharpCount=0;
2115 yyextra->initBracketCount=0;
2117 BEGIN(ReadInitializer);
2120 if (yyextra->usingNewVarNeeded)
2122 yyextra->previous = yyextra->current;
2123 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2125 yyextra->usingNewVarNeeded =
false;
2130 yyextra->lastInitializerContext = UsingAlias;
2131 yyextra->sharpCount=0;
2132 yyextra->initBracketCount=0;
2134 yyextra->usingNewVarNeeded =
false;
2135 BEGIN(ReadInitializer);
2138 yyextra->lastCContext = YY_START ;
2139 BEGIN( SkipComment ) ;
2142 yyextra->lastCContext = YY_START ;
2143 BEGIN( SkipCxxComment ) ;
2147 if (yyextra->usingNewVarNeeded)
2149 yyextra->previous = yyextra->current;
2150 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2152 yyextra->usingNewVarNeeded =
false;
2156 yyextra->current->section = EntryType::makeVariable();
2157 DString init = yyextra->current->initializer.str();
2158 init.stripPrefix(
"class ");
2159 init.stripPrefix(
"struct ");
2161 yyextra->current->type =
"typedef "+
init;
2162 yyextra->current->args.clear();
2163 yyextra->current->spec.setAlias(
true);
2164 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2169 yyextra->current->initializer << yytext;
2172 yyextra->current->initializer << yytext;
2176 yyextra->current->fileName = yyextra->fileName;
2177 yyextra->current->section = EntryType::makeUsingDir();
2178 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2180 yyextra->usingNewVarNeeded =
false;
2183<FindMembers>{SCOPENAME}{BN}*"<>" {
2188<FindMembers>{SCOPENAME}{BNopt}/"<" {
2190 if (yyextra->insideCpp && name==
"import") REJECT;
2191 yyextra->roundCount=0;
2192 yyextra->sharpCount=0;
2195 yyextra->current->name=
name;
2201 BEGIN( EndTemplate );
2203<FindMemberName>{SCOPENAME}{BNopt}/"<" {
2204 yyextra->sharpCount=0;
2205 yyextra->roundCount=0;
2213 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...
2216 if (!yyextra->insidePHP)
2222 yyextra->lastHereDocContext = YY_START;
2226<ClassTemplSpec,EndTemplate>("<<"|"<=") {
2227 yyextra->current->name+=yytext;
2231 if (yyextra->roundCount==0)
2234 yyextra->sharpCount++;
2236 yyextra->current->name+=yytext;
2238<ClassTemplSpec,EndTemplate>">=" {
2239 yyextra->current->name+=yytext;
2241<ClassTemplSpec,EndTemplate>(">>") {
2242 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
2250 yyextra->current->name+=yytext;
2255 yyextra->current->name+=
'>';
2257 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2259 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
2264<EndTemplate>">"{BN}*"(" {
2266 yyextra->current->name+=
'>';
2268 if (yyextra->roundCount==0)
2270 --yyextra->sharpCount;
2272 if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
2274 yyextra->current->bodyLine = yyextra->yyLineNr;
2275 yyextra->current->bodyColumn = yyextra->yyColNr;
2276 yyextra->current->args =
"(";
2277 yyextra->currentArgumentContext = FuncQual;
2278 yyextra->fullArgString = yyextra->current->args;
2279 yyextra->copyArgString = &yyextra->current->args;
2281 BEGIN( ReadFuncArgType ) ;
2285 yyextra->current->name+=
"(";
2286 yyextra->roundCount++;
2289<EndTemplate>">"{BNopt}/"("({BN}*{TSCOPE}{BN}*"::")*({BN}*"*"{BN}*)+ {
2291 yyextra->current->name+=
'>';
2292 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2297<EndTemplate>">"{BNopt}/"::" {
2299 yyextra->current->name+=
'>';
2301 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
2303 BEGIN(FindMemberName);
2306<ClassTemplSpec,EndTemplate>"(" { yyextra->current->name+=*yytext;
2307 yyextra->roundCount++;
2309<ClassTemplSpec,EndTemplate>")" { yyextra->current->name+=*yytext;
2310 if (yyextra->roundCount>0) yyextra->roundCount--;
2313 yyextra->current->name+=*yytext;
2316<FindMembers>"define"{BN}*"("{BN}*["'] {
2317 if (yyextra->insidePHP)
2319 yyextra->current->bodyLine = yyextra->yyLineNr;
2320 yyextra->current->bodyColumn = yyextra->yyColNr;
2327 yyextra->delimiter = yytext;
2328 *yyextra->pCopyHereDocGString << yytext;
2329 BEGIN(CopyHereDocEnd);
2331<CopyHereDoc>"\""{ID}/"\"" {
2332 yyextra->delimiter = &yytext[1];
2333 *yyextra->pCopyHereDocGString << yytext;
2334 BEGIN(CopyHereDocEnd);
2336<CopyHereDoc>"'"{ID}/"'" {
2337 yyextra->delimiter = &yytext[1];
2338 *yyextra->pCopyHereDocGString << yytext;
2339 BEGIN(CopyHereDocEnd);
2342 yyextra->delimiter = yytext;
2345<HereDoc>"\""{ID}/"\"" {
2346 yyextra->delimiter = &yytext[1];
2349<HereDoc>"'"{ID}/"'" {
2350 yyextra->delimiter = &yytext[1];
2353<HereDocEnd>^{Bopt}{ID} {
2356 BEGIN(yyextra->lastHereDocContext);
2360<CopyHereDocEnd>^{Bopt}{ID} {
2361 *yyextra->pCopyHereDocGString << yytext;
2364 BEGIN(yyextra->lastHereDocContext);
2369 *yyextra->pCopyHereDocGString << yytext;
2371<CopyHereDocEnd>{ID} {
2372 *yyextra->pCopyHereDocGString << yytext;
2375 *yyextra->pCopyHereDocGString << yytext;
2377<FindMembers>"Q_OBJECT"|"Q_GADGET" {
2379<FindMembers>"Q_PROPERTY" {
2380 yyextra->yyBegLineNr = yyextra->yyLineNr;
2381 yyextra->yyBegColNr = yyextra->yyColNr;
2382 yyextra->current->protection = Protection::Public ;
2383 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
2384 yyextra->current->type.clear();
2394 yyextra->current->name+=yytext;
2397 yyextra->current->type+= yyextra->current->name;
2398 yyextra->current->type+= yytext;
2399 yyextra->current->name=
"";
2401<QtPropType>({TSCOPE}"::")*{TSCOPE} {
2402 yyextra->current->type+= yyextra->current->name;
2403 yyextra->current->name=yytext;
2405<QtPropType,QtPropAttr>{BN}+"READ"{BN}+ {
2406 yyextra->current->spec.setReadable(
true);
2409<QtPropType,QtPropAttr>{BN}+"WRITE"{BN}+ {
2410 yyextra->current->spec.setWritable(
true);
2413<QtPropType,QtPropAttr>{BN}+"MEMBER"{BN}+{ID} |
2414<QtPropType,QtPropAttr>{BN}+"RESET"{BN}+{ID} |
2415<QtPropType,QtPropAttr>{BN}+"SCRIPTABLE"{BN}+{ID} |
2416<QtPropType,QtPropAttr>{BN}+"DESIGNABLE"{BN}+{ID} |
2417<QtPropType,QtPropAttr>{BN}+"NOTIFY"{BN}+{ID} |
2418<QtPropType,QtPropAttr>{BN}+"REVISION"{BN}+{ID} |
2419<QtPropType,QtPropAttr>{BN}+"STORED"{BN}+{ID} |
2420<QtPropType,QtPropAttr>{BN}+"USER"{BN}+{ID} |
2421<QtPropType,QtPropAttr>{BN}+"CONSTANT"{BN} |
2422<QtPropType,QtPropAttr>{BN}+"FINAL"{BN} {
2426 yyextra->current->read = yytext;
2430 yyextra->current->write = yytext;
2433<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
2434 yyextra->current->name=yytext;
2438<FindMembers>"requires" {
2439 if (yyextra->insideJava) REJECT;
2440 yyextra->current->req.clear();
2441 yyextra->requiresContext = YY_START;
2442 BEGIN(RequiresClause);
2444<RequiresClause>"requires"{BN}*/"{" {
2445 if (yyextra->insideJava) REJECT;
2447 yyextra->current->req+=yytext;
2448 BEGIN( RequiresExpression ) ;
2450<RequiresClause>"requires"{BN}*"(" {
2451 if (yyextra->insideJava) REJECT;
2453 yyextra->current->req+=yytext;
2454 yyextra->lastRoundContext=RequiresExpression;
2455 yyextra->pCopyRoundString=&yyextra->current->req;
2456 yyextra->roundCount=0;
2457 BEGIN( CopyRound ) ;
2459<RequiresExpression>"{" {
2460 yyextra->current->req+=yytext;
2461 yyextra->lastCurlyContext=RequiresClause;
2462 yyextra->pCopyCurlyString=&yyextra->current->req;
2463 yyextra->curlyCount=0;
2464 BEGIN( CopyCurly ) ;
2466<RequiresExpression>\n {
2467 yyextra->current->req+=
' ';
2470<RequiresExpression>. {
2471 yyextra->current->req+=yytext;
2473<RequiresClause>"(" {
2474 yyextra->current->req+=yytext;
2475 yyextra->lastRoundContext=RequiresClause;
2476 yyextra->pCopyRoundString=&yyextra->current->req;
2477 yyextra->roundCount=0;
2478 BEGIN( CopyRound ) ;
2480<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"(" {
2484 yyextra->current->req+=yytext;
2485 yyextra->lastRoundContext=RequiresClause;
2486 yyextra->pCopyRoundString=&yyextra->current->req;
2487 yyextra->roundCount=0;
2495<RequiresClause>{NOTopt}{SCOPENAME}{BNopt}"<" {
2499 yyextra->current->req+=yytext;
2500 yyextra->lastSharpContext=RequiresClause;
2501 yyextra->pCopySharpString=&yyextra->current->req;
2502 yyextra->sharpCount=0;
2510<RequiresClause>{NOTopt}{SCOPENAME} {
2514 yyextra->current->req=yytext;
2515 BEGIN(yyextra->requiresContext);
2522<RequiresClause>{NOTopt}"::"{ID} {
2524 yyextra->current->req+=yytext;
2526<RequiresClause>"||"|"&&"|"!"|("or"{BN}+)|("and"{BN}+)|("not"{BN}+) {
2528 yyextra->current->req+=yytext;
2530<RequiresClause>{BN}+ {
2531 yyextra->current->req+=
' ';
2536 yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
2537 BEGIN(yyextra->requiresContext);
2539<FindMembers,FindMemberName>{SCOPENAME} {
2541 yyextra->yyBegColNr=yyextra->yyColNr;
2542 yyextra->yyBegLineNr=yyextra->yyLineNr;
2544 if (yyextra->insideIDL && yyleng==9 &&
dstrcmp(yytext,
"cpp_quote")==0)
2548 else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 &&
dstrcmp(yytext,
"import")==0)
2550 if (yyextra->insideIDL)
2555 else if (yyextra->insidePHP &&
dstrcmp(yytext,
"use")==0)
2559 else if (yyextra->insideJava &&
dstrcmp(yytext,
"package")==0)
2564 else if (yyextra->insideIDL &&
dstrcmp(yytext,
"case")==0)
2566 BEGIN(IDLUnionCase);
2568 else if (yyextra->insideTryBlock &&
dstrcmp(yytext,
"catch")==0)
2570 yyextra->insideTryBlock=
false;
2571 BEGIN(TryFunctionBlock);
2573 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"alignas")==0)
2575 yyextra->lastAlignAsContext = YY_START;
2578 else if (yyextra->insideJS &&
dstrcmp(yytext,
"var")==0)
2580 yyextra->current->type=
"var";
2582 else if (yyextra->insideJS &&
dstrcmp(yytext,
"function")==0)
2584 yyextra->current->type=
"function";
2586 else if (yyextra->insideCS &&
dstrcmp(yytext,
"this")==0)
2590 yyextra->current->name=
"this";
2593 else if (yyextra->insideCpp && (
dstrcmp(yytext,
"static_assert")==0 ||
dstrcmp(yytext,
"_Static_assert")==0))
2596 BEGIN(StaticAssert);
2598 else if (yyextra->insideCpp &&
dstrcmp(yytext,
"decltype")==0)
2602 if (!yyextra->current->type.empty()) yyextra->current->type+=
' ';
2603 yyextra->current->type+=yytext;
2606 else if (yyextra->insideSlice &&
dstrcmp(yytext,
"optional")==0)
2608 if (yyextra->current->type.empty())
2610 yyextra->current->type =
"optional";
2614 yyextra->current->type +=
" optional";
2616 yyextra->lastModifierContext = YY_START;
2617 BEGIN(SliceOptional);
2621 if (YY_START==FindMembers)
2625 bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
2626 if (javaLike &&
dstrcmp(yytext,
"public")==0)
2628 yyextra->current->protection = Protection::Public;
2630 else if (javaLike &&
dstrcmp(yytext,
"protected")==0)
2632 yyextra->current->protection = Protection::Protected;
2634 else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) &&
dstrcmp(yytext,
"internal")==0)
2637 if (!(yyextra->insideCS && yyextra->current->protection==Protection::Protected))
2639 yyextra->current->protection = Protection::Package;
2642 else if (javaLike &&
dstrcmp(yytext,
"private")==0)
2644 yyextra->current->protection = Protection::Private;
2646 else if (yyextra->insideCS && YY_START==FindMembers &&
dstrcmp(yytext,
"new")==0)
2649 yyextra->current->spec.setNew(
true);
2651 else if (javaLike &&
dstrcmp(yytext,
"static")==0)
2653 if (YY_START==FindMembers)
2654 yyextra->current->name = yytext;
2656 yyextra->current->name += yytext;
2657 yyextra->current->isStatic =
true;
2661 if (YY_START==FindMembers)
2662 yyextra->current->name = yytext;
2664 yyextra->current->name += yytext;
2665 if (yyextra->current->name.startsWith(
"static "))
2667 yyextra->current->isStatic =
true;
2668 yyextra->current->name= yyextra->current->name.mid(7);
2670 else if (yyextra->current->name.startsWith(
"inline "))
2672 if (yyextra->current->type.empty())
2674 yyextra->current->type=
"inline";
2678 yyextra->current->type+=
"inline ";
2680 yyextra->current->name= yyextra->current->name.mid(7);
2682 else if (yyextra->current->name.startsWith(
"constexpr "))
2684 if (yyextra->current->type.empty())
2686 yyextra->current->type=
"constexpr";
2690 yyextra->current->type+=
"constexpr ";
2692 yyextra->current->name=yyextra->current->name.mid(10);
2694 else if (yyextra->current->name.startsWith(
"consteval "))
2696 if (yyextra->current->type.empty())
2698 yyextra->current->type=
"consteval";
2702 yyextra->current->type+=
"consteval ";
2704 yyextra->current->name=yyextra->current->name.mid(10);
2706 else if (yyextra->current->name.startsWith(
"constinit "))
2708 if (yyextra->current->type.empty())
2710 yyextra->current->type=
"constinit";
2714 yyextra->current->type+=
"constinit ";
2716 yyextra->current->name=yyextra->current->name.mid(10);
2718 else if (yyextra->current->name.startsWith(
"const "))
2720 if (yyextra->current->type.empty())
2722 yyextra->current->type=
"const";
2726 yyextra->current->type+=
"const ";
2728 yyextra->current->name=yyextra->current->name.mid(6);
2730 else if (yyextra->current->name.startsWith(
"volatile "))
2732 if (yyextra->current->type.empty())
2734 yyextra->current->type=
"volatile";
2738 yyextra->current->type+=
"volatile ";
2740 yyextra->current->name=yyextra->current->name.mid(9);
2742 else if (yyextra->current->name.startsWith(
"typedef "))
2744 if (yyextra->current->type.empty())
2746 yyextra->current->type=
"typedef";
2750 yyextra->current->type+=
"typedef ";
2752 yyextra->current->name=yyextra->current->name.mid(8);
2762 yyextra->externLinkage=
false;
2766 yyextra->current->name = yyextra->current->name.removeWhiteSpace();
2769 yyextra->lastSkipRoundContext = FindMembers;
2770 yyextra->roundCount=0;
2773<StaticAssert>{BN}+ {
lineCount(yyscanner); }
2779 yyextra->current->type+=yytext;
2780 yyextra->lastRoundContext=FindMembers;
2781 yyextra->pCopyRoundString=&yyextra->current->type;
2782 yyextra->roundCount=0;
2785<DeclType>{BN}+ {
lineCount(yyscanner); }
2790<CSIndexer>"["[^\n\]]*"]" {
2794<FindMembers>[0-9]{ID} {
2797 if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
2799 yyextra->current->name+=
".";
2803 yyextra->current->name+=yytext;
2805<CppQuote>"("{B}*"\"" {
2806 yyextra->insideCppQuote=
true;
2810<IDLUnionCase>":" { BEGIN(FindMembers); }
2811<IDLUnionCase>\n {
lineCount(yyscanner); }
2813<TryFunctionBlock>\n {
lineCount(yyscanner); }
2814<TryFunctionBlock>"{" {
2815 yyextra->curlyCount=0;
2816 yyextra->lastCurlyContext = TryFunctionBlockEnd ;
2820<TryFunctionBlockEnd>{BN}*"catch" {
lineCount(yyscanner); BEGIN(TryFunctionBlock);
2822<TryFunctionBlockEnd>\n { unput(*yytext);
2823 BEGIN( FindMembers );
2825<TryFunctionBlockEnd>. { unput(*yytext);
2826 BEGIN( FindMembers );
2829 yyextra->insideCppQuote=
false;
2832<FindConceptParts>[^\/\n]* {
2833 yyextra->current->initializer << yytext;
2835<FindConceptParts>. {
2836 yyextra->current->initializer << yytext;
2838<FindConceptParts>\n {
2839 yyextra->current->initializer << yytext;
2840 yyextra->yyLineNr++;
2842<FindConceptParts>{CCS} {
2843 yyextra->current->initializer << yytext;
2845<FindConceptParts>{CPPC} {
2846 yyextra->current->initializer << yytext;
2848<FindConceptParts>^[ \t]*{CCS}[!*] {
2850 size_t indent = text.
find(
'/');
2852 if (!yyextra->current->initializer.empty())
2854 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2857 yyextra->current->section = EntryType::makeConceptDocPart();
2858 yyextra->current->startLine = yyextra->yyLineNr;
2859 yyextra->current->startColumn = indent;
2860 yyextra->current->initializer.clear();
2861 BEGIN(FindConceptDocs);
2863<FindConceptParts>^[ \t]*{CPPC}[!/].*\n {
2864 if (!yyextra->current->initializer.empty())
2866 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2870 size_t indent = line.find(
'/');
2871 yyextra->current->section = EntryType::makeConceptDocPart();
2872 yyextra->current->startLine = yyextra->yyLineNr;
2873 yyextra->current->startColumn = indent;
2874 yyextra->current->initializer.clear();
2875 yyextra->current->initializer << line.mid(indent+3);
2876 yyextra->yyLineNr++;
2877 BEGIN(FindConceptCxxDocs);
2879<FindConceptCxxDocs>^[ \t]*{CPPC}.*\n {
2881 size_t p = line.find(
'/');
2882 if (line.at(p+2)==
'!' || line.at(p+2)==
'/') p++;
2883 yyextra->current->initializer << line.mid(p+2);
2884 yyextra->yyLineNr++;
2886<FindConceptCxxDocs>{CCS}|{CCE}|{CPPC} {
2887 yyextra->current->initializer << yytext;
2889<FindConceptCxxDocs>. {
2890 if (!yyextra->current->initializer.empty())
2894 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2898 yyextra->current->section = EntryType::makeConceptCodePart();
2899 yyextra->current->startLine = yyextra->yyLineNr;
2900 BEGIN(FindConceptParts);
2902<FindConceptDocs>^[ \t]*"*"+/[^/] {
2904<FindConceptDocs>[^\*\n]+ {
2905 yyextra->current->initializer << yytext;
2907<FindConceptDocs>\n {
2908 yyextra->current->initializer << yytext;
2909 yyextra->yyLineNr++;
2911<FindConceptDocs>"*"*{CCE}[ t]*\n? {
2912 if (!yyextra->current->initializer.empty())
2916 yyextra->current->section = EntryType::makeConceptDocPart();
2917 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2921 yyextra->current->section = EntryType::makeConceptCodePart();
2922 yyextra->current->startLine = yyextra->yyLineNr;
2923 BEGIN(FindConceptParts);
2925<FindConceptDocs>"*"*{CCE} {
2926 if (!yyextra->current->initializer.empty())
2930 yyextra->current->section = EntryType::makeConceptDocPart();
2931 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2934 yyextra->current->section = EntryType::makeConceptCodePart();
2935 yyextra->current->startLine = yyextra->yyLineNr;
2936 BEGIN(FindConceptParts);
2938<FindConceptParts><<EOF>> {
2939 if (!yyextra->current->initializer.empty())
2941 if (!yyextra->current->section.isConceptCodePart())
2943 yyextra->current->section = EntryType::makeConceptDocPart();
2945 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2950<FindMembers,FindFields>{B}*"#" {
if (yyextra->insidePHP)
2952 yyextra->lastCPPContext = YY_START;
2955<FindMembers,FindFields>{B}*"#"{B}*"cmakedefine01" |
2956<FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define" {
2957 if (yyextra->insidePHP)
2959 yyextra->current->bodyLine = yyextra->yyLineNr;
2960 yyextra->current->bodyColumn = yyextra->yyColNr;
2961 yyextra->current->fileName = yyextra->fileName;
2962 yyextra->current->startLine = yyextra->yyLineNr;
2963 yyextra->current->startColumn = yyextra->yyColNr;
2964 yyextra->current->type.clear();
2965 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
2966 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2967 yyextra->current->section = EntryType::makeDefine();
2968 yyextra->lastDefineContext = YY_START;
2971<FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\"" {
2972 yyextra->yyLineNr = atoi(&yytext[1]);
2974 yyextra->lastPreLineCtrlContext = YY_START;
2975 if (YY_START==ReadBody ||
2976 YY_START==ReadNSBody ||
2977 YY_START==ReadBodyIntf)
2979 yyextra->current->program << yytext;
2981 BEGIN( PreLineCtrl );
2983<PreLineCtrl>"\""[^\n\"]*"\"" {
2985 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2986 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2987 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2989 yyextra->current->program << yytext;
2993 if (yyextra->lastPreLineCtrlContext==ReadBody ||
2994 yyextra->lastPreLineCtrlContext==ReadNSBody ||
2995 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
2997 yyextra->current->program << yytext;
3001 if (yyextra->lastPreLineCtrlContext==ReadBody ||
3002 yyextra->lastPreLineCtrlContext==ReadNSBody ||
3003 yyextra->lastPreLineCtrlContext==ReadBodyIntf)
3005 yyextra->current->program << yytext;
3008 BEGIN( yyextra->lastPreLineCtrlContext );
3011<SkipCPP>\\[\r]*"\n"[\r]* {
lineCount(yyscanner); }
3012<SkipCPP>[\r]*\n[\r]* {
lineCount(yyscanner);
3013 BEGIN( yyextra->lastCPPContext) ;
3015<SDefine>{ID}{B}*"(" {
3016 yyextra->current->name = yytext;
3017 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3018 yyextra->current->args =
"(";
3019 yyextra->current->bodyLine = yyextra->yyLineNr;
3020 yyextra->current->bodyColumn = yyextra->yyColNr;
3021 yyextra->currentArgumentContext = DefineEnd;
3022 yyextra->fullArgString=yyextra->current->args;
3023 yyextra->copyArgString=&yyextra->current->args;
3024 BEGIN( ReadFuncArgType ) ;
3039 yyextra->current->bodyLine = yyextra->yyLineNr;
3040 yyextra->current->bodyColumn = yyextra->yyColNr;
3041 yyextra->current->name = yytext;
3048 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3050 BEGIN(yyextra->lastDefineContext);
3054 yyextra->current->fileName = yyextra->fileName;
3055 yyextra->current->startLine = yyextra->yyLineNr;
3056 yyextra->current->startColumn = yyextra->yyColNr;
3057 yyextra->current->type.clear();
3058 yyextra->current->type =
"const";
3059 DString init = yyextra->current->initializer.str();
3062 yyextra->current->initializer.str(
init.str());
3063 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3064 yyextra->current->section = EntryType::makeVariable();
3065 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3070<DefineEnd>\\[\r]?\n {
3072 yyextra->current->endBodyLine = yyextra->yyLineNr;
3075 if (yyextra->insideIDL && yyextra->insideCppQuote)
3081 yyextra->lastStringContext=DefineEnd;
3086<DefinePHP>{ID}["']{BN}*","{BN}* {
3087 yyextra->current->name = yytext;
3088 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3089 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
3090 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
3091 yyextra->current->bodyLine = yyextra->yyLineNr;
3092 yyextra->current->bodyColumn = yyextra->yyColNr;
3093 yyextra->lastRoundContext = DefinePHPEnd;
3094 yyextra->pCopyRoundGString = &yyextra->current->initializer;
3095 yyextra->roundCount = 0;
3096 BEGIN( GCopyRound );
3100 if (yyextra->insideCli)
3103 yyextra->current->name = yytext ;
3111 yyextra->current->name += yytext ;
3114<FindMembers,MemberSpec,SFunction,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
3115 if (YY_START==ReadInitializer && yyextra->keepComment)
3121 if (yyextra->current->bodyLine==-1)
3123 yyextra->current->bodyLine=yyextra->yyLineNr;
3124 yyextra->current->bodyColumn = yyextra->yyColNr;
3126 yyextra->docBlockContext = YY_START;
3127 yyextra->docBlockInBody =
false;
3128 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3130 if (YY_START==MemberSpec && yyextra->memspecEntry && yyextra->memspecEntry->briefFile.empty())
3132 if (yytext[yyleng-3]==
'/')
3134 yyextra->memspecEntry->briefFile = yyextra->fileName;
3135 yyextra->memspecEntry->briefLine = yyextra->yyLineNr;
3139 yyextra->memspecEntry->docFile = yyextra->fileName;
3140 yyextra->memspecEntry->docLine = yyextra->yyLineNr;
3146 yyextra->docBlock.
str(indent.
str());
3150 yyextra->docBlockTerm =
';';
3151 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3153 yyextra->current->bitfields =
":"+yyextra->current->args;
3154 yyextra->current->args.clear();
3155 yyextra->current->section = EntryType::makeVariable();
3157 if (yytext[yyleng-3]==
'/')
DString fill(char c, size_t len)
Fills a string with a predefined character.
#define Config_getBool(name)
3169<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
3170 if (YY_START==ReadInitializer && yyextra->keepComment)
3176 yyextra->docBlockContext = YY_START;
3177 yyextra->docBlockInBody =
false;
3178 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3183 yyextra->docBlock.
str(indent.
str());
3186 yyextra->docBlockTerm =
',';
3187 if (YY_START==EnumBaseType && yyextra->current->section.isEnum())
3189 yyextra->current->bitfields =
":"+yyextra->current->args;
3190 yyextra->current->args.clear();
3191 yyextra->current->section = EntryType::makeVariable();
3193 if (yytext[yyleng-3]==
'/')
3205<DefineEnd,FindFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
3206 if (YY_START==ReadInitializer && yyextra->keepComment)
3212 if (yyextra->current->bodyLine==-1)
3214 yyextra->current->bodyLine=yyextra->yyLineNr;
3215 yyextra->current->bodyColumn = yyextra->yyColNr;
3217 yyextra->docBlockContext = YY_START;
3218 yyextra->docBlockInBody =
false;
3219 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3223 yyextra->docBlock.
str(indent.
str());
3226 yyextra->docBlockTerm = 0;
3227 if (yytext[yyleng-3]==
'/')
3240<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
3242 if (yyextra->previous && yyextra->previous->section.isGroupDoc())
3245 yyextra->commentScanner.open(yyextra->previous.get(),yyextra->fileName,yyextra->yyLineNr);
3250 yyextra->commentScanner.open(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr);
3256 if (yytext[2]==
'!' || yytext[2]==
'/')
3258 yyextra->docBlockContext = YY_START;
3259 yyextra->docBlockInBody =
false;
3260 yyextra->docBlockAutoBrief =
false;
3261 yyextra->docBlock.str(std::string());
3262 yyextra->docBlockTerm = 0;
3268 yyextra->lastCContext=YY_START;
3269 BEGIN(SkipCxxComment);
3274 if (yytext[2]==
'!' || yytext[2]==
'*')
3276 yyextra->docBlockContext = YY_START;
3277 yyextra->docBlockInBody =
false;
3278 yyextra->docBlock.str(std::string());
3279 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
3281 yyextra->docBlockTerm = 0;
3287 yyextra->lastCContext=YY_START;
3292<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
3293 bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields);
3294 yyextra->commentScanner.close(yyextra->current.get(),yyextra->fileName,yyextra->yyLineNr,insideEnum);
3298 if (!yyextra->insideCS) REJECT;
3299 yyextra->current->bodyLine = yyextra->yyLineNr;
3300 yyextra->current->bodyColumn = yyextra->yyColNr;
3301 yyextra->current->initializer.str(yytext);
3302 yyextra->lastInitializerContext = YY_START;
3303 yyextra->sharpCount=0;
3304 yyextra->initBracketCount=0;
3305 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
3306 yyextra->current->spec.setGettable(
true);
3307 BEGIN(ReadInitializerPtr);
3310 yyextra->current->bodyLine = yyextra->yyLineNr;
3311 yyextra->current->bodyColumn = yyextra->yyColNr;
3312 yyextra->current->initializer.str(
" ");
3313 for (
size_t ii = 2 ; ii < yyextra->yyColNr; ii++)
3314 yyextra->current->initializer <<
" ";
3315 yyextra->current->initializer <<
"=";
3316 yyextra->lastInitializerContext = YY_START;
3317 yyextra->sharpCount=0;
3318 yyextra->initBracketCount=0;
3319 BEGIN(ReadInitializer);
3321<UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";" {
3323 yyextra->current->exception +=
" ";
3326<UNOIDLAttributeBlock>"}" {
3327 yyextra->current->exception +=
" }";
3331<ReadInitializer,ReadInitializerPtr>"(" {
3332 yyextra->lastRoundContext=YY_START;
3333 yyextra->pCopyRoundGString=&yyextra->current->initializer;
3334 yyextra->roundCount=0;
3335 yyextra->current->initializer << *yytext;
3338<ReadInitializer,ReadInitializerPtr>"[" {
3339 if (!yyextra->insidePHP) REJECT;
3340 yyextra->lastSquareContext=YY_START;
3341 yyextra->pCopySquareGString=&yyextra->current->initializer;
3342 yyextra->squareCount=0;
3343 yyextra->current->initializer << *yytext;
3346<ReadInitializer,ReadInitializerPtr>"{" {
3347 yyextra->lastCurlyContext=YY_START;
3348 yyextra->pCopyCurlyGString=&yyextra->current->initializer;
3349 yyextra->curlyCount=0;
3350 yyextra->current->initializer << *yytext;
3353<ReadInitializer,ReadInitializerPtr>[;,] {
3355 if (*yytext==
';' && yyextra->current_root->spec.isEnum())
3357 yyextra->current->fileName = yyextra->fileName;
3358 yyextra->current->startLine = yyextra->yyLineNr;
3359 yyextra->current->startColumn = yyextra->yyColNr;
3360 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
3361 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
3362 yyextra->current->section = EntryType::makeVariable();
3363 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
3367 else if (*yytext==
';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0))
3370 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3371 BEGIN(yyextra->lastInitializerContext);
3373 else if (*yytext==
',' && yyextra->initBracketCount==0)
3376 if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
3377 BEGIN(yyextra->lastInitializerContext);
3381 yyextra->current->initializer << *yytext;
3384<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} {
3385 if (!yyextra->insideCpp)
3391 yyextra->current->initializer << yytext;
3393 yyextra->lastRawStringContext = YY_START;
3394 yyextra->pCopyRawGString = &yyextra->current->initializer;
DString extractBeginRawStringDelimiter(const char *rawStart)
3399<ReadInitializer>{CPPC}.* {
3400 if (yyextra->keepComment)
3402 yyextra->current->initializer << yytext;
3409<ReadInitializer>{CCS} {
3410 if (yyextra->keepComment)
3412 yyextra->current->initializer << yytext;
3413 BEGIN(InitCopyComment);
3420<InitCopyComment>{CCE} {
3421 yyextra->current->initializer << yytext;
3422 BEGIN(ReadInitializer);
3424<InitCopyComment>\n {
3426 yyextra->current->initializer << yytext;
3429 yyextra->current->initializer << yytext;
3431<InitCopyComment><<EOF>> {
3432 warn(yyextra->fileName,yyextra->yyLineNr,
3433 "reached end of file while inside a C style comment block!");
#define warn(file, line, fmt,...)
3436<RawGString>{RAWEND} {
3439 *yyextra->pCopyRawGString << yytext;
3440 BEGIN(yyextra->lastRawStringContext);
DString extractEndRawStringDelimiter(const char *rawEnd)
3447<RawGString>[^)\n]+ {
3448 *yyextra->pCopyRawGString << yytext;
3451 *yyextra->pCopyRawGString << yytext;
3454 *yyextra->pCopyRawGString << yytext;
3457<RawString>{RAWEND} {
3458 *yyextra->pCopyRawString+=yytext;
3459 yyextra->fullArgString+=yytext;
3462 BEGIN(yyextra->lastRawStringContext);
3466 *yyextra->pCopyRawString += yytext;
3467 yyextra->fullArgString+=yytext;
3470 *yyextra->pCopyRawString += yytext;
3471 yyextra->fullArgString+=yytext;
3474 *yyextra->pCopyRawString += yytext;
3475 yyextra->fullArgString+=yytext;
3478<ReadInitializer,ReadInitializerPtr>\" {
3479 if (yyextra->insideIDL && yyextra->insideCppQuote)
3485 yyextra->lastStringContext=YY_START;
3486 yyextra->current->initializer << yytext;
3487 yyextra->pCopyQuotedGString=&yyextra->current->initializer;
3488 yyextra->stopAtInvalidString=
false;
3492<ReadInitializer,ReadInitializerPtr>"->" {
3493 yyextra->current->initializer << yytext;
3495<ReadInitializer,ReadInitializerPtr>("<<"|"<=") {
3496 yyextra->current->initializer << yytext;
3498<ReadInitializer,ReadInitializerPtr>(">>") {
3499 if (yyextra->initBracketCount<=yyextra->sharpCount && yyextra->sharpCount>=2)
3502 yyextra->initBracketCount-=2;
3503 yyextra->sharpCount-=2;
3505 yyextra->current->initializer << yytext;
3507<ReadInitializer,ReadInitializerPtr>(">=") {
3508 yyextra->current->initializer << yytext;
3510<ReadInitializer,ReadInitializerPtr>[<\[{(] {
3511 yyextra->initBracketCount++;
3512 yyextra->sharpCount++;
3513 yyextra->current->initializer << *yytext;
3515<ReadInitializer,ReadInitializerPtr>[>\]})] {
3516 yyextra->initBracketCount--;
3517 yyextra->sharpCount--;
3520 yyextra->current->endBodyLine=yyextra->yyLineNr;
3522 yyextra->current->initializer << *yytext;
3524<ReadInitializer,ReadInitializerPtr>\' {
3525 if (yyextra->insidePHP)
3527 yyextra->current->initializer << yytext;
3528 yyextra->pCopyQuotedGString = &yyextra->current->initializer;
3529 yyextra->lastStringContext=YY_START;
3530 BEGIN(CopyPHPGString);
3534 yyextra->current->initializer << yytext;
3537<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
3538 if (yyextra->insidePHP)
3544 yyextra->current->initializer << yytext;
3547<ReadInitializer,ReadInitializerPtr>\n {
3548 yyextra->current->initializer << *yytext;
3551<ReadInitializer,ReadInitializerPtr>"@\"" {
3553 yyextra->current->initializer << yytext;
3554 if (!yyextra->insideCS && !yyextra->insideObjC)
3561 yyextra->lastSkipVerbStringContext=YY_START;
3562 yyextra->pSkipVerbString=&yyextra->current->initializer;
3563 BEGIN(SkipVerbString);
3566<SkipVerbString>[^\n"\\]+ {
3567 *yyextra->pSkipVerbString << yytext;
3569<SkipVerbString>"\\\\" {
3570 if (yyextra->insideCS) REJECT
3571 *yyextra->pSkipVerbString << yytext;
3573<SkipVerbString>"\\\"" {
3574 if (yyextra->insideCS) REJECT
3575 *yyextra->pSkipVerbString << yytext;
3577<SkipVerbString>"\"\"" {
3578 *yyextra->pSkipVerbString << yytext;
3580<SkipVerbString>"\"" {
3581 *yyextra->pSkipVerbString << *yytext;
3582 BEGIN(yyextra->lastSkipVerbStringContext);
3585 *yyextra->pSkipVerbString << *yytext;
3589 *yyextra->pSkipVerbString << *yytext;
3591<ReadInitializer,ReadInitializerPtr>"?>" {
3592 if (yyextra->insidePHP)
3593 BEGIN( FindMembersPHP );
3595 yyextra->current->initializer << yytext;
3597<ReadInitializer,ReadInitializerPtr>. {
3598 yyextra->current->initializer << *yytext;
3602<CopyString,CopyPHPString>\\. {
3603 *yyextra->pCopyQuotedString+=yytext;
3606 *yyextra->pCopyQuotedString+=*yytext;
3607 BEGIN( yyextra->lastStringContext );
3610 *yyextra->pCopyQuotedString+=*yytext;
3611 BEGIN( yyextra->lastStringContext );
3613<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
3614 *yyextra->pCopyQuotedString+=yytext;
3616<CopyString,CopyPHPString>\n {
3617 *yyextra->pCopyQuotedString+=*yytext;
3620<CopyString,CopyPHPString>. {
3621 *yyextra->pCopyQuotedString+=*yytext;
3625<CopyGString,CopyPHPGString>\\. {
3626 *yyextra->pCopyQuotedGString << yytext;
3629 *yyextra->pCopyQuotedGString << *yytext;
3630 BEGIN( yyextra->lastStringContext );
3633 *yyextra->pCopyQuotedGString << *yytext;
3634 BEGIN( yyextra->lastStringContext );
3636<CopyGString,CopyPHPGString>"<?php" {
3637 *yyextra->pCopyQuotedGString << yytext;
3638 BEGIN( yyextra->lastStringContext );
3640<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
3641 *yyextra->pCopyQuotedGString << yytext;
3643<CopyGString,CopyPHPGString>\n {
3644 *yyextra->pCopyQuotedGString << *yytext;
3645 if (yyextra->stopAtInvalidString)
3647 BEGIN( yyextra->lastStringContext );
3654<CopyGString,CopyPHPGString>. {
3655 *yyextra->pCopyQuotedGString << *yytext;
3659<CopyC11Attribute>\" {
3660 *yyextra->pCopyC11AttributeString += *yytext;
3661 yyextra->pCopyQuotedString=yyextra->pCopyC11AttributeString;
3662 yyextra->lastStringContext=YY_START;
3665<CopyC11Attribute>\n {
3667 *yyextra->pCopyC11AttributeString += *yytext;
3669<CopyC11Attribute>{ID} {
3670 if (
dstrcmp(yytext,
"nodiscard")==0)
3672 yyextra->current->spec.setNoDiscard(
true);
3674 *yyextra->pCopyC11AttributeString += yytext;
3676<CopyC11Attribute>. {
3677 *yyextra->pCopyC11AttributeString += *yytext;
3679<CopyC11Attribute>"]]" {
3680 yyextra->commentScanner.addDeprecatedDocs(yyextra->current.get(),
3683 yyextra->thisParser);
3684 BEGIN(yyextra->lastC11AttributeContext);
3690 *yyextra->pCopyRoundString += *yytext;
3691 yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
3692 yyextra->lastStringContext=YY_START;
3696 *yyextra->pCopyRoundString += *yytext;
3697 yyextra->roundCount++;
3700 *yyextra->pCopyRoundString += *yytext;
3701 if (--yyextra->roundCount<0)
3702 BEGIN(yyextra->lastRoundContext);
3706 *yyextra->pCopyRoundString += *yytext;
3709 if (yyextra->insidePHP)
3711 yyextra->current->initializer << yytext;
3712 yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
3713 yyextra->lastStringContext=YY_START;
3714 BEGIN(CopyPHPString);
3718 *yyextra->pCopyRoundString += yytext;
3721<CopyRound>{CHARLIT} {
3722 if (yyextra->insidePHP)
3728 *yyextra->pCopyRoundString+=yytext;
3731<CopyRound>[^"'()\n,]+ {
3732 *yyextra->pCopyRoundString+=yytext;
3735 *yyextra->pCopyRoundString+=*yytext;
3740 *yyextra->pCopySharpString += *yytext;
3741 yyextra->pCopyQuotedString=yyextra->pCopySharpString;
3742 yyextra->lastStringContext=YY_START;
3746 *yyextra->pCopySharpString += *yytext;
3747 yyextra->sharpCount++;
3750 *yyextra->pCopySharpString += *yytext;
3751 if (--yyextra->sharpCount<0)
3753 BEGIN(yyextra->lastSharpContext);
3758 *yyextra->pCopySharpString += *yytext;
3761 if (yyextra->insidePHP)
3763 yyextra->current->initializer << yytext;
3764 yyextra->pCopyQuotedString = yyextra->pCopySharpString;
3765 yyextra->lastStringContext=YY_START;
3766 BEGIN(CopyPHPString);
3770 *yyextra->pCopySharpString += yytext;
3773<CopySharp>{CHARLIT} {
3774 if (yyextra->insidePHP)
3780 *yyextra->pCopySharpString+=yytext;
3783<CopySharp>[^"'<>\n,]+ {
3784 *yyextra->pCopySharpString+=yytext;
3787 *yyextra->pCopySharpString+=*yytext;
3793 *yyextra->pCopyRoundGString << *yytext;
3794 yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
3795 yyextra->lastStringContext=YY_START;
3799 *yyextra->pCopyRoundGString << *yytext;
3800 yyextra->roundCount++;
3803 *yyextra->pCopyRoundGString << *yytext;
3804 if (--yyextra->roundCount<0)
3805 BEGIN(yyextra->lastRoundContext);
3809 *yyextra->pCopyRoundGString << *yytext;
3812 if (yyextra->insidePHP)
3814 yyextra->current->initializer << yytext;
3815 yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
3816 yyextra->lastStringContext=YY_START;
3817 BEGIN(CopyPHPGString);
3821 *yyextra->pCopyRoundGString << yytext;
3824<GCopyRound>{CHARLIT} {
3825 if (yyextra->insidePHP)
3831 *yyextra->pCopyRoundGString << yytext;
3835 if (!yyextra->insideCS) REJECT;
3836 *yyextra->pCopyRoundGString << yytext;
3837 yyextra->lastSkipVerbStringContext=YY_START;
3838 yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
3839 BEGIN(SkipVerbString);
3841<GCopyRound>[^"'()\n\/,R]+ {
3842 *yyextra->pCopyRoundGString << yytext;
3844<GCopyRound>{RAWBEGIN} {
3845 *yyextra->pCopyRoundGString << yytext;
3847 yyextra->lastRawStringContext = YY_START;
3848 yyextra->pCopyRawGString = yyextra->pCopyRoundGString;
3852 *yyextra->pCopyRoundGString << *yytext;
3857 *yyextra->pCopySquareGString << *yytext;
3858 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3859 yyextra->lastStringContext=YY_START;
3863 *yyextra->pCopySquareGString << *yytext;
3864 if (yyextra->insidePHP)
3866 yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
3867 yyextra->lastStringContext=YY_START;
3868 BEGIN(CopyPHPGString);
3872 *yyextra->pCopySquareGString << *yytext;
3873 yyextra->squareCount++;
3876 *yyextra->pCopySquareGString << *yytext;
3877 if (--yyextra->squareCount<0)
3878 BEGIN(yyextra->lastSquareContext);
3882 *yyextra->pCopySquareGString << *yytext;
3885 if (yyextra->insidePHP)
3887 yyextra->current->initializer << yytext;
3888 yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
3889 yyextra->lastStringContext=YY_START;
3890 BEGIN(CopyPHPGString);
3894 *yyextra->pCopySquareGString << yytext;
3897<GCopySquare>{CHARLIT} {
3898 if (yyextra->insidePHP)
3904 *yyextra->pCopySquareGString << yytext;
3907<GCopySquare>[^"'\[\]\n\/,]+ {
3908 *yyextra->pCopySquareGString << yytext;
3911 *yyextra->pCopySquareGString << *yytext;
3916 *yyextra->pCopyCurlyString += *yytext;
3917 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3918 yyextra->lastStringContext=YY_START;
3919 yyextra->keepComment=
false;
3923 *yyextra->pCopyCurlyString += *yytext;
3924 if (yyextra->insidePHP)
3926 yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
3927 yyextra->lastStringContext=YY_START;
3928 yyextra->keepComment=
false;
3929 BEGIN(CopyPHPString);
3933 *yyextra->pCopyCurlyString += *yytext;
3934 yyextra->curlyCount++;
3937 *yyextra->pCopyCurlyString += *yytext;
3938 if (--yyextra->curlyCount<0)
3940 yyextra->keepComment=
false;
3941 BEGIN(yyextra->lastCurlyContext);
3944<CopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
3950 *yyextra->pCopyCurlyString += yytext;
3953<CopyCurly>[^"'{}\/\n,]+ {
3954 *yyextra->pCopyCurlyString += yytext;
3956<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
3959 *yyextra->pCopyCurlyString += *yytext;
3962 *yyextra->pCopyCurlyString += *yytext;
3964<CopyCurly>{CPPC}[^\n]* {
3965 if (yyextra->keepComment)
3967 *yyextra->pCopyCurlyString += yytext;
3975 if (yyextra->keepComment)
3977 *yyextra->pCopyCurlyString += yytext;
3986 *yyextra->pCopyCurlyString += yytext;
3991 *yyextra->pCopyCurlyString += *yytext;
3994 *yyextra->pCopyCurlyString += *yytext;
3996<CopyComment><<EOF>> {
3997 warn(yyextra->fileName,yyextra->yyLineNr,
3998 "reached end of file while inside a C style comment block!");
4003<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"1"{B}*\n? {
4005<GCopyCurly>^"#"{B}+[0-9]+{B}+"\""[^\"\n]+"\""{B}+"2"{B}*\n? {
4007 size_t s = line.
find(
' ');
4009 size_t e = line.
find(
'"',s);
4010 yyextra->yyLineNr = line.
mid(s,e-s).
toInt();
4011 if (yytext[yyleng-1]==
'\n')
DString mid(size_t index, size_t len=npos) const
int toInt(bool *ok=nullptr, int base=10) const
4018 *yyextra->pCopyCurlyGString << *yytext;
4019 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
4020 yyextra->lastStringContext=YY_START;
4021 yyextra->keepComment =
false;
4025 *yyextra->pCopyCurlyGString << *yytext;
4026 if (yyextra->insidePHP)
4028 yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
4029 yyextra->lastStringContext=YY_START;
4030 yyextra->keepComment =
false;
4031 BEGIN(CopyPHPGString);
4035 *yyextra->pCopyCurlyGString << *yytext;
4036 yyextra->curlyCount++;
4038<GCopyCurly>"}"/{BN}*("||"|"&&") {
4039 *yyextra->pCopyCurlyGString << *yytext;
4040 if (--yyextra->curlyCount<0)
4042 yyextra->current->endBodyLine = yyextra->yyLineNr;
4043 BEGIN(yyextra->lastCurlyContext);
4047 *yyextra->pCopyCurlyGString << *yytext;
4048 if (--yyextra->curlyCount<0)
4050 yyextra->current->endBodyLine = yyextra->yyLineNr;
4051 yyextra->keepComment =
false;
4052 BEGIN(yyextra->lastCurlyContext);
4055<GCopyCurly>{CHARLIT} {
if (yyextra->insidePHP)
4061 *yyextra->pCopyCurlyGString << yytext;
4064<GCopyCurly>[^"'{}\/\n,]+ {
4065 *yyextra->pCopyCurlyGString << yytext;
4068 *yyextra->pCopyCurlyGString << yytext;
4070<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
4073 *yyextra->pCopyCurlyGString << *yytext;
4076 *yyextra->pCopyCurlyGString << *yytext;
4078<GCopyCurly>{CPPC}[^\n]* {
4079 if (yyextra->keepComment)
4081 *yyextra->pCopyCurlyGString << yytext;
4089 if (yyextra->keepComment)
4091 *yyextra->pCopyCurlyGString << yytext;
4092 BEGIN(GCopyComment);
4099<GCopyComment>{CCE} {
4100 *yyextra->pCopyCurlyGString << yytext;
4105 *yyextra->pCopyCurlyGString << *yytext;
4108 *yyextra->pCopyCurlyGString << *yytext;
4110<GCopyComment><<EOF>> {
4111 warn(yyextra->fileName,yyextra->yyLineNr,
4112 "reached end of file while inside a C style comment block!");
4120 if (yyextra->current->type.empty() &&
4121 yyextra->current->name==
"enum")
4123 yyextra->current->section = EntryType::makeEnum();
4124 yyextra->current->name.clear();
4125 yyextra->current->args.clear();
4126 BEGIN(EnumBaseType);
4130 if (yyextra->current->type.empty())
4133 yyextra->current->name.sprintf(
"__pad%d__",yyextra->padCount++);
4136 yyextra->current->bitfields+=
":";
4140 yyextra->current->bitfields+=*yytext;
4143 yyextra->current->args+=*yytext;
4147 yyextra->current->args+=
' ';
4150 DString oldType = yyextra->current->type;
4151 if (yyextra->current->bodyLine==-1)
4153 yyextra->current->bodyLine = yyextra->yyLineNr;
4154 yyextra->current->bodyColumn = yyextra->yyColNr;
4156 if ( yyextra->insidePHP && yyextra->current->type.startsWith(
"var"))
4158 yyextra->current->type = yyextra->current->type.mid(3);
4160 if (yyextra->isTypedef && !yyextra->current->type.startsWith(
"typedef "))
4162 yyextra->current->type.prepend(
"typedef ");
4164 bool isStatic = yyextra->current->isStatic;
4165 Protection prot = yyextra->current->protection;
4166 bool isConcept = yyextra->current->section.isConcept();
4167 bool isModule = yyextra->current->section.isModuleDoc();
4170 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4175 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4178 else if (!yyextra->current->name.empty() && !yyextra->current->section.isEnum())
4180 yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
4182 yyextra->current->name=yyextra->current->name.stripWhiteSpace();
4183 if (yyextra->current->section.isClass())
4187 yyextra->current->section = EntryType::makeVariable() ;
4188 yyextra->current->fileName = yyextra->fileName;
4189 yyextra->current->startLine = yyextra->yyBegLineNr;
4190 yyextra->current->startColumn = yyextra->yyBegColNr;
4191 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4194 if ( *yytext ==
',')
4196 yyextra->current->isStatic = isStatic;
4197 yyextra->current->protection = prot;
4198 yyextra->current->name.clear();
4199 yyextra->current->args.clear();
4200 yyextra->current->brief.clear();
4201 yyextra->current->doc.clear();
4202 yyextra->current->initializer.str(std::string());
4203 yyextra->current->bitfields.clear();
4208 yyextra->mtype = MethodTypes::Method;
4209 yyextra->virt = Specifier::Normal;
4210 yyextra->current->bodyLine = -1;
4211 yyextra->current->bodyColumn = 1;
4212 yyextra->current->groups.clear();
4218 if (yyextra->insideSlice)
4220 yyextra->squareCount=1;
4221 yyextra->lastSquareContext = YY_START;
4222 yyextra->current->metaData +=
"[";
4223 BEGIN( SliceMetadata );
4225 else if (!yyextra->insideCS &&
4226 (yyextra->current->name.empty() ||
4227 yyextra->current->name==
"typedef"
4231 yyextra->squareCount=1;
4232 yyextra->lastSquareContext = YY_START;
4233 yyextra->idlAttr.clear();
4234 yyextra->idlProp.clear();
4235 yyextra->current->mtype = yyextra->mtype;
4238 yyextra->current->mtype == MethodTypes::Property)
4240 yyextra->odlProp =
true;
4241 yyextra->current->spec.setGettable(
true).setSettable(
true);
4244 BEGIN( IDLAttribute );
4246 else if (yyextra->insideCS &&
4247 yyextra->current->name.empty())
4249 yyextra->squareCount=1;
4250 yyextra->lastSquareContext = YY_START;
4253 yyextra->current->args.clear();
4254 BEGIN( SkipSquare );
4258 yyextra->current->args += yytext ;
4259 yyextra->squareCount=1;
4260 yyextra->externLinkage=
false;
4265 yyextra->squareCount++;
4266 yyextra->current->metaData +=
"[";
4268<SliceMetadata>{BN}* {
4271<SliceMetadata>\"[^\"]*\" {
4272 yyextra->current->metaData += yytext;
4275 yyextra->current->metaData += yytext;
4278 yyextra->current->metaData += yytext;
4279 if (--yyextra->squareCount<=0)
4281 BEGIN (yyextra->lastSquareContext);
4285 yyextra->current->type +=
"(";
4286 yyextra->roundCount++;
4288<SliceOptional>[0-9]+ {
4289 yyextra->current->type += yytext;
4292 yyextra->current->type +=
")";
4293 if(--yyextra->roundCount<=0)
4295 BEGIN (yyextra->lastModifierContext);
4300 if (--yyextra->squareCount<=0)
4303 if (yyextra->current->mtype == MethodTypes::Property)
4304 BEGIN( IDLPropName );
4306 BEGIN( yyextra->lastSquareContext );
4309<IDLAttribute>"propput" {
4312 yyextra->current->mtype = MethodTypes::Property;
4314 yyextra->current->spec.setSettable(
true);
4316<IDLAttribute>"propget" {
4319 yyextra->current->mtype = MethodTypes::Property;
4321 yyextra->current->spec.setGettable(
true);
4323<IDLAttribute>"property" {
4324 yyextra->current->spec.setProperty(
true);
4326<IDLAttribute>"attribute" {
4327 yyextra->current->spec.setAttribute(
true);
4329<IDLAttribute>"optional" {
4330 yyextra->current->spec.setOptional(
true);
4332<IDLAttribute>"readonly" {
4335 yyextra->current->spec.setSettable(
false);
4339 yyextra->current->spec.setReadonly(
true);
4342<IDLAttribute>"bound" {
4343 yyextra->current->spec.setBound(
true);
4345<IDLAttribute>"removable" {
4346 yyextra->current->spec.setRemovable(
true);
4348<IDLAttribute>"constrained" {
4349 yyextra->current->spec.setConstrained(
true);
4351<IDLAttribute>"transient" {
4352 yyextra->current->spec.setTransient(
true);
4354<IDLAttribute>"maybevoid" {
4355 yyextra->current->spec.setMaybeVoid(
true);
4357<IDLAttribute>"maybedefault" {
4358 yyextra->current->spec.setMaybeDefault(
true);
4360<IDLAttribute>"maybeambiguous" {
4361 yyextra->current->spec.setMaybeAmbiguous(
true);
4365<IDLPropName>{BN}*{ID}({BN}*[*]*{BN}*)? {
4368 if (yyextra->odlProp)
4370 yyextra->idlProp = yytext;
4373<IDLPropName>{ID}{BN}*"(" {
4374 yyextra->current->name = yytext;
4375 yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
4376 yyextra->current->startLine = yyextra->yyLineNr;
4377 yyextra->current->startColumn = yyextra->yyColNr;
4380<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
4381 if (yyextra->odlProp)
4383 yyextra->idlProp += yytext;
4386<IDLPropName>{ID}{BNopt}/";" {
4387 if (yyextra->odlProp)
4389 yyextra->current->name = yytext;
4390 yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
4391 yyextra->odlProp =
false;
4396<IDLProp>{BN}*"["[^\]]*"]"{BN}* {
4397 yyextra->idlAttr = yytext;
4398 yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
4401 yyextra->idlProp = yytext;
4403<IDLProp>{BN}*{ID}{BN}*"," {
4404 if (yyextra->current->args.empty())
4405 yyextra->current->args =
"(";
4407 yyextra->current->args +=
", ";
4408 yyextra->current->args += yyextra->idlAttr;
4409 yyextra->current->args +=
" ";
4410 yyextra->current->args += yyextra->idlProp;
4411 yyextra->current->args +=
" ";
4412 yyextra->current->args += yytext;
4413 yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);
4414 yyextra->idlProp.clear();
4415 yyextra->idlAttr.clear();
4418<IDLProp>{BN}*{ID}{BN}*")"{BN}* {
4422 yyextra->current->fileName = yyextra->fileName;
4423 yyextra->current->type = yyextra->idlProp;
4424 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4425 if (!yyextra->current->args.empty())
4426 yyextra->current->args +=
")";
4427 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4428 yyextra->current->section = EntryType::makeVariable();
4429 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4431 BEGIN( FindMembers );
4436<Array>"]" { yyextra->current->args += *yytext ;
4437 if (--yyextra->squareCount<=0)
4438 BEGIN( FindMembers ) ;
4440<FuncFuncArray>"]" { yyextra->current->args += *yytext ;
4441 if (--yyextra->squareCount<=0)
4442 BEGIN( SFunction ) ;
4444<Array,FuncFuncArray>"[" { yyextra->current->args += *yytext ;
4445 yyextra->squareCount++;
4447<Array,FuncFuncArray>. { yyextra->current->args += *yytext ; }
4448<SkipSquare>"[" { yyextra->squareCount++; }
4450 if (--yyextra->squareCount<=0)
4451 BEGIN( yyextra->lastSquareContext );
4454 yyextra->lastStringContext=YY_START;
4455 BEGIN( SkipString );
4457<SkipSquare>[^\n\[\]\"]+
4458<FindMembers>"<" {
addType(yyscanner);
4459 yyextra->current->type += yytext ;
4462<Sharp>">" { yyextra->current->type += *yytext ;
4463 if (--yyextra->sharpCount<=0)
4464 BEGIN( FindMembers ) ;
4466<Sharp>"<" { yyextra->current->type += *yytext ;
4467 yyextra->sharpCount++;
4470 yyextra->current->type +=
' ';
4473<Sharp>. { yyextra->current->type += *yytext ; }
4476 yyextra->current->bodyLine = yyextra->yyLineNr;
4477 yyextra->current->bodyColumn = yyextra->yyColNr;
4478 yyextra->current->name = yytext;
4483 yyextra->lastInitializerContext = YY_START;
4484 yyextra->sharpCount=0;
4485 yyextra->initBracketCount=0;
4486 yyextra->current->initializer.str(
"=");
4487 BEGIN(ReadInitializer);
4490 yyextra->lastInitializerContext = YY_START;
4491 yyextra->sharpCount=0;
4492 yyextra->initBracketCount=0;
4493 yyextra->current->initializer.str(yytext);
4494 BEGIN(ReadInitializer);
4497 if (yyextra->insideJava)
4499 if (!yyextra->current->name.empty())
4501 yyextra->current->fileName = yyextra->fileName;
4502 yyextra->current->startLine = yyextra->yyLineNr;
4503 yyextra->current->startColumn = yyextra->yyColNr;
4504 if (!yyextra->current_root->spec.isEnum())
4506 yyextra->current->type =
"@";
4508 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4509 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4510 yyextra->current->section = EntryType::makeVariable();
4511 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4515 BEGIN( FindMembers );
4526 if (!yyextra->current->name.empty())
4528 yyextra->current->fileName = yyextra->fileName;
4529 if (yyextra->current_root->section.isEnum() || yyextra->current_root->spec.isEnum())
4531 yyextra->current->startLine = yyextra->current->bodyLine;
4532 yyextra->current->startColumn = yyextra->current->bodyColumn;
4536 yyextra->current->startLine = yyextra->yyLineNr;
4537 yyextra->current->startColumn = yyextra->yyColNr;
4539 if (!yyextra->current_root->spec.isEnum())
4541 yyextra->current->type =
"@";
4543 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4544 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4545 yyextra->current->section = EntryType::makeVariable();
4547 if (!yyextra->insideCS && !yyextra->insideJava &&
4548 !yyextra->current_root->spec.isStrong())
4555 yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
4557 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
4562 yyextra->current->reset();
4567 yyextra->squareCount=1;
4568 yyextra->lastSquareContext = YY_START;
4571<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<\\\$R]* { yyextra->current->program << yytext ; }
4572<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
4573<ReadBody,ReadNSBody,ReadBodyIntf>"#".* {
if (!yyextra->insidePHP)
4576 yyextra->current->program << yytext ;
4579<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$\" {
if (!yyextra->insideCS) REJECT
4580 yyextra->current->program << yytext ;
4581 yyextra->pSkipInterpString = &yyextra->current->program;
4582 yyextra->lastSkipInterpStringContext=YY_START;
4583 yyextra->strCurlyCount = 0;
4584 BEGIN( SkipInterpString );
4586<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})* {
4587 *yyextra->pSkipInterpString << yytext;
4589<SkipInterpString>"{" {
4590 *yyextra->pSkipInterpString << *yytext;
4591 yyextra->strCurlyCount++;
4593<SkipInterpString>"}" {
4594 *yyextra->pSkipInterpString << *yytext;
4595 yyextra->strCurlyCount--;
4597<SkipInterpString>\" {
4598 *yyextra->pSkipInterpString << *yytext;
4599 if (yyextra->strCurlyCount==0)
4601 BEGIN( yyextra->lastSkipInterpStringContext );
4604<SkipInterpString>. {
4605 *yyextra->pSkipInterpString << *yytext;
4608<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,ReadExpressionBody,FindMembers,FindMemberName>$@\" {
if (!yyextra->insideCS) REJECT
4609 yyextra->current->program << yytext ;
4610 yyextra->pSkipInterpVerbString = &yyextra->current->program;
4611 yyextra->lastSkipInterpVerbStringContext=YY_START;
4612 yyextra->strCurlyCount = 0;
4613 BEGIN( SkipInterpVerbString );
4615<SkipInterpVerbString>([^\"{}]|"{{"|"}}"|"\"\"")* {
4616 *yyextra->pSkipInterpVerbString << yytext;
4618<SkipInterpVerbString>"{" {
4619 *yyextra->pSkipInterpVerbString << *yytext;
4620 yyextra->strCurlyCount++;
4622<SkipInterpVerbString>"}" {
4623 *yyextra->pSkipInterpVerbString << *yytext;
4624 yyextra->strCurlyCount--;
4626<SkipInterpVerbString>\" {
4627 *yyextra->pSkipInterpVerbString << *yytext;
4628 if (yyextra->strCurlyCount==0)
4630 BEGIN( yyextra->lastSkipInterpVerbStringContext );
4633<SkipInterpVerbString>. {
4634 *yyextra->pSkipInterpVerbString << *yytext;
4636<ReadBody,ReadNSBody,ReadBodyIntf>"\$" { yyextra->current->program << yytext ; }
4637<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
4638 yyextra->pSkipVerbString = &yyextra->current->program;
4639 yyextra->lastSkipVerbStringContext=YY_START;
4640 BEGIN( SkipVerbString );
4642<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" {
if (yyextra->insidePHP)
4644 yyextra->current->program << yytext ;
4645 yyextra->pCopyHereDocGString = &yyextra->current->program;
4646 yyextra->lastHereDocContext=YY_START;
4647 BEGIN( CopyHereDoc );
4654<ReadBody,ReadNSBody,ReadBodyIntf>{RAWBEGIN} {
4655 yyextra->current->program << yytext;
4657 yyextra->lastRawStringContext = YY_START;
4658 yyextra->pCopyRawGString = &yyextra->current->program;
4661<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
4662 yyextra->pCopyQuotedGString = &yyextra->current->program;
4663 yyextra->lastStringContext=YY_START;
4664 yyextra->stopAtInvalidString=
false;
4665 BEGIN( CopyGString );
4667<ReadBody,ReadNSBody,ReadBodyIntf>{DCOMMC} { yyextra->doxygenComment=
true; REJECT;}
4668<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
4669 yyextra->lastContext = YY_START ;
4672<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
4673 ++yyextra->yyLineNr ;
4674 yyextra->lastContext = YY_START ;
4677<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
4678 if (!yyextra->insidePHP)
4680 yyextra->current->program << yytext;
4684 yyextra->current->program << yytext;
4685 yyextra->pCopyQuotedGString = &yyextra->current->program;
4686 yyextra->lastStringContext=YY_START;
4687 BEGIN(CopyPHPGString);
4690<ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} {
4691 if (yyextra->insidePHP)
4698 yyextra->current->program << yytext;
4701<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
4702 ++yyextra->curlyCount ;
4705 yyextra->current->program << yytext ;
4706 --yyextra->curlyCount ;
4708<ReadBody,ReadNSBody>"}" {
4709 if ( yyextra->curlyCount>0 )
4711 yyextra->current->program << yytext ;
4712 --yyextra->curlyCount ;
4716 yyextra->current->endBodyLine = yyextra->yyLineNr;
4717 std::shared_ptr<Entry> original_root = yyextra->current_root;
4718 if (yyextra->current->section.isNamespace() && yyextra->current->type ==
"namespace")
4722 DString doc = yyextra->current->doc;
4723 int docLine = yyextra->current->docLine;
4724 DString docFile = yyextra->current->docFile;
4725 DString brief = yyextra->current->brief;
4726 int briefLine = yyextra->current->briefLine;
4727 DString briefFile = yyextra->current->briefFile;
4728 auto groups = yyextra->current->groups;
4729 auto anchors = yyextra->current->anchors;
4730 auto sli = yyextra->current->sli;
4731 auto rqli = yyextra->current->rqli;
4733 yyextra->current->doc =
"";
4734 yyextra->current->docLine = 0;
4735 yyextra->current->docFile =
"";
4736 yyextra->current->brief =
"";
4737 yyextra->current->briefLine = 0;
4738 yyextra->current->briefFile =
"";
4739 yyextra->current->groups.
clear();
4740 yyextra->current->anchors.clear();
4741 yyextra->current->sli.clear();
4742 yyextra->current->rqli.clear();
4744 while ((split_point = yyextra->current->name.find(
"::")) !=
DString::npos)
4746 std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
4747 yyextra->current->program.str(std::string());
4748 new_current->name = yyextra->current->name.mid(split_point + 2);
4749 yyextra->current->name = yyextra->current->name.left(split_point);
4750 if (yyextra->current->name.startsWith(
"inline "))
4752 yyextra->current->name = yyextra->current->name.mid(7);
4753 yyextra->current->spec.setInline(
true);
4755 if (!yyextra->current_root->name.empty()) yyextra->current->name.prepend(yyextra->current_root->name+
"::");
4757 yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
4758 yyextra->current_root = yyextra->current;
4759 yyextra->current = new_current;
4762 yyextra->current->doc = doc;
4763 yyextra->current->docLine = docLine;
4764 yyextra->current->docFile = docFile;
4765 yyextra->current->brief = brief;
4766 yyextra->current->briefLine = briefLine;
4767 yyextra->current->briefFile = briefFile;
4768 yyextra->current->groups = groups;
4769 yyextra->current->anchors = anchors;
4770 yyextra->current->sli = sli;
4771 yyextra->current->rqli = rqli;
4773 DString &cn = yyextra->current->name;
4777 yyextra->current->spec.setInline(
true);
4779 DString rn = yyextra->current_root->name;
4785 if (yyextra->isTypedef && cn.
empty())
4788 BEGIN( TypedefName );
4792 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4794 yyextra->current->program <<
',';
4799 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4800 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
4802 if (yyextra->insideObjC &&
4803 (yyextra->current->spec.isInterface() || yyextra->current->spec.isCategory())
4806 BEGIN( ReadBodyIntf ) ;
4810 yyextra->memspecEntry = yyextra->current;
4811 if (yyextra->isTypedef)
4813 yyextra->current_root->moveToSubEntryAndKeep( yyextra->current ) ;
4814 yyextra->current = std::make_shared<Entry>(*yyextra->current);
4818 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4819 yyextra->current = std::make_shared<Entry>(*yyextra->memspecEntry);
4821 if (yyextra->current->section.isNamespace() ||
4822 yyextra->current->spec.isInterface() ||
4823 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
4824 yyextra->insideSlice
4827 yyextra->current->reset();
4828 yyextra->current_root = std::move(original_root);
4830 yyextra->memspecEntry.reset();
4831 BEGIN( FindMembers ) ;
4835 if (!yyextra->isTypedef)
4837 yyextra->current->doc.clear();
4838 yyextra->current->brief.clear();
4840 BEGIN( MemberSpec ) ;
bool startsWith(const char *s) const
4846<ReadBody>"}"{BN}+"typedef"{BN}+ {
4848 if ( yyextra->curlyCount>0 )
4850 yyextra->current->program << yytext ;
4851 --yyextra->curlyCount ;
4855 yyextra->isTypedef =
true;
4856 yyextra->current->endBodyLine = yyextra->yyLineNr;
4857 DString &cn = yyextra->current->name;
4858 DString rn = yyextra->current_root->name;
4863 BEGIN( TypedefName );
4866<TypedefName>("const"|"volatile"){BN} {
4868 yyextra->current->type.prepend(yytext);
4871 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4873 yyextra->current->program <<
",";
4875 yyextra->current->name=yytext;
4877 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4878 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4880 if (!yyextra->firstTypedefEntry)
4882 yyextra->firstTypedefEntry = yyextra->current;
4884 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4886 yyextra->isTypedef=
true;
4887 BEGIN(MemberSpecSkip);
4891 if (yyextra->current->section.isEnum() || yyextra->current->spec.isEnum())
4893 yyextra->current->program <<
',';
4896 yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
4897 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
4898 yyextra->memspecEntry = yyextra->current;
4899 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
4902 BEGIN( MemberSpec ) ;
4904<MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* {
4906 int i=0,l=(int)yyleng;
4907 while (i<l && (!
isId(yytext[i]))) i++;
4911 yyextra->msArgs=yyextra->msName.mid(j);
4912 yyextra->msName=yyextra->msName.left(j);
4917 if (yyextra->firstTypedefEntry)
4919 if (yyextra->firstTypedefEntry->spec.isStruct())
4921 yyextra->msType.prepend(
"struct "+yyextra->firstTypedefEntry->name);
4923 else if (yyextra->firstTypedefEntry->spec.isUnion())
4925 yyextra->msType.prepend(
"union "+yyextra->firstTypedefEntry->name);
4927 else if (yyextra->firstTypedefEntry->section.isEnum())
4929 yyextra->msType.prepend(
"enum "+yyextra->firstTypedefEntry->name);
4931 else if (yyextra->firstTypedefEntry->spec.isRecord())
4933 yyextra->msType.prepend(
"record "+yyextra->firstTypedefEntry->name);
4937 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.
4943 yyextra->current->name = yyextra->msName;
4950 if (yyextra->msName.empty() && !yyextra->current->name.empty())
4956 const Entry *p=yyextra->current.get();
4974 if (p==yyextra->current.get()) p=yyextra->current_root.get();
else p=p->
parent();
4978 if (!yyextra->msName.empty()
4984 if (typedefHidesStruct &&
4985 yyextra->isTypedef &&
4986 ((yyextra->current->spec.isStruct() || yyextra->current->spec.isRecord() || yyextra->current->spec.isUnion()) || yyextra->current->section.isEnum()) &&
4987 yyextra->msType.stripWhiteSpace().empty() &&
4988 yyextra->memspecEntry)
4990 yyextra->memspecEntry->name=yyextra->msName;
4994 std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
4995 varEntry->lang = yyextra->language;
4996 varEntry->protection = yyextra->current->protection ;
4997 varEntry->mtype = yyextra->current->mtype;
4998 varEntry->virt = yyextra->current->virt;
4999 varEntry->isStatic = yyextra->current->isStatic;
5000 varEntry->section = EntryType::makeVariable();
5001 varEntry->name = yyextra->msName.stripWhiteSpace();
5002 varEntry->type = yyextra->current->type.simplifyWhiteSpace()+
" ";
5003 varEntry->args = yyextra->msArgs;
5004 if (yyextra->isTypedef)
5006 varEntry->type.prepend(
"typedef ");
5009 if (typedefHidesStruct &&
5010 yyextra->isTypedef &&
5011 (yyextra->current->spec.isStruct() || yyextra->current->spec.isRecord() || yyextra->current->spec.isUnion()) &&
5012 yyextra->memspecEntry
5015 varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
5019 varEntry->type+=yyextra->current->name+yyextra->msType;
5021 varEntry->fileName = yyextra->fileName;
5022 varEntry->startLine = yyextra->yyLineNr;
5023 varEntry->startColumn = yyextra->yyColNr;
5024 varEntry->doc = yyextra->current->doc;
5025 varEntry->brief = yyextra->current->brief;
5026 varEntry->mGrpId = yyextra->current->mGrpId;
5027 varEntry->initializer.str(yyextra->current->initializer.str());
5028 varEntry->groups = yyextra->current->groups;
5029 varEntry->sli = yyextra->current->sli;
5034 yyextra->current_root->moveToSubEntryAndKeep(varEntry);
5039 if (!yyextra->isTypedef && yyextra->msName.empty() &&
5040 yyextra->memspecEntry && yyextra->current->section.isCompound())
5042 if (!yyextra->current->doc.empty())
5044 yyextra->memspecEntry->doc += yyextra->current->doc;
5046 if (!yyextra->current->brief.empty())
5048 yyextra->memspecEntry->brief += yyextra->current->brief;
5051 yyextra->msType.clear();
5052 yyextra->msName.clear();
5053 yyextra->msArgs.clear();
5054 yyextra->isTypedef=
false;
5055 yyextra->firstTypedefEntry.reset();
5056 yyextra->memspecEntry.reset();
5057 yyextra->current->reset();
5059 BEGIN( FindMembers );
5063 yyextra->current->doc.clear();
5064 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
5069 yyextra->lastInitializerContext=YY_START;
5070 yyextra->sharpCount=0;
5071 yyextra->initBracketCount=0;
5072 yyextra->current->initializer.str(yytext);
5073 BEGIN(ReadInitializer);
5084<MemberSpecSkip>"," { BEGIN(MemberSpec); }
5085<MemberSpecSkip>";" { unput(
';'); BEGIN(MemberSpec); }
5086<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
5089<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] {
5090 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
5092 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
5093 yyextra->insideObjC=
false;
5094 BEGIN( FindMembers );
5096<ReadBody,ReadNSBody,ReadBodyIntf>\\. { yyextra->current->program << yytext ; }
5097<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
5099<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" |
5100<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ {
5101 if (yyextra->insidePHP)
5107 yyextra->current->bodyLine = yyextra->yyLineNr;
5108 yyextra->current->bodyColumn = yyextra->yyColNr;
5111 yyextra->funcPtrType=yytext;
5112 yyextra->roundCount=0;
5117<FuncPtr>{SCOPENAME} {
5118 yyextra->current->name = yytext;
5121 BEGIN( FuncPtrOperator );
5125 if (yyextra->current->name==
"const" || yyextra->current->name==
"volatile")
5127 yyextra->funcPtrType += yyextra->current->name;
5131 BEGIN( EndFuncPtr );
5138<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
5139 yyextra->current->name += yytext;
5140 yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
5143<FuncPtrOperator>\n {
5145 yyextra->current->name += *yytext;
5147<FuncPtrOperator>"(" {
5149 BEGIN( EndFuncPtr );
5152 yyextra->current->name += *yytext;
5154<EndFuncPtr>")"{BNopt}/";" {
5156 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5159<EndFuncPtr>")"{BNopt}/"(" {
5161 if (yyextra->funcPtrType!=
"(")
5163 yyextra->current->type+=yyextra->funcPtrType+
")";
5167<EndFuncPtr>")"{BNopt}/"[" {
5169 yyextra->current->type+=yyextra->funcPtrType;
5170 yyextra->current->args +=
")";
5175 yyextra->current->args += *yytext ;
5178 yyextra->current->bodyLine = yyextra->yyLineNr;
5179 yyextra->current->bodyColumn = yyextra->yyColNr;
5180 yyextra->currentArgumentContext = FuncFuncEnd;
5181 yyextra->fullArgString=yyextra->current->args;
5182 yyextra->copyArgString=&yyextra->current->args;
5183 BEGIN( ReadFuncArgType ) ;
5185<EndFuncPtr>"["[^\n\]]*"]" {
5186 yyextra->funcPtrType+=yytext;
5192 yyextra->current->args += *yytext ;
5193 ++yyextra->roundCount;
5196 yyextra->current->args += *yytext ;
5197 if ( yyextra->roundCount )
5198 --yyextra->roundCount;
5204<FuncFuncEnd>")"{BN}*"(" {
5206 yyextra->current->type+=yyextra->funcPtrType+
")(";
5207 BEGIN(FuncFuncType);
5209<FuncFuncEnd>")"{BNopt}/[;{] {
5211 yyextra->current->type+=yyextra->funcPtrType.mid(1);
5214<FuncFuncEnd>")"{BNopt}/"[" {
5216 yyextra->current->type+=yyextra->funcPtrType;
5217 yyextra->current->args+=
")";
5218 BEGIN(FuncFuncArray);
5221 yyextra->current->args += *yytext;
5224 yyextra->current->type += *yytext;
5225 yyextra->roundCount++;
5228 yyextra->current->type += *yytext;
5229 if (yyextra->roundCount)
5230 --yyextra->roundCount;
5234<FuncFuncType>{BN}*","{BN}* {
lineCount(yyscanner) ; yyextra->current->type +=
", " ; }
5235<FuncFuncType>{BN}+ {
lineCount(yyscanner) ; yyextra->current->type +=
' ' ; }
5237 yyextra->current->type += *yytext;
5239<FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" {
5240 if (yyextra->current->type.startsWith(
"typedef") &&
5241 yyextra->current->bodyLine==-1)
5244 yyextra->current->bodyLine = yyextra->yyLineNr;
5245 yyextra->current->bodyColumn = yyextra->yyColNr;
5246 BEGIN( GetCallType );
5248 else if (!yyextra->current->name.empty())
5250 yyextra->current->args = yytext;
5251 yyextra->current->bodyLine = yyextra->yyLineNr;
5252 yyextra->current->bodyColumn = yyextra->yyColNr;
5253 yyextra->currentArgumentContext = FuncQual;
5254 yyextra->fullArgString=yyextra->current->args;
5255 yyextra->copyArgString=&yyextra->current->args;
5256 BEGIN( ReadFuncArgType ) ;
5260<GetCallType>{BN}*{ID}{BN}*"*" {
5263 yyextra->funcPtrType=
"(";
5264 yyextra->funcPtrType+=yytext;
5265 yyextra->roundCount=0;
5269 if (yyextra->insideCS && yyextra->current->name.empty())
5274 yyextra->current->type += *yytext;
5275 yyextra->lastRoundContext = FindMembers;
5276 yyextra->pCopyRoundString = &yyextra->current->type;
5277 yyextra->roundCount = 0;
5280 else if (!yyextra->current->name.empty())
5282 yyextra->current->args = yytext;
5283 yyextra->current->bodyLine = yyextra->yyLineNr;
5284 yyextra->current->bodyColumn = yyextra->yyColNr;
5285 yyextra->currentArgumentContext = FuncQual;
5286 yyextra->fullArgString=yyextra->current->args;
5287 yyextra->copyArgString=&yyextra->current->args;
5288 BEGIN( ReadFuncArgType ) ;
5295<ReadFuncArgType>[^ \/\r\t\n\[\]\)\(\"\'#]+ { *yyextra->copyArgString+=yytext;
5296 if (yyextra->insideCS) yyextra->fullArgString+=
substitute(yytext,
".",
"::");
5297 else yyextra->fullArgString+=yytext;
5299<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *yyextra->copyArgString+=yytext;
5300 yyextra->fullArgString+=yytext;
5302<CopyArgRound>[^\/\n\)\(\"\']+ {
5303 *yyextra->copyArgString+=yytext;
5304 yyextra->fullArgString+=yytext;
5306<CopyArgSquare>[^\/\n\]\[\"\']+ {
5307 *yyextra->copyArgString+=yytext;
5308 yyextra->fullArgString+=yytext;
5310<ReadFuncArgType,ReadTempArgs>{BN}* {
5311 *yyextra->copyArgString+=
" ";
5312 yyextra->fullArgString+=
" ";
5315<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>{RAWBEGIN} {
5317 yyextra->lastRawStringContext = YY_START;
5318 yyextra->pCopyRawString = yyextra->copyArgString;
5319 *yyextra->pCopyRawString+=yytext;
5320 yyextra->fullArgString+=yytext;
5323<ReadFuncArgType,CopyArgRound,CopyArgSquare,CopyArgSharp,ReadTempArgs>\" {
5324 *yyextra->copyArgString+=*yytext;
5325 yyextra->fullArgString+=*yytext;
5326 yyextra->lastCopyArgStringContext = YY_START;
5327 BEGIN( CopyArgString );
5329<ReadFuncArgType>"[" {
5330 if (!yyextra->insidePHP) REJECT;
5331 *yyextra->copyArgString+=*yytext;
5332 yyextra->fullArgString+=*yytext;
5333 yyextra->argSquareCount=0;
5334 yyextra->lastCopyArgContext = YY_START;
5335 BEGIN( CopyArgSquare );
5337<ReadFuncArgType,ReadTempArgs>"(" {
5338 *yyextra->copyArgString+=*yytext;
5339 yyextra->fullArgString+=*yytext;
5340 yyextra->argRoundCount=0;
5341 yyextra->lastCopyArgContext = YY_START;
5342 BEGIN( CopyArgRound );
5344<ReadFuncArgType>")" {
5345 *yyextra->copyArgString+=*yytext;
5346 yyextra->fullArgString+=*yytext;
5348 if (yyextra->insideJS)
5359 yyextra->docBackup = yyextra->current->doc;
5360 yyextra->briefBackup = yyextra->current->brief;
5362 BEGIN( yyextra->currentArgumentContext );
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
5365<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
5366 if (yyextra->currentArgumentContext==DefineEnd)
5370 int i;
for (i=(
int)yyleng-1;i>=0;i--)
5376 BEGIN( yyextra->currentArgumentContext );
5382 yyextra->fullArgString+=yytext;
5383 yyextra->lastCopyArgChar=0;
5384 yyextra->lastCommentInArgContext=YY_START;
5386 BEGIN( CopyArgCommentLine );
5388 BEGIN( CopyArgComment );
5392<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { }
5393<ReadFuncArgType,ReadTempArgs>{CCS} {
5394 yyextra->lastCContext = YY_START;
5395 BEGIN( SkipComment );
5397<ReadFuncArgType,ReadTempArgs>{CPPC} {
5398 yyextra->lastCContext = YY_START;
5399 BEGIN( SkipCxxComment );
5415<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
5417 if (yyextra->currentArgumentContext==DefineEnd)
5421 int i;
for (i=(
int)yyleng-1;i>0;i--)
5425 *yyextra->copyArgString+=*yytext;
5426 yyextra->fullArgString+=*yytext;
5429 BEGIN( yyextra->currentArgumentContext );
5435 yyextra->lastCopyArgChar=*yytext;
5438 yyextra->lastCommentInArgContext=YY_START;
5439 yyextra->fullArgString+=text;
5441 BEGIN( CopyArgCommentLine );
5443 BEGIN( CopyArgComment );
5446<CopyArgComment>^{B}*"*"+/{BN}+
5447<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
5448<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
5449 if (yyextra->lastCopyArgChar!=0)
5450 unput(yyextra->lastCopyArgChar);
5451 BEGIN( yyextra->lastCommentInArgContext );
5453<CopyArgCommentLine>\n { yyextra->fullArgString+=yytext;
5455 if (yyextra->lastCopyArgChar!=0)
5456 unput(yyextra->lastCopyArgChar);
5457 BEGIN( yyextra->lastCommentInArgContext );
5459<CopyArgCommentLine>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
5460 yyextra->docBlockName=
"uml";
5461 yyextra->fullArgString+=yytext;
5462 BEGIN(CopyArgVerbatim);
5464<CopyArgCommentLine>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid"|"code")/[^a-z_A-Z0-9\-] {
5465 yyextra->docBlockName=&yytext[1];
5466 yyextra->fullArgString+=yytext;
5467 BEGIN(CopyArgVerbatim);
5469<CopyArgCommentLine>{CMD}("f$"|"f["|"f{"|"f(") {
5470 yyextra->docBlockName=&yytext[1];
5471 if (yyextra->docBlockName.at(1)==
'[')
5473 yyextra->docBlockName.at(1)=
']';
5475 if (yyextra->docBlockName.at(1)==
'{')
5477 yyextra->docBlockName.at(1)=
'}';
5479 if (yyextra->docBlockName.at(1)==
'(')
5481 yyextra->docBlockName.at(1)=
')';
5483 yyextra->fullArgString+=yytext;
5484 BEGIN(CopyArgVerbatim);
5486<CopyArgVerbatim>{CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9\-] {
5487 yyextra->fullArgString+=yytext;
5488 if (&yytext[4]==yyextra->docBlockName)
5490 yyextra->docBlockName=
"";
5491 BEGIN(CopyArgCommentLine);
5494<CopyArgVerbatim>{CMD}("f$"|"f]"|"f}"|"f)") {
5495 yyextra->fullArgString+=yytext;
5496 if (yyextra->docBlockName==&yytext[1])
5498 yyextra->docBlockName=
"";
5499 BEGIN(CopyArgCommentLine);
5502<CopyArgCommentLine>[^\\\@\n]+ { yyextra->fullArgString+=yytext; }
5503<CopyArgCommentLine>. { yyextra->fullArgString+=*yytext; }
5504<CopyArgComment,CopyArgVerbatim>\n { yyextra->fullArgString+=*yytext;
lineCount(yyscanner); }
5505<CopyArgComment,CopyArgVerbatim>. { yyextra->fullArgString+=*yytext; }
5506<CopyArgComment>{CMD}("brief"|"short"){B}+ {
5507 warn(yyextra->fileName,yyextra->yyLineNr,
5508 "Ignoring {:c}brief command inside argument documentation",*yytext
5510 yyextra->fullArgString+=
' ';
5513 *yyextra->copyArgString+=*yytext;
5514 yyextra->fullArgString+=*yytext;
5515 yyextra->argSharpCount=1;
5516 BEGIN( CopyArgSharp );
5519 *yyextra->copyArgString+=*yytext;
5520 yyextra->fullArgString+=*yytext;
5522 *yyextra->currentArgumentList = *
stringToArgumentList(yyextra->language, yyextra->fullArgString);
5524 BEGIN( yyextra->currentArgumentContext );
5527 yyextra->argRoundCount++;
5528 *yyextra->copyArgString+=*yytext;
5529 yyextra->fullArgString+=*yytext;
5532 *yyextra->copyArgString+=*yytext;
5533 yyextra->fullArgString+=*yytext;
5534 if (yyextra->argRoundCount>0)
5535 yyextra->argRoundCount--;
5537 BEGIN( yyextra->lastCopyArgContext );
5540 yyextra->argSquareCount++;
5541 *yyextra->copyArgString+=*yytext;
5542 yyextra->fullArgString+=*yytext;
5545 *yyextra->copyArgString+=*yytext;
5546 yyextra->fullArgString+=*yytext;
5547 if (yyextra->argSquareCount>0)
5548 yyextra->argSquareCount--;
5550 BEGIN( yyextra->lastCopyArgContext );
5553 *yyextra->copyArgString+=*yytext;
5554 yyextra->fullArgString+=*yytext;
5555 yyextra->argRoundCount=0;
5556 yyextra->lastCopyArgContext = YY_START;
5557 BEGIN( CopyArgRound );
5560 yyextra->argSharpCount++;
5562 *yyextra->copyArgString+=*yytext;
5563 yyextra->fullArgString+=*yytext;
5566 *yyextra->copyArgString+=*yytext;
5567 yyextra->fullArgString+=*yytext;
5568 yyextra->argSharpCount--;
5569 if (yyextra->argSharpCount>0)
5575 BEGIN( ReadTempArgs );
5579<CopyArgString,CopyArgPHPString>\\. {
5580 *yyextra->copyArgString+=yytext;
5581 yyextra->fullArgString+=yytext;
5584 *yyextra->copyArgString+=*yytext;
5585 yyextra->fullArgString+=*yytext;
5586 BEGIN( yyextra->lastCopyArgStringContext );
5588<CopyArgPHPString>\' {
5589 *yyextra->copyArgString+=*yytext;
5590 yyextra->fullArgString+=*yytext;
5591 BEGIN( yyextra->lastCopyArgStringContext );
5593<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>{CHARLIT} {
5594 if (yyextra->insidePHP)
5600 *yyextra->copyArgString+=yytext;
5601 yyextra->fullArgString+=yytext;
5604<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSquare,CopyArgSharp>\' {
5605 *yyextra->copyArgString+=yytext;
5606 yyextra->fullArgString+=yytext;
5607 if (yyextra->insidePHP)
5609 yyextra->lastCopyArgStringContext=YY_START;
5610 BEGIN(CopyArgPHPString);
5613<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {
5614 *yyextra->copyArgString+=yytext;
5615 yyextra->fullArgString+=yytext;
5617<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>\n {
5619 *yyextra->copyArgString+=*yytext;
5620 yyextra->fullArgString+=*yytext;
5622<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>{ID} {
5623 *yyextra->copyArgString+=yytext;
5624 yyextra->fullArgString+=yytext;
5626<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>. {
5627 *yyextra->copyArgString+=*yytext;
5628 yyextra->fullArgString+=*yytext;
5636<FuncRound>"(" { yyextra->current->args += *yytext ;
5637 ++yyextra->roundCount ;
5639<FuncRound>")" { yyextra->current->args += *yytext ;
5640 if ( yyextra->roundCount )
5641 --yyextra->roundCount ;
5653 if (
dstrcmp(yytext,
";")==0 &&
5654 ((yyextra->insideJS || yyextra->insidePHP) &&
5655 !yyextra->current->type.containsWord(
"function")) )
5657 yyextra->current->reset();
5659 BEGIN( FindMembers );
5663 unput(*yytext); BEGIN( SFunction );
5666<FuncQual>{BN}*"abstract"{BN}* {
5668 yyextra->current->virt = Specifier::Pure;
5669 yyextra->current->args +=
" override ";
5671<FuncQual,TrailingReturn>{BN}*"override"{BN}* {
5673 yyextra->current->spec.setOverride(
true);
5674 yyextra->current->args +=
" override ";
5675 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5678<FuncQual,TrailingReturn>{BN}*"final"{BN}* {
5680 yyextra->current->spec.setFinal(
true);
5681 yyextra->current->args +=
" final ";
5682 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5685<FuncQual>{BN}*"sealed"{BN}* {
5687 yyextra->current->spec.setSealed(
true);
5688 yyextra->current->args +=
" sealed ";
5690<FuncQual>{BN}*"new"{BN}* {
5692 yyextra->current->spec.setNew(
true);
5693 yyextra->current->args +=
" new ";
5695<FuncQual>{BN}*"const"{BN}* {
5697 yyextra->current->args +=
" const ";
5698 yyextra->current->argList.setConstSpecifier(
true);
5700<FuncQual>{BN}*"volatile"{BN}* {
5702 yyextra->current->args +=
" volatile ";
5703 yyextra->current->argList.setVolatileSpecifier(
true);
5705<FuncQual>{BN}*"noexcept"{BN}* {
5707 yyextra->current->args +=
" noexcept ";
5708 yyextra->current->spec.setNoExcept(
true);
5710<FuncQual>{BN}*"noexcept"{BN}*"("{B}*false{B}*")"{BN}* {
5712 yyextra->current->args +=
" noexcept(false)";
5714<FuncQual>{BN}*"noexcept"{BN}*"(" {
5716 yyextra->current->args +=
" noexcept(";
5717 yyextra->current->spec.setNoExcept(
true);
5718 yyextra->lastRoundContext=FuncQual;
5719 yyextra->pCopyRoundString=&yyextra->current->args;
5720 yyextra->roundCount=0;
5724 yyextra->current->args +=
" &";
5727<FuncQual>{BN}*"&&" {
5728 yyextra->current->args +=
" &&";
5732<FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* {
5734 yyextra->current->args +=
" = 0";
5735 yyextra->current->virt = Specifier::Pure;
5736 yyextra->current->argList.setPureSpecifier(
true);
5737 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5740<FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}* {
5742 yyextra->current->args +=
" = delete";
5743 yyextra->current->spec.setDelete(
true);
5744 yyextra->current->argList.setIsDeleted(
true);
5745 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5748<FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}* {
5750 yyextra->current->args +=
" = default";
5751 yyextra->current->spec.setDefault(
true);
5752 if (YY_START==TrailingReturn) yyextra->current->argList.finishTrailingReturnType();
5755<FuncQual>{BN}*"->"{BN}* {
5757 yyextra->current->argList.setTrailingReturnType(
" -> ");
5758 yyextra->current->args +=
" -> ";
5759 yyextra->roundCount=0;
5760 BEGIN(TrailingReturn);
5762<TrailingReturn>[{;] {
5763 if (yyextra->roundCount>0) REJECT;
5765 yyextra->current->argList.finishTrailingReturnType();
5768<TrailingReturn>"requires"{BN}+ {
5769 if (yyextra->insideJava) REJECT;
5770 yyextra->requiresContext = FuncQual;
5771 yyextra->current->req+=
' ';
5772 yyextra->current->argList.finishTrailingReturnType();
5773 BEGIN(RequiresClause);
5775<TrailingReturn>"(" {
5776 yyextra->roundCount++;
5777 yyextra->current->argList.appendTrailingReturnType(yytext);
5778 yyextra->current->args+=yytext;
5780<TrailingReturn>")" {
5781 if (yyextra->roundCount>0)
5783 yyextra->roundCount--;
5787 warn(yyextra->fileName,yyextra->yyLineNr,
5788 "Found ')' without opening '(' for trailing return type '{})...'",
5789 yyextra->current->argList.trailingReturnType());
5791 yyextra->current->argList.appendTrailingReturnType(yytext);
5792 yyextra->current->args+=yytext;
5795 yyextra->current->argList.appendTrailingReturnType(yytext);
5796 yyextra->current->args+=yytext;
5800 yyextra->current->argList.appendTrailingReturnType(yytext);
5801 yyextra->current->args+=
' ';
5803<FuncRound,FuncFunc>{BN}*","{BN}* {
5805 yyextra->current->args +=
", " ;
5807<FuncQual,FuncRound,FuncFunc>{BN}+ {
5809 yyextra->current->args +=
' ' ;
5811<SFunction,FuncQual,FuncRound,FuncFunc>"#" {
if (yyextra->insidePHP)
5813 yyextra->lastCPPContext = YY_START;
5817 if (!yyextra->insideCS)
5824 if (yyextra->insideCli && yyextra->current_root->section.isCompound())
5831 yyextra->lastInitializerContext=YY_START;
5832 yyextra->sharpCount=0;
5833 yyextra->initBracketCount=0;
5834 yyextra->current->initializer.str(yytext);
5835 BEGIN(ReadInitializer);
5838<ReadExpressionBody>";" {
5839 if (!yyextra->current->sli.empty() && yyextra->previous)
5841 yyextra->previous->sli = yyextra->current->sli;
5842 yyextra->current->sli.clear();
5844 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
5859 if (yyextra->insideCpp &&
dstrcmp(yytext,
"requires")==0)
5862 yyextra->requiresContext = YY_START;
5863 if (!yyextra->current->req.empty())
5865 yyextra->current->req+=
" && ";
5867 BEGIN(RequiresClause);
5869 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
5872 yyextra->current->typeConstr.clear();
5873 yyextra->current->typeConstr.push_back(
Argument());
5874 yyextra->lastCSConstraint = YY_START;
5875 BEGIN( CSConstraintName );
5879 yyextra->current->args = yytext;
5880 yyextra->oldStyleArgType.clear();
5881 BEGIN(OldStyleArgs);
5885 yyextra->current->args += yytext;
5891 splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
5893 if (yyextra->current->doc!=yyextra->docBackup)
5895 doc=yyextra->current->doc;
5896 yyextra->current->doc=yyextra->docBackup;
5898 if (yyextra->current->brief!=yyextra->briefBackup)
5900 brief=yyextra->current->brief;
5901 yyextra->current->brief=yyextra->briefBackup;
5903 addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
5904 oldStyleArgName,brief,doc);
5905 yyextra->current->args.clear();
5906 if (*yytext==
';') yyextra->oldStyleArgType.clear();
5908<OldStyleArgs>{ID} { yyextra->current->args += yytext; }
5910 if (yyextra->current->argList.empty())
5912 yyextra->current->argList.setNoParameters(
true);
5918<OldStyleArgs>. { yyextra->current->args += *yytext; }
5919<FuncQual,FuncRound,FuncFunc>\" {
5920 if (yyextra->insideIDL && yyextra->insideCppQuote)
5926 yyextra->current->args += *yytext;
5929<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
5930<FuncQual>{BN}*"try:" |
5931<FuncQual>{BN}*"try"{BN}+ {
5932 yyextra->insideTryBlock=
true;
5934 if (yytext[yyleng-1]==
':')
5940<FuncQual>{BN}*"throw"{BN}*"(" {
5941 yyextra->current->exception =
" throw (" ;
5942 yyextra->roundCount=0;
5944 BEGIN( ExcpRound ) ;
5946<FuncQual>{BN}*"raises"{BN}*"(" {
5947 yyextra->current->exception =
" raises (" ;
5949 yyextra->roundCount=0;
5950 BEGIN( ExcpRound ) ;
5952<FuncQual>{BN}*"throws"{BN}+ {
5953 yyextra->current->exception =
" throws " ;
5957<ExcpRound>"(" { yyextra->current->exception += *yytext ;
5958 ++yyextra->roundCount ;
5960<ExcpRound>")" { yyextra->current->exception += *yytext ;
5961 if ( yyextra->roundCount )
5962 --yyextra->roundCount ;
5967 yyextra->current->exception += *yytext;
5970 unput(
'{'); BEGIN( FuncQual );
5973 unput(
';'); BEGIN( FuncQual );
5976 yyextra->current->exception +=
' ';
5980 yyextra->current->exception += *yytext;
5982<SFunction>"(" { yyextra->current->type += yyextra->current->name ;
5983 yyextra->current->name = yyextra->current->args ;
5984 yyextra->current->args = yytext ;
5985 yyextra->roundCount=0;
5986 BEGIN( FuncRound ) ;
5989 if (!yyextra->insidePHP) BEGIN(SkipInits);
5995 yyextra->current->fileName = yyextra->fileName;
5996 yyextra->current->startLine = yyextra->yyBegLineNr;
5997 yyextra->current->startColumn = yyextra->yyBegColNr;
5998 static const reg::Ex re(R
"(\([^)]*[*&][^)]*\))");
6000 std::string type = yyextra->current->type.str();
6004 ti =
match.position();
6008 if (
size_t di = yyextra->current->type.find(
"decltype(");
6014 size_t ts=yyextra->current->type.find(
'<');
6015 size_t te=yyextra->current->type.rfind(
'>');
6018 bool startsWithTypedef = yyextra->current->type.startsWith(
"typedef ");
6021 bool isVariable = !yyextra->current->type.empty() &&
6022 (!isFunction || startsWithTypedef);
6027 if (*yytext!=
';' || yyextra->current_root->section.isCompound())
6032 if (yyextra->isTypedef && !startsWithTypedef)
6034 yyextra->current->type.prepend(
"typedef ");
6036 yyextra->current->section = EntryType::makeVariable() ;
6041 yyextra->current->section = EntryType::makeFunction() ;
6042 yyextra->current->proto = *yytext==
';';
6050 if (yyextra->isTypedef && !startsWithTypedef)
6052 yyextra->current->type.prepend(
"typedef ");
6055 yyextra->current->section = EntryType::makeVariable();
6060 yyextra->current->section = EntryType::makeFunction();
6061 yyextra->current->proto =
true;
6065 if ( yyextra->insidePHP)
6067 if (yyextra->current->type.findAndRemoveWord(
"final"))
6069 yyextra->current->spec.setFinal(
true);
6071 if (yyextra->current->type.findAndRemoveWord(
"abstract"))
6073 yyextra->current->spec.setAbstract(
true);
6076 if ( yyextra->insidePHP && !yyextra->current->type.containsWord(
"function"))
6079 if ( *yytext ==
'{' )
6081 yyextra->lastCurlyContext = FindMembers;
6082 yyextra->curlyCount=0;
6087 BEGIN( FindMembers );
6092 if ( yyextra->insidePHP)
6094 yyextra->current->type.findAndRemoveWord(
"function");
6096 yyextra->previous = yyextra->current;
6097 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6100 if (yyextra->previous->spec.isOptional() || yyextra->previous->spec.isRequired())
6102 yyextra->current->spec.setOptional(
true).setRequired(
true);
6104 yyextra->lastCurlyContext = FindMembers;
6105 if ( *yytext ==
',' )
6107 yyextra->current->type =
stripFuncPtr(yyextra->previous->type);
6109 if ( *yytext ==
'{' )
6111 if ( !yyextra->insidePHP && yyextra->current_root->section.isCompound() )
6113 yyextra->previous->spec.setInline(
true);
6115 yyextra->curlyCount=0;
6116 BEGIN( SkipCurly ) ;
6118 else if ( *yytext ==
'=' )
6120 yyextra->previous->spec.setInline(
true);
6121 yyextra->curlyCount=0;
6122 BEGIN( ReadExpressionBody );
6126 if (!yyextra->previous->section.isVariable())
6127 yyextra->previous->bodyLine=-1;
6128 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.
6132<SkipInits>">"{BN}*"{" {
6134 yyextra->curlyCount=1;
6135 BEGIN(SkipC11Inits);
6137<SkipInits>{ID}{BN}*"{" {
6139 yyextra->curlyCount=1;
6140 BEGIN(SkipC11Inits);
6143 ++yyextra->curlyCount;
6146 if ( --yyextra->curlyCount<=0 )
6157 ++yyextra->curlyCount ;
6159<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | )
6162 if( yyextra->curlyCount )
6164 --yyextra->curlyCount ;
6168 if (!yyextra->current->sli.empty() && yyextra->previous)
6170 yyextra->previous->sli = yyextra->current->sli;
6171 yyextra->current->sli.clear();
6173 if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
6174 BEGIN( yyextra->lastCurlyContext ) ;
6177<SkipCurly>"}"{BN}*{DCOMM}"<" {
6179 if ( yyextra->curlyCount )
6182 --yyextra->curlyCount ;
6186 yyextra->current->endBodyLine=yyextra->yyLineNr;
6187 yyextra->tempEntry = yyextra->current;
6188 yyextra->current = yyextra->previous;
6190 yyextra->docBlockContext = SkipCurlyEndDoc;
6191 yyextra->docBlockInBody =
false;
6192 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6194 yyextra->docBlock.str(std::string());
6195 yyextra->docBlockTerm =
'}';
6196 if (yytext[yyleng-3]==
'/')
6208<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" {
6209 yyextra->docBlockContext = SkipCurlyEndDoc;
6210 yyextra->docBlockInBody =
false;
6211 yyextra->docBlockAutoBrief = ( yytext[yyleng-2]==
'*' &&
Config_getBool(JAVADOC_AUTOBRIEF) ) ||
6213 yyextra->docBlock.str(std::string());
6214 yyextra->docBlockTerm =
'}';
6215 if (yytext[yyleng-3]==
'/')
6226<SkipCurlyEndDoc>"}" {
6228 if (yyextra->tempEntry)
6230 yyextra->current = yyextra->tempEntry;
6231 yyextra->tempEntry.reset();
6233 BEGIN( yyextra->lastCurlyContext );
6235<SkipCurly,ReadExpressionBody>\" {
6237 yyextra->lastStringContext=YY_START;
6238 BEGIN( SkipString );
6240<SkipCurly>^{B}*"#" {
6241 if (yyextra->insidePHP)
6244 BEGIN( SkipCurlyCpp );
6246<SkipCurly,SkipC11Inits,SkipInits,ReadExpressionBody>\n {
6250<SkipCurly,SkipCurlyCpp,ReadInitializer,ReadInitializerPtr>"<<<" {
6251 if (!yyextra->insidePHP)
6257 yyextra->lastHereDocContext = YY_START;
6261<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
6263 yyextra->lastRawStringContext = YY_START;
6264 yyextra->dummyRawString.clear();
6265 yyextra->pCopyRawString = &yyextra->dummyRawString;
6266 *yyextra->pCopyRawString += yytext;
6269<SkipCurly,SkipCurlyCpp>[^\n#"R'@\\/{}<\$]+ {
6273<SkipCurly,SkipCurlyCpp>"\$" {}
6277 yyextra->lastCurlyContext = FindMembers;
6280<SkipCurlyCpp>\\[\r]*"\n"[\r]* {
6284<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CCS} {
6286 yyextra->lastCContext = YY_START;
6289<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,CopyC11Attribute,ReadExpressionBody>{CPPC} {
6291 yyextra->lastCContext = YY_START;
6292 BEGIN(SkipCxxComment);
6294<SkipInits,SkipC11Inits>"(" {
6295 yyextra->roundCount=0;
6296 yyextra->lastSkipRoundContext=YY_START;
6299<SkipInits,SkipC11Inits>\" {
6300 yyextra->lastStringContext=YY_START;
6301 BEGIN( SkipString );
6304 warn(yyextra->fileName,yyextra->yyLineNr,
6305 "Found ';' while parsing initializer list! "
6306 "(doxygen could be confused by a macro call without semicolon)"
6308 BEGIN( FindMembers );
6310<SkipInits,SkipCurly,SkipCurlyCpp>"#" {
6311 if (!yyextra->insidePHP)
6314 yyextra->lastCContext = YY_START;
6315 BEGIN(SkipCxxComment);
6317<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>@\" {
6318 if (!yyextra->insideCS) REJECT;
6321 yyextra->lastSkipVerbStringContext=YY_START;
6322 yyextra->pSkipVerbString=&yyextra->dummyTextStream;
6323 yyextra->dummyTextStream.clear();
6324 BEGIN(SkipVerbString);
6326<SkipInits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>{CHARLIT} {
6327 if (yyextra->insidePHP) REJECT;
6329<SkipInits,SkipCurly,SkipCurlyCpp>\' {
6330 if (yyextra->insidePHP)
6332 yyextra->lastStringContext=YY_START;
6333 BEGIN(SkipPHPString);
6336<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,ReadExpressionBody>. { }
6337<SkipString,SkipPHPString>\\. { }
6339 BEGIN( yyextra->lastStringContext );
6342 BEGIN( yyextra->lastStringContext );
6344<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
6345<SkipString,SkipPHPString>\n {
6349<SkipString,SkipPHPString>. { }
6355 yyextra->current->section = EntryType::makeEmpty() ;
6356 yyextra->current->type.clear() ;
6357 yyextra->current->name.clear() ;
6358 yyextra->current->args.clear() ;
6359 yyextra->current->argList.clear();
6360 BEGIN( FindMembers ) ;
6363 if (yyextra->insideIDL && (yyextra->current->spec.isSingleton() || yyextra->current->spec.isService()))
6367 if (!yyextra->current->name.empty() && !yyextra->current_root->name.empty())
6371 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6373 if (!yyextra->baseName.empty())
6375 yyextra->current->extends.emplace_back(
6376 yyextra->baseName,Protection::Public,Specifier::Normal);
6377 yyextra->baseName.clear();
6379 yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
6384 yyextra->current->section = EntryType::makeEmpty() ;
6385 yyextra->current->type.clear() ;
6386 yyextra->current->name.clear() ;
6387 yyextra->current->args.clear() ;
6388 yyextra->current->argList.clear();
6390 BEGIN( FindMembers ) ;
6392<CompoundName>{SCOPENAME}/{BN}*"<" {
6393 yyextra->sharpCount = 0;
6394 yyextra->current->name = yytext ;
6396 if (yyextra->current->spec.isProtocol())
6398 yyextra->current->name+=
"-p";
6401 yyextra->lastClassTemplSpecContext = ClassVar;
6402 if (yyextra->insideObjC)
6404 BEGIN( ObjCProtocolList );
6406 else if (yyextra->insideCS)
6413 yyextra->roundCount=0;
6414 BEGIN( ClassTemplSpec );
6421 yyextra->current->tArgLists.
push_back(al);
6422 yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
6423 yyextra->templateStr=
"<";
6424 yyextra->current->name +=
"<";
6425 yyextra->fullArgString = yyextra->templateStr;
6426 yyextra->copyArgString = &yyextra->current->name;
6428 yyextra->currentArgumentContext = ClassVar;
6429 BEGIN( ReadTempArgs );
6431<ObjCProtocolList>"<" {
6432 yyextra->insideProtocolList=
true;
6435<ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})? {
6436 yyextra->current->name += yytext;
6438 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
6441 if (yyextra->current->spec.isProtocol())
6448 BEGIN( yyextra->lastClassTemplSpecContext );
6452<ClassTemplSpec>"<" {
6453 yyextra->current->name += yytext;
6454 if (yyextra->roundCount==0) yyextra->sharpCount++;
6457 yyextra->current->name += yytext;
6459<CompoundName>({SCOPENAME}|{CSSCOPENAME}){BN}*";" {
6460 if (yyextra->insideCS && yyextra->current->type ==
"namespace")
6464 yyextra->current->name =
substitute(yytext,
".",
"::");
6465 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6470 else if (!yyextra->current->tArgLists.empty())
6474 yyextra->current->name = yytext;
6475 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6478 DString rn = yyextra->current_root->name;
6480 if (!yyextra->current->name.empty() && !rn.
empty())
6484 yyextra->current->spec.setForwardDecl(
true);
6485 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6487 else if (yyextra->insideIDL &&
6488 (((yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isService()) &&
6489 yyextra->current->spec.isInterface()) ||
6490 ((yyextra->current_root->spec.isService() || yyextra->current_root->spec.isSingleton()) &&
6491 yyextra->current->spec.isService())
6499 yyextra->current->name = yytext;
6500 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
6501 yyextra->current->section = yyextra->current->spec.isInterface() ? EntryType::makeExportedInterface()
6504 yyextra->current->spec.setInterface(
false).setService(
false);
6508 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
6511 if (!(yyextra->insideCS && yyextra->current->type ==
"namespace"))
6514 yyextra->current->reset();
6516 if (yyextra->insideObjC)
6518 yyextra->language = yyextra->current->lang = SrcLangExt::Cpp;
6519 yyextra->insideObjC =
false;
6521 if (yyextra->isTypedef)
6523 yyextra->current->type.prepend(
"typedef");
6525 BEGIN( FindMembers );
Wrapper class for the Entry type.
6528<CompoundName>{SCOPENAME}/{BN}*"(" {
6529 yyextra->current->name = yytext ;
6532 if (yyextra->insideCpp && yyextra->current->name==
"alignas")
6534 yyextra->lastAlignAsContext = YY_START;
6539 if (yyextra->current->spec.isProtocol())
6541 yyextra->current->name +=
"-p";
6546<AlignAs>"(" { yyextra->roundCount=0;
6547 BEGIN( AlignAsEnd );
6551<AlignAsEnd>"(" { yyextra->roundCount++; }
6552<AlignAsEnd>")" {
if (--yyextra->roundCount<0)
6554 BEGIN( yyextra->lastAlignAsContext );
6560 yyextra->current->name = yytext ;
6564 yyextra->current->bodyLine = yyextra->yyLineNr;
6565 yyextra->current->bodyColumn = yyextra->yyColNr;
6566 yyextra->current->initializer.str(std::string());
6567 yyextra->lastInitializerContext = FindMembers;
6568 yyextra->sharpCount=0;
6569 yyextra->initBracketCount=0;
6570 BEGIN(ReadInitializer);
6572<CompoundName>{SCOPENAME}/{BN}*"," {
6574 yyextra->current->reset();
6577<CompoundName>{SCOPENAME} {
6578 yyextra->current->name = yytext ;
6581 if (yyextra->current->spec.isProtocol())
6583 yyextra->current->name +=
"-p";
6585 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6591<CompoundName>({ID}{BN}*"::"{BN}*)+("inline"{BN}+({ID}{BN}*"::"{BN}*)*)+{ID} {
6592 if (yyextra->current->section.isNamespace())
DString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple internal white...
6604<CompoundName>{CSSCOPENAME} {
6605 yyextra->current->name =
substitute(yytext,
".",
"::");
6609<ClassVar>{SCOPENAME}{BNopt}/"(" {
6610 if (yyextra->insideIDL &&
literal_at(yytext,
"switch") && !
isId(yytext[6]))
6613 yyextra->roundCount=0;
6614 BEGIN(SkipUnionSwitch);
6619 yyextra->yyBegColNr=yyextra->yyColNr;
6620 yyextra->yyBegLineNr=yyextra->yyLineNr;
6621 yyextra->current->name = yytext;
6622 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
6625 BEGIN( FindMembers );
6629 if (yyextra->isTypedef)
6633 yyextra->current->type.prepend(
"typedef ");
6641<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
6642 if (yyextra->insideCli)
6645 yyextra->current->spec.setSealedClass(
true);
6647 yyextra->current->spec.setAbstractClass(
true);
6655<ClassVar>({ID}{BN}*"::"{BN}*)+{ID} {
6656 yyextra->yyBegColNr=yyextra->yyColNr;
6657 yyextra->yyBegLineNr=yyextra->yyLineNr;
6660 if (yyextra->current->section.isEnum())
6662 yyextra->current->section = EntryType::makeVariable() ;
6664 yyextra->current->type +=
' ' ;
6665 yyextra->current->type += yyextra->current->name ;
6674 yyextra->yyBegColNr=yyextra->yyColNr;
6675 yyextra->yyBegLineNr=yyextra->yyLineNr;
6677 if (yyextra->insideIDL &&
dstrcmp(yytext,
"switch")==0)
6680 yyextra->roundCount=0;
6681 BEGIN(SkipUnionSwitch);
6683 else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (
dstrcmp(yytext,
"implements")==0 ||
dstrcmp(yytext,
"extends")==0))
6685 yyextra->current->type.clear();
6686 yyextra->baseProt = Protection::Public;
6687 yyextra->baseVirt = Specifier::Normal;
6688 yyextra->baseName.clear();
6689 BEGIN( BasesProt ) ;
6691 else if (yyextra->insideCS &&
dstrcmp(yytext,
"where")==0)
6693 yyextra->current->typeConstr.clear();
6694 yyextra->current->typeConstr.push_back(
Argument());
6695 yyextra->lastCSConstraint = YY_START;
6696 BEGIN( CSConstraintName );
6698 else if (yyextra->insideCli &&
dstrcmp(yytext,
"abstract")==0)
6700 yyextra->current->spec.setAbstract(
true);
6702 else if (yyextra->insideCli &&
dstrcmp(yytext,
"sealed")==0)
6704 yyextra->current->spec.setSealed(
true);
6706 else if (
dstrcmp(yytext,
"final")==0)
6708 yyextra->current->spec.setFinal(
true);
6712 if (yyextra->current->section.isEnum())
6714 yyextra->current->section = EntryType::makeVariable() ;
6716 yyextra->current->type +=
' ' ;
6717 yyextra->current->type += yyextra->current->name ;
6718 yyextra->current->name = yytext ;
6727 if (yyextra->insideObjC && *yytext==
'(')
6729 yyextra->current->name+=
'(';
6730 yyextra->current->spec.setCategory(
true);
6731 BEGIN( ClassCategory );
6733 else if ((yyextra->insideCS && *yytext==
'(') ||
6734 (yyextra->insideJava && *yytext==
'('))
6736 yyextra->current->args=yytext;
6737 yyextra->currentArgumentContext = ClassVar;
6738 yyextra->fullArgString = yyextra->current->args;
6739 yyextra->copyArgString = &yyextra->current->args;
6740 BEGIN( ReadFuncArgType ) ;
6746 BEGIN( FindMembers );
6749<CSConstraintType,CSConstraintName>{CCS}{CCE} { }
6750<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) {
6751 yyextra->fullArgString.clear();
6752 yyextra->lastCopyArgChar=
'#';
6753 yyextra->lastCommentInArgContext=YY_START;
6755 BEGIN( CopyArgCommentLine );
6757 BEGIN( CopyArgComment );
6759<CSConstraintType,CSConstraintName>"#" {
6760 yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
6762<CSConstraintType>"=>" {
6767 BEGIN( yyextra->lastCSConstraint );
6769<CSConstraintType>"{" {
6773 BEGIN( yyextra->lastCSConstraint );
6775<CSConstraintType,CSConstraintName>";" {
6778 BEGIN( yyextra->lastCSConstraint );
6780<CSConstraintName>":" {
6781 BEGIN( CSConstraintType );
6783<CSConstraintName>{ID} {
6785 yyextra->current->typeConstr.back().name=yytext;
6787<CSConstraintType>"where" {
6788 yyextra->current->typeConstr.push_back(
Argument());
6789 BEGIN( CSConstraintName );
6791<CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")? {
6792 if (yyextra->current->typeConstr.back().type.empty())
6795 yyextra->current->typeConstr.back().type=yytext;
6799 DString name = yyextra->current->typeConstr.back().name;
6800 yyextra->current->typeConstr.push_back(
Argument());
6801 yyextra->current->typeConstr.back().name=
name;
6802 yyextra->current->typeConstr.back().type=yytext;
6805<CSConstraintName,CSConstraintType>\n {
6808<CSConstraintName,CSConstraintType>. {
6810<ClassCategory>{ID} {
6811 yyextra->current->name+=yytext;
6813<ClassCategory>")"/{BN}*"{" {
6814 yyextra->current->name+=
')';
6817<ClassCategory>")"/{BN}*"<" {
6818 yyextra->current->name+=
')';
6819 BEGIN( ObjCProtocolList );
6822 yyextra->current->name+=
')';
6823 if (yyextra->current->spec.isProtocol() || yyextra->current->section.isObjcImpl())
6835 if (yyextra->current->section.isVariable())
6837 yyextra->current->bitfields+=
":";
6838 yyextra->current->args.clear();
6841 else if (yyextra->current->section.isEnum())
6844 yyextra->current->args.clear();
6845 BEGIN(EnumBaseType);
6849 yyextra->current->type.clear();
6850 if (yyextra->current->spec.isInterface() ||
6851 yyextra->current->spec.isStruct() ||
6852 yyextra->current->spec.isRecord() ||
6853 yyextra->current->spec.isRef() ||
6854 yyextra->current->spec.isValue() ||
6855 yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
6858 yyextra->baseProt = Protection::Public;
6862 yyextra->baseProt = Protection::Private;
6864 yyextra->baseVirt = Specifier::Normal;
6865 yyextra->baseName.clear();
6866 BEGIN( BasesProt ) ;
6870 if (yyextra->isTypedef)
6872 yyextra->current->type.prepend(
"typedef");
6874 if ((yytext[0]==
'*' || yytext[0]==
'&') && yyextra->current->section.isEnum())
6876 yyextra->current->section = EntryType::makeVariable() ;
6878 if (yytext[0]==
';' && yyextra->current->section.isEnum())
6880 yyextra->current->reset();
6887 BEGIN( FindMembers );
6889<Bases,ClassVar>{CPPC}"/"/[^/] {
6890 if (!yyextra->insideObjC)
6897 yyextra->current->program << yytext;
6898 yyextra->current->fileName = yyextra->fileName ;
6899 yyextra->current->startLine = yyextra->yyLineNr ;
6900 yyextra->current->startColumn = yyextra->yyColNr;
6901 yyextra->curlyCount=0;
6902 BEGIN( ReadBodyIntf );
6905<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
6906<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
6907<Bases,ClassVar>{CPPC}"!" |
6908<Bases,ClassVar>[\-+]{BN}* {
6909 if (!yyextra->insideObjC)
6916 yyextra->current->program << yytext;
6917 yyextra->current->fileName = yyextra->fileName ;
6918 yyextra->current->startLine = yyextra->yyLineNr ;
6919 yyextra->current->startColumn = yyextra->yyColNr;
6920 yyextra->curlyCount=0;
6921 BEGIN( ReadBodyIntf );
6924<CompoundName,ClassVar>{B}*"{"{B}* {
6925 yyextra->current->program.str(std::string());
6926 yyextra->current->fileName = yyextra->fileName ;
6927 yyextra->current->bodyLine = yyextra->yyLineNr;
6928 yyextra->current->bodyColumn = yyextra->yyColNr;
6930 if (yyextra->current->name.empty() && !yyextra->isTypedef)
6932 if (yyextra->current->section.isNamespace())
6936 yyextra->current->name=
"anonymous_namespace{"+
stripPath(yyextra->current->fileName)+
"}";
6948 yyextra->curlyCount=0;
6949 if (yyextra->current_root &&
6950 !yyextra->current_root->spec.isInterface() &&
6951 (yyextra->current->spec.isInterface() ||
6952 yyextra->current->spec.isProtocol() ||
6953 yyextra->current->spec.isCategory() ||
6954 yyextra->current->section.isObjcImpl()
6959 BEGIN( ReadBodyIntf );
6961 else if (yyextra->current->section.isNamespace())
6963 BEGIN( ReadNSBody );
DString stripPath(const DString &s)
6970<BasesProt>"virtual"{BN}+ {
lineCount(yyscanner); yyextra->baseVirt = Specifier::Virtual; }
6971<BasesProt>"public"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Public; }
6972<BasesProt>"protected"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Protected; }
6973<BasesProt>"internal"{BN}+ {
if (!yyextra->insideCli) REJECT ;
lineCount(yyscanner); yyextra->baseProt = Protection::Package; }
6974<BasesProt>"private"{BN}+ {
lineCount(yyscanner); yyextra->baseProt = Protection::Private; }
6975<BasesProt>{BN} {
lineCount(yyscanner); }
6976<BasesProt>. { unput(*yytext); BEGIN(Bases); }
6977<Bases>"decltype"{BN}*"(" {
6979 yyextra->roundCount=0;
6980 yyextra->lastSkipRoundContext=YY_START;
6983<Bases>("\\")?({ID}"\\")*{ID} {
6984 if (!yyextra->insidePHP)
6993 yyextra->baseName += bn;
6994 yyextra->current->args +=
' ';
6995 yyextra->current->args += yytext;
6998<Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}("...")? {
7004 yyextra->current->typeConstr.clear();
7005 yyextra->current->typeConstr.push_back(
Argument());
7006 yyextra->lastCSConstraint = YY_START;
7007 BEGIN( CSConstraintName );
7011 yyextra->baseName+=yytext;
7012 yyextra->current->args +=
' ';
7013 yyextra->current->args += yytext;
7016<Bases>{BN}*{ID}("."{ID})* {
7018 yyextra->baseName +=
name;
7019 yyextra->current->args +=
' ';
7020 yyextra->current->args +=
name;
7022<ClassVar,Bases>\n/{BN}*[^{, \t\n:] {
7023 if (!yyextra->insideObjC)
7033<ClassVar,Bases>"@end" {
7041<ClassVar>"<" { yyextra->current->name += *yytext;
7042 yyextra->sharpCount=1;
7043 yyextra->roundCount=0;
7044 yyextra->lastSkipSharpContext = YY_START;
7045 yyextra->specName = &yyextra->current->name;
7046 BEGIN ( Specialization );
7050 yyextra->sharpCount=1;
7051 yyextra->roundCount=0;
7052 yyextra->lastSkipSharpContext = YY_START;
7053 if (yyextra->insideObjC)
7063 yyextra->templateStr = yytext;
7064 yyextra->specName = &yyextra->templateStr;
7065 BEGIN ( Specialization );
7068<Specialization>"<" { *yyextra->specName += *yytext;
7069 if (yyextra->roundCount==0) yyextra->sharpCount++;
7071<Specialization>">" {
7072 *yyextra->specName += *yytext;
7073 if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
7076 BEGIN(yyextra->lastSkipSharpContext);
7079<Specialization>{BN}+ {
lineCount(yyscanner); *yyextra->specName +=
' '; }
7080<Specialization>"<<" { *yyextra->specName += yytext; }
7081<Specialization>">>"/{B}*"::" {
7086<Specialization>">>" {
7087 if (yyextra->insideCS)
7097 if (yyextra->roundCount>0)
7099 *yyextra->specName += yytext;
7109<Specialization>"typename"{BN}+ {
lineCount(yyscanner); }
7110<Specialization>"(" { *yyextra->specName += *yytext; yyextra->roundCount++; }
7111<Specialization>")" { *yyextra->specName += *yytext; yyextra->roundCount--; }
7113<Specialization>"\\\\" { *yyextra->specName += *yytext;}
7114<Specialization>"\\'" { *yyextra->specName += *yytext;}
7115<Specialization>"\\\"" { *yyextra->specName += *yytext;}
7116<Specialization>"'" { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
7117<Specialization>"\"" { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
7118<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *yyextra->specName += *yytext;}
7119<SpecializationSingleQuote>"\\'" { *yyextra->specName += *yytext;}
7120<SpecializationSingleQuote>"'" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7121<SpecializationDoubleQuote>"\\\"" { *yyextra->specName += *yytext;}
7122<SpecializationDoubleQuote>"\"" { *yyextra->specName += *yytext; BEGIN(Specialization);}
7123<SpecializationSingleQuote,SpecializationDoubleQuote>. { *yyextra->specName += *yytext;}
7126 *yyextra->specName += *yytext;
7128<SkipRound>"(" { ++yyextra->roundCount; }
7129<SkipRound>")" {
if (--yyextra->roundCount<0)
7130 BEGIN ( yyextra->lastSkipRoundContext );
7133 yyextra->lastStringContext=SkipRound;
7136<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*) {
lineCount(yyscanner);
7137 if (yyextra->insideProtocolList)
7139 yyextra->baseName+=
"-p";
7143 yyextra->current->args +=
',' ;
7146 if (!yyextra->baseName.empty())
7148 yyextra->current->extends.emplace_back(
7149 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7152 if (yyextra->current->spec.isInterface() || yyextra->current->spec.isStruct() ||
7153 yyextra->current->spec.isRecord() ||
7154 yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS ||
7155 yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
7157 yyextra->baseProt=Protection::Public;
7161 yyextra->baseProt=Protection::Private;
7163 yyextra->baseVirt=Specifier::Normal;
7164 yyextra->baseName.clear();
7167 yyextra->insideProtocolList=
false;
7170 if (yyextra->insideObjC && !yyextra->current->spec.isProtocol())
7186 if (*yytext==
',' && yyextra->insideObjC)
7188 yyextra->insideProtocolList=
true;
7194 yyextra->current->program.str(std::string());
7195 yyextra->current->fileName = yyextra->fileName ;
7196 yyextra->current->bodyLine = yyextra->yyLineNr;
7197 yyextra->current->bodyColumn = yyextra->yyColNr;
7199 if (!yyextra->baseName.empty())
7201 yyextra->current->extends.emplace_back(
7202 yyextra->baseName,yyextra->baseProt,yyextra->baseVirt
7204 yyextra->baseName.clear();
7206 yyextra->curlyCount=0;
7207 if (yyextra->insideObjC)
7209 BEGIN( ReadBodyIntf );
7216<SkipUnionSwitch>{B}*"(" {
7217 yyextra->roundCount++;
7219<SkipUnionSwitch>")" {
7220 if (--yyextra->roundCount==0)
7225<SkipUnionSwitch>\n {
lineCount(yyscanner); }
7227<Comment>{BN}+ { yyextra->current->program << yytext ;
7230<Comment>{CCS} { yyextra->current->program << yytext ; }
7231<Comment>{CPPC} { yyextra->current->program << yytext ; }
7232<Comment>{CMD}("code"|"verbatim"|"iliteral") {
7233 if (yyextra->doxygenComment) yyextra->insideCode=
true;
7234 yyextra->current->program << yytext ;
7236<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
7237 if (yyextra->doxygenComment) yyextra->insideCode=
false;
7238 yyextra->current->program << yytext ;
7240<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
7241<Comment>{CCE} { yyextra->current->program << yytext ;
7242 if (!yyextra->insideCode)
7244 yyextra->doxygenComment=
false;
7245 BEGIN( yyextra->lastContext );
7248<Comment>. { yyextra->current->program << *yytext ; }
7250<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,ReadExpressionBody,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
7252 if (!yyextra->current->doc.empty())
7254 yyextra->current->doc+=
"\n\n";
7258 yyextra->current->docLine = yyextra->yyLineNr;
7259 yyextra->current->docFile = yyextra->fileName;
7262 yyextra->lastDocContext = YY_START;
7263 if (yyextra->current_root->section.isScope())
7265 yyextra->current->inside = yyextra->current_root->name+
"::";
7267 yyextra->docBlockContext = YY_START;
7268 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7273 yyextra->docBlock.
str(indent.
str());
7275 if (yyextra->docBlockAutoBrief)
7277 yyextra->current->briefLine = yyextra->yyLineNr;
7278 yyextra->current->briefFile = yyextra->fileName;
7283<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,ReadExpressionBody,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
7289 yyextra->lastDocContext = YY_START;
7292 if (yyextra->current_root->section.isScope())
7294 yyextra->current->inside = yyextra->current_root->name+
"::";
7296 yyextra->current->docLine = yyextra->yyLineNr;
7297 yyextra->current->docFile = yyextra->fileName;
7298 yyextra->docBlockContext = YY_START;
7299 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7301 yyextra->docBlockAutoBrief = javadocAutoBrief;
7305 yyextra->docBlock.
str(indent.
str());
7307 if (yyextra->docBlockAutoBrief)
7309 yyextra->current->briefLine = yyextra->yyLineNr;
7310 yyextra->current->briefFile = yyextra->fileName;
7317 yyextra->current->program << yytext ;
7318 yyextra->lastContext = YY_START ;
7319 yyextra->doxygenComment=
true;
7323<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,ReadExpressionBody,SkipInits,Bases,OldStyleArgs>^{B}+({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7328<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,ReadExpressionBody,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
7329 yyextra->lastDocContext = YY_START;
7332 if (yyextra->current_root->section.isScope())
7334 yyextra->current->inside = yyextra->current_root->name+
"::";
7336 yyextra->current->docLine = yyextra->yyLineNr;
7337 yyextra->current->docFile = yyextra->fileName;
7338 yyextra->docBlockContext = YY_START;
7339 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7341 yyextra->docBlockAutoBrief = javadocAutoBrief;
7345 yyextra->docBlock.
str(indent.
str());
7347 if (yyextra->docBlockAutoBrief)
7349 yyextra->current->briefLine = yyextra->yyLineNr;
7350 yyextra->current->briefFile = yyextra->fileName;
7355<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
7356 yyextra->lastDocContext = YY_START;
7357 if (yyextra->current_root->section.isScope())
7359 yyextra->current->inside = yyextra->current_root->name+
"::";
7361 yyextra->docBlockContext = YY_START;
7362 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7363 yyextra->docBlockAutoBrief =
false;
7367 yyextra->docBlock.
str(indent.
str());
7372<FindMembers,FindFields,MemberSpec,SkipCurly,ReadExpressionBody,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
7373 yyextra->lastDocContext = YY_START;
7374 if (yyextra->current_root->section.isScope())
7376 yyextra->current->inside = yyextra->current_root->name+
"::";
7378 yyextra->docBlockContext = YY_START;
7379 yyextra->docBlockInBody = YY_START==SkipCurly || YY_START==ReadExpressionBody;
7380 yyextra->docBlockAutoBrief =
false;
7383 yyextra->docBlock.
str(indent.
str());
7387<FindMembers>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
7389 yyextra->externLinkage=
true;
7392 if (yyextra->externLinkage)
7394 yyextra->externLinkage=
false;
7396 else if (yyextra->insideCS &&
7397 !yyextra->current->name.empty() &&
7398 !yyextra->current->type.empty())
7400 if (yyextra->current->mtype == MethodTypes::Event)
7402 yyextra->mtype = MethodTypes::Event;
7404 else if (yyextra->current->type.containsWord(
"event"))
7406 yyextra->current->mtype = yyextra->mtype = MethodTypes::Event;
7410 yyextra->current->mtype = yyextra->mtype = MethodTypes::Property;
7412 yyextra->current->bodyLine = yyextra->yyLineNr;
7413 yyextra->current->bodyColumn = yyextra->yyColNr;
7414 yyextra->curlyCount=0;
7415 BEGIN( CSAccessorDecl );
7417 else if (yyextra->insideIDL && yyextra->current->spec.isAttribute())
7421 yyextra->current->exception =
" {";
7422 BEGIN(UNOIDLAttributeBlock);
7426 if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
7427 yyextra->current->name.empty()
7431 yyextra->needsSemi =
false;
7432 if (yyextra->current->isStatic)
7434 yyextra->current->name=
"[static initializer]";
7435 yyextra->current->type.clear();
7439 yyextra->current->name=
"[instance initializer]";
7456 yyextra->current->bodyLine = yyextra->yyLineNr;
7457 yyextra->current->bodyColumn = yyextra->yyColNr;
7458 yyextra->current->initializer.str(yytext);
7459 yyextra->lastInitializerContext = YY_START;
7460 yyextra->sharpCount=0;
7461 yyextra->initBracketCount=1;
7462 BEGIN(ReadInitializer);
7466<CSAccessorDecl>"{" { yyextra->curlyCount++; }
7467<CSAccessorDecl>"}"{B}*"=" {
7469 if (yyextra->curlyCount != 0) REJECT;
7470 yyextra->current->initializer.str(
"=");
7471 yyextra->current->endBodyLine=yyextra->yyLineNr;
7472 yyextra->lastInitializerContext = FindMembers;
7473 BEGIN(ReadInitializer);
7475<CSAccessorDecl>"}" {
7476 if (yyextra->curlyCount)
7478 yyextra->curlyCount--;
7482 yyextra->mtype = MethodTypes::Method;
7483 yyextra->virt = Specifier::Normal;
7485 yyextra->current->endBodyLine=yyextra->yyLineNr;
7490<CSAccessorDecl>"private "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateSettable(
true); }
7491<CSAccessorDecl>"protected "{BN}*"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedSettable(
true); }
7492<CSAccessorDecl>"private "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setPrivateGettable(
true); }
7493<CSAccessorDecl>"protected "{BN}*"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setProtectedGettable(
true); }
7494<CSAccessorDecl>"set" {
if (yyextra->curlyCount==0) yyextra->current->spec.setSettable(
true); }
7495<CSAccessorDecl>"get" {
if (yyextra->curlyCount==0) yyextra->current->spec.setGettable(
true); }
7496<CSAccessorDecl>"init" {
if (yyextra->curlyCount==0) yyextra->current->spec.setInitonly(
true); }
7497<CSAccessorDecl>"add" {
if (yyextra->curlyCount==0) yyextra->current->spec.setAddable(
true); }
7498<CSAccessorDecl>"remove" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRemovable(
true); }
7499<CSAccessorDecl>"raise" {
if (yyextra->curlyCount==0) yyextra->current->spec.setRaisable(
true); }
7500<CSAccessorDecl>{CHARLIT} {}
7501<CSAccessorDecl>{ID} {}
7502<CSAccessorDecl>"\"" { BEGIN(CSString);}
7503<CSAccessorDecl>"." {}
7504<CSAccessorDecl>\n {
lineCount(yyscanner); }
7505<CSString>"\"" { BEGIN(CSAccessorDecl);}
7513<SliceSequence>{SCOPENAME} {
7514 if (yyextra->current->spec.isLocal())
7516 yyextra->current->type =
"local ";
7518 yyextra->current->type +=
"sequence<";
7519 yyextra->current->type += yytext;
7520 yyextra->current->type +=
">";
7523<SliceSequence>{BN}*">"{BN}* {
7525 BEGIN(SliceSequenceName);
7528<SliceSequenceName>{ID}{BN}* {
7530 yyextra->current->name = yytext ;
7531 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7534<SliceSequenceName>";" {
7535 yyextra->current->section = EntryType::makeVariable();
7536 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7541<SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
7543 if (yyextra->current->spec.isLocal())
7545 yyextra->current->type =
"local ";
7547 yyextra->current->type +=
"dictionary<";
7548 yyextra->current->type += yytext;
7549 yyextra->current->type +=
">";
7550 yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
7553<SliceDictionary>{BN}*">"{BN}* {
7555 BEGIN(SliceDictionaryName);
7558<SliceDictionaryName>{ID}{BN}* {
7560 yyextra->current->name = yytext ;
7561 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
7564<SliceDictionaryName>";" {
7565 yyextra->current->section = EntryType::makeVariable();
7566 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
7576<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? {
7577 int markerLen = yytext[yyleng-1]==
'<' ? 4 : 3;
7578 yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
7581<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" {
7582 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7583 BEGIN( yyextra->docBlockContext );
7585<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" {
7586 yyextra->docBlock << yytext;
7587 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7588 BEGIN( yyextra->docBlockContext );
7590<DocLine>{NONLopt}/"\n" {
7591 yyextra->docBlock << yytext;
7592 handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.empty());
7593 BEGIN( yyextra->docBlockContext );
7598<DocBlock>"*"*{CCE} {
7600 BEGIN(yyextra->docBlockContext);
7602<DocBlock>"\\ilinebr "{B}*"*"/[^/] {
7605 yyextra->docBlock <<
"\\ilinebr " << indent;
7607<DocBlock>^{B}*"*"+/[^/] {
7610 yyextra->docBlock << indent;
7612<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] {
7615 yyextra->docBlock << indent;
7617<DocBlock>^{B}*({CPPC}){B}* {
7620 yyextra->docBlock << yytext;
7624 yyextra->docBlock << yytext;
7626<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
7627 yyextra->docBlock << yytext;
7629<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
7630 yyextra->docBlock << yytext;
7631 char blockName[] =
"f$";
7633 if (c==
'[') blockName[1]=
']';
7634 else if (c==
'{') blockName[1]=
'}';
7635 else if (c==
'(') blockName[1]=
')';
7637 BEGIN(DocCopyBlock);
7639<DocBlock>{CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
7640 yyextra->fileName = &yytext[6];
7641 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7642 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
7643 yyextra->docBlock << yytext;
7645<DocBlock>{CMD}"ifile"{B}+{FILEMASK} {
7646 yyextra->fileName = &yytext[6];
7647 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
7648 yyextra->docBlock << yytext;
7650<DocBlock>{CMD}"iline"{LINENR}{B} {
7655 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
7659 yyextra->yyLineNr = nr;
7661 yyextra->docBlock << yytext;
7663<DocBlock>{B}*"<"{PRE}">" {
7664 yyextra->docBlock << yytext;
7666 BEGIN(DocCopyBlock);
7668<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
7669 yyextra->docBlock << yytext;
7671 BEGIN(DocCopyBlock);
7673<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"mermaid")/[^a-z_A-Z0-9\-] {
7674 yyextra->docBlock << yytext;
7676 BEGIN(DocCopyBlock);
7678<DocBlock>{CMD}("code")/[^a-z_A-Z0-9\-] {
7679 yyextra->docBlock << yytext;
7681 BEGIN(DocCopyBlock);
7683<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7685 yyextra->docBlock <<
"\\ilinebr ";
7686 yyextra->docBlock << pat;
7688 BEGIN(DocCopyBlock);
7690<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7692 yyextra->docBlock << pat;
7694 BEGIN(DocCopyBlock);
7696<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7697<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7698<DocBlock>"\\ilinebr "({B}*"*"+)?{B}{0,3}"```"[`]* {
7700 yyextra->docBlock <<
"\\ilinebr ";
7701 yyextra->docBlock << pat;
7703 BEGIN(DocCopyBlock);
7705<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/(".")?[a-zA-Z0-9#_-]+ |
7706<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*/"{"[^}]+"}" |
7707<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7709 yyextra->docBlock << pat;
7711 BEGIN(DocCopyBlock);
7714 yyextra->docBlock <<
"```";
7717 yyextra->docBlock << yytext;
7720 yyextra->docBlock << yytext;
7722 BEGIN(DocCopyBlock);
7724<DocBlock>{B}*"<"{CODE}">" {
7725 if (yyextra->insideCS)
7727 yyextra->docBlock << yytext;
7729 BEGIN(DocCopyBlock);
7736<DocBlock>[^@*~`'\/\\\n]+ {
7737 yyextra->docBlock << yytext;
7741 yyextra->docBlock << *yytext;
7744 yyextra->docBlock << *yytext;
7749<DocCopyBlock>"</"{PRE}">" {
7754 yyextra->docBlock << yytext;
7756<DocCopyBlock>"</"{CODE}">" {
7761 yyextra->docBlock << yytext;
7763<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
7768 yyextra->docBlock << yytext;
7770<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"endmermaid"|"enduml"|"endcode")/[^a-z_A-Z0-9] {
7775 yyextra->docBlock << yytext;
7777<DocCopyBlock>^{B}*"*"+/{BN}+ {
7778 if ((yyextra->docBlockName==
"verbatim") || (yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7786 yyextra->docBlock << indent;
7789<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* {
7790 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7794 yyextra->docBlock << indent;
7801<DocCopyBlock>^{B}*"*"+/({ID}|"(") {
7802 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7806 yyextra->docBlock << indent+
"*";
7813<DocCopyBlock>^{B}*"*"+/{BN}* {
7814 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
7817 if (yyextra->nestedComment>0)
7820 yyextra->docBlock << indent+
"*";
7825 yyextra->docBlock << indent;
7833<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
7839 yyextra->docBlock << pat;
7841<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
7847 yyextra->docBlock << pat;
7849<DocCopyBlock>"```" {
7850 if (yyextra->docBlockName==
"``")
7852 yyextra->docBlock <<
"`";
7854 yyextra->docBlock <<
"``";
7859 yyextra->docBlock << yytext;
7862<DocCopyBlock>"''"/[^a-z_A-Z0-9-] {
7867 yyextra->docBlock << yytext;
7869<DocCopyBlock>"'"/[^'a-z_A-Z0-9-] {
7874 yyextra->docBlock << yytext;
7876<DocCopyBlock>"`"{1,2} {
7881 yyextra->docBlock << yytext;
7883<DocCopyBlock>[^<@/\*\]`'~"\$\\\n]+ {
7884 yyextra->docBlock << yytext;
7887 yyextra->docBlock << yytext;
7888 if (yyextra->docBlockName==
"code" || yyextra->docBlockName==
"iliteral")
7892 yyextra->lastStringContext=YY_START;
7893 yyextra->pCopyQuotedGString=&yyextra->docBlock;
7894 yyextra->stopAtInvalidString=
true;
7898<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
7901 yyextra->nestedComment++;
7903 else if (yytext[0]==
'*' && yyextra->nestedComment>0)
7905 yyextra->nestedComment--;
7907 else if (yytext[0]==
'*' && yyextra->nestedComment==0 && yyextra->isCodeBlock)
7909 warn(yyextra->fileName,yyextra->yyLineNr,
7910 "Found end of C comment inside a '{}' block without matching start of the comment!"
7911 " Maybe the end marker for the block is missing?",
7912 yyextra->docBlockName);
7915 yyextra->docBlock << yytext;
7918 yyextra->docBlock << *yytext;
7922 yyextra->docBlock << *yytext;
7924<DocCopyBlock><<EOF>> {
7925 warn(yyextra->fileName,yyextra->yyLineNr,
7926 "reached end of file while inside a '{}' block!"
7927 " The command that should end the block seems to be missing!",
7928 yyextra->docBlockName);
7935<Prototype>"operator"{B}*"("{B}*")" {
7936 yyextra->current->name+=yytext;
7939 yyextra->current->args+=*yytext;
7940 yyextra->currentArgumentContext = PrototypeQual;
7941 yyextra->fullArgString = yyextra->current->args;
7942 yyextra->copyArgString = &yyextra->current->args;
7943 BEGIN( ReadFuncArgType ) ;
7945<Prototype>"("({ID}"::")*({B}*[&*])+ {
7946 if (yyextra->insidePHP)
7952 yyextra->current->type+=yyextra->current->name+yytext;
7953 yyextra->current->name.clear();
7954 BEGIN( PrototypePtr );
7957<PrototypePtr>{SCOPENAME} {
7958 yyextra->current->name+=yytext;
7961 yyextra->current->args+=*yytext;
7962 yyextra->currentArgumentContext = PrototypeQual;
7963 yyextra->fullArgString = yyextra->current->args;
7964 yyextra->copyArgString = &yyextra->current->args;
7965 BEGIN( ReadFuncArgType ) ;
7968 yyextra->current->type+=
')';
7972 yyextra->current->name+=yytext;
7975 BEGIN( PrototypeSkipLine);
7977<PrototypeQual>{B}*"const"{B}* {
7978 yyextra->current->args +=
" const ";
7979 yyextra->current->argList.setConstSpecifier(
true);
7981<PrototypeQual>{B}*"volatile"{B}* {
7982 yyextra->current->args +=
" volatile ";
7983 yyextra->current->argList.setVolatileSpecifier(
true);
7985<PrototypeQual>{B}*"="{B}*"0"{B}* {
7986 yyextra->current->args +=
" = 0";
7987 yyextra->current->virt = Specifier::Pure;
7988 yyextra->current->argList.setPureSpecifier(
true);
7990<PrototypeQual>"throw"{B}*"(" {
7991 yyextra->current->exception =
"throw(";
7992 BEGIN(PrototypeExc);
7995 yyextra->current->exception +=
')';
7996 BEGIN(PrototypeQual);
7999 yyextra->current->exception += *yytext;
8002 yyextra->current->args += *yytext;
8005 yyextra->current->name += *yytext;
8007<PrototypeSkipLine>. {
8013<SkipCxxComment>.*"\\\n" {
8014 if (yyextra->insideCS)
8023<SkipCxxComment>{ANYopt}/\n {
8024 BEGIN( yyextra->lastCContext ) ;
8026<SkipComment>[^\*\n]+
8031 if (!yyextra->insideCpp) REJECT;
8032 if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
8033 yyextra->lastC11AttributeContext = YY_START;
8034 yyextra->pCopyC11AttributeString = &yyextra->current->attributes;
8035 BEGIN( CopyC11Attribute );
8040 if (yyextra->insideIDL && yyextra->insideCppQuote)
8044 else if (yyextra->insidePHP)
8046 yyextra->lastStringContext=YY_START;
8051 if (!yyextra->insidePHP)
8053 yyextra->lastCPPContext = YY_START;
8058 yyextra->lastCContext = YY_START ;
8059 BEGIN( SkipCxxComment ) ;
8063 if (!yyextra->insidePHP)
8065 yyextra->lastCContext = YY_START ;
8066 BEGIN( SkipCxxComment ) ;
8069 if (yyextra->insidePHP)
8071 yyextra->lastStringContext=YY_START;
8072 BEGIN(SkipPHPString);
8076 if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
8078 if (yyextra->current->type.empty())
8080 if (yyextra->current->name.empty())
8081 yyextra->current->name=
"?";
8083 yyextra->current->name+=
"?";
8087 yyextra->current->type+=
"?";
8091<*>"}" { yyextra->exported=
false; }
8093<SkipComment>{CPPC}|{CCS}
8094<*>{CCS} { yyextra->lastCContext = YY_START ;
8095 BEGIN( SkipComment ) ;
8097<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
8099 yyextra->lastCContext = YY_START ;
8100 BEGIN( SkipCxxComment ) ;
8103 if (yyextra->insideCS && yyextra->fakeNS)
8107 BEGIN ( ReadNSBody);
8119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8121 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
8123 *buf = yyextra->inputString[yyextra->inputPosition++] ;
8133 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8134 yyextra->outerScopeEntries.clear();
8135 yyextra->baseName.clear();
8136 yyextra->protection = Protection::Public;
8137 yyextra->baseProt = Protection::Public;
8138 yyextra->sharpCount = 0;
8139 yyextra->roundCount = 0;
8140 yyextra->curlyCount = 0;
8141 yyextra->mtype = MethodTypes::Method;
8142 yyextra->isStatic =
false;
8143 yyextra->virt = Specifier::Normal;
8144 yyextra->baseVirt = Specifier::Normal;
8145 yyextra->isTypedef =
false;
8146 yyextra->insideTryBlock =
false;
8147 yyextra->insideFormula =
false;
8148 yyextra->insideCode=
false;
8150 yyextra->previous = 0;
8151 yyextra->firstTypedefEntry.reset();
8152 yyextra->memspecEntry.reset();
8157 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8158 if (yyextra->insideJava)
8160 yyextra->protection = (yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isEnum()) ? Protection::Public : Protection::Package;
8162 yyextra->current->protection = yyextra->protection;
8163 yyextra->current->exported = yyextra->exported ;
8164 yyextra->current->mtype = yyextra->mtype;
8165 yyextra->current->virt = yyextra->virt;
8166 yyextra->current->isStatic = yyextra->isStatic;
8167 yyextra->current->lang = yyextra->language;
8169 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
8170 yyextra->isTypedef=
false;
8180 char result[md5_sig.size()*3+2];
8183 for (
size_t i=0;i<md5_sig.size();i++)
8185 static const char oct[]=
"01234567";
8186 uint8_t
byte = md5_sig[i];
8187 *p++=oct[(
byte>>6)&7];
8188 *p++=oct[(
byte>>3)&7];
8189 *p++=oct[(
byte>>0)&7];
8197 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8198 if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
8200 yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,
id);
8206 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8209 for (p = yytext ; *p ; ++p )
8213 yyextra->yyLineNr++;
8219 yyextra->column+=tabSize - (yyextra->column%tabSize);
8220 yyextra->yyColNr=1+yyextra->column;
8233 size_t col=startIndent;
8239 if (c==
'\t') col+=tabSize-(col%tabSize);
8240 else if (c==
'\n') col=0;
8248 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8249 yyextra->current->
protection = yyextra->protection = prot;
8250 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
8251 yyextra->current->type.clear();
8252 yyextra->current->name.clear();
8253 yyextra->current->args.clear();
8254 yyextra->current->argList.clear();
8260 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8261 size_t tl=yyextra->current->type.length();
8262 if( tl>0 && !yyextra->current->name.empty() && yyextra->current->type.at(tl-1)!=
'.')
8264 yyextra->current->type +=
' ' ;
8266 yyextra->current->type += yyextra->current->name;
8267 yyextra->current->name.clear() ;
8268 tl=yyextra->current->type.length();
8269 if( tl>0 && !yyextra->current->args.empty() && yyextra->current->type.at(tl-1)!=
'.')
8271 yyextra->current->type +=
' ' ;
8273 yyextra->current->type += yyextra->current->args ;
8274 yyextra->current->args.clear() ;
8275 yyextra->current->argList.clear();
8282 if (s==
nullptr || *s==0)
return name;
8284 if (name.at(0)==
'"' && name.at(name.length()-1)==
'"')
8286 name=name.mid(1,name.length()-2);
8296 bool funcPtr = i>0 && type[i-1]==
')';
8298 while (i>0 && (type[i-1]==
'*' || type[i-1]==
'&' || type[i-1]==
' ')) i--;
8299 if (funcPtr && i>0 && type[i-1]==
'(') i--;
8300 return type.
left(i);
8306 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8309 yyextra->docBlock <<
"\\iskip";
8311 yyextra->docBlockName=blockName;
8312 yyextra->fencedSize=fencedSize;
8313 yyextra->isCodeBlock=codeBlock;
8314 yyextra->nestedComment=0;
8320 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8321 if (yyextra->docBlockName==blockName && (fencedSize==0 || fencedSize==yyextra->fencedSize))
8325 yyextra->docBlock <<
"\\endiskip";
8327 yyextra->docBlockName=
"";
8347 size_t i=name.find(
"operator");
8349 if (i==0 && !
isId(name.at(8)))
return true;
8350 if (i>0 && !
isId(name.at(i-1)) && !
isId(name.at(i+8)))
return true;
8358 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8360 yyextra->insideIDL = yyextra->language==SrcLangExt::IDL;
8361 yyextra->insideJava = yyextra->language==SrcLangExt::Java;
8362 yyextra->insideCS = yyextra->language==SrcLangExt::CSharp;
8363 yyextra->insideD = yyextra->language==SrcLangExt::D;
8364 yyextra->insidePHP = yyextra->language==SrcLangExt::PHP;
8365 yyextra->insideObjC = yyextra->language==SrcLangExt::ObjC;
8366 yyextra->insideJS = yyextra->language==SrcLangExt::JS;
8367 yyextra->insideSlice = yyextra->language==SrcLangExt::Slice;
8368 yyextra->insideCpp = (yyextra->language==SrcLangExt::Cpp ||
8369 yyextra->language==SrcLangExt::Lex);
8380 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8381 if (yyextra->current_root->section.isScope())
8384 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
8386 for (
const ArgumentList &srcAl : yyextra->current_root->tArgLists)
8388 yyextra->current->tArgLists.insert(yyextra->current->tArgLists.begin(),srcAl);
8398 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8399 if (!yyextra->fileName.lower().endsWith(
".c"))
return false;
8400 if (yyextra->current->argList.empty())
return false;
8401 for (
const Argument &a : yyextra->current->argList)
8412 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8413 if (yyextra->insideJava)
8416 yyextra->current->protection = Protection::Public;
8418 yyextra->current->protection = Protection::Protected;
8420 yyextra->current->protection = Protection::Private;
8422 yyextra->current->protection = Protection::Package;
8429 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8430 int si =
static_cast<int>(yyextra->current->args.length());
8431 if (yyextra->oldStyleArgType.empty())
8433 std::string args = yyextra->current->args.str();
8434 static const reg::Ex re(R
"(\([^)]*\).*)");
8440 bi1=(int)match.position();
8441 size_t secondMatchStart = match.position()+match.length();
8444 bi2=(int)match.position();
8448 if (bi1!=-1 && bi2!=-1)
8451 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8453 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8454 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8456 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8457 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8458 yyextra->oldStyleArgType+=yyextra->current->args.
mid(i);
8463 yyextra->oldStyleArgType = yyextra->current->args.left(s);
8466 while (i<si && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i++;
8467 yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
8469 while (i<si &&
isId(yyextra->current->args.at(i))) i++;
8470 oldStyleArgName = yyextra->current->args.
mid(s,i-s);
8476 while (i>=0 &&
isId(yyextra->current->args.at(i))) i--;
8479 while (i>=0 && ((c=yyextra->current->args.at(i))==
'*' || isspace((uint8_t)c))) i--;
8483 yyextra->oldStyleArgType=yyextra->current->args.left(i);
8484 oldStyleArgPtr=yyextra->current->args.
mid(i,j-i);
8497 while (j<l && ((c=yyextra->current->args.at(j))==
'*' || isspace((uint8_t)c))) j++;
8500 oldStyleArgPtr=yyextra->current->args.
left(j);
8519 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8520 for (
Argument &a : yyextra->current->argList)
8526 a.
name=name.stripWhiteSpace();
8529 a.
docs=brief+
"\n\n"+docs;
8531 else if (!brief.
empty())
8561 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8564 yyextra->current->briefFile = yyextra->fileName;
8565 yyextra->current->briefLine = yyextra->yyLineNr;
8569 yyextra->current->docFile = yyextra->fileName;
8570 yyextra->current->docLine = yyextra->yyLineNr;
8578 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8579 if (yyextra->tempEntry==0)
8584 yyextra->previous = yyextra->current;
8585 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8589 yyextra->previous = yyextra->current;
8590 yyextra->current = yyextra->tempEntry;
8591 yyextra->tempEntry.reset();
8598 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8601 if (yyextra->docBlockInBody && hideInBodyDocs)
return;
8602 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
8605 std::shared_ptr<Entry> docEntry = yyextra->docBlockInBody && yyextra->previous ? yyextra->previous : yyextra->current;
8606 if (yyextra->docBlockInBody && docEntry && docEntry->inbodyLine==-1)
8608 docEntry->inbodyFile = yyextra->fileName;
8609 docEntry->inbodyLine = lineNr;
8613 bool needsEntry=
false;
8615 Markdown markdown(yyextra->fileName,lineNr);
8618 while (yyextra->commentScanner.parseCommentBlock(
8619 yyextra->thisParser,
8620 yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(),
8624 yyextra->docBlockInBody ?
false : brief,
8625 yyextra->docBlockInBody ?
false : yyextra->docBlockAutoBrief,
8626 yyextra->docBlockInBody,
8627 yyextra->protection,
8638 DString docFile = yyextra->current->docFile;
8640 yyextra->current->docFile = docFile;
8641 yyextra->current->docLine = lineNr;
8649 if (yyextra->docBlockTerm)
8651 unput(yyextra->docBlockTerm);
8652 yyextra->docBlockTerm=0;
8659 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8670 DString orgDoc = yyextra->current->doc;
8671 DString orgBrief = yyextra->current->brief;
8672 int orgDocLine = yyextra->current->docLine;
8673 int orgBriefLine = yyextra->current->briefLine;
8675 yyextra->current->doc.
clear();
8676 yyextra->current->brief.clear();
8679 int lineNr = orgDocLine;
8681 Markdown markdown(yyextra->fileName,lineNr);
8684 while (yyextra->commentScanner.parseCommentBlock(
8685 yyextra->thisParser,
8686 yyextra->current.get(),
8693 yyextra->protection,
8702 if (needsEntry)
newEntry(yyscanner);
8708 a.
docs = yyextra->current->doc;
8711 yyextra->current->doc = orgDoc;
8712 yyextra->current->brief = orgBrief;
8713 yyextra->current->docLine = orgDocLine;
8714 yyextra->current->briefLine = orgBriefLine;
8725 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8726 for (
const auto &ce : rt->children())
8728 if (!ce->program.empty())
8732 yyextra->padCount=0;
8734 yyextra->programStr = ce->program.str();
8735 yyextra->inputString = yyextra->programStr.data();
8736 yyextra->inputPosition = 0;
8737 if (ce->section.isEnum() || ce->spec.isEnum())
8738 BEGIN( FindFields ) ;
8740 BEGIN( FindMembers ) ;
8741 yyextra->current_root = ce;
8742 yyextra->fileName = ce->fileName;
8744 yyextra->yyLineNr = ce->bodyLine;
8745 yyextra->yyColNr = ce->bodyColumn;
8746 yyextra->insideObjC = ce->lang==SrcLangExt::ObjC;
8748 yyextra->current = std::make_shared<Entry>();
8749 yyextra->isStatic =
false;
8754 if (autoGroupNested && !rt->groups.empty() && !ce->section.isEnum() && !ce->spec.isEnum())
8756 ce->groups = rt->groups;
8759 size_t ni=ce->name.rfind(
"::");
8762 if ( ce->section.isClass() )
8764 if (yyextra->insidePHP || yyextra->insideD || yyextra->insideJS || yyextra->insideIDL || yyextra->insideSlice)
8766 yyextra->current->protection = yyextra->protection = Protection::Public ;
8768 else if (yyextra->insideJava)
8770 yyextra->current->protection = yyextra->protection = (ce->spec.isInterface() || ce->spec.isEnum()) ? Protection::Public : Protection::Package;
8772 else if (ce->spec.isInterface() || ce->spec.isRef() || ce->spec.isValue() || ce->spec.isStruct() || ce->spec.isRecord() ||ce->spec.isUnion())
8774 if (ce->lang==SrcLangExt::ObjC)
8776 yyextra->current->protection = yyextra->protection = Protection::Protected ;
8778 else if (!ce->name.empty() && ce->name.at(ni)==
'@' && (ce->spec.isStruct() || ce->spec.isRecord() || ce->spec.isUnion()))
8782 yyextra->current->protection = yyextra->protection = ce->protection;
8786 yyextra->current->protection = yyextra->protection = Protection::Public ;
8791 yyextra->current->protection = yyextra->protection = Protection::Private ;
8794 else if (ce->section.isEnum() )
8796 yyextra->current->protection = yyextra->protection = ce->protection;
8798 else if (!ce->name.empty() && ce->name.at(ni)==
'@')
8800 if (ce->section.isNamespace() )
8802 yyextra->current->isStatic = yyextra->isStatic =
true;
8804 yyextra->current->protection = yyextra->protection = ce->protection;
8805 yyextra->current->exported = yyextra->exported =
false;
8807 else if (ce->section.isNamespace() )
8809 yyextra->current->protection = yyextra->protection = Protection::Public ;
8810 yyextra->current->exported = yyextra->exported = ce->exported;
8814 yyextra->current->protection = yyextra->protection = Protection::Public ;
8815 yyextra->current->exported = yyextra->exported =
false;
8817 yyextra->mtype = MethodTypes::Method;
8818 yyextra->virt = Specifier::Normal;
8825 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
8827 scannerYYlex(yyscanner);
8830 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
8832 yyextra->programStr.clear();
8833 ce->program.str(std::string());
8847 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8848 for (
const auto &ce : rt->children())
8850 if (ce->section.isConcept())
8854 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8856 yyextra->padCount =0;
8858 yyextra->programStr = ce->initializer.str();
8859 yyextra->inputString = yyextra->programStr.data();
8860 yyextra->inputPosition = 0;
8861 yyextra->current_root = ce;
8862 yyextra->fileName = ce->fileName;
8863 yyextra->yyLineNr = ce->bodyLine;
8864 yyextra->yyColNr = ce->bodyColumn;
8865 yyextra->insideObjC =
false;
8866 yyextra->current = std::make_shared<Entry>();
8870 indent.
fill(
' ',ce->startColumn?ce->startColumn-1:0);
8872 if (!ce->args.empty())
8874 templArgs=indent+
"template"+ce->args+
"\n";
8876 yyextra->current->initializer.
str(
DString(templArgs+indent+
"concept "+ce->name+
" =").
str());
8878 yyextra->isStatic =
false;
8880 yyextra->current->section = EntryType::makeConceptCodePart();
8881 yyextra->current->startLine = yyextra->yyLineNr;
8882 BEGIN( FindConceptParts );
8883 scannerYYlex(yyscanner);
8884 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,ce->name);
8895 const char *fileBuf,
8896 const std::shared_ptr<Entry> &rt,
8900 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8903 yyextra->inputString = fileBuf;
8904 yyextra->inputPosition = 0;
8905 yyextra->column = 0;
8906 scannerYYrestart(
nullptr,yyscanner);
8909 yyextra->protection = Protection::Public;
8910 yyextra->mtype = MethodTypes::Method;
8911 yyextra->isStatic =
false;
8912 yyextra->exported =
false;
8913 yyextra->virt = Specifier::Normal;
8914 yyextra->current_root = rt;
8915 yyextra->yyLineNr = 1 ;
8916 yyextra->yyBegLineNr = 1;
8917 yyextra->yyBegColNr = 0;
8918 yyextra->anonCount = 0;
8919 yyextra->anonNSCount = 0;
8920 yyextra->fileName = fileName;
8921 yyextra->clangParser = clangParser;
8923 rt->lang = yyextra->language;
8924 msg(
"Parsing file {}...\n",yyextra->fileName);
8926 yyextra->current_root = rt;
8928 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
8929 yyextra->current = std::make_shared<Entry>();
8934 yyextra->current->name = yyextra->fileName;
8935 yyextra->current->section = sec;
8936 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8938 yyextra->current->reset();
8940 if ( yyextra->insidePHP )
8942 BEGIN( FindMembersPHP );
8944 else if ( yyextra->insideJava )
8946 yyextra->current->name=
"java::lang";
8947 yyextra->current->fileName = yyextra->fileName;
8948 yyextra->current->section = EntryType::makeUsingDir();
8949 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
8951 BEGIN( FindMembers );
8955 BEGIN( FindMembers );
8958 scannerYYlex(yyscanner);
8960 if (YY_START==Comment)
8962 warn(yyextra->fileName,yyextra->yyLineNr,
"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
8966 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
8968 yyextra->programStr.clear();
8969 rt->program.str(std::string());
8974 yyextra->anonNSCount++;
8977 for (
auto &[
parent,child]: yyextra->outerScopeEntries)
8980 parent->moveToSubEntryAndKeep(child);
8982 yyextra->outerScopeEntries.clear();
8991 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
8994 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
8997 if (!yyextra->current)
9002 const char *orgInputString;
9003 int orgInputPosition;
9004 YY_BUFFER_STATE orgState;
9007 orgState = YY_CURRENT_BUFFER;
9008 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
9009 orgInputString = yyextra->inputString;
9010 orgInputPosition = yyextra->inputPosition;
9013 yyextra->inputString = text.
data();
9014 yyextra->inputPosition = 0;
9015 yyextra->column = 0;
9016 scannerYYrestart(
nullptr, yyscanner);
9018 scannerYYlex(yyscanner);
9020 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
9021 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.empty())
9023 yyextra->current->section = EntryType::makeVariableDoc();
9027 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
9028 yy_switch_to_buffer(orgState, yyscanner);
9029 yyextra->inputString = orgInputString;
9030 yyextra->inputPosition = orgInputPosition;
9046 scannerYYlex_init_extra(&
p->state,&
p->yyscanner);
9054 scannerYYlex_destroy(
p->yyscanner);
9058 const char *fileBuf,
9059 const std::shared_ptr<Entry> &root,
9063 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
9064 yyextra->thisParser =
this;
9068 ::parseMain(
p->yyscanner,fileName,fileBuf,root,clangParser);
9076 return (SrcLangExt::Cpp == lang) || (SrcLangExt::Lex == lang) ||
9077 !( fe==
".java" || fe==
".as" || fe==
".d" || fe==
".php" ||
9078 fe==
".php4" || fe==
".inc" || fe==
".phtml"|| fe==
".php5"
9089#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)