20%option never-interactive
21%option prefix="pyscannerYY"
23%option extra-type="struct pyscannerYY_state *"
27#define YY_TYPEDEF_YY_SCANNER_T
63#define DBG_CTX(x) do { } while(0)
66#define YY_NO_UNISTD_H 1
68#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
164#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
167static inline const char *
getLexerFILE() {
return __FILE__;}
Abstract interface for outline parsers.
This is an alternative implementation of QCString.
Text streaming class that buffers data.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static const char * stateToString(int state)
static void addVariable(yyscan_t yyscanner, QCString type, QCString name)
static const char * getLexerFILE()
std::unordered_map< std::string, std::string > StringUnorderedMap
#define lineCount(s, len)
static void startCommentBlock(yyscan_t yyscanner, bool)
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
static void initEntry(yyscan_t yyscanner)
static void newEntry(yyscan_t yyscanner)
static void incLineNr(yyscan_t yyscanner)
static void docVariable(yyscan_t yyscanner, const char *s)
static void initSpecialBlock(yyscan_t yyscanner)
static void initTriSingleQuoteBlock(yyscan_t yyscanner)
static void searchFoundTypeAlias(yyscan_t yyscanner)
static void addFrom(yyscan_t yyscanner, bool all)
static void setProtection(yyscan_t yyscanner)
static void endOfDef(yyscan_t yyscanner, int correction=0)
static QCString findPackageScope(yyscan_t yyscanner, const QCString &fileName)
static void searchFoundClass(yyscan_t yyscanner)
static QCString findPackageScopeFromPath(yyscan_t yyscanner, const QCString &path)
static void newVariable(yyscan_t yyscanner)
static void newTypeAlias(yyscan_t yyscanner)
static void initTriDoubleQuoteBlock(yyscan_t yyscanner)
static void searchFoundDef(yyscan_t yyscanner)
static void addEntry(yyscan_t yyscanner)
static void newFunction(yyscan_t yyscanner)
static void addToString(yyscan_t yyscanner, const char *s)
Some helper functions for std::string.
std::shared_ptr< Entry > previous
std::shared_ptr< Entry > current
StringUnorderedMap packageNameCache
std::shared_ptr< Entry > bodyEntry
TextStream decoratorCommentStr
std::shared_ptr< Entry > current_root
bool packageCommentAllowed
OutlineParserInterface * thisParser
std::vector< QCString > decorators
CommentScanner commentScanner
A bunch of utility functions.
181HEXNUMBER "0"[xX][0-9a-fA-F]+[lL]?
182OCTNUMBER "0"[0-7]+[lL]?
183NUMBER {DIGIT}+[lLjJ]?
184INTNUMBER {HEXNUMBER}|{OCTNUMBER}|{NUMBER}
185FLOATNUMBER {DIGIT}+"."{DIGIT}+([eE][+\-]?{DIGIT}+)?[jJ]?
187LETTER [A-Za-z\x80-\xFF]
188NONEMPTY [A-Za-z0-9_\x80-\xFF]
189EXPCHAR [#(){}\[\],:.%/\\=`*~|&<>!;+-]
190PARAMNONEMPTY [^ \t\n():]
191IDENTIFIER ({LETTER}|"_")({LETTER}|{DIGIT}|"_")*
192SCOPE {IDENTIFIER}("."{IDENTIFIER})*
194TRISINGLEQUOTE {STRINGPREFIX}?"'''"(!)?
195TRIDOUBLEQUOTE {STRINGPREFIX}?"\"\"\""(!)?
196ENDTRISINGLEQUOTE "'''"
197ENDTRIDOUBLEQUOTE "\"\"\""
198LONGSTRINGCHAR [^\\"']
200LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
201SMALLQUOTE ("\"\""|"\""|"'"|"''")
202LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
204STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR")
205POUNDCOMMENT "#"[^#\n][^\n]*
210LINENR {B}*[1-9][0-9]*
211FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
212FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
213FILECHARS {FILEICHAR}*{FILEECHAR}+
214HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
215VFILEMASK {FILECHARS}("."{FILECHARS})*
216FILEMASK {VFILEMASK}|{HFILEMASK}
219ID [a-z_A-Z%]+{IDSYM}*
242%x FunctionTypeAnnotation
243%x FunctionParamDefVal
262%x SingleQuoteStringIgnore
263%x DoubleQuoteStringIgnore
288 DBG_CTX((stderr,
"Found def at %d\n",yyextra->yyLineNr));
291 BEGIN( FunctionDec );
293 ^{B}"async"{BB}"def"{BB} {
294 DBG_CTX((stderr,
"Found async def at %d\n",yyextra->yyLineNr));
297 BEGIN( FunctionDec );
301 BEGIN( FunctionDec );
303 "async"{BB}"def"{BB} {
305 BEGIN( FunctionDec );
309 DBG_CTX((stderr,
"Found class at %d\n",yyextra->yyLineNr));
329 yyextra->packageCommentAllowed =
FALSE;
335 yyextra->packageCommentAllowed =
FALSE;
338 ^{B}{IDENTIFIER}/{B}"="{B}"property" {
339 yyextra->current->section = EntryType::makeVariable();
340 yyextra->current->mtype = MethodTypes::Property;
342 yyextra->current->fileName = yyextra->fileName;
343 yyextra->current->startLine = yyextra->yyLineNr;
344 yyextra->current->bodyLine = yyextra->yyLineNr;
345 yyextra->packageCommentAllowed =
FALSE;
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
348 ^{B}{IDENTIFIER}/{B}"="[^=] {
349 if (yyextra->searchCount>0) REJECT;
351 yyextra->current->section = EntryType::makeVariable();
353 yyextra->current->fileName = yyextra->fileName;
354 yyextra->current->startLine = yyextra->yyLineNr;
355 yyextra->current->bodyLine = yyextra->yyLineNr;
356 yyextra->packageCommentAllowed =
FALSE;
359 ^{B}{IDENTIFIER}/{B}":" {
360 if (yyextra->searchCount>0) REJECT;
362 if (
id ==
"try" ||
id ==
"else" ||
id ==
"except" ||
id ==
"finally") REJECT;
364 yyextra->current->section = EntryType::makeVariable();
365 yyextra->current->name = id;
366 yyextra->current->fileName = yyextra->fileName;
367 yyextra->current->startLine = yyextra->yyLineNr;
368 yyextra->current->bodyLine = yyextra->yyLineNr;
369 yyextra->packageCommentAllowed =
FALSE;
372 {B}{IDENTIFIER}/({B},{B}{IDENTIFIER})*{B}")"*{B}"="[^=] {
376 if (yyextra->searchCount>1) REJECT;
378 yyextra->current->section = EntryType::makeVariable();
380 yyextra->current->fileName = yyextra->fileName;
381 yyextra->current->startLine = yyextra->yyLineNr;
382 yyextra->current->bodyLine = yyextra->yyLineNr;
383 yyextra->packageCommentAllowed =
FALSE;
387 yyextra->stringContext=YY_START;
388 yyextra->copyString=
nullptr;
389 yyextra->packageCommentAllowed =
FALSE;
390 BEGIN( SingleQuoteString );
393 yyextra->stringContext=YY_START;
394 yyextra->copyString=
nullptr;
395 yyextra->packageCommentAllowed =
FALSE;
396 BEGIN( DoubleQuoteString );
399 yyextra->isStatic=
TRUE;
403 yyextra->decoratorRound = 1;
404 yyextra->copyString=
nullptr;
411 if (yyextra->yyLineNr != 1) REJECT;
418 yyextra->packageCommentAllowed =
FALSE;
430 BEGIN(TripleComment);
435 BEGIN(TripleComment);
438 {B}{STARTDOCSYMS}/[^#] {
440 yyextra->packageCommentAllowed =
FALSE;
442 BEGIN(SpecialComment);
445 yyextra->searchCount++;
448 if (yyextra->searchCount>0)
450 yyextra->searchCount--;
454 yyextra->current->doc.clear();
455 yyextra->current->brief.clear();
469 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
470 yyextra->packageName=yytext;
492 {IDENTIFIER}/{B}","{B} {
495 {IDENTIFIER}/{B}")" {
500 if (!yyextra->importTuple)
507 if (!yyextra->importTuple)
515 yyextra->importTuple=
TRUE;
518 yyextra->importTuple=
FALSE;
533 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
535 yyextra->current->fileName = yyextra->fileName;
537 yyextra->current->section=EntryType::makeUsingDecl();
538 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
QCString removeRedundantWhiteSpace(const QCString &s)
555 ("cls"|"self")"."{IDENTIFIER}/{B}[,)] {
556 const char *s = strchr(yytext,
'.'); s++;
557 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
const char * qPrint(const char *s)
561 ("cls"|"self")"."{IDENTIFIER}/{B}"=" {
562 const char *s = strchr(yytext,
'.'); s++;
563 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
565 BEGIN( SearchSkipValue );
567 ("cls"|"self")"."{IDENTIFIER}/{B}":" {
568 const char *s = strchr(yytext,
'.'); s++;
569 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
575 BEGIN(TripleComment);
580 BEGIN(TripleComment);
583 {STARTDOCSYMS}/[^#] {
585 BEGIN(SpecialComment);
590 yyextra->stringContext=YY_START;
591 yyextra->copyString=
nullptr;
592 BEGIN( SingleQuoteString );
595 yyextra->stringContext=YY_START;
596 yyextra->copyString=
nullptr;
597 BEGIN( DoubleQuoteString );
601 yyextra->current->doc.clear();
602 yyextra->current->brief.clear();
604 BEGIN( SearchSkipValue );
613 yyextra->braceCount=0;
616 yyextra->current->type+=*yytext;
617 yyextra->braceCount++;
620 yyextra->current->type+=*yytext;
621 yyextra->braceCount--;
624 yyextra->stringContext=YY_START;
625 yyextra->copyString=
nullptr;
626 BEGIN( SingleQuoteString );
629 yyextra->stringContext=YY_START;
630 yyextra->copyString=
nullptr;
631 BEGIN( DoubleQuoteString );
634 if (yyextra->braceCount==0)
636 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
638 BEGIN(SearchSkipValue);
642 yyextra->current->type+=*yytext;
646 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
649 BEGIN(SearchMemVars);
652 yyextra->current->type+=
' ';
656 yyextra->current->type+=*yytext;
660<SearchSkipValue,VariableDec,TypeValue>{
663 yyextra->startInit =
TRUE;
664 if (YY_START!=TypeValue)
666 yyextra->current->initializer.str(yytext);
667 yyextra->current->initializer <<
" ";
671 yyextra->current->initializer << yytext;
675 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"int";
676 yyextra->current->initializer << yytext;
679 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"float";
680 yyextra->current->initializer << yytext;
683 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"bool";
684 yyextra->current->initializer << yytext;
687 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
688 yyextra->current->initializer << yytext;
689 yyextra->copyString=&yyextra->current->initializer;
690 yyextra->stringContext=YY_START;
691 BEGIN( SingleQuoteString );
693 {STRINGPREFIX}?"\"" {
694 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
695 yyextra->current->initializer << yytext;
696 yyextra->copyString=&yyextra->current->initializer;
697 yyextra->stringContext=YY_START;
698 BEGIN( DoubleQuoteString );
701 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
702 yyextra->current->initializer << yytext;
703 yyextra->doubleQuote=
TRUE;
704 yyextra->copyString=&yyextra->current->initializer;
705 yyextra->stringContext=YY_START;
710 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
711 yyextra->current->initializer << yytext;
712 yyextra->doubleQuote=
FALSE;
713 yyextra->copyString=&yyextra->current->initializer;
714 yyextra->stringContext=YY_START;
718 if (yyextra->current->mtype!=MethodTypes::Property && yyextra->startInit)
720 yyextra->current->type =
"tuple";
722 yyextra->current->initializer << *yytext;
723 yyextra->atomStart=
'(';
724 yyextra->atomEnd=
')';
725 yyextra->atomCount=1;
726 yyextra->atomContext=YY_START;
727 BEGIN( VariableAtom );
730 if (yyextra->startInit) yyextra->current->type =
"list";
731 yyextra->current->initializer << *yytext;
732 yyextra->atomStart=
'[';
733 yyextra->atomEnd=
']';
734 yyextra->atomCount=1;
735 yyextra->atomContext=YY_START;
736 BEGIN( VariableAtom );
739 if (yyextra->startInit) yyextra->current->type =
"dict";
740 yyextra->current->initializer << *yytext;
741 yyextra->atomStart=
'{';
742 yyextra->atomEnd=
'}';
743 yyextra->atomCount=1;
744 yyextra->atomContext=YY_START;
745 BEGIN( VariableAtom );
748 yyextra->current->initializer << yytext;
753 if (yyextra->current->type.isEmpty())
755 for (
const auto &child : yyextra->current_root->children())
757 if (child->name == yytext)
759 yyextra->current->type = child->type;
764 yyextra->startInit =
FALSE;
765 yyextra->current->initializer << yytext;
768 yyextra->startInit =
FALSE;
769 yyextra->current->initializer << *yytext;
773 {STARTDOCSYMS}/[^#] {
775 BEGIN(SpecialComment);
781 BEGIN(SearchMemVars);
785 BEGIN(SearchMemVars);
790 \n{B}/{IDENTIFIER}[^{LETTER}{DIGIT}_] {
802 yyextra->current->program << yytext;
816 yyextra->current->program << yytext;
824 yyextra->current->program << yytext;
828 if (yyextra->curIndent<=yyextra->indent)
836 yyextra->current->program << yytext;
840 yyextra->current->program << yytext;
841 yyextra->stringContext=YY_START;
842 yyextra->specialBlock =
FALSE;
843 yyextra->copyString=&yyextra->current->program;
844 BEGIN( SingleQuoteString );
847 yyextra->current->program << yytext;
848 yyextra->stringContext=YY_START;
849 yyextra->specialBlock =
FALSE;
850 yyextra->copyString=&yyextra->current->program;
851 BEGIN( DoubleQuoteString );
854 yyextra->current->program << yytext;
855 yyextra->specialBlock =
FALSE;
858 yyextra->current->program << yytext;
861 yyextra->current->program << yytext;
865 yyextra->current->program << yytext;
868 yyextra->current->program << *yytext;
869 yyextra->specialBlock =
FALSE;
873 yyextra->current->program << yytext;
875 BEGIN(TripleComment);
879 yyextra->current->program << yytext;
881 BEGIN(TripleComment);
889 yyextra->current->name = yytext;
890 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
894 yyextra->specialBlock =
TRUE;
895 yyextra->bodyEntry = yyextra->current;
896 yyextra->current->bodyLine = yyextra->yyLineNr;
900 yyextra->genericsContext = YY_START;
901 yyextra->bracketDepth = 1;
902 yyextra->genericsValue =
"[";
906 yyextra->defVal.str(std::string());
907 yyextra->braceCount = 0;
908 BEGIN(FunctionTypeAnnotation);
911 yyextra->funcParamsEnd =
FALSE;
912 yyextra->current->bodyLine = yyextra->yyLineNr;
913 BEGIN(FunctionParams);
916 if (yyextra->current->argList.empty())
918 yyextra->current->argList.setNoParameters(
TRUE);
921 yyextra->funcParamsEnd =
TRUE;
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
927 yyextra->genericsValue+=yytext;
930 yyextra->genericsValue+=yytext;
931 yyextra->bracketDepth++;
934 yyextra->genericsValue+=yytext;
935 yyextra->bracketDepth--;
936 if (yyextra->bracketDepth==0)
938 BEGIN(yyextra->genericsContext);
942 yyextra->genericsValue+=yytext;
951 if (!yyextra->argType.isEmpty())
955 a.
type = yyextra->argType;
956 yyextra->current->argList.push_back(a);
957 yyextra->argType =
"";
This class contains the information about the argument of a function or template.
962 yyextra->argType = yytext;
968 a.
type = yyextra->argType;
969 yyextra->current->argList.push_back(a);
970 yyextra->argType =
"";
975 yyextra->defVal.str(std::string());
976 yyextra->braceCount = 0;
977 BEGIN(FunctionParamDefVal);
980 if (!yyextra->argType.isEmpty())
984 a.
type = yyextra->argType;
985 yyextra->current->argList.push_back(a);
986 yyextra->argType =
"";
992 yyextra->defVal.str(std::string());
993 yyextra->braceCount = 0;
994 BEGIN(FunctionAnnotation);
1003<FunctionTypeAnnotation>{
1007 ++yyextra->braceCount;
1008 yyextra->defVal << *yytext;
1013 --yyextra->braceCount;
1014 yyextra->defVal << *yytext;
1017 if (yyextra->braceCount == 0)
1019 yyextra->current->type = yyextra->defVal.str();
1024 yyextra->defVal << *yytext;
1027 yyextra->defVal << *yytext;
1028 yyextra->copyString=&yyextra->defVal;
1029 yyextra->stringContext=FunctionTypeAnnotation;
1030 BEGIN(SingleQuoteString);
1033 yyextra->defVal << *yytext;
1034 yyextra->copyString=&yyextra->defVal;
1035 yyextra->stringContext=FunctionTypeAnnotation;
1036 BEGIN(DoubleQuoteString);
1039 yyextra->defVal << *yytext;
1043 yyextra->defVal << *yytext;
1047<FunctionAnnotation>{
1051 ++yyextra->braceCount;
1052 yyextra->defVal << *yytext;
1056 --yyextra->braceCount;
1057 yyextra->defVal << *yytext;
1062 if (yyextra->braceCount == 0)
1064 if (!yyextra->current->argList.empty())
1065 yyextra->current->argList.back().type += yyextra->defVal.str();
1068 BEGIN(FunctionParams);
1073 --yyextra->braceCount;
1074 yyextra->defVal << *yytext;
1078 yyextra->defVal << *yytext;
1079 yyextra->copyString=&yyextra->defVal;
1080 yyextra->stringContext=FunctionAnnotation;
1081 BEGIN(SingleQuoteString);
1084 yyextra->defVal << *yytext;
1085 yyextra->copyString=&yyextra->defVal;
1086 yyextra->stringContext=FunctionAnnotation;
1087 BEGIN(DoubleQuoteString);
1090 yyextra->defVal << *yytext;
1094 yyextra->defVal << *yytext;
1098<FunctionParamDefVal>{
1102 ++yyextra->braceCount;
1103 yyextra->defVal << *yytext;
1107 --yyextra->braceCount;
1108 yyextra->defVal << *yytext;
1112 if (yyextra->braceCount == 0)
1114 if (!yyextra->current->argList.empty())
1118 BEGIN(FunctionParams);
1123 --yyextra->braceCount;
1124 yyextra->defVal << *yytext;
1129 yyextra->defVal << *yytext;
1130 yyextra->copyString=&yyextra->defVal;
1131 yyextra->stringContext=FunctionParamDefVal;
1132 BEGIN( SingleQuoteString );
1135 yyextra->defVal << *yytext;
1136 yyextra->copyString=&yyextra->defVal;
1137 yyextra->stringContext=FunctionParamDefVal;
1138 BEGIN( DoubleQuoteString );
1141 yyextra->defVal << *yytext;
1145 yyextra->defVal << *yytext;
1151 \n/{IDENTIFIER}{BB} {
1155 for (i=(
int)yyleng-1;i>=0;i--)
1166 yyextra->current->program << yytext;
1173 for (i=(
int)yyleng-1;i>=0;i--)
1184 yyextra->current->program << yytext;
1188 yyextra->current->program << yytext;
1196 DBG_CTX((stderr,
"yyextra->curIndent=%d yyextra->indent=%d\n",yyextra->curIndent,yyextra->indent));
1197 if (yyextra->curIndent<=yyextra->indent)
1201 yyextra->indent=yyextra->curIndent;
1209 yyextra->current->program << yytext;
1213 yyextra->current->program << *yytext;
1214 yyextra->stringContext=YY_START;
1215 yyextra->specialBlock =
FALSE;
1216 yyextra->copyString=&yyextra->current->program;
1217 BEGIN( SingleQuoteString );
1220 yyextra->current->program << *yytext;
1221 yyextra->stringContext=YY_START;
1222 yyextra->specialBlock =
FALSE;
1223 yyextra->copyString=&yyextra->current->program;
1224 BEGIN( DoubleQuoteString );
1227 yyextra->current->program << yytext;
1228 yyextra->specialBlock =
FALSE;
1232 yyextra->current->program << *yytext;
1236 yyextra->current->program << yytext;
1239 yyextra->specialBlock =
FALSE;
1240 yyextra->current->program << *yytext;
1244 yyextra->current->program << yytext;
1246 BEGIN(TripleComment);
1251 yyextra->current->program << yytext;
1253 BEGIN(TripleComment);
1259 yyextra->current->name = yytext;
1262 yyextra->bracketDepth=1;
1263 yyextra->genericsContext = YY_START;
1264 yyextra->genericsValue =
"[";
1268 yyextra->current->args = yyextra->genericsValue;
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...
1290<ClassDec>{IDENTIFIER} {
1291 if (yyextra->current->type.isEmpty())
1293 yyextra->current->type =
"class";
1296 yyextra->current->section = EntryType::makeClass();
1297 yyextra->current->name = yytext;
1302 if (yyextra->current_root->section.isScope())
1305 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
1308 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1309 yyextra->current->fileName = yyextra->fileName;
1310 yyextra->docBlockContext = YY_START;
1311 yyextra->docBlockInBody =
FALSE;
1312 yyextra->docBlockJavaStyle =
FALSE;
1313 yyextra->docBlock.clear();
1314 yyextra->bracketDepth = 0;
1316 BEGIN(ClassInheritance);
1323 yyextra->bracketDepth=1;
1324 yyextra->genericsContext = YY_START;
1325 yyextra->genericsValue =
"[";
1329 yyextra->specialBlock =
TRUE;
1330 yyextra->current->bodyLine = yyextra->yyLineNr;
1331 yyextra->current->program.str(std::string());
1332 BEGIN(ClassCaptureIndent);
1336 yyextra->current->extends.emplace_back(
1337 substitute(yytext,
".",
"::"),Protection::Public,Specifier::Normal
1341 yyextra->stringContext=YY_START;
1342 BEGIN( SingleQuoteStringIgnore );
1345 yyextra->stringContext=YY_START;
1346 BEGIN( DoubleQuoteStringIgnore );
1350<SingleQuoteStringIgnore>{
1352 BEGIN(yyextra->stringContext);
1356<DoubleQuoteStringIgnore>{
1358 BEGIN(yyextra->stringContext);
1363<ClassCaptureIndent>{
1367 yyextra->current->program << yytext;
1372 yyextra->current->program << yytext;
1373 BEGIN(TripleComment);
1377 yyextra->current->program << yytext;
1378 BEGIN(TripleComment);
1380 {STARTDOCSYMS}[#]* {
1382 BEGIN(SpecialComment);
1387 yyextra->current->program << yytext;
1390 yyextra->bodyEntry = yyextra->current;
1391 DBG_CTX((stderr,
"setting indent %d\n",yyextra->curIndent));
1397 ""/({NONEMPTY}|{EXPCHAR}) {
1401 yyextra->current->program << yytext;
1410 ":"{B}{IDENTIFIER} {
1411 yyextra->startInit =
FALSE;
1412 yyextra->current->type =
substitute(yytext,
":",
"");
1414 {STARTDOCSYMS}"<"/.* {
1416 yyextra->packageCommentAllowed =
FALSE;
1418 yyextra->docBlockContext = VariableEnd;
1419 BEGIN(SpecialComment);
1422 BEGIN( VariableEnd );
1426 BEGIN( VariableEnd );
1432 yyextra->current->initializer << *yytext;
1433 if (yyextra->atomStart==*yytext)
1435 yyextra->atomCount++;
1439 yyextra->current->initializer << *yytext;
1440 if (yyextra->atomEnd==*yytext)
1442 yyextra->atomCount--;
1444 if (yyextra->atomCount==0)
1446 yyextra->startInit =
FALSE;
1447 BEGIN(yyextra->atomContext);
1451 yyextra->specialBlock =
FALSE;
1452 yyextra->current->program << yytext;
1454 BEGIN(TripleComment);
1458 yyextra->specialBlock =
FALSE;
1459 yyextra->current->program << yytext;
1461 BEGIN(TripleComment);
1464 yyextra->stringContext=YY_START;
1465 yyextra->current->initializer <<
"'";
1466 yyextra->copyString=&yyextra->current->initializer;
1467 BEGIN( SingleQuoteString );
1470 yyextra->stringContext=YY_START;
1471 yyextra->current->initializer <<
"\"";
1472 yyextra->copyString=&yyextra->current->initializer;
1473 BEGIN( DoubleQuoteString );
1476 yyextra->current->initializer << yytext;
1479 yyextra->current->initializer << yytext;
1482 yyextra->current->initializer << *yytext;
1485 yyextra->current->initializer << *yytext;
1510 {ENDTRIDOUBLEQUOTE} |
1511 {ENDTRISINGLEQUOTE} {
1513 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1515 if (yyextra->specialBlock)
1517 QCString actualDoc=yyextra->docBlock;
1518 if (!yyextra->docBlockSpecial)
1523 actualDoc.
prepend(
"@iverbatim\n");
1524 actualDoc.
append(
"@endiverbatim ");
1530 else if (yyextra->packageCommentAllowed)
1532 QCString actualDoc=yyextra->docBlock;
1533 if (!yyextra->docBlockSpecial)
1538 actualDoc.
prepend(
"@iverbatim\n");
1539 actualDoc.
append(
"@endiverbatim ");
1542 if (yyextra->moduleScope.startsWith(
"__") && yyextra->moduleScope.endsWith(
"__"))
1544 actualDoc.
prepend(
"\\namespace \\"+yyextra->moduleScope+
" ");
1548 actualDoc.
prepend(
"\\namespace "+yyextra->moduleScope+
" ");
1552 if ((yyextra->docBlockContext==ClassBody ) ||
1553 yyextra->docBlockContext==FunctionBody)
1555 yyextra->current->program << yyextra->docBlock;
1556 yyextra->current->program << yytext;
1563 BEGIN(yyextra->docBlockContext);
1567 yyextra->docBlock += yytext;
1569 yyextra->packageCommentAllowed =
FALSE;
QCString & prepend(const char *s)
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString & append(char c)
void stripIndentationVerbatim(QCString &doc, const int indentationLevel, bool skipFirstLine)
1574 if (yyextra->firstPass && yyextra->docBlockSpecial && yyleng >= yyextra->curIndent)
1575 yyextra->docBlock += yytext + yyextra->curIndent;
1577 yyextra->docBlock += yytext;
1580 yyextra->docBlock += yytext;
1584 yyextra->docBlock += yytext;
1586 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1587 yyextra->fileName = &yytext[6];
1588 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1589 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1590 yyextra->docBlock+=yytext;
1592 {CMD}"ifile"{B}+{FILEMASK} {
1593 yyextra->fileName = &yytext[6];
1594 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1595 yyextra->docBlock+=yytext;
1597 {CMD}"iline"{LINENR}/[\n\.] |
1598 {CMD}"iline"{LINENR}{B} {
1603 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1607 yyextra->yyLineNr = nr;
1609 yyextra->docBlock+=yytext;
int toInt(bool *ok=nullptr, int base=10) const
#define warn(file, line, fmt,...)
1611 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1612 yyextra->docBlock+=yytext;
1615 yyextra->docBlock += yytext;
1618 yyextra->docBlock += yytext;
1626 yyextra->docBlock+=
'\n';
1627 yyextra->docBrief =
FALSE;
1630 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1631 yyextra->fileName = &yytext[6];
1632 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1633 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1634 yyextra->docBlock+=yytext;
1636 {CMD}"ifile"{B}+{FILEMASK} {
1637 yyextra->fileName = &yytext[6];
1638 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1639 yyextra->docBlock+=yytext;
1641 {CMD}"iline"{LINENR}/[\n\.] |
1642 {CMD}"iline"{LINENR}{B} {
1647 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1651 yyextra->yyLineNr = nr;
1653 yyextra->docBlock+=yytext;
1655 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1656 yyextra->docBlock+=yytext;
1660 int extraSpaces = std::max(0,
static_cast<int>(yyleng-9-yyextra->curIndent-2));
1661 indent.
fill(
' ',extraSpaces);
1663 yyextra->docBlock +=
"\\ilinebr ";
1664 yyextra->docBlock += indent;
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
1667 yyextra->docBlock+=yytext;
1671 if (yyextra->docBlockContext == VariableEnd)
1679 BEGIN(yyextra->docBlockContext);
1682 yyextra->docBlock+=*yytext;
1699 BEGIN(yyextra->stringContext);
1722 BEGIN(yyextra->stringContext);
1733 {ENDTRIDOUBLEQUOTE} |
1734 {ENDTRISINGLEQUOTE} {
1735 *yyextra->copyString << yytext;
1736 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1738 BEGIN(yyextra->stringContext);
1743 ({LONGSTRINGBLOCK}) {
1745 *yyextra->copyString << yytext;
1749 *yyextra->copyString << yytext;
1752 *yyextra->copyString << *yytext;
1758 yyextra->doubleQuote=
TRUE;
1759 yyextra->decoratorCommentStr.str(std::string());
1760 yyextra->copyString=&yyextra->decoratorCommentStr;
1761 yyextra->stringContext=YY_START;
1762 BEGIN(TripleString);
1766 yyextra->doubleQuote=
FALSE;
1767 yyextra->decoratorCommentStr.str(std::string());
1768 yyextra->copyString=&yyextra->decoratorCommentStr;
1769 yyextra->stringContext=YY_START;
1770 BEGIN(TripleString);
1773 yyextra->stringContext=YY_START;
1774 yyextra->decoratorCommentStr.str(std::string());
1775 yyextra->copyString=&yyextra->decoratorCommentStr;
1776 BEGIN( SingleQuoteString );
1779 yyextra->stringContext=YY_START;
1780 yyextra->decoratorCommentStr.str(std::string());
1781 yyextra->copyString=&yyextra->decoratorCommentStr;
1782 BEGIN( DoubleQuoteString );
1785 yyextra->decoratorRound++;
1788 yyextra->decoratorRound--;
1789 if (!yyextra->decoratorRound) BEGIN(
Search );
1832 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1834 const char *p = yyextra->inputString + yyextra->inputPosition;
1835 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1836 yyextra->inputPosition+=c;
1842 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1843 yyextra->protection = Protection::Public;
1844 yyextra->mtype = MethodTypes::Method;
1845 yyextra->isStatic =
FALSE;
1846 yyextra->virt = Specifier::Normal;
1847 yyextra->previous = 0;
1848 yyextra->packageCommentAllowed =
TRUE;
1853 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1855 yyextra->current->protection = yyextra->protection ;
1856 yyextra->current->mtype = yyextra->mtype;
1857 yyextra->current->virt = yyextra->virt;
1858 yyextra->current->isStatic = yyextra->isStatic;
1859 yyextra->current->lang = SrcLangExt::Python;
1860 yyextra->current->type.clear();
1861 yyextra->current->name.clear();
1862 yyextra->current->initializer.clear();
1863 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
1864 yyextra->isStatic =
FALSE;
1869 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1870 if (yyextra->current->name.isEmpty())
1876 if (yyextra->checkDupEntry)
1878 for (
auto &v : yyextra->current_root->children())
1881 if (v->name==yyextra->current->name && v->section==yyextra->current->section)
1883 if (v->doc.isEmpty() && !yyextra->current->doc.isEmpty())
1885 v->doc = yyextra->current->doc;
1886 v->docLine = yyextra->current->docLine;
1887 v->docFile = yyextra->current->docFile;
1889 if (v->brief.isEmpty() && !yyextra->current->brief.isEmpty())
1891 v->brief = yyextra->current->brief;
1892 v->briefLine = yyextra->current->briefLine;
1893 v->briefFile = yyextra->current->briefFile;
1895 if (v->type.isEmpty() && !yyextra->current->type.isEmpty())
1898 v->type = yyextra->current->type;
1907 yyextra->previous = yyextra->current;
1908 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1915 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1917 auto doc = yyextra->current->doc;
1918 auto docLine = yyextra->current->docLine;
1919 auto docFile = yyextra->current->docFile;
1920 auto brief = yyextra->current->brief;
1921 auto briefLine = yyextra->current->briefLine;
1922 auto briefFile = yyextra->current->briefFile;
1924 yyextra->previous = yyextra->current;
1925 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1928 yyextra->current->doc = doc;
1929 yyextra->current->docLine = docLine;
1930 yyextra->current->docFile = docFile;
1931 yyextra->current->brief = brief;
1932 yyextra->current->briefLine = briefLine;
1933 yyextra->current->briefFile = briefFile;
1938 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1939 if (!yyextra->current->name.isEmpty() && yyextra->current->name.at(0)==
'_')
1941 if (yyextra->current->name.at(1)==
'_')
1943 yyextra->current->protection=Protection::Private;
1947 yyextra->current->protection=Protection::Protected;
1954 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1955 yyextra->current->name = name;
1956 yyextra->current->section=EntryType::makeVariable();
1957 yyextra->current->fileName = yyextra->fileName;
1958 yyextra->current->startLine = yyextra->yyLineNr;
1959 yyextra->current->bodyLine = yyextra->yyLineNr;
1960 yyextra->current->type.clear();
1962 yyextra->checkDupEntry =
true;
1967 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1969 if (yyextra->current_root->section.isCompound())
1971 yyextra->current->isStatic =
TRUE;
1978 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1979 printf(
"*** newTypeAlias %s\n",
qPrint(yyextra->current->name));
1985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1987 if (yyextra->current_root->section.isCompound())
1989 yyextra->current->isStatic =
TRUE;
1996 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1997 if (yyextra->current->name.startsWith(
"__") && yyextra->current->name.endsWith(
"__"))
2001 yyextra->current->protection=Protection::Public;
2018 else if (c==
'\t') col+=tabSize-(col%tabSize);
2026 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2027 auto it = yyextra->packageNameCache.
find(path.
str());
2028 if (it!=yyextra->packageNameCache.end())
2043 scope+=path.
mid(i+1);
2044 yyextra->packageNameCache.emplace(path.
str(),scope.
str());
2060 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2061 QCString item=all ? yyextra->packageName : yyextra->packageName+
"."+yytext;
2063 yyextra->current->fileName = yyextra->fileName;
2065 yyextra->current->section=all ? EntryType::makeUsingDir() :
EntryType::makeUsingDecl();
2066 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2074 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
2075 for (
const char *p = yytext; *p; ++p)
2077 yyextra->yyLineNr += (*p ==
'\n') ;
2083 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2084 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
2085 yyextra->yyLineNr++;
2091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2094 yyextra->current->briefFile = yyextra->fileName;
2095 yyextra->current->briefLine = yyextra->yyLineNr;
2099 yyextra->current->docFile = yyextra->fileName;
2100 yyextra->current->docLine = yyextra->yyLineNr;
2106 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2111 yyextra->docBlockInBody=
FALSE;
2113 if (!yyextra->current->doc.isEmpty())
2115 yyextra->current->doc=yyextra->current->doc.stripWhiteSpace()+
"\n\n";
2117 if (yyextra->docBlockInBody && yyextra->previous && !yyextra->previous->doc.isEmpty())
2119 yyextra->previous->doc=yyextra->previous->doc.stripWhiteSpace()+
"\n\n";
2123 bool needsEntry =
false;
2124 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
2125 Markdown markdown(yyextra->fileName,lineNr);
2129 QCString processedDoc =
Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(strippedDoc,lineNr) : strippedDoc;
2130 while (yyextra->commentScanner.parseCommentBlock(
2131 yyextra->thisParser,
2132 (yyextra->docBlockInBody && yyextra->previous) ? yyextra->previous.get() : yyextra->current.get(),
2136 yyextra->docBlockInBody ?
FALSE : brief,
2137 yyextra->docBlockJavaStyle,
2138 yyextra->docBlockInBody,
2139 yyextra->protection,
2161 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2163 if (yyextra->bodyEntry)
2165 yyextra->bodyEntry->endBodyLine = yyextra->yyLineNr-correction;
2166 yyextra->bodyEntry = 0;
2174 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2175 if (yyextra->copyString) (*yyextra->copyString) << s;
2180 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2181 yyextra->docBlockContext = YY_START;
2182 yyextra->docBlockInBody =
FALSE;
2183 yyextra->docBlockJavaStyle =
TRUE;
2184 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2185 yyextra->docBlock.clear();
2186 yyextra->commentIndent = yyextra->curIndent;
2187 yyextra->doubleQuote =
TRUE;
2193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2194 yyextra->docBlockContext = YY_START;
2195 yyextra->docBlockInBody =
FALSE;
2196 yyextra->docBlockJavaStyle =
TRUE;
2197 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2198 yyextra->docBlock.clear();
2199 yyextra->commentIndent = yyextra->curIndent;
2200 yyextra->doubleQuote =
FALSE;
2206 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2207 yyextra->docBlockContext = YY_START;
2208 yyextra->docBlockInBody =
FALSE;
2209 yyextra->docBlockJavaStyle =
TRUE;
2210 yyextra->docBrief =
TRUE;
2211 yyextra->docBlock.clear();
2212 yyextra->commentIndent = yyextra->curIndent;
2218 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2219 yyextra->current->fileName = yyextra->fileName;
2220 yyextra->current->startLine = yyextra->yyLineNr;
2221 yyextra->current->bodyLine = yyextra->yyLineNr;
2222 yyextra->current->section = EntryType::makeFunction();
2223 yyextra->current->lang = SrcLangExt::Python;
2224 yyextra->current->virt = Specifier::Normal;
2225 yyextra->current->isStatic = yyextra->isStatic;
2226 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
2227 yyextra->current->type.clear();
2228 yyextra->current->name.clear();
2229 yyextra->current->args.clear();
2230 yyextra->current->argList.clear();
2231 yyextra->packageCommentAllowed =
FALSE;
2232 yyextra->isStatic=
FALSE;
2238 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2239 yyextra->current->section = EntryType::makeClass();
2240 yyextra->current->argList.clear();
2241 yyextra->current->type +=
"class" ;
2242 yyextra->current->fileName = yyextra->fileName;
2243 yyextra->current->startLine = yyextra->yyLineNr;
2244 yyextra->current->bodyLine = yyextra->yyLineNr;
2245 yyextra->packageCommentAllowed =
FALSE;
2250 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2251 yyextra->current->section = EntryType::makeVariable();
2252 yyextra->current->argList.clear();
2253 yyextra->current->type =
"typedef " ;
2254 yyextra->current->spec.setAlias(
true);
2255 yyextra->current->fileName = yyextra->fileName;
2256 yyextra->current->startLine = yyextra->yyLineNr;
2257 yyextra->current->bodyLine = yyextra->yyLineNr;
2258 yyextra->packageCommentAllowed =
FALSE;
2265 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2267 for (
size_t i=0; i<rt->children().size(); ++i)
2269 std::shared_ptr<Entry> ce = rt->children()[i];
2270 if (!ce->program.empty())
2275 yyextra->programStr = ce->program.str();
2276 yyextra->inputString = yyextra->programStr.data();
2277 yyextra->inputPosition = 0;
2278 yyextra->firstPass =
false;
2279 pyscannerYYrestart(
nullptr, yyscanner );
2280 if (ce->section.isCompound())
2282 yyextra->specialBlock =
false;
2283 yyextra->current_root = ce;
2286 else if (ce->parent())
2288 yyextra->current_root = rt;
2291 BEGIN( SearchMemVars );
2293 yyextra->fileName = ce->fileName;
2294 yyextra->yyLineNr = ce->bodyLine ;
2295 yyextra->current = std::make_shared<Entry>();
2298 yyextra->checkDupEntry =
false;
2301 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
2303 pyscannerYYlex(yyscanner) ;
2304 yyextra->lexInit=
TRUE;
2306 yyextra->programStr.clear();
2307 ce->program.str(std::string());
2309 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
2321 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2324 if (fileBuf==
nullptr || fileBuf[0]==
'\0')
return;
2326 yyextra->inputString = fileBuf;
2327 yyextra->inputPosition = 0;
2329 yyextra->protection = Protection::Public;
2330 yyextra->mtype = MethodTypes::Method;
2331 yyextra->isStatic =
false;
2332 yyextra->virt = Specifier::Normal;
2333 yyextra->current_root = rt;
2334 yyextra->specialBlock =
false;
2336 yyextra->yyLineNr = 1 ;
2337 yyextra->fileName = fileName;
2338 yyextra->checkDupEntry =
false;
2339 yyextra->firstPass =
true;
2341 msg(
"Parsing file {}...\n",yyextra->fileName);
2346 if (baseName!=
"__init__")
2348 if (!yyextra->moduleScope.isEmpty())
2350 yyextra->moduleScope+=
"::";
2352 yyextra->moduleScope+=baseName;
2356 QCString scope = yyextra->moduleScope;
2361 pos = scope.
find(
"::",startPos);
2363 if (pos==-1) pos=(int)scope.
length();
2364 yyextra->current = std::make_shared<Entry>();
2366 yyextra->current->name = scope.
left(pos);
2367 yyextra->current->section = EntryType::makeNamespace();
2368 yyextra->current->type =
"namespace";
2369 yyextra->current->fileName = yyextra->fileName;
2370 yyextra->current->startLine = yyextra->yyLineNr;
2371 yyextra->current->bodyLine = yyextra->yyLineNr;
2372 yyextra->current_root = yyextra->current;
2373 rt->moveToSubEntryAndRefresh(yyextra->current);
2374 }
while (pos<(
int)scope.
length());
2378 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
2380 yyextra->current->reset();
2382 pyscannerYYrestart(
nullptr,yyscanner);
2384 pyscannerYYlex(yyscanner);
2385 yyextra->lexInit=
TRUE;
2387 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
2389 yyextra->programStr.clear();
2390 yyextra->current_root->program.str(std::string());
2399 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2403 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
2407 yyextra->specialBlock =
FALSE;
2408 yyextra->packageCommentAllowed =
FALSE;
2411 YY_BUFFER_STATE orgState = YY_CURRENT_BUFFER;
2412 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
2413 const char *orgInputString = yyextra->inputString;
2414 int orgInputPosition = yyextra->inputPosition;
2417 yyextra->inputString = text.
data();
2418 yyextra->inputPosition = 0;
2419 pyscannerYYrestart(
nullptr, yyscanner );
2421 BEGIN( FunctionDec );
2423 pyscannerYYlex(yyscanner);
2424 yyextra->lexInit=
TRUE;
2426 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2427 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.isEmpty())
2429 yyextra->current->section = EntryType::makeVariableDoc();
2434 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
2435 yy_switch_to_buffer(orgState, yyscanner);
2437 yyextra->inputString = orgInputString;
2438 yyextra->inputPosition = orgInputPosition;
2453 pyscannerYYlex_init_extra(&
p->state,&
p->yyscanner);
2461 pyscannerYYlex_destroy(
p->yyscanner);
2466 const char *fileBuf,
2467 const std::shared_ptr<Entry> &root,
2470 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
2471 yyextra->thisParser =
this;
2491#include "pyscanner.l.h"
Clang parser object for a single translation unit, which consists of a source file and the directly o...
static bool isFlagSet(const DebugMask mask)
Wrapper class for the Entry type.
Minimal replacement for QFileInfo.
Helper class to process markdown formatted text.
bool needsPreprocessing(const QCString &extension) const override
Returns TRUE if the language identified by extension needs the C preprocessor to be run before feed t...
void parseInput(const QCString &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
~PythonOutlineParser() override
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
int find(char c, int index=0, bool cs=TRUE) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
const std::string & str() const
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
#define Config_getInt(name)
#define Config_getBool(name)
static void parseMain(yyscan_t yyscanner, const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, FortranFormat format)
static void parsePrototype(yyscan_t yyscanner, const QCString &text)
static void parseCompounds(yyscan_t yyscanner, std::shared_ptr< Entry > rt)
QCString stripIndentation(const QCString &s, bool skipFirstLine)