22%option never-interactive
23%option prefix="pyscannerYY"
25%option extra-type="struct pyscannerYY_state *"
29#define YY_TYPEDEF_YY_SCANNER_T
65#define DBG_CTX(x) do { } while(0)
68#define YY_NO_UNISTD_H 1
70#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
166#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
Abstract interface for outline parsers.
This is an alternative implementation of QCString.
Text streaming class that buffers data.
std::unordered_map< std::string, std::string > StringUnorderedMap
#define lineCount(s, len)
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 int computeIndent(const char *s)
static void searchFoundTypeAlias(yyscan_t yyscanner)
static void addFrom(yyscan_t yyscanner, bool all)
static void setProtection(yyscan_t yyscanner)
static void initParser(yyscan_t yyscanner)
static void endOfDef(yyscan_t yyscanner, int correction=0)
static QCString findPackageScope(yyscan_t yyscanner, const QCString &fileName)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static void searchFoundClass(yyscan_t yyscanner)
static const char * stateToString(int state)
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 handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
static void searchFoundDef(yyscan_t yyscanner)
static void addEntry(yyscan_t yyscanner)
static const char * getLexerFILE()
static void startCommentBlock(yyscan_t yyscanner, bool brief)
static void newFunction(yyscan_t yyscanner)
static void addVariable(yyscan_t yyscanner)
static void addToString(yyscan_t yyscanner, const char *s)
static void initEntry(yyscan_t yyscanner)
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.
183HEXNUMBER "0"[xX][0-9a-fA-F]+[lL]?
184OCTNUMBER "0"[0-7]+[lL]?
185NUMBER {DIGIT}+[lLjJ]?
186INTNUMBER {HEXNUMBER}|{OCTNUMBER}|{NUMBER}
187FLOATNUMBER {DIGIT}+"."{DIGIT}+([eE][+\-]?{DIGIT}+)?[jJ]?
189LETTER [A-Za-z\x80-\xFF]
190NONEMPTY [A-Za-z0-9_\x80-\xFF]
191EXPCHAR [#(){}\[\],:.%/\\=`*~|&<>!;+-]
192PARAMNONEMPTY [^ \t\n():]
193IDENTIFIER ({LETTER}|"_")({LETTER}|{DIGIT}|"_")*
194SCOPE {IDENTIFIER}("."{IDENTIFIER})*
196TRISINGLEQUOTE {STRINGPREFIX}?"'''"(!)?
197TRIDOUBLEQUOTE {STRINGPREFIX}?"\"\"\""(!)?
198ENDTRISINGLEQUOTE "'''"
199ENDTRIDOUBLEQUOTE "\"\"\""
200LONGSTRINGCHAR [^\\"']
202LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
203SMALLQUOTE ("\"\""|"\""|"'"|"''")
204LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
206STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR")
207POUNDCOMMENT "#"[^#\n][^\n]*
212LINENR {B}*[1-9][0-9]*
213FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
214FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
215FILECHARS {FILEICHAR}*{FILEECHAR}+
216HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
217VFILEMASK {FILECHARS}("."{FILECHARS})*
218FILEMASK {VFILEMASK}|{HFILEMASK}
221ID [a-z_A-Z%]+{IDSYM}*
244%x FunctionTypeAnnotation
245%x FunctionParamDefVal
264%x SingleQuoteStringIgnore
265%x DoubleQuoteStringIgnore
290 DBG_CTX((stderr,
"Found def at %d\n",yyextra->yyLineNr));
293 BEGIN( FunctionDec );
295 ^{B}"async"{BB}"def"{BB} {
296 DBG_CTX((stderr,
"Found async def at %d\n",yyextra->yyLineNr));
299 BEGIN( FunctionDec );
303 BEGIN( FunctionDec );
305 "async"{BB}"def"{BB} {
307 BEGIN( FunctionDec );
311 DBG_CTX((stderr,
"Found class at %d\n",yyextra->yyLineNr));
331 yyextra->packageCommentAllowed =
FALSE;
337 yyextra->packageCommentAllowed =
FALSE;
340 ^{B}{IDENTIFIER}/{B}"="{B}"property" {
341 yyextra->current->section = EntryType::makeVariable();
342 yyextra->current->mtype = MethodTypes::Property;
344 yyextra->current->fileName = yyextra->fileName;
345 yyextra->current->startLine = yyextra->yyLineNr;
346 yyextra->current->bodyLine = yyextra->yyLineNr;
347 yyextra->packageCommentAllowed =
FALSE;
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
350 ^{B}{IDENTIFIER}/{B}"="[^=] {
351 if (yyextra->searchCount>0) REJECT;
353 yyextra->current->section = EntryType::makeVariable();
355 yyextra->current->fileName = yyextra->fileName;
356 yyextra->current->startLine = yyextra->yyLineNr;
357 yyextra->current->bodyLine = yyextra->yyLineNr;
358 yyextra->packageCommentAllowed =
FALSE;
361 ^{B}{IDENTIFIER}/{B}":" {
362 if (yyextra->searchCount>0) REJECT;
364 if (
id ==
"try" ||
id ==
"else" ||
id ==
"except" ||
id ==
"finally") REJECT;
366 yyextra->current->section = EntryType::makeVariable();
367 yyextra->current->name = id;
368 yyextra->current->fileName = yyextra->fileName;
369 yyextra->current->startLine = yyextra->yyLineNr;
370 yyextra->current->bodyLine = yyextra->yyLineNr;
371 yyextra->packageCommentAllowed =
FALSE;
374 {B}{IDENTIFIER}/({B},{B}{IDENTIFIER})*{B}")"*{B}"="[^=] {
378 if (yyextra->searchCount>1) REJECT;
380 yyextra->current->section = EntryType::makeVariable();
382 yyextra->current->fileName = yyextra->fileName;
383 yyextra->current->startLine = yyextra->yyLineNr;
384 yyextra->current->bodyLine = yyextra->yyLineNr;
385 yyextra->packageCommentAllowed =
FALSE;
static void addVariable(yyscan_t yyscanner, QCString type, QCString name)
389 yyextra->stringContext=YY_START;
390 yyextra->copyString=
nullptr;
391 yyextra->packageCommentAllowed =
FALSE;
392 BEGIN( SingleQuoteString );
395 yyextra->stringContext=YY_START;
396 yyextra->copyString=
nullptr;
397 yyextra->packageCommentAllowed =
FALSE;
398 BEGIN( DoubleQuoteString );
401 yyextra->isStatic=
TRUE;
405 yyextra->decoratorRound = 1;
406 yyextra->copyString=
nullptr;
413 if (yyextra->yyLineNr != 1) REJECT;
420 yyextra->packageCommentAllowed =
FALSE;
432 BEGIN(TripleComment);
437 BEGIN(TripleComment);
440 {B}{STARTDOCSYMS}/[^#] {
442 yyextra->packageCommentAllowed =
FALSE;
444 BEGIN(SpecialComment);
447 yyextra->searchCount++;
450 if (yyextra->searchCount>0)
452 yyextra->searchCount--;
456 yyextra->current->doc.clear();
457 yyextra->current->brief.clear();
471 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
472 yyextra->packageName=yytext;
494 {IDENTIFIER}/{B}","{B} {
497 {IDENTIFIER}/{B}")" {
502 if (!yyextra->importTuple)
509 if (!yyextra->importTuple)
517 yyextra->importTuple=
TRUE;
520 yyextra->importTuple=
FALSE;
535 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
537 yyextra->current->fileName = yyextra->fileName;
539 yyextra->current->section=EntryType::makeUsingDecl();
540 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
static void initEntry(yyscan_t yyscanner)
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)
557 ("cls"|"self")"."{IDENTIFIER}/{B}[,)] {
558 const char *s = strchr(yytext,
'.'); s++;
559 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)
563 ("cls"|"self")"."{IDENTIFIER}/{B}"=" {
564 const char *s = strchr(yytext,
'.'); s++;
565 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
567 BEGIN( SearchSkipValue );
569 ("cls"|"self")"."{IDENTIFIER}/{B}":" {
570 const char *s = strchr(yytext,
'.'); s++;
571 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
577 BEGIN(TripleComment);
582 BEGIN(TripleComment);
585 {STARTDOCSYMS}/[^#] {
587 BEGIN(SpecialComment);
592 yyextra->stringContext=YY_START;
593 yyextra->copyString=
nullptr;
594 BEGIN( SingleQuoteString );
597 yyextra->stringContext=YY_START;
598 yyextra->copyString=
nullptr;
599 BEGIN( DoubleQuoteString );
603 yyextra->current->doc.clear();
604 yyextra->current->brief.clear();
606 BEGIN( SearchSkipValue );
615 yyextra->braceCount=0;
618 yyextra->current->type+=*yytext;
619 yyextra->braceCount++;
622 yyextra->current->type+=*yytext;
623 yyextra->braceCount--;
626 yyextra->stringContext=YY_START;
627 yyextra->copyString=
nullptr;
628 BEGIN( SingleQuoteString );
631 yyextra->stringContext=YY_START;
632 yyextra->copyString=
nullptr;
633 BEGIN( DoubleQuoteString );
636 if (yyextra->braceCount==0)
638 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
640 BEGIN(SearchSkipValue);
644 yyextra->current->type+=*yytext;
648 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
651 BEGIN(SearchMemVars);
654 yyextra->current->type+=
' ';
658 yyextra->current->type+=*yytext;
662<SearchSkipValue,VariableDec,TypeValue>{
665 yyextra->startInit =
TRUE;
666 if (YY_START!=TypeValue)
668 yyextra->current->initializer.str(yytext);
669 yyextra->current->initializer <<
" ";
673 yyextra->current->initializer << yytext;
677 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"int";
678 yyextra->current->initializer << yytext;
681 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"float";
682 yyextra->current->initializer << yytext;
685 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"bool";
686 yyextra->current->initializer << yytext;
689 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
690 yyextra->current->initializer << yytext;
691 yyextra->copyString=&yyextra->current->initializer;
692 yyextra->stringContext=YY_START;
693 BEGIN( SingleQuoteString );
695 {STRINGPREFIX}?"\"" {
696 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
697 yyextra->current->initializer << yytext;
698 yyextra->copyString=&yyextra->current->initializer;
699 yyextra->stringContext=YY_START;
700 BEGIN( DoubleQuoteString );
703 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
704 yyextra->current->initializer << yytext;
705 yyextra->doubleQuote=
TRUE;
706 yyextra->copyString=&yyextra->current->initializer;
707 yyextra->stringContext=YY_START;
712 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
713 yyextra->current->initializer << yytext;
714 yyextra->doubleQuote=
FALSE;
715 yyextra->copyString=&yyextra->current->initializer;
716 yyextra->stringContext=YY_START;
720 if (yyextra->current->mtype!=MethodTypes::Property && yyextra->startInit)
722 yyextra->current->type =
"tuple";
724 yyextra->current->initializer << *yytext;
725 yyextra->atomStart=
'(';
726 yyextra->atomEnd=
')';
727 yyextra->atomCount=1;
728 yyextra->atomContext=YY_START;
729 BEGIN( VariableAtom );
732 if (yyextra->startInit) yyextra->current->type =
"list";
733 yyextra->current->initializer << *yytext;
734 yyextra->atomStart=
'[';
735 yyextra->atomEnd=
']';
736 yyextra->atomCount=1;
737 yyextra->atomContext=YY_START;
738 BEGIN( VariableAtom );
741 if (yyextra->startInit) yyextra->current->type =
"dict";
742 yyextra->current->initializer << *yytext;
743 yyextra->atomStart=
'{';
744 yyextra->atomEnd=
'}';
745 yyextra->atomCount=1;
746 yyextra->atomContext=YY_START;
747 BEGIN( VariableAtom );
750 yyextra->current->initializer << yytext;
755 if (yyextra->current->type.isEmpty())
757 for (
const auto &child : yyextra->current_root->children())
759 if (child->name == yytext)
761 yyextra->current->type = child->type;
766 yyextra->startInit =
FALSE;
767 yyextra->current->initializer << yytext;
770 yyextra->startInit =
FALSE;
771 yyextra->current->initializer << *yytext;
775 {STARTDOCSYMS}/[^#] {
777 BEGIN(SpecialComment);
783 BEGIN(SearchMemVars);
787 BEGIN(SearchMemVars);
792 \n{B}/{IDENTIFIER}[^{LETTER}{DIGIT}_] {
804 yyextra->current->program << yytext;
818 yyextra->current->program << yytext;
826 yyextra->current->program << yytext;
830 if (yyextra->curIndent<=yyextra->indent)
838 yyextra->current->program << yytext;
842 yyextra->current->program << yytext;
843 yyextra->stringContext=YY_START;
844 yyextra->specialBlock =
FALSE;
845 yyextra->copyString=&yyextra->current->program;
846 BEGIN( SingleQuoteString );
849 yyextra->current->program << yytext;
850 yyextra->stringContext=YY_START;
851 yyextra->specialBlock =
FALSE;
852 yyextra->copyString=&yyextra->current->program;
853 BEGIN( DoubleQuoteString );
856 yyextra->current->program << yytext;
857 yyextra->specialBlock =
FALSE;
860 yyextra->current->program << yytext;
863 yyextra->current->program << yytext;
867 yyextra->current->program << yytext;
870 yyextra->current->program << *yytext;
871 yyextra->specialBlock =
FALSE;
875 yyextra->current->program << yytext;
877 BEGIN(TripleComment);
881 yyextra->current->program << yytext;
883 BEGIN(TripleComment);
891 yyextra->current->name = yytext;
892 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
896 yyextra->specialBlock =
TRUE;
897 yyextra->bodyEntry = yyextra->current;
898 yyextra->current->bodyLine = yyextra->yyLineNr;
902 yyextra->genericsContext = YY_START;
903 yyextra->bracketDepth = 1;
904 yyextra->genericsValue =
"[";
908 yyextra->defVal.str(std::string());
909 yyextra->braceCount = 0;
910 BEGIN(FunctionTypeAnnotation);
913 yyextra->funcParamsEnd =
FALSE;
914 yyextra->current->bodyLine = yyextra->yyLineNr;
915 BEGIN(FunctionParams);
918 if (yyextra->current->argList.empty())
920 yyextra->current->argList.setNoParameters(
TRUE);
923 yyextra->funcParamsEnd =
TRUE;
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
929 yyextra->genericsValue+=yytext;
932 yyextra->genericsValue+=yytext;
933 yyextra->bracketDepth++;
936 yyextra->genericsValue+=yytext;
937 yyextra->bracketDepth--;
938 if (yyextra->bracketDepth==0)
940 BEGIN(yyextra->genericsContext);
944 yyextra->genericsValue+=yytext;
953 if (!yyextra->argType.isEmpty())
957 a.
type = yyextra->argType;
958 yyextra->current->argList.push_back(a);
959 yyextra->argType =
"";
This class contains the information about the argument of a function or template.
964 yyextra->argType = yytext;
970 a.
type = yyextra->argType;
971 yyextra->current->argList.push_back(a);
972 yyextra->argType =
"";
977 yyextra->defVal.str(std::string());
978 yyextra->braceCount = 0;
979 BEGIN(FunctionParamDefVal);
982 if (!yyextra->argType.isEmpty())
986 a.
type = yyextra->argType;
987 yyextra->current->argList.push_back(a);
988 yyextra->argType =
"";
994 yyextra->defVal.str(std::string());
995 yyextra->braceCount = 0;
996 BEGIN(FunctionAnnotation);
1005<FunctionTypeAnnotation>{
1009 ++yyextra->braceCount;
1010 yyextra->defVal << *yytext;
1015 --yyextra->braceCount;
1016 yyextra->defVal << *yytext;
1019 if (yyextra->braceCount == 0)
1021 yyextra->current->type = yyextra->defVal.str();
1026 yyextra->defVal << *yytext;
1029 yyextra->defVal << *yytext;
1030 yyextra->copyString=&yyextra->defVal;
1031 yyextra->stringContext=FunctionTypeAnnotation;
1032 BEGIN(SingleQuoteString);
1035 yyextra->defVal << *yytext;
1036 yyextra->copyString=&yyextra->defVal;
1037 yyextra->stringContext=FunctionTypeAnnotation;
1038 BEGIN(DoubleQuoteString);
1041 yyextra->defVal << *yytext;
1045 yyextra->defVal << *yytext;
1049<FunctionAnnotation>{
1053 ++yyextra->braceCount;
1054 yyextra->defVal << *yytext;
1058 --yyextra->braceCount;
1059 yyextra->defVal << *yytext;
1064 if (yyextra->braceCount == 0)
1066 if (!yyextra->current->argList.empty())
1067 yyextra->current->argList.back().type += yyextra->defVal.str();
1070 BEGIN(FunctionParams);
1075 --yyextra->braceCount;
1076 yyextra->defVal << *yytext;
1080 yyextra->defVal << *yytext;
1081 yyextra->copyString=&yyextra->defVal;
1082 yyextra->stringContext=FunctionAnnotation;
1083 BEGIN(SingleQuoteString);
1086 yyextra->defVal << *yytext;
1087 yyextra->copyString=&yyextra->defVal;
1088 yyextra->stringContext=FunctionAnnotation;
1089 BEGIN(DoubleQuoteString);
1092 yyextra->defVal << *yytext;
1096 yyextra->defVal << *yytext;
1100<FunctionParamDefVal>{
1104 ++yyextra->braceCount;
1105 yyextra->defVal << *yytext;
1109 --yyextra->braceCount;
1110 yyextra->defVal << *yytext;
1114 if (yyextra->braceCount == 0)
1116 if (!yyextra->current->argList.empty())
1120 BEGIN(FunctionParams);
1125 --yyextra->braceCount;
1126 yyextra->defVal << *yytext;
1131 yyextra->defVal << *yytext;
1132 yyextra->copyString=&yyextra->defVal;
1133 yyextra->stringContext=FunctionParamDefVal;
1134 BEGIN( SingleQuoteString );
1137 yyextra->defVal << *yytext;
1138 yyextra->copyString=&yyextra->defVal;
1139 yyextra->stringContext=FunctionParamDefVal;
1140 BEGIN( DoubleQuoteString );
1143 yyextra->defVal << *yytext;
1147 yyextra->defVal << *yytext;
1153 \n/{IDENTIFIER}{BB} {
1157 for (i=(
int)yyleng-1;i>=0;i--)
1168 yyextra->current->program << yytext;
1175 for (i=(
int)yyleng-1;i>=0;i--)
1186 yyextra->current->program << yytext;
1190 yyextra->current->program << yytext;
1198 DBG_CTX((stderr,
"yyextra->curIndent=%d yyextra->indent=%d\n",yyextra->curIndent,yyextra->indent));
1199 if (yyextra->curIndent<=yyextra->indent)
1203 yyextra->indent=yyextra->curIndent;
1211 yyextra->current->program << yytext;
1215 yyextra->current->program << *yytext;
1216 yyextra->stringContext=YY_START;
1217 yyextra->specialBlock =
FALSE;
1218 yyextra->copyString=&yyextra->current->program;
1219 BEGIN( SingleQuoteString );
1222 yyextra->current->program << *yytext;
1223 yyextra->stringContext=YY_START;
1224 yyextra->specialBlock =
FALSE;
1225 yyextra->copyString=&yyextra->current->program;
1226 BEGIN( DoubleQuoteString );
1229 yyextra->current->program << yytext;
1230 yyextra->specialBlock =
FALSE;
1234 yyextra->current->program << *yytext;
1238 yyextra->current->program << yytext;
1241 yyextra->specialBlock =
FALSE;
1242 yyextra->current->program << *yytext;
1246 yyextra->current->program << yytext;
1248 BEGIN(TripleComment);
1253 yyextra->current->program << yytext;
1255 BEGIN(TripleComment);
1261 yyextra->current->name = yytext;
1264 yyextra->bracketDepth=1;
1265 yyextra->genericsContext = YY_START;
1266 yyextra->genericsValue =
"[";
1270 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...
1292<ClassDec>{IDENTIFIER} {
1293 if (yyextra->current->type.isEmpty())
1295 yyextra->current->type =
"class";
1298 yyextra->current->section = EntryType::makeClass();
1299 yyextra->current->name = yytext;
1304 if (yyextra->current_root->section.isScope())
1307 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
1310 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1311 yyextra->current->fileName = yyextra->fileName;
1312 yyextra->docBlockContext = YY_START;
1313 yyextra->docBlockInBody =
FALSE;
1314 yyextra->docBlockJavaStyle =
FALSE;
1315 yyextra->docBlock.clear();
1316 yyextra->bracketDepth = 0;
1318 BEGIN(ClassInheritance);
1325 yyextra->bracketDepth=1;
1326 yyextra->genericsContext = YY_START;
1327 yyextra->genericsValue =
"[";
1331 yyextra->specialBlock =
TRUE;
1332 yyextra->current->bodyLine = yyextra->yyLineNr;
1333 yyextra->current->program.str(std::string());
1334 BEGIN(ClassCaptureIndent);
1338 yyextra->current->extends.emplace_back(
1339 substitute(yytext,
".",
"::"),Protection::Public,Specifier::Normal
1343 yyextra->stringContext=YY_START;
1344 BEGIN( SingleQuoteStringIgnore );
1347 yyextra->stringContext=YY_START;
1348 BEGIN( DoubleQuoteStringIgnore );
1352<SingleQuoteStringIgnore>{
1354 BEGIN(yyextra->stringContext);
1358<DoubleQuoteStringIgnore>{
1360 BEGIN(yyextra->stringContext);
1365<ClassCaptureIndent>{
1369 yyextra->current->program << yytext;
1374 yyextra->current->program << yytext;
1375 BEGIN(TripleComment);
1379 yyextra->current->program << yytext;
1380 BEGIN(TripleComment);
1382 {STARTDOCSYMS}[#]* {
1384 BEGIN(SpecialComment);
1389 yyextra->current->program << yytext;
1392 yyextra->bodyEntry = yyextra->current;
1393 DBG_CTX((stderr,
"setting indent %d\n",yyextra->curIndent));
1399 ""/({NONEMPTY}|{EXPCHAR}) {
1403 yyextra->current->program << yytext;
1412 ":"{B}{IDENTIFIER} {
1413 yyextra->startInit =
FALSE;
1414 yyextra->current->type =
substitute(yytext,
":",
"");
1416 {STARTDOCSYMS}"<"/.* {
1418 yyextra->packageCommentAllowed =
FALSE;
1420 yyextra->docBlockContext = VariableEnd;
1421 BEGIN(SpecialComment);
1424 BEGIN( VariableEnd );
1428 BEGIN( VariableEnd );
1434 yyextra->current->initializer << *yytext;
1435 if (yyextra->atomStart==*yytext)
1437 yyextra->atomCount++;
1441 yyextra->current->initializer << *yytext;
1442 if (yyextra->atomEnd==*yytext)
1444 yyextra->atomCount--;
1446 if (yyextra->atomCount==0)
1448 yyextra->startInit =
FALSE;
1449 BEGIN(yyextra->atomContext);
1453 yyextra->specialBlock =
FALSE;
1454 yyextra->current->program << yytext;
1456 BEGIN(TripleComment);
1460 yyextra->specialBlock =
FALSE;
1461 yyextra->current->program << yytext;
1463 BEGIN(TripleComment);
1466 yyextra->stringContext=YY_START;
1467 yyextra->current->initializer <<
"'";
1468 yyextra->copyString=&yyextra->current->initializer;
1469 BEGIN( SingleQuoteString );
1472 yyextra->stringContext=YY_START;
1473 yyextra->current->initializer <<
"\"";
1474 yyextra->copyString=&yyextra->current->initializer;
1475 BEGIN( DoubleQuoteString );
1478 yyextra->current->initializer << yytext;
1481 yyextra->current->initializer << yytext;
1484 yyextra->current->initializer << *yytext;
1487 yyextra->current->initializer << *yytext;
1512 {ENDTRIDOUBLEQUOTE} |
1513 {ENDTRISINGLEQUOTE} {
1515 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1517 if (yyextra->specialBlock)
1519 QCString actualDoc=yyextra->docBlock;
1520 if (!yyextra->docBlockSpecial)
1525 actualDoc.
prepend(
"@iverbatim\n");
1526 actualDoc.
append(
"@endiverbatim ");
1532 else if (yyextra->packageCommentAllowed)
1534 QCString actualDoc=yyextra->docBlock;
1535 if (!yyextra->docBlockSpecial)
1540 actualDoc.
prepend(
"@iverbatim\n");
1541 actualDoc.
append(
"@endiverbatim ");
1544 if (yyextra->moduleScope.startsWith(
"__") && yyextra->moduleScope.endsWith(
"__"))
1546 actualDoc.
prepend(
"\\namespace \\"+yyextra->moduleScope+
" ");
1550 actualDoc.
prepend(
"\\namespace "+yyextra->moduleScope+
" ");
1554 if ((yyextra->docBlockContext==ClassBody ) ||
1555 yyextra->docBlockContext==FunctionBody)
1557 yyextra->current->program << yyextra->docBlock;
1558 yyextra->current->program << yytext;
1565 BEGIN(yyextra->docBlockContext);
1569 yyextra->docBlock += yytext;
1571 yyextra->packageCommentAllowed =
FALSE;
QCString & prepend(const char *s)
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString & append(char c)
static void handleCommentBlock(yyscan_t yyscanner, const QCString &doc, bool brief)
void stripIndentationVerbatim(QCString &doc, const int indentationLevel, bool skipFirstLine)
1576 if (yyextra->firstPass && yyextra->docBlockSpecial && yyleng >= yyextra->curIndent)
1577 yyextra->docBlock += yytext + yyextra->curIndent;
1579 yyextra->docBlock += yytext;
1582 yyextra->docBlock += yytext;
1586 yyextra->docBlock += yytext;
1588 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1589 yyextra->fileName = &yytext[6];
1590 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1591 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1592 yyextra->docBlock+=yytext;
1594 {CMD}"ifile"{B}+{FILEMASK} {
1595 yyextra->fileName = &yytext[6];
1596 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1597 yyextra->docBlock+=yytext;
1599 {CMD}"iline"{LINENR}/[\n\.] |
1600 {CMD}"iline"{LINENR}{B} {
1605 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1609 yyextra->yyLineNr = nr;
1611 yyextra->docBlock+=yytext;
int toInt(bool *ok=nullptr, int base=10) const
#define warn(file, line, fmt,...)
1613 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1614 yyextra->docBlock+=yytext;
1617 yyextra->docBlock += yytext;
1620 yyextra->docBlock += yytext;
1628 yyextra->docBlock+=
'\n';
1629 yyextra->docBrief =
FALSE;
1632 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1633 yyextra->fileName = &yytext[6];
1634 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1635 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1636 yyextra->docBlock+=yytext;
1638 {CMD}"ifile"{B}+{FILEMASK} {
1639 yyextra->fileName = &yytext[6];
1640 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1641 yyextra->docBlock+=yytext;
1643 {CMD}"iline"{LINENR}/[\n\.] |
1644 {CMD}"iline"{LINENR}{B} {
1649 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1653 yyextra->yyLineNr = nr;
1655 yyextra->docBlock+=yytext;
1657 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1658 yyextra->docBlock+=yytext;
1662 int extraSpaces = std::max(0,
static_cast<int>(yyleng-9-yyextra->curIndent-2));
1663 indent.
fill(
' ',extraSpaces);
1665 yyextra->docBlock +=
"\\ilinebr ";
1666 yyextra->docBlock += indent;
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
1669 yyextra->docBlock+=yytext;
1673 if (yyextra->docBlockContext == VariableEnd)
1681 BEGIN(yyextra->docBlockContext);
1684 yyextra->docBlock+=*yytext;
1701 BEGIN(yyextra->stringContext);
1724 BEGIN(yyextra->stringContext);
1735 {ENDTRIDOUBLEQUOTE} |
1736 {ENDTRISINGLEQUOTE} {
1737 *yyextra->copyString << yytext;
1738 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1740 BEGIN(yyextra->stringContext);
1745 ({LONGSTRINGBLOCK}) {
1747 *yyextra->copyString << yytext;
1751 *yyextra->copyString << yytext;
1754 *yyextra->copyString << *yytext;
1760 yyextra->doubleQuote=
TRUE;
1761 yyextra->decoratorCommentStr.str(std::string());
1762 yyextra->copyString=&yyextra->decoratorCommentStr;
1763 yyextra->stringContext=YY_START;
1764 BEGIN(TripleString);
1768 yyextra->doubleQuote=
FALSE;
1769 yyextra->decoratorCommentStr.str(std::string());
1770 yyextra->copyString=&yyextra->decoratorCommentStr;
1771 yyextra->stringContext=YY_START;
1772 BEGIN(TripleString);
1775 yyextra->stringContext=YY_START;
1776 yyextra->decoratorCommentStr.str(std::string());
1777 yyextra->copyString=&yyextra->decoratorCommentStr;
1778 BEGIN( SingleQuoteString );
1781 yyextra->stringContext=YY_START;
1782 yyextra->decoratorCommentStr.str(std::string());
1783 yyextra->copyString=&yyextra->decoratorCommentStr;
1784 BEGIN( DoubleQuoteString );
1787 yyextra->decoratorRound++;
1790 yyextra->decoratorRound--;
1791 if (!yyextra->decoratorRound) BEGIN(
Search );
1834 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1836 const char *p = yyextra->inputString + yyextra->inputPosition;
1837 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1838 yyextra->inputPosition+=c;
1844 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1845 yyextra->protection = Protection::Public;
1846 yyextra->mtype = MethodTypes::Method;
1847 yyextra->isStatic =
FALSE;
1848 yyextra->virt = Specifier::Normal;
1849 yyextra->previous = 0;
1850 yyextra->packageCommentAllowed =
TRUE;
1855 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1857 yyextra->current->protection = yyextra->protection ;
1858 yyextra->current->mtype = yyextra->mtype;
1859 yyextra->current->virt = yyextra->virt;
1860 yyextra->current->isStatic = yyextra->isStatic;
1861 yyextra->current->lang = SrcLangExt::Python;
1862 yyextra->current->type.clear();
1863 yyextra->current->name.clear();
1864 yyextra->current->initializer.clear();
1865 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
1866 yyextra->isStatic =
FALSE;
1871 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1872 if (yyextra->current->name.isEmpty())
1878 if (yyextra->checkDupEntry)
1880 for (
auto &v : yyextra->current_root->children())
1883 if (v->name==yyextra->current->name && v->section==yyextra->current->section)
1885 if (v->doc.isEmpty() && !yyextra->current->doc.isEmpty())
1887 v->doc = yyextra->current->doc;
1888 v->docLine = yyextra->current->docLine;
1889 v->docFile = yyextra->current->docFile;
1891 if (v->brief.isEmpty() && !yyextra->current->brief.isEmpty())
1893 v->brief = yyextra->current->brief;
1894 v->briefLine = yyextra->current->briefLine;
1895 v->briefFile = yyextra->current->briefFile;
1897 if (v->type.isEmpty() && !yyextra->current->type.isEmpty())
1900 v->type = yyextra->current->type;
1909 yyextra->previous = yyextra->current;
1910 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1917 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1919 auto doc = yyextra->current->doc;
1920 auto docLine = yyextra->current->docLine;
1921 auto docFile = yyextra->current->docFile;
1922 auto brief = yyextra->current->brief;
1923 auto briefLine = yyextra->current->briefLine;
1924 auto briefFile = yyextra->current->briefFile;
1926 yyextra->previous = yyextra->current;
1927 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1930 yyextra->current->doc = doc;
1931 yyextra->current->docLine = docLine;
1932 yyextra->current->docFile = docFile;
1933 yyextra->current->brief = brief;
1934 yyextra->current->briefLine = briefLine;
1935 yyextra->current->briefFile = briefFile;
1940 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1941 if (!yyextra->current->name.isEmpty() && yyextra->current->name.at(0)==
'_')
1943 if (yyextra->current->name.at(1)==
'_')
1945 yyextra->current->protection=Protection::Private;
1949 yyextra->current->protection=Protection::Protected;
1956 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1957 yyextra->current->name = name;
1958 yyextra->current->section=EntryType::makeVariable();
1959 yyextra->current->fileName = yyextra->fileName;
1960 yyextra->current->startLine = yyextra->yyLineNr;
1961 yyextra->current->bodyLine = yyextra->yyLineNr;
1962 yyextra->current->type.clear();
1964 yyextra->checkDupEntry =
true;
1969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1971 if (yyextra->current_root->section.isCompound())
1973 yyextra->current->isStatic =
TRUE;
1987 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1989 if (yyextra->current_root->section.isCompound())
1991 yyextra->current->isStatic =
TRUE;
1998 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1999 if (yyextra->current->name.startsWith(
"__") && yyextra->current->name.endsWith(
"__"))
2003 yyextra->current->protection=Protection::Public;
2020 else if (c==
'\t') col+=tabSize-(col%tabSize);
2028 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2029 auto it = yyextra->packageNameCache.
find(path.
str());
2030 if (it!=yyextra->packageNameCache.end())
2045 scope+=path.
mid(i+1);
2046 yyextra->packageNameCache.emplace(path.
str(),scope.
str());
2055 if (fileName.
isEmpty())
return fileName;
2062 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2063 QCString item=all ? yyextra->packageName : yyextra->packageName+
"."+yytext;
2065 yyextra->current->fileName = yyextra->fileName;
2067 yyextra->current->section=all ? EntryType::makeUsingDir() : EntryType::makeUsingDecl();
2068 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
2075 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2076 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
2077 for (
const char *p = yytext; *p; ++p)
2079 yyextra->yyLineNr += (*p ==
'\n') ;
2085 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2086 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
2087 yyextra->yyLineNr++;
2093 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2096 yyextra->current->briefFile = yyextra->fileName;
2097 yyextra->current->briefLine = yyextra->yyLineNr;
2101 yyextra->current->docFile = yyextra->fileName;
2102 yyextra->current->docLine = yyextra->yyLineNr;
2108 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2113 yyextra->docBlockInBody=
FALSE;
2115 if (!yyextra->current->doc.isEmpty())
2117 yyextra->current->doc=yyextra->current->doc.stripWhiteSpace()+
"\n\n";
2119 if (yyextra->docBlockInBody && yyextra->previous && !yyextra->previous->doc.isEmpty())
2121 yyextra->previous->doc=yyextra->previous->doc.stripWhiteSpace()+
"\n\n";
2125 bool needsEntry =
false;
2126 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
2127 Markdown markdown(yyextra->fileName,lineNr);
2132 while (yyextra->commentScanner.parseCommentBlock(
2133 yyextra->thisParser,
2134 (yyextra->docBlockInBody && yyextra->previous) ? yyextra->previous.get() : yyextra->current.get(),
2138 yyextra->docBlockInBody ?
FALSE : brief,
2139 yyextra->docBlockJavaStyle,
2140 yyextra->docBlockInBody,
2141 yyextra->protection,
2163 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2165 if (yyextra->bodyEntry)
2167 yyextra->bodyEntry->endBodyLine = yyextra->yyLineNr-correction;
2168 yyextra->bodyEntry = 0;
2176 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2177 if (yyextra->copyString) (*yyextra->copyString) << s;
2182 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2183 yyextra->docBlockContext = YY_START;
2184 yyextra->docBlockInBody =
FALSE;
2185 yyextra->docBlockJavaStyle =
TRUE;
2186 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2187 yyextra->docBlock.clear();
2188 yyextra->commentIndent = yyextra->curIndent;
2189 yyextra->doubleQuote =
TRUE;
2195 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2196 yyextra->docBlockContext = YY_START;
2197 yyextra->docBlockInBody =
FALSE;
2198 yyextra->docBlockJavaStyle =
TRUE;
2199 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2200 yyextra->docBlock.clear();
2201 yyextra->commentIndent = yyextra->curIndent;
2202 yyextra->doubleQuote =
FALSE;
2208 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2209 yyextra->docBlockContext = YY_START;
2210 yyextra->docBlockInBody =
FALSE;
2211 yyextra->docBlockJavaStyle =
TRUE;
2212 yyextra->docBrief =
TRUE;
2213 yyextra->docBlock.clear();
2214 yyextra->commentIndent = yyextra->curIndent;
2220 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2221 yyextra->current->fileName = yyextra->fileName;
2222 yyextra->current->startLine = yyextra->yyLineNr;
2223 yyextra->current->bodyLine = yyextra->yyLineNr;
2224 yyextra->current->section = EntryType::makeFunction();
2225 yyextra->current->lang = SrcLangExt::Python;
2226 yyextra->current->virt = Specifier::Normal;
2227 yyextra->current->isStatic = yyextra->isStatic;
2228 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
2229 yyextra->current->type.clear();
2230 yyextra->current->name.clear();
2231 yyextra->current->args.clear();
2232 yyextra->current->argList.clear();
2233 yyextra->packageCommentAllowed =
FALSE;
2234 yyextra->isStatic=
FALSE;
2240 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2241 yyextra->current->section = EntryType::makeClass();
2242 yyextra->current->argList.clear();
2243 yyextra->current->type +=
"class" ;
2244 yyextra->current->fileName = yyextra->fileName;
2245 yyextra->current->startLine = yyextra->yyLineNr;
2246 yyextra->current->bodyLine = yyextra->yyLineNr;
2247 yyextra->packageCommentAllowed =
FALSE;
2252 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2253 yyextra->current->section = EntryType::makeVariable();
2254 yyextra->current->argList.clear();
2255 yyextra->current->type =
"typedef " ;
2256 yyextra->current->spec.setAlias(
true);
2257 yyextra->current->fileName = yyextra->fileName;
2258 yyextra->current->startLine = yyextra->yyLineNr;
2259 yyextra->current->bodyLine = yyextra->yyLineNr;
2260 yyextra->packageCommentAllowed =
FALSE;
2267 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2269 for (
size_t i=0; i<rt->children().size(); ++i)
2271 std::shared_ptr<Entry> ce = rt->children()[i];
2272 if (!ce->program.empty())
2277 yyextra->programStr = ce->program.str();
2278 yyextra->inputString = yyextra->programStr.data();
2279 yyextra->inputPosition = 0;
2280 yyextra->firstPass =
false;
2281 pyscannerYYrestart(
nullptr, yyscanner );
2282 if (ce->section.isCompound())
2284 yyextra->specialBlock =
false;
2285 yyextra->current_root = ce;
2288 else if (ce->parent())
2290 yyextra->current_root = rt;
2293 BEGIN( SearchMemVars );
2295 yyextra->fileName = ce->fileName;
2296 yyextra->yyLineNr = ce->bodyLine ;
2297 yyextra->current = std::make_shared<Entry>();
2300 yyextra->checkDupEntry =
false;
2303 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
2305 pyscannerYYlex(yyscanner) ;
2306 yyextra->lexInit=
TRUE;
2308 yyextra->programStr.clear();
2309 ce->program.str(std::string());
2311 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
2323 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2326 if (fileBuf==
nullptr || fileBuf[0]==
'\0')
return;
2328 yyextra->inputString = fileBuf;
2329 yyextra->inputPosition = 0;
2331 yyextra->protection = Protection::Public;
2332 yyextra->mtype = MethodTypes::Method;
2333 yyextra->isStatic =
false;
2334 yyextra->virt = Specifier::Normal;
2335 yyextra->current_root = rt;
2336 yyextra->specialBlock =
false;
2338 yyextra->yyLineNr = 1 ;
2339 yyextra->fileName = fileName;
2340 yyextra->checkDupEntry =
false;
2341 yyextra->firstPass =
true;
2343 msg(
"Parsing file {}...\n",yyextra->fileName);
2348 if (baseName!=
"__init__")
2350 if (!yyextra->moduleScope.isEmpty())
2352 yyextra->moduleScope+=
"::";
2354 yyextra->moduleScope+=baseName;
2358 QCString scope = yyextra->moduleScope;
2363 pos = scope.
find(
"::",startPos);
2365 if (pos==-1) pos=(int)scope.
length();
2366 yyextra->current = std::make_shared<Entry>();
2368 yyextra->current->name = scope.
left(pos);
2369 yyextra->current->section = EntryType::makeNamespace();
2370 yyextra->current->type =
"namespace";
2371 yyextra->current->fileName = yyextra->fileName;
2372 yyextra->current->startLine = yyextra->yyLineNr;
2373 yyextra->current->bodyLine = yyextra->yyLineNr;
2374 yyextra->current_root = yyextra->current;
2375 rt->moveToSubEntryAndRefresh(yyextra->current);
2376 }
while (pos<(
int)scope.
length());
2380 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
2382 yyextra->current->reset();
2384 pyscannerYYrestart(
nullptr,yyscanner);
2386 pyscannerYYlex(yyscanner);
2387 yyextra->lexInit=
TRUE;
2389 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
2391 yyextra->programStr.clear();
2392 yyextra->current_root->program.str(std::string());
2401 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2405 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
2409 yyextra->specialBlock =
FALSE;
2410 yyextra->packageCommentAllowed =
FALSE;
2413 YY_BUFFER_STATE orgState = YY_CURRENT_BUFFER;
2414 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
2415 const char *orgInputString = yyextra->inputString;
2416 int orgInputPosition = yyextra->inputPosition;
2419 yyextra->inputString = text.
data();
2420 yyextra->inputPosition = 0;
2421 pyscannerYYrestart(
nullptr, yyscanner );
2423 BEGIN( FunctionDec );
2425 pyscannerYYlex(yyscanner);
2426 yyextra->lexInit=
TRUE;
2428 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2429 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.isEmpty())
2431 yyextra->current->section = EntryType::makeVariableDoc();
2436 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
2437 yy_switch_to_buffer(orgState, yyscanner);
2439 yyextra->inputString = orgInputString;
2440 yyextra->inputPosition = orgInputPosition;
2455 pyscannerYYlex_init_extra(&
p->state,&
p->yyscanner);
2463 pyscannerYYlex_destroy(
p->yyscanner);
2468 const char *fileBuf,
2469 const std::shared_ptr<Entry> &root,
2472 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
2473 yyextra->thisParser =
this;
2493#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)
Minimal replacement for QFileInfo.
std::string dirPath(bool absPath=true) const
std::string baseName() const
Helper class to process markdown formatted text.
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
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
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
#define Config_getInt(name)
#define Config_getBool(name)
static void startCommentBlock(yyscan_t yyscanner, bool)
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)