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)
162#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 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 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.
179HEXNUMBER "0"[xX][0-9a-fA-F]+[lL]?
180OCTNUMBER "0"[0-7]+[lL]?
181NUMBER {DIGIT}+[lLjJ]?
182INTNUMBER {HEXNUMBER}|{OCTNUMBER}|{NUMBER}
183FLOATNUMBER {DIGIT}+"."{DIGIT}+([eE][+\-]?{DIGIT}+)?[jJ]?
185LETTER [A-Za-z\x80-\xFF]
186NONEMPTY [A-Za-z0-9_\x80-\xFF]
187EXPCHAR [#(){}\[\],:.%/\\=`*~|&<>!;+-]
188PARAMNONEMPTY [^ \t\n():]
189IDENTIFIER ({LETTER}|"_")({LETTER}|{DIGIT}|"_")*
190SCOPE {IDENTIFIER}("."{IDENTIFIER})*
192TRISINGLEQUOTE {STRINGPREFIX}?"'''"(!)?
193TRIDOUBLEQUOTE {STRINGPREFIX}?"\"\"\""(!)?
194ENDTRISINGLEQUOTE "'''"
195ENDTRIDOUBLEQUOTE "\"\"\""
196LONGSTRINGCHAR [^\\"']
198LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
199SMALLQUOTE ("\"\""|"\""|"'"|"''")
200LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
202STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR")
203POUNDCOMMENT "#"[^#\n][^\n]*
208LINENR {B}*[1-9][0-9]*
209FILEICHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=&#@~]
210FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=&#@~]
211FILECHARS {FILEICHAR}*{FILEECHAR}+
212HFILEMASK {FILEICHAR}*("."{FILEICHAR}+)+{FILECHARS}*
213VFILEMASK {FILECHARS}("."{FILECHARS})*
214FILEMASK {VFILEMASK}|{HFILEMASK}
217ID [a-z_A-Z%]+{IDSYM}*
240%x FunctionTypeAnnotation
241%x FunctionParamDefVal
260%x SingleQuoteStringIgnore
261%x DoubleQuoteStringIgnore
281 DBG_CTX((stderr,
"Found def at %d\n",yyextra->yyLineNr));
284 BEGIN( FunctionDec );
286 ^{B}"async"{BB}"def"{BB} {
287 DBG_CTX((stderr,
"Found async def at %d\n",yyextra->yyLineNr));
290 BEGIN( FunctionDec );
294 BEGIN( FunctionDec );
296 "async"{BB}"def"{BB} {
298 BEGIN( FunctionDec );
302 DBG_CTX((stderr,
"Found class at %d\n",yyextra->yyLineNr));
313 yyextra->packageCommentAllowed =
FALSE;
319 yyextra->packageCommentAllowed =
FALSE;
322 ^{B}{IDENTIFIER}/{B}"="{B}"property" {
323 yyextra->current->section = EntryType::makeVariable();
324 yyextra->current->mtype = MethodTypes::Property;
326 yyextra->current->fileName = yyextra->fileName;
327 yyextra->current->startLine = yyextra->yyLineNr;
328 yyextra->current->bodyLine = yyextra->yyLineNr;
329 yyextra->packageCommentAllowed =
FALSE;
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
332 ^{B}{IDENTIFIER}/{B}"="[^=] {
333 if (yyextra->searchCount>0) REJECT;
335 yyextra->current->section = EntryType::makeVariable();
337 yyextra->current->fileName = yyextra->fileName;
338 yyextra->current->startLine = yyextra->yyLineNr;
339 yyextra->current->bodyLine = yyextra->yyLineNr;
340 yyextra->packageCommentAllowed =
FALSE;
343 ^{B}{IDENTIFIER}/{B}":" {
344 if (yyextra->searchCount>0) REJECT;
346 if (
id ==
"try" ||
id ==
"else" ||
id ==
"except" ||
id ==
"finally") REJECT;
348 yyextra->current->section = EntryType::makeVariable();
349 yyextra->current->name = id;
350 yyextra->current->fileName = yyextra->fileName;
351 yyextra->current->startLine = yyextra->yyLineNr;
352 yyextra->current->bodyLine = yyextra->yyLineNr;
353 yyextra->packageCommentAllowed =
FALSE;
356 {B}{IDENTIFIER}/({B},{B}{IDENTIFIER})*{B}")"*{B}"="[^=] {
360 if (yyextra->searchCount>1) REJECT;
362 yyextra->current->section = EntryType::makeVariable();
364 yyextra->current->fileName = yyextra->fileName;
365 yyextra->current->startLine = yyextra->yyLineNr;
366 yyextra->current->bodyLine = yyextra->yyLineNr;
367 yyextra->packageCommentAllowed =
FALSE;
static void addVariable(yyscan_t yyscanner, QCString type, QCString name)
371 yyextra->stringContext=YY_START;
372 yyextra->copyString=
nullptr;
373 yyextra->packageCommentAllowed =
FALSE;
374 BEGIN( SingleQuoteString );
377 yyextra->stringContext=YY_START;
378 yyextra->copyString=
nullptr;
379 yyextra->packageCommentAllowed =
FALSE;
380 BEGIN( DoubleQuoteString );
383 yyextra->isStatic=
TRUE;
387 yyextra->decoratorRound = 1;
388 yyextra->copyString=
nullptr;
395 if (yyextra->yyLineNr != 1) REJECT;
402 yyextra->packageCommentAllowed =
FALSE;
414 BEGIN(TripleComment);
419 BEGIN(TripleComment);
422 {B}{STARTDOCSYMS}/[^#] {
424 yyextra->packageCommentAllowed =
FALSE;
426 BEGIN(SpecialComment);
429 yyextra->searchCount++;
432 if (yyextra->searchCount>0)
434 yyextra->searchCount--;
438 yyextra->current->doc.clear();
439 yyextra->current->brief.clear();
453 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
454 yyextra->packageName=yytext;
476 {IDENTIFIER}/{B}","{B} {
479 {IDENTIFIER}/{B}")" {
484 if (!yyextra->importTuple)
491 if (!yyextra->importTuple)
499 yyextra->importTuple=
TRUE;
502 yyextra->importTuple=
FALSE;
517 {IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
519 yyextra->current->fileName = yyextra->fileName;
521 yyextra->current->section=EntryType::makeUsingDecl();
522 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)
539 ("cls"|"self")"."{IDENTIFIER}/{B}[,)] {
540 const char *s = strchr(yytext,
'.'); s++;
541 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)
545 ("cls"|"self")"."{IDENTIFIER}/{B}"=" {
546 const char *s = strchr(yytext,
'.'); s++;
547 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
549 BEGIN( SearchSkipValue );
551 ("cls"|"self")"."{IDENTIFIER}/{B}":" {
552 const char *s = strchr(yytext,
'.'); s++;
553 DBG_CTX((stderr,
"Found instance method variable %s in %s at %d\n",s,
qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
559 BEGIN(TripleComment);
564 BEGIN(TripleComment);
567 {STARTDOCSYMS}/[^#] {
569 BEGIN(SpecialComment);
574 yyextra->stringContext=YY_START;
575 yyextra->copyString=
nullptr;
576 BEGIN( SingleQuoteString );
579 yyextra->stringContext=YY_START;
580 yyextra->copyString=
nullptr;
581 BEGIN( DoubleQuoteString );
585 yyextra->current->doc.clear();
586 yyextra->current->brief.clear();
588 BEGIN( SearchSkipValue );
597 yyextra->braceCount=0;
600 yyextra->current->type+=*yytext;
601 yyextra->braceCount++;
604 yyextra->current->type+=*yytext;
605 yyextra->braceCount--;
608 yyextra->stringContext=YY_START;
609 yyextra->copyString=
nullptr;
610 BEGIN( SingleQuoteString );
613 yyextra->stringContext=YY_START;
614 yyextra->copyString=
nullptr;
615 BEGIN( DoubleQuoteString );
618 if (yyextra->braceCount==0)
620 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
622 BEGIN(SearchSkipValue);
626 yyextra->current->type+=*yytext;
630 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
633 BEGIN(SearchMemVars);
636 yyextra->current->type+=
' ';
640 yyextra->current->type+=*yytext;
644<SearchSkipValue,VariableDec>{
647 yyextra->startInit =
TRUE;
648 yyextra->current->initializer.str(yytext);
649 yyextra->current->initializer <<
" ";
652 yyextra->current->initializer << yytext;
656 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"int";
657 yyextra->current->initializer << yytext;
660 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"float";
661 yyextra->current->initializer << yytext;
664 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"bool";
665 yyextra->current->initializer << yytext;
668 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
669 yyextra->current->initializer << yytext;
670 yyextra->copyString=&yyextra->current->initializer;
671 yyextra->stringContext=YY_START;
672 BEGIN( SingleQuoteString );
674 {STRINGPREFIX}?"\"" {
675 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
676 yyextra->current->initializer << yytext;
677 yyextra->copyString=&yyextra->current->initializer;
678 yyextra->stringContext=YY_START;
679 BEGIN( DoubleQuoteString );
682 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
683 yyextra->current->initializer << yytext;
684 yyextra->doubleQuote=
TRUE;
685 yyextra->copyString=&yyextra->current->initializer;
686 yyextra->stringContext=YY_START;
691 if (yyextra->current->type.isEmpty()) yyextra->current->type =
"str";
692 yyextra->current->initializer << yytext;
693 yyextra->doubleQuote=
FALSE;
694 yyextra->copyString=&yyextra->current->initializer;
695 yyextra->stringContext=YY_START;
699 if (yyextra->current->mtype!=MethodTypes::Property && yyextra->startInit)
701 yyextra->current->type =
"tuple";
703 yyextra->current->initializer << *yytext;
704 yyextra->atomStart=
'(';
705 yyextra->atomEnd=
')';
706 yyextra->atomCount=1;
707 yyextra->atomContext=YY_START;
708 BEGIN( VariableAtom );
711 if (yyextra->startInit) yyextra->current->type =
"list";
712 yyextra->current->initializer << *yytext;
713 yyextra->atomStart=
'[';
714 yyextra->atomEnd=
']';
715 yyextra->atomCount=1;
716 yyextra->atomContext=YY_START;
717 BEGIN( VariableAtom );
720 if (yyextra->startInit) yyextra->current->type =
"dict";
721 yyextra->current->initializer << *yytext;
722 yyextra->atomStart=
'{';
723 yyextra->atomEnd=
'}';
724 yyextra->atomCount=1;
725 yyextra->atomContext=YY_START;
726 BEGIN( VariableAtom );
729 yyextra->current->initializer << yytext;
734 if (yyextra->current->type.isEmpty())
736 for (
const auto &child : yyextra->current_root->children())
738 if (child->name == yytext)
740 yyextra->current->type = child->type;
745 yyextra->startInit =
FALSE;
746 yyextra->current->initializer << yytext;
749 yyextra->startInit =
FALSE;
750 yyextra->current->initializer << *yytext;
754 {STARTDOCSYMS}/[^#] {
756 BEGIN(SpecialComment);
762 BEGIN(SearchMemVars);
766 BEGIN(SearchMemVars);
771 \n{B}/{IDENTIFIER}[^{LETTER}{DIGIT}_] {
783 yyextra->current->program << yytext;
797 yyextra->current->program << yytext;
805 yyextra->current->program << yytext;
809 if (yyextra->curIndent<=yyextra->indent)
817 yyextra->current->program << yytext;
821 yyextra->current->program << yytext;
822 yyextra->stringContext=YY_START;
823 yyextra->specialBlock =
FALSE;
824 yyextra->copyString=&yyextra->current->program;
825 BEGIN( SingleQuoteString );
828 yyextra->current->program << yytext;
829 yyextra->stringContext=YY_START;
830 yyextra->specialBlock =
FALSE;
831 yyextra->copyString=&yyextra->current->program;
832 BEGIN( DoubleQuoteString );
835 yyextra->current->program << yytext;
836 yyextra->specialBlock =
FALSE;
839 yyextra->current->program << yytext;
842 yyextra->current->program << yytext;
846 yyextra->current->program << yytext;
849 yyextra->current->program << *yytext;
850 yyextra->specialBlock =
FALSE;
854 yyextra->current->program << yytext;
856 BEGIN(TripleComment);
860 yyextra->current->program << yytext;
862 BEGIN(TripleComment);
870 yyextra->current->name = yytext;
871 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
875 yyextra->specialBlock =
TRUE;
876 yyextra->bodyEntry = yyextra->current;
877 yyextra->current->bodyLine = yyextra->yyLineNr;
882 yyextra->defVal.str(std::string());
883 yyextra->braceCount = 0;
884 BEGIN(FunctionTypeAnnotation);
887 yyextra->funcParamsEnd =
FALSE;
888 yyextra->current->bodyLine = yyextra->yyLineNr;
889 BEGIN(FunctionParams);
892 if (yyextra->current->argList.empty())
894 yyextra->current->argList.setNoParameters(
TRUE);
897 yyextra->funcParamsEnd =
TRUE;
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
906 if (!yyextra->argType.isEmpty())
910 a.
type = yyextra->argType;
911 yyextra->current->argList.push_back(a);
912 yyextra->argType =
"";
This class contains the information about the argument of a function or template.
917 yyextra->argType = yytext;
923 a.
type = yyextra->argType;
924 yyextra->current->argList.push_back(a);
925 yyextra->argType =
"";
930 yyextra->defVal.str(std::string());
931 yyextra->braceCount = 0;
932 BEGIN(FunctionParamDefVal);
935 if (!yyextra->argType.isEmpty())
939 a.
type = yyextra->argType;
940 yyextra->current->argList.push_back(a);
941 yyextra->argType =
"";
947 yyextra->defVal.str(std::string());
948 yyextra->braceCount = 0;
949 BEGIN(FunctionAnnotation);
958<FunctionTypeAnnotation>{
962 ++yyextra->braceCount;
963 yyextra->defVal << *yytext;
968 --yyextra->braceCount;
969 yyextra->defVal << *yytext;
972 if (yyextra->braceCount == 0)
974 yyextra->current->type = yyextra->defVal.str();
979 yyextra->defVal << *yytext;
982 yyextra->defVal << *yytext;
983 yyextra->copyString=&yyextra->defVal;
984 yyextra->stringContext=FunctionTypeAnnotation;
985 BEGIN(SingleQuoteString);
988 yyextra->defVal << *yytext;
989 yyextra->copyString=&yyextra->defVal;
990 yyextra->stringContext=FunctionTypeAnnotation;
991 BEGIN(DoubleQuoteString);
994 yyextra->defVal << *yytext;
998 yyextra->defVal << *yytext;
1002<FunctionAnnotation>{
1006 ++yyextra->braceCount;
1007 yyextra->defVal << *yytext;
1011 --yyextra->braceCount;
1012 yyextra->defVal << *yytext;
1017 if (yyextra->braceCount == 0)
1019 if (!yyextra->current->argList.empty())
1020 yyextra->current->argList.back().type += yyextra->defVal.str();
1023 BEGIN(FunctionParams);
1028 --yyextra->braceCount;
1029 yyextra->defVal << *yytext;
1033 yyextra->defVal << *yytext;
1034 yyextra->copyString=&yyextra->defVal;
1035 yyextra->stringContext=FunctionAnnotation;
1036 BEGIN(SingleQuoteString);
1039 yyextra->defVal << *yytext;
1040 yyextra->copyString=&yyextra->defVal;
1041 yyextra->stringContext=FunctionAnnotation;
1042 BEGIN(DoubleQuoteString);
1045 yyextra->defVal << *yytext;
1049 yyextra->defVal << *yytext;
1053<FunctionParamDefVal>{
1057 ++yyextra->braceCount;
1058 yyextra->defVal << *yytext;
1062 --yyextra->braceCount;
1063 yyextra->defVal << *yytext;
1067 if (yyextra->braceCount == 0)
1069 if (!yyextra->current->argList.empty())
1073 BEGIN(FunctionParams);
1078 --yyextra->braceCount;
1079 yyextra->defVal << *yytext;
1084 yyextra->defVal << *yytext;
1085 yyextra->copyString=&yyextra->defVal;
1086 yyextra->stringContext=FunctionParamDefVal;
1087 BEGIN( SingleQuoteString );
1090 yyextra->defVal << *yytext;
1091 yyextra->copyString=&yyextra->defVal;
1092 yyextra->stringContext=FunctionParamDefVal;
1093 BEGIN( DoubleQuoteString );
1096 yyextra->defVal << *yytext;
1100 yyextra->defVal << *yytext;
1106 \n/{IDENTIFIER}{BB} {
1110 for (i=(
int)yyleng-1;i>=0;i--)
1121 yyextra->current->program << yytext;
1128 for (i=(
int)yyleng-1;i>=0;i--)
1139 yyextra->current->program << yytext;
1143 yyextra->current->program << yytext;
1151 DBG_CTX((stderr,
"yyextra->curIndent=%d yyextra->indent=%d\n",yyextra->curIndent,yyextra->indent));
1152 if (yyextra->curIndent<=yyextra->indent)
1156 yyextra->indent=yyextra->curIndent;
1164 yyextra->current->program << yytext;
1168 yyextra->current->program << *yytext;
1169 yyextra->stringContext=YY_START;
1170 yyextra->specialBlock =
FALSE;
1171 yyextra->copyString=&yyextra->current->program;
1172 BEGIN( SingleQuoteString );
1175 yyextra->current->program << *yytext;
1176 yyextra->stringContext=YY_START;
1177 yyextra->specialBlock =
FALSE;
1178 yyextra->copyString=&yyextra->current->program;
1179 BEGIN( DoubleQuoteString );
1182 yyextra->current->program << yytext;
1183 yyextra->specialBlock =
FALSE;
1187 yyextra->current->program << *yytext;
1191 yyextra->current->program << yytext;
1194 yyextra->specialBlock =
FALSE;
1195 yyextra->current->program << *yytext;
1199 yyextra->current->program << yytext;
1201 BEGIN(TripleComment);
1206 yyextra->current->program << yytext;
1208 BEGIN(TripleComment);
1212<ClassDec>{IDENTIFIER} {
1213 if (yyextra->current->type.isEmpty())
1215 yyextra->current->type =
"class";
1218 yyextra->current->section = EntryType::makeClass();
1219 yyextra->current->name = yytext;
1224 if (yyextra->current_root->section.isScope())
1227 yyextra->current->name.prepend(yyextra->current_root->name+
"::");
1230 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
1231 yyextra->current->fileName = yyextra->fileName;
1232 yyextra->docBlockContext = YY_START;
1233 yyextra->docBlockInBody =
FALSE;
1234 yyextra->docBlockJavaStyle =
FALSE;
1235 yyextra->docBlock.clear();
1236 yyextra->bracketDepth = 0;
1238 BEGIN(ClassInheritance);
1245 yyextra->bracketDepth++;
1248 if (yyextra->bracketDepth > 0)
1249 yyextra->bracketDepth--;
1252 yyextra->specialBlock =
TRUE;
1253 yyextra->current->bodyLine = yyextra->yyLineNr;
1254 yyextra->current->program.str(std::string());
1255 BEGIN(ClassCaptureIndent);
1259 if (yyextra->bracketDepth == 0)
1261 yyextra->current->extends.emplace_back(
1262 substitute(yytext,
".",
"::"),Protection::Public,Specifier::Normal
1268 yyextra->stringContext=YY_START;
1269 BEGIN( SingleQuoteStringIgnore );
1272 yyextra->stringContext=YY_START;
1273 BEGIN( DoubleQuoteStringIgnore );
1277<SingleQuoteStringIgnore>{
1279 BEGIN(yyextra->stringContext);
1283<DoubleQuoteStringIgnore>{
1285 BEGIN(yyextra->stringContext);
1290<ClassCaptureIndent>{
1294 yyextra->current->program << yytext;
1299 yyextra->current->program << yytext;
1300 BEGIN(TripleComment);
1304 yyextra->current->program << yytext;
1305 BEGIN(TripleComment);
1307 {STARTDOCSYMS}[#]* {
1309 BEGIN(SpecialComment);
1314 yyextra->current->program << yytext;
1317 yyextra->bodyEntry = yyextra->current;
1318 DBG_CTX((stderr,
"setting indent %d\n",yyextra->curIndent));
1324 ""/({NONEMPTY}|{EXPCHAR}) {
1328 yyextra->current->program << yytext;
1337 ":"{B}{IDENTIFIER} {
1338 yyextra->startInit =
FALSE;
1339 yyextra->current->type =
substitute(yytext,
":",
"");
1341 {STARTDOCSYMS}"<"/.* {
1343 yyextra->packageCommentAllowed =
FALSE;
1345 yyextra->docBlockContext = VariableEnd;
1346 BEGIN(SpecialComment);
1349 BEGIN( VariableEnd );
1353 BEGIN( VariableEnd );
1359 yyextra->current->initializer << *yytext;
1360 if (yyextra->atomStart==*yytext)
1362 yyextra->atomCount++;
1366 yyextra->current->initializer << *yytext;
1367 if (yyextra->atomEnd==*yytext)
1369 yyextra->atomCount--;
1371 if (yyextra->atomCount==0)
1373 yyextra->startInit =
FALSE;
1374 BEGIN(yyextra->atomContext);
1378 yyextra->specialBlock =
FALSE;
1379 yyextra->current->program << yytext;
1381 BEGIN(TripleComment);
1385 yyextra->specialBlock =
FALSE;
1386 yyextra->current->program << yytext;
1388 BEGIN(TripleComment);
1391 yyextra->stringContext=YY_START;
1392 yyextra->current->initializer <<
"'";
1393 yyextra->copyString=&yyextra->current->initializer;
1394 BEGIN( SingleQuoteString );
1397 yyextra->stringContext=YY_START;
1398 yyextra->current->initializer <<
"\"";
1399 yyextra->copyString=&yyextra->current->initializer;
1400 BEGIN( DoubleQuoteString );
1403 yyextra->current->initializer << yytext;
1406 yyextra->current->initializer << *yytext;
1409 yyextra->current->initializer << *yytext;
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...
1434 {ENDTRIDOUBLEQUOTE} |
1435 {ENDTRISINGLEQUOTE} {
1437 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1439 if (yyextra->specialBlock)
1441 QCString actualDoc=yyextra->docBlock;
1442 if (!yyextra->docBlockSpecial)
1447 actualDoc.
prepend(
"@iverbatim\n");
1448 actualDoc.
append(
"@endiverbatim ");
1454 else if (yyextra->packageCommentAllowed)
1456 QCString actualDoc=yyextra->docBlock;
1457 if (!yyextra->docBlockSpecial)
1462 actualDoc.
prepend(
"@iverbatim\n");
1463 actualDoc.
append(
"@endiverbatim ");
1466 if (yyextra->moduleScope.startsWith(
"__") && yyextra->moduleScope.endsWith(
"__"))
1468 actualDoc.
prepend(
"\\namespace \\"+yyextra->moduleScope+
" ");
1472 actualDoc.
prepend(
"\\namespace "+yyextra->moduleScope+
" ");
1476 if ((yyextra->docBlockContext==ClassBody ) ||
1477 yyextra->docBlockContext==FunctionBody)
1479 yyextra->current->program << yyextra->docBlock;
1480 yyextra->current->program << yytext;
1487 BEGIN(yyextra->docBlockContext);
1491 yyextra->docBlock += yytext;
1493 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)
1498 if (yyextra->firstPass && yyextra->docBlockSpecial && yyleng >= yyextra->curIndent)
1499 yyextra->docBlock += yytext + yyextra->curIndent;
1501 yyextra->docBlock += yytext;
1504 yyextra->docBlock += yytext;
1508 yyextra->docBlock += yytext;
1510 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1511 yyextra->fileName = &yytext[6];
1512 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1513 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1514 yyextra->docBlock+=yytext;
1516 {CMD}"ifile"{B}+{FILEMASK} {
1517 yyextra->fileName = &yytext[6];
1518 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1519 yyextra->docBlock+=yytext;
1521 {CMD}"iline"{LINENR}/[\n\.] |
1522 {CMD}"iline"{LINENR}{B} {
1527 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1531 yyextra->yyLineNr = nr;
1533 yyextra->docBlock+=yytext;
int toInt(bool *ok=nullptr, int base=10) const
#define warn(file, line, fmt,...)
1535 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1536 yyextra->docBlock+=yytext;
1539 yyextra->docBlock += yytext;
1542 yyextra->docBlock += yytext;
1550 yyextra->docBlock+=
'\n';
1551 yyextra->docBrief =
FALSE;
1554 {CMD}"ifile"{B}+"\""[^\n\"]+"\"" {
1555 yyextra->fileName = &yytext[6];
1556 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1557 yyextra->fileName = yyextra->fileName.mid(1,yyextra->fileName.length()-2);
1558 yyextra->docBlock+=yytext;
1560 {CMD}"ifile"{B}+{FILEMASK} {
1561 yyextra->fileName = &yytext[6];
1562 yyextra->fileName = yyextra->fileName.stripWhiteSpace();
1563 yyextra->docBlock+=yytext;
1565 {CMD}"iline"{LINENR}/[\n\.] |
1566 {CMD}"iline"{LINENR}{B} {
1571 warn(yyextra->fileName,yyextra->yyLineNr,
"Invalid line number '{}' for iline command",yytext);
1575 yyextra->yyLineNr = nr;
1577 yyextra->docBlock+=yytext;
1579 ({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
1580 yyextra->docBlock+=yytext;
1584 int extraSpaces = std::max(0,
static_cast<int>(yyleng-9-yyextra->curIndent-2));
1585 indent.
fill(
' ',extraSpaces);
1587 yyextra->docBlock +=
"\\ilinebr ";
1588 yyextra->docBlock += indent;
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
1591 yyextra->docBlock+=yytext;
1595 if (yyextra->docBlockContext == VariableEnd)
1603 BEGIN(yyextra->docBlockContext);
1606 yyextra->docBlock+=*yytext;
1623 BEGIN(yyextra->stringContext);
1646 BEGIN(yyextra->stringContext);
1657 {ENDTRIDOUBLEQUOTE} |
1658 {ENDTRISINGLEQUOTE} {
1659 *yyextra->copyString << yytext;
1660 if (yyextra->doubleQuote==(yytext[0]==
'"'))
1662 BEGIN(yyextra->stringContext);
1667 ({LONGSTRINGBLOCK}) {
1669 *yyextra->copyString << yytext;
1673 *yyextra->copyString << yytext;
1676 *yyextra->copyString << *yytext;
1682 yyextra->doubleQuote=
TRUE;
1683 yyextra->decoratorCommentStr.str(std::string());
1684 yyextra->copyString=&yyextra->decoratorCommentStr;
1685 yyextra->stringContext=YY_START;
1686 BEGIN(TripleString);
1690 yyextra->doubleQuote=
FALSE;
1691 yyextra->decoratorCommentStr.str(std::string());
1692 yyextra->copyString=&yyextra->decoratorCommentStr;
1693 yyextra->stringContext=YY_START;
1694 BEGIN(TripleString);
1697 yyextra->stringContext=YY_START;
1698 yyextra->decoratorCommentStr.str(std::string());
1699 yyextra->copyString=&yyextra->decoratorCommentStr;
1700 BEGIN( SingleQuoteString );
1703 yyextra->stringContext=YY_START;
1704 yyextra->decoratorCommentStr.str(std::string());
1705 yyextra->copyString=&yyextra->decoratorCommentStr;
1706 BEGIN( DoubleQuoteString );
1709 yyextra->decoratorRound++;
1712 yyextra->decoratorRound--;
1713 if (!yyextra->decoratorRound) BEGIN(
Search );
1755 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1757 const char *p = yyextra->inputString + yyextra->inputPosition;
1758 while ( c < max_size && *p ) { *buf++ = *p++; c++; }
1759 yyextra->inputPosition+=c;
1765 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1766 yyextra->protection = Protection::Public;
1767 yyextra->mtype = MethodTypes::Method;
1768 yyextra->isStatic =
FALSE;
1769 yyextra->virt = Specifier::Normal;
1770 yyextra->previous = 0;
1771 yyextra->packageCommentAllowed =
TRUE;
1776 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1778 yyextra->current->protection = yyextra->protection ;
1779 yyextra->current->mtype = yyextra->mtype;
1780 yyextra->current->virt = yyextra->virt;
1781 yyextra->current->isStatic = yyextra->isStatic;
1782 yyextra->current->lang = SrcLangExt::Python;
1783 yyextra->current->type.clear();
1784 yyextra->current->name.clear();
1785 yyextra->current->initializer.clear();
1786 yyextra->commentScanner.initGroupInfo(yyextra->current.get());
1787 yyextra->isStatic =
FALSE;
1792 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1793 if (yyextra->current->name.isEmpty())
1799 if (yyextra->checkDupEntry)
1801 for (
auto &v : yyextra->current_root->children())
1804 if (v->name==yyextra->current->name && v->section==yyextra->current->section)
1806 if (v->doc.isEmpty() && !yyextra->current->doc.isEmpty())
1808 v->doc = yyextra->current->doc;
1809 v->docLine = yyextra->current->docLine;
1810 v->docFile = yyextra->current->docFile;
1812 if (v->brief.isEmpty() && !yyextra->current->brief.isEmpty())
1814 v->brief = yyextra->current->brief;
1815 v->briefLine = yyextra->current->briefLine;
1816 v->briefFile = yyextra->current->briefFile;
1818 if (v->type.isEmpty() && !yyextra->current->type.isEmpty())
1821 v->type = yyextra->current->type;
1830 yyextra->previous = yyextra->current;
1831 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1838 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1840 auto doc = yyextra->current->doc;
1841 auto docLine = yyextra->current->docLine;
1842 auto docFile = yyextra->current->docFile;
1843 auto brief = yyextra->current->brief;
1844 auto briefLine = yyextra->current->briefLine;
1845 auto briefFile = yyextra->current->briefFile;
1847 yyextra->previous = yyextra->current;
1848 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1851 yyextra->current->doc = doc;
1852 yyextra->current->docLine = docLine;
1853 yyextra->current->docFile = docFile;
1854 yyextra->current->brief = brief;
1855 yyextra->current->briefLine = briefLine;
1856 yyextra->current->briefFile = briefFile;
1861 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1862 if (!yyextra->current->name.isEmpty() && yyextra->current->name.at(0)==
'_')
1864 if (yyextra->current->name.at(1)==
'_')
1866 yyextra->current->protection=Protection::Private;
1870 yyextra->current->protection=Protection::Protected;
1877 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1878 yyextra->current->name = name;
1879 yyextra->current->section=EntryType::makeVariable();
1880 yyextra->current->fileName = yyextra->fileName;
1881 yyextra->current->startLine = yyextra->yyLineNr;
1882 yyextra->current->bodyLine = yyextra->yyLineNr;
1883 yyextra->current->type.clear();
1885 yyextra->checkDupEntry =
true;
1890 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1892 if (yyextra->current_root->section.isCompound())
1894 yyextra->current->isStatic =
TRUE;
1901 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1903 if (yyextra->current_root->section.isCompound())
1905 yyextra->current->isStatic =
TRUE;
1912 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1913 if (yyextra->current->name.startsWith(
"__") && yyextra->current->name.endsWith(
"__"))
1917 yyextra->current->protection=Protection::Public;
1934 else if (c==
'\t') col+=tabSize-(col%tabSize);
1942 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1943 auto it = yyextra->packageNameCache.
find(path.
str());
1944 if (it!=yyextra->packageNameCache.end())
1959 scope+=path.
mid(i+1);
1960 yyextra->packageNameCache.emplace(path.
str(),scope.
str());
1969 if (fileName.
isEmpty())
return fileName;
1976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1977 QCString item=all ? yyextra->packageName : yyextra->packageName+
"."+yytext;
1979 yyextra->current->fileName = yyextra->fileName;
1981 yyextra->current->section=all ? EntryType::makeUsingDir() : EntryType::makeUsingDecl();
1982 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
1989 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1990 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
1991 for (
const char *p = yytext; *p; ++p)
1993 yyextra->yyLineNr += (*p ==
'\n') ;
1999 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2000 DBG_CTX((stderr,
"yyextra->yyLineNr=%d\n",yyextra->yyLineNr));
2001 yyextra->yyLineNr++;
2007 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2010 yyextra->current->briefFile = yyextra->fileName;
2011 yyextra->current->briefLine = yyextra->yyLineNr;
2015 yyextra->current->docFile = yyextra->fileName;
2016 yyextra->current->docLine = yyextra->yyLineNr;
2022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2027 yyextra->docBlockInBody=
FALSE;
2029 if (!yyextra->current->doc.isEmpty())
2031 yyextra->current->doc=yyextra->current->doc.stripWhiteSpace()+
"\n\n";
2033 if (yyextra->docBlockInBody && yyextra->previous && !yyextra->previous->doc.isEmpty())
2035 yyextra->previous->doc=yyextra->previous->doc.stripWhiteSpace()+
"\n\n";
2039 bool needsEntry =
false;
2040 int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
2041 Markdown markdown(yyextra->fileName,lineNr);
2046 while (yyextra->commentScanner.parseCommentBlock(
2047 yyextra->thisParser,
2048 (yyextra->docBlockInBody && yyextra->previous) ? yyextra->previous.get() : yyextra->current.get(),
2052 yyextra->docBlockInBody ?
FALSE : brief,
2053 yyextra->docBlockJavaStyle,
2054 yyextra->docBlockInBody,
2055 yyextra->protection,
2077 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2079 if (yyextra->bodyEntry)
2081 yyextra->bodyEntry->endBodyLine = yyextra->yyLineNr-correction;
2082 yyextra->bodyEntry = 0;
2090 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2091 if (yyextra->copyString) (*yyextra->copyString) << s;
2096 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2097 yyextra->docBlockContext = YY_START;
2098 yyextra->docBlockInBody =
FALSE;
2099 yyextra->docBlockJavaStyle =
TRUE;
2100 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2101 yyextra->docBlock.clear();
2102 yyextra->commentIndent = yyextra->curIndent;
2103 yyextra->doubleQuote =
TRUE;
2109 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2110 yyextra->docBlockContext = YY_START;
2111 yyextra->docBlockInBody =
FALSE;
2112 yyextra->docBlockJavaStyle =
TRUE;
2113 yyextra->docBlockSpecial = yytext[strlen(yytext) - 1]==
'!' || !
Config_getBool(PYTHON_DOCSTRING);
2114 yyextra->docBlock.clear();
2115 yyextra->commentIndent = yyextra->curIndent;
2116 yyextra->doubleQuote =
FALSE;
2122 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2123 yyextra->docBlockContext = YY_START;
2124 yyextra->docBlockInBody =
FALSE;
2125 yyextra->docBlockJavaStyle =
TRUE;
2126 yyextra->docBrief =
TRUE;
2127 yyextra->docBlock.clear();
2128 yyextra->commentIndent = yyextra->curIndent;
2134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2135 yyextra->current->fileName = yyextra->fileName;
2136 yyextra->current->startLine = yyextra->yyLineNr;
2137 yyextra->current->bodyLine = yyextra->yyLineNr;
2138 yyextra->current->section = EntryType::makeFunction();
2139 yyextra->current->lang = SrcLangExt::Python;
2140 yyextra->current->virt = Specifier::Normal;
2141 yyextra->current->isStatic = yyextra->isStatic;
2142 yyextra->current->mtype = yyextra->mtype = MethodTypes::Method;
2143 yyextra->current->type.clear();
2144 yyextra->current->name.clear();
2145 yyextra->current->args.clear();
2146 yyextra->current->argList.clear();
2147 yyextra->packageCommentAllowed =
FALSE;
2148 yyextra->isStatic=
FALSE;
2154 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2155 yyextra->current->section = EntryType::makeClass();
2156 yyextra->current->argList.clear();
2157 yyextra->current->type +=
"class" ;
2158 yyextra->current->fileName = yyextra->fileName;
2159 yyextra->current->startLine = yyextra->yyLineNr;
2160 yyextra->current->bodyLine = yyextra->yyLineNr;
2161 yyextra->packageCommentAllowed =
FALSE;
2168 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2170 for (
size_t i=0; i<rt->children().size(); ++i)
2172 std::shared_ptr<Entry> ce = rt->children()[i];
2173 if (!ce->program.empty())
2178 yyextra->programStr = ce->program.str();
2179 yyextra->inputString = yyextra->programStr.data();
2180 yyextra->inputPosition = 0;
2181 yyextra->firstPass =
false;
2182 pyscannerYYrestart(
nullptr, yyscanner );
2183 if (ce->section.isCompound())
2185 yyextra->specialBlock =
false;
2186 yyextra->current_root = ce;
2189 else if (ce->parent())
2191 yyextra->current_root = rt;
2194 BEGIN( SearchMemVars );
2196 yyextra->fileName = ce->fileName;
2197 yyextra->yyLineNr = ce->bodyLine ;
2198 yyextra->current = std::make_shared<Entry>();
2201 yyextra->checkDupEntry =
false;
2204 yyextra->commentScanner.enterCompound(yyextra->fileName,yyextra->yyLineNr,name);
2206 pyscannerYYlex(yyscanner) ;
2207 yyextra->lexInit=
TRUE;
2209 yyextra->programStr.clear();
2210 ce->program.str(std::string());
2212 yyextra->commentScanner.leaveCompound(yyextra->fileName,yyextra->yyLineNr,name);
2224 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2227 if (fileBuf==
nullptr || fileBuf[0]==
'\0')
return;
2229 yyextra->inputString = fileBuf;
2230 yyextra->inputPosition = 0;
2232 yyextra->protection = Protection::Public;
2233 yyextra->mtype = MethodTypes::Method;
2234 yyextra->isStatic =
false;
2235 yyextra->virt = Specifier::Normal;
2236 yyextra->current_root = rt;
2237 yyextra->specialBlock =
false;
2239 yyextra->yyLineNr = 1 ;
2240 yyextra->fileName = fileName;
2241 yyextra->checkDupEntry =
false;
2242 yyextra->firstPass =
true;
2244 msg(
"Parsing file {}...\n",yyextra->fileName);
2249 if (baseName!=
"__init__")
2251 if (!yyextra->moduleScope.isEmpty())
2253 yyextra->moduleScope+=
"::";
2255 yyextra->moduleScope+=baseName;
2259 QCString scope = yyextra->moduleScope;
2264 pos = scope.
find(
"::",startPos);
2266 if (pos==-1) pos=(int)scope.
length();
2267 yyextra->current = std::make_shared<Entry>();
2269 yyextra->current->name = scope.
left(pos);
2270 yyextra->current->section = EntryType::makeNamespace();
2271 yyextra->current->type =
"namespace";
2272 yyextra->current->fileName = yyextra->fileName;
2273 yyextra->current->startLine = yyextra->yyLineNr;
2274 yyextra->current->bodyLine = yyextra->yyLineNr;
2275 yyextra->current_root = yyextra->current;
2276 rt->moveToSubEntryAndRefresh(yyextra->current);
2277 }
while (pos<(
int)scope.
length());
2281 yyextra->commentScanner.enterFile(yyextra->fileName,yyextra->yyLineNr);
2283 yyextra->current->reset();
2285 pyscannerYYrestart(
nullptr,yyscanner);
2287 pyscannerYYlex(yyscanner);
2288 yyextra->lexInit=
TRUE;
2290 yyextra->commentScanner.leaveFile(yyextra->fileName,yyextra->yyLineNr);
2292 yyextra->programStr.clear();
2293 yyextra->current_root->program.str(std::string());
2302 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2306 warn(yyextra->fileName,yyextra->yyLineNr,
"Empty prototype found!");
2310 yyextra->specialBlock =
FALSE;
2311 yyextra->packageCommentAllowed =
FALSE;
2314 YY_BUFFER_STATE orgState = YY_CURRENT_BUFFER;
2315 yy_switch_to_buffer(yy_create_buffer(
nullptr,
YY_BUF_SIZE, yyscanner), yyscanner);
2316 const char *orgInputString = yyextra->inputString;
2317 int orgInputPosition = yyextra->inputPosition;
2320 yyextra->inputString = text.
data();
2321 yyextra->inputPosition = 0;
2322 pyscannerYYrestart(
nullptr, yyscanner );
2324 BEGIN( FunctionDec );
2326 pyscannerYYlex(yyscanner);
2327 yyextra->lexInit=
TRUE;
2329 yyextra->current->name = yyextra->current->name.stripWhiteSpace();
2330 if (yyextra->current->section.isMemberDoc() && yyextra->current->args.isEmpty())
2332 yyextra->current->section = EntryType::makeVariableDoc();
2337 yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
2338 yy_switch_to_buffer(orgState, yyscanner);
2340 yyextra->inputString = orgInputString;
2341 yyextra->inputPosition = orgInputPosition;
2356 pyscannerYYlex_init_extra(&
p->state,&
p->yyscanner);
2364 pyscannerYYlex_destroy(
p->yyscanner);
2369 const char *fileBuf,
2370 const std::shared_ptr<Entry> &root,
2373 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
2374 yyextra->thisParser =
this;
2394#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)