15%option never-interactive
18%option extra-type="struct preYY_state *"
22#define YY_TYPEDEF_YY_SCANNER_T
68#define YY_NO_UNISTD_H 1
132 for (
auto &[name,define] : fromMap)
150 if (dpf && includeStack.find(incFile)==includeStack.end())
152 includeStack.insert(incFile);
159 toMap.emplace(name,define);
173 void addInclude(
const std::string &fromFileName,
const std::string &toFileName)
179 it =
m_fileMap.emplace(fromFileName,std::make_unique<DefinesPerFile>(
this)).first;
181 auto &dpf = it->second;
182 dpf->addInclude(toFileName);
191 it =
m_fileMap.emplace(fileName,std::make_unique<DefinesPerFile>(
this)).first;
193 it->second->store(fromMap);
201 auto &dpf = it->second;
202 dpf->retrieve(toMap);
212 return it->second->stored();
222 return it!=
m_fileMap.end() ? it->second.get() :
nullptr;
225 std::unordered_map< std::string, std::unique_ptr<DefinesPerFile> >
m_fileMap;
344static yy_size_t
getFenceSize(
char *txt, yy_size_t leng);
349#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
constant expression parser used for the C preprocessor
A class representing a macro definition.
Local class used to hold the defines for a single file.
void addInclude(const std::string &fileName)
DefinesPerFile(DefineManager *parent)
Creates an empty container for defines.
void retrieveRec(DefineMap &toMap, StringUnorderedSet &includeStack)
void store(const DefineMap &fromMap)
StringUnorderedSet m_includedFiles
void retrieve(DefineMap &toMap)
Class that manages the defines available while preprocessing files.
bool alreadyProcessed(const std::string &fileName) const
void addInclude(const std::string &fromFileName, const std::string &toFileName)
void store(const std::string &fileName, const DefineMap &fromMap)
std::unordered_map< std::string, std::unique_ptr< DefinesPerFile > > m_fileMap
void retrieve(const std::string &fileName, DefineMap &toMap)
DefinesPerFile * find(const std::string &fileName) const
Helper function to return the DefinesPerFile object for a given file name.
A model of a file symbol.
Container class representing a vector of objects with keys.
This is an alternative implementation of QCString.
std::stack< bool > BoolStack
std::unordered_set< std::string > StringUnorderedSet
std::vector< std::string > StringVector
std::map< std::string, int > IntMap
std::vector< Define > DefineList
List of all macro definitions.
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Portable versions of functions that are platform dependent.
std::map< std::string, Define > DefineMap
A dictionary of managed Define objects.
static void startCondSection(yyscan_t yyscanner, const QCString §Id)
static void setCaseDone(yyscan_t yyscanner, bool value)
static void addMacroDefinition(yyscan_t yyscanner)
static void decrLevel(yyscan_t yyscanner)
static void addDefine(yyscan_t yyscanner)
static void determineBlockName(yyscan_t yyscanner)
static void incrLevel(yyscan_t yyscanner)
static QCString expandMacro(yyscan_t yyscanner, const QCString &name)
static void outputSpaces(yyscan_t yyscanner, char *s)
static void endCondSection(yyscan_t yyscanner)
static Define * isDefined(yyscan_t yyscanner, const QCString &name)
Returns a reference to a Define object given its name or 0 if the Define does not exist.
static void outputString(yyscan_t yyscanner, const QCString &s)
static void setFileName(yyscan_t yyscanner, const QCString &name)
static std::mutex g_globalDefineMutex
static void outputChar(yyscan_t yyscanner, char c)
static QCString extractTrailingComment(const QCString &s)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static char resolveTrigraph(char c)
static const char * stateToString(int state)
static DefineManager g_defineManager
static void readIncludeFile(yyscan_t yyscanner, const QCString &inc)
static yy_size_t getFenceSize(char *txt, yy_size_t leng)
static std::mutex g_updateGlobals
static bool otherCaseDone(yyscan_t yyscanner)
static void outputArray(yyscan_t yyscanner, const char *a, yy_size_t len)
static void extraSpacing(yyscan_t yyscanner)
static const char * getLexerFILE()
static QCString escapeAt(const QCString &text)
static bool computeExpression(yyscan_t yyscanner, const QCString &expr)
static void outputSpace(yyscan_t yyscanner, char c)
static std::mutex g_debugMutex
Some helper functions for std::string.
const std::string * oldFileBuf
PreIncludeInfo(const QCString &fn, FileDef *srcFd, FileDef *dstFd, const QCString &iName, bool loc, bool imp)
preYY_CondCtx(const QCString &file, int line, const QCString &id, bool b)
StringUnorderedSet expanded
LinkedMap< PreIncludeInfo > includeRelations
StringUnorderedSet pragmaSet
ConstExpressionParser constExpParser
std::unordered_map< std::string, Define * > expandedDict
std::deque< std::unique_ptr< FileState > > includeStack
std::stack< std::unique_ptr< preYY_CondCtx > > condStack
const std::string * inputBuf
DefineList macroDefinitions
A bunch of utility functions.
359IDSTART [a-z_A-Z\x80-\xFF]
360ID {IDSTART}[a-z_A-Z0-9\x80-\xFF]*
364RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
365RAWEND ")"[^ \t\(\)\\]{0,16}\"
366CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
369FORMULA_START {CMD}("f{"|"f$"|"f["|"f(")
370FORMULA_END {CMD}("f}"|"f$"|"f]"|"f)")
371VERBATIM_START {CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly"|"dot"|"msc"|"startuml"|"code"("{"[^}]*"}")?){BN}+
372VERBATIM_END {CMD}("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endmsc"|"enduml"|"endcode")
373VERBATIM_LINE {CMD}"noop"{B}+
374LITERAL_BLOCK {FORMULA_START}|{VERBATIM_START}
375LITERAL_BLOCK_END {FORMULA_END}|{VERBATIM_END}
380RulesSharp "<"[^>\n]*">"
381RulesCurly "{"[^{}\n]*"}"
386EscapeRulesCharOpen "\\["|"\<"|"\\{"|"\\("|"\\\""|"\\ "|"\\\\"
387EscapeRulesCharClose "\\]"|"\>"|"\\}"|"\\)"
388EscapeRulesChar {EscapeRulesCharOpen}|{EscapeRulesCharClose}
414%x CopyStringFtnDouble
431%x JavaDocVerbatimCode
465 yyextra->yyColNr+=(int)yyleng;
467 yyextra->potentialDefine=yytext;
470<Start>^("%top{"|"%{") {
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
475<Start>^{Bopt}"cpp_quote"{Bopt}"("{Bopt}\" {
476 if (yyextra->insideIDL)
491<IDLquote>"\""{Bopt}")" {
505<Start>^{B}*[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]+{B}*"("[^\)\n]*")"/{BN}{1,10}*[:{] {
507 for (i=(
int)yyleng-1;i>=0;i--)
513<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\(\)\n]*"("[^\)\n]*")"[^\)\n]*")"{B}*\n |
514<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\)\n]*")"{B}*\n |
515<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\(\)\n]*"("[^\)\n]*")"[^\)\n]*")"/{B}*("//"|"/\*") |
516<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\)\n]*")"/{B}*("//"|"/\*") {
519 int pos = name.find(
'(');
521 name=name.left(pos).stripWhiteSpace();
524 if (skipFuncMacros && !yyextra->insideFtn &&
525 name!=
"Q_PROPERTY" &&
527 (yyextra->includeStack.empty() || yyextra->curlyCount>0) &&
528 yyextra->macroExpansion &&
536 if (yytext[yyleng-1] ==
'\n')
545 for (i=(
int)yyleng-1;i>=0;i--)
#define Config_getBool(name)
552<CopyLine,LexCopyLine>"extern"{BN}*"\""[^\"]+"\""{BN}*("{")? {
554 yyextra->yyLineNr+=text.
contains(
'\n');
int contains(char c, bool cs=TRUE) const
557<CopyLine,LexCopyLine>{RAWBEGIN} {
558 yyextra->delimiter = yytext+2;
559 yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
561 BEGIN(CopyRawString);
563<CopyLine,LexCopyLine>"{" {
564 if (yyextra->includeStack.empty())
566 yyextra->curlyCount++;
573<CopyLine,LexCopyLine>"}" {
574 if (yyextra->includeStack.empty() && yyextra->curlyCount>0)
576 yyextra->curlyCount--;
580<CopyLine,LexCopyLine>"'"\\[0-7]{1,3}"'" {
583<CopyLine,LexCopyLine>"'"\\."'" {
586<CopyLine,LexCopyLine>"'"."'" {
589<CopyLine,LexCopyLine>[$]?@\" {
592 BEGIN( CopyStringCs );
594<CopyLine,LexCopyLine>\" {
602 BEGIN( CopyStringFtnDouble );
605<CopyLine,LexCopyLine>\' {
608 BEGIN( CopyStringFtn );
610<CopyString>[^\"\\\r\n]+ {
613<CopyStringCs>[^\"\r\n]+ {
622<CopyString,CopyStringCs>\" {
626<CopyStringFtnDouble>[^\"\\\r\n]+ {
629<CopyStringFtnDouble>\\. {
632<CopyStringFtnDouble>\" {
636<CopyStringFtn>[^\'\\\r\n]+ {
646<CopyRawString>{RAWEND} {
649 delimiter=delimiter.
left(delimiter.
length()-1);
650 if (delimiter==yyextra->delimiter)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString left(size_t len) const
655<CopyRawString>[^)]+ {
661<CopyLine,LexCopyLine>{ID}/{BN}{0,80}"(" {
662 yyextra->expectGuard =
FALSE;
672 if ((yyextra->includeStack.empty() || yyextra->curlyCount>0) &&
673 yyextra->macroExpansion &&
679 yyextra->roundCount=0;
680 yyextra->defArgsStr=yytext;
690 yyextra->findDefArgContext = CopyLine;
691 BEGIN(FindDefineArgs);
699<CopyLine>{RulesDelim} {
701 yyextra->lexRulesPart = !yyextra->lexRulesPart;
705<CopyLine>{RulesSharp} {
706 if (!yyextra->lexRulesPart) REJECT;
707 if (yyextra->curlyCount) REJECT;
711<RulesPattern>{EscapeRulesChar} {
714<RulesPattern>{RulesCurly} {
717<RulesPattern>{StartDouble} {
719 yyextra->lastContext = YY_START;
722<RulesDouble,RulesRoundDouble>"\\\\" {
725<RulesDouble,RulesRoundDouble>"\\\"" {
730 BEGIN( yyextra->lastContext ) ;
732<RulesRoundDouble>"\"" {
736<RulesDouble,RulesRoundDouble>. {
739<RulesPattern>{StartSquare} {
741 yyextra->lastContext = YY_START;
744<RulesSquare,RulesRoundSquare>{CHARCE} {
747<RulesSquare,RulesRoundSquare>"\\[" |
748<RulesSquare,RulesRoundSquare>"\\]" {
755<RulesRoundSquare>"]" {
759<RulesSquare,RulesRoundSquare>"\\\\" {
762<RulesSquare,RulesRoundSquare>. {
765<RulesPattern>{StartRoundQuest} {
767 yyextra->lastContext = YY_START;
768 BEGIN(RulesRoundQuest);
770<RulesRoundQuest>{nl} {
773<RulesRoundQuest>[^)] {
776<RulesRoundQuest>")" {
778 BEGIN(yyextra->lastContext);
780<RulesPattern>{StartRound} {
781 yyextra->roundCount++;
783 yyextra->lastContext = YY_START;
786<RulesRound>{RulesCurly} {
789<RulesRound>{StartSquare} {
791 BEGIN(RulesRoundSquare);
793<RulesRound>{StartDouble} {
795 BEGIN(RulesRoundDouble);
797<RulesRound>{EscapeRulesChar} {
801 yyextra->roundCount++;
805 yyextra->roundCount--;
807 if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
826<CopyLine,LexCopyLine>{ID} {
828 if ((yyextra->includeStack.empty() || yyextra->curlyCount>0) &&
829 yyextra->macroExpansion &&
845<CopyLine,LexCopyLine>"\\"\r?/\n {
848<CopyLine,LexCopyLine>\\. {
851<CopyLine,LexCopyLine>. {
854<CopyLine,LexCopyLine>\n {
861 yyextra->defArgsStr+=
'(';
862 yyextra->roundCount++;
865 yyextra->defArgsStr+=
')';
866 yyextra->roundCount--;
867 if (yyextra->roundCount==0)
871 if (yyextra->findDefArgContext==CopyLine)
874 BEGIN(yyextra->findDefArgContext);
879 yyextra->nospaces=
FALSE;
889<FindDefineArgs>{CHARLIT} {
890 yyextra->defArgsStr+=yytext;
892<FindDefineArgs>{CCS}[*]? {
893 yyextra->defArgsStr+=yytext;
894 BEGIN(ArgCopyCComment);
896<FindDefineArgs>{CPPC}[/!].*\n/{B}*{CPPC}[/!] {
897 yyextra->defArgsStr+=
QCString(
"/**")+&yytext[3];
898 BEGIN(ArgCopyCppComment);
900<FindDefineArgs>{CPPC}[/!].*\n {
901 yyextra->defArgsStr+=
QCString(
"/**")+&yytext[3]+
" */";
904 yyextra->defArgsStr+=*yytext;
909 yyextra->defArgsStr+=*yytext;
913 yyextra->defArgsStr+=
' ';
918 yyextra->defArgsStr+=
"@@";
921 yyextra->defArgsStr+=*yytext;
923<ArgCopyCComment>[^*\n]+ {
924 yyextra->defArgsStr+=yytext;
926<ArgCopyCComment>{CCE} {
927 yyextra->defArgsStr+=yytext;
928 BEGIN(FindDefineArgs);
931 yyextra->defArgsStr+=
' ';
936 yyextra->defArgsStr+=yytext;
938<ArgCopyCppComment>^{B}*
939<ArgCopyCppComment>{CPPC}[/!].*\n/{B}*{CPPC}[/!] {
940 const char *startContent = &yytext[3];
941 if (startContent[0]==
'<') startContent++;
942 yyextra->defArgsStr+=startContent;
944<ArgCopyCppComment>{CPPC}[/!].*\n {
945 const char *startContent = &yytext[3];
946 if (startContent[0]==
'<') startContent++;
947 yyextra->defArgsStr+=
QCString(startContent)+
" */";
948 BEGIN(FindDefineArgs);
950<ArgCopyCppComment>. {
952 yyextra->defArgsStr+=
" */";
953 BEGIN(FindDefineArgs);
956 yyextra->defArgsStr+=*yytext;
957 BEGIN(FindDefineArgs);
961 yyextra->defArgsStr+=*yytext;
962 BEGIN(FindDefineArgs);
965<ReadString>{CPPC}|{CCS} {
966 yyextra->defArgsStr+=yytext;
968<ReadString>\\/\r?\n {
971 yyextra->defArgsStr+=yytext;
974 yyextra->defArgsStr+=*yytext;
976<Command>("include"|"import"){B}+/{ID} {
977 yyextra->isImported = yytext[1]==
'm';
978 if (yyextra->macroExpansion)
981<Command>("include"|"import"){B}*[<"] {
982 yyextra->isImported = yytext[1]==
'm';
984 c[0]=yytext[yyleng-1];c[1]=
'\0';
988<Command>("cmake")?"define"{B}+ {
989 yyextra->potentialDefine +=
substitute(yytext,
"cmake",
" ");
991 yyextra->yyColNr+=(int)yyleng;
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
994<Command>"cmakedefine01"{B}+ {
995 yyextra->potentialDefine +=
substitute(yytext,
"cmakedefine01",
" define ");
997 yyextra->yyColNr+=(int)yyleng;
998 BEGIN(CmakeDefName01);
1000<Command>"ifdef"/{B}*"(" {
1002 yyextra->guardExpr.clear();
1003 BEGIN(DefinedExpr2);
1005<Command>"ifdef"/{B}+ {
1008 yyextra->guardExpr.clear();
1009 BEGIN(DefinedExpr1);
1011<Command>"ifndef"/{B}*"(" {
1013 yyextra->guardExpr=
"! ";
1014 BEGIN(DefinedExpr2);
1016<Command>"ifndef"/{B}+ {
1018 yyextra->guardExpr=
"! ";
1019 BEGIN(DefinedExpr1);
1021<Command>"if"/[ \t(!] {
1023 yyextra->guardExpr.clear();
1026<Command>("elif"|"else"{B}*"if")/[ \t(!] {
1029 yyextra->guardExpr.clear();
1035 BEGIN(SkipCPPBlock);
1038<Command>"else"/[^a-z_A-Z0-9\x80-\xFF] {
1042 BEGIN(SkipCPPBlock);
1049<Command>"undef"{B}+ {
1052<Command>("elif"|"else"{B}*"if")/[ \t(!] {
1055 yyextra->guardExpr.clear();
1059<Command>"endif"/[^a-z_A-Z0-9\x80-\xFF] {
1063<Command,IgnoreLine>\n {
1066 yyextra->yyLineNr++;
1068<Command>"pragma"{B}+"once" {
1069 yyextra->expectGuard =
FALSE;
1070 if (yyextra->pragmaSet.find(yyextra->fileName.str())!=yyextra->pragmaSet.end())
1077 yyextra->pragmaSet.insert(yyextra->fileName.data());
1082<PragmaOnce><<EOF>> {
1083 yyextra->expectGuard =
FALSE;
1089<IgnoreLine>\\[\r]?\n {
1091 yyextra->yyLineNr++;
1094<Command>. { yyextra->potentialDefine += yytext[0]==
'\t' ?
'\t' :
' ';
1095 yyextra->yyColNr+=(int)yyleng;
1111 yyextra->guardExpr+=
' ';
1112 yyextra->yyLineNr++;
1114<Guard>"defined"/{B}*"(" {
1115 BEGIN(DefinedExpr2);
1117<Guard>"defined"/{B}+ {
1118 BEGIN(DefinedExpr1);
1120<Guard>"true"/{B}|{B}*[\r]?\n { yyextra->guardExpr+=
"1L"; }
1121<Guard>"false"/{B}|{B}*[\r]?\n { yyextra->guardExpr+=
"0L"; }
1122<Guard>"not"/{B} { yyextra->guardExpr+=
'!'; }
1123<Guard>"not_eq"/{B} { yyextra->guardExpr+=
"!="; }
1124<Guard>"and"/{B} { yyextra->guardExpr+=
"&&"; }
1125<Guard>"or"/{B} { yyextra->guardExpr+=
"||"; }
1126<Guard>"bitand"/{B} { yyextra->guardExpr+=
"&"; }
1127<Guard>"bitor"/{B} { yyextra->guardExpr+=
"|"; }
1128<Guard>"xor"/{B} { yyextra->guardExpr+=
"^"; }
1129<Guard>"compl"/{B} { yyextra->guardExpr+=
"~"; }
1130<Guard>{ID} { yyextra->guardExpr+=yytext; }
1131<Guard>"@" { yyextra->guardExpr+=
"@@"; }
1132<Guard>. { yyextra->guardExpr+=*yytext; }
1146 BEGIN(SkipCPPBlock);
1149<DefinedExpr1,DefinedExpr2>\\\n { yyextra->yyLineNr++;
outputChar(yyscanner,
'\n'); }
1151 if (
isDefined(yyscanner,yytext) || yyextra->guardName==yytext)
1152 yyextra->guardExpr+=
" 1L ";
1154 yyextra->guardExpr+=
" 0L ";
1155 yyextra->lastGuardName=yytext;
1159 if (
isDefined(yyscanner,yytext) || yyextra->guardName==yytext)
1160 yyextra->guardExpr+=
" 1L ";
1162 yyextra->guardExpr+=
" 0L ";
1163 yyextra->lastGuardName=yytext;
1165<DefinedExpr1,DefinedExpr2>\n {
1166 yyextra->yyLineNr++;
1168 BEGIN(SkipCPPBlock);
1173<DefinedExpr1,DefinedExpr2>.
1174<SkipCPPBlock>^{B}*"#" { BEGIN(SkipCommand); }
1175<SkipCPPBlock>^{Bopt}/[^#] { BEGIN(SkipLine); }
1176<SkipCPPBlock>\n { yyextra->yyLineNr++;
outputChar(yyscanner,
'\n'); }
1178<SkipCommand>"if"(("n")?("def"))?/[ \t(!] {
1183<SkipCommand>"else" {
1192<SkipCommand>("elif"|"else"{B}*"if")/[ \t(!] {
1193 if (yyextra->ifcount==0)
1197 yyextra->guardExpr.clear();
1198 yyextra->lastGuardName.clear();
1203 BEGIN(SkipCPPBlock);
1207<SkipCommand>"endif" {
1208 yyextra->expectGuard =
FALSE;
1210 if (--yyextra->ifcount<0)
1218 yyextra->yyLineNr++;
1219 BEGIN(SkipCPPBlock);
1226<SkipLine>{CHARLIT} { }
1231<SkipString>{CPPC}/[^\n]* {
1233<SkipLine,SkipCommand,SkipCPPBlock>{CPPC}[^\n]* {
1234 yyextra->lastCPPContext=YY_START;
1235 BEGIN(RemoveCPPComment);
1237<SkipString>{CCS}/[^\n]* {
1239<SkipLine,SkipCommand,SkipCPPBlock>{CCS}/[^\n]* {
1240 yyextra->lastCContext=YY_START;
1241 BEGIN(RemoveCComment);
1245 yyextra->yyLineNr++;
1246 BEGIN(SkipCPPBlock);
1248<SkipString>[^"\\\n]+ { }
1254<IncludeID>{ID}{Bopt}/"(" {
1255 yyextra->nospaces=
TRUE;
1256 yyextra->roundCount=0;
1257 yyextra->defArgsStr=yytext;
1258 yyextra->findDefArgContext = IncludeID;
1259 BEGIN(FindDefineArgs);
1262 yyextra->nospaces=
TRUE;
1266<Include>[^\">\n]+[\">] {
1267 yyextra->incName+=yytext;
1268 if (yyextra->isImported)
1278<EndImport>{ENDIMPORTopt}/\n {
1282<EndImport>\\[\r]?"\n" {
1284 yyextra->yyLineNr++;
1288<DefName>{ID}/("\\\n")*"(" {
1290 yyextra->argMap.clear();
1291 yyextra->defArgs = 0;
1292 yyextra->defArgsStr.clear();
1293 yyextra->defText.clear();
1294 yyextra->defLitText.clear();
1295 yyextra->defName = yytext;
1296 yyextra->defVarArgs =
FALSE;
1297 yyextra->defExtraSpacing.clear();
1298 yyextra->defContinue =
false;
1301<DefName>{ID}{B}+"1"/[ \r\t\n] {
1303 yyextra->argMap.clear();
1304 yyextra->defArgs = -1;
1305 yyextra->defArgsStr.clear();
1307 yyextra->defVarArgs =
FALSE;
1310 if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
1312 QCString def = yyextra->potentialDefine +
1315 outputSpaces(yyscanner,yytext+yyextra->defName.length());
1316 yyextra->quoteArg=
FALSE;
1317 yyextra->insideComment=
FALSE;
1318 yyextra->lastGuardName.clear();
1319 yyextra->defText=
"1";
1320 yyextra->defLitText=
"1";
1326 yyextra->defText.clear();
1327 yyextra->defLitText.clear();
1330 yyextra->expectGuard=
FALSE;
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
1332<DefName,CmakeDefName01>{ID}/{B}*"\n" {
1333 yyextra->argMap.clear();
1334 yyextra->defArgs = -1;
1335 yyextra->defName = yytext;
1336 yyextra->defArgsStr.clear();
1337 yyextra->defText.clear();
1338 yyextra->defLitText.clear();
1339 yyextra->defVarArgs =
FALSE;
1342 if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
1344 QCString def = yyextra->potentialDefine + yyextra->defName;
1346 yyextra->quoteArg=
FALSE;
1347 yyextra->insideComment=
FALSE;
1348 if (YY_START == CmakeDefName01) yyextra->defText =
"0";
1349 else if (yyextra->insideCS) yyextra->defText=
"1";
1355 yyextra->guardName = yytext;
1356 yyextra->lastGuardName.clear();
1359 yyextra->expectGuard=
FALSE;
1363 yyextra->argMap.clear();
1364 yyextra->defArgs = -1;
1365 yyextra->defArgsStr.clear();
1366 yyextra->defText.clear();
1367 yyextra->defLitText.clear();
1368 yyextra->defName = yytext;
1369 yyextra->defVarArgs =
FALSE;
1370 QCString def = yyextra->potentialDefine +
1372 yyextra->defArgsStr ;
1374 yyextra->quoteArg=
FALSE;
1375 yyextra->insideComment=
FALSE;
1379 yyextra->defExtraSpacing+=
"\n";
1380 yyextra->defContinue =
true;
1381 yyextra->yyLineNr++;
1383<DefineArg>{B}* { yyextra->defExtraSpacing+=yytext; }
1384<DefineArg>","{B}* { yyextra->defArgsStr+=yytext; }
1385<DefineArg>"("{B}* { yyextra->defArgsStr+=yytext; }
1386<DefineArg>{B}*")"{B}* {
1388 yyextra->defArgsStr+=yytext;
1389 QCString def = yyextra->potentialDefine +
1391 yyextra->defArgsStr +
1392 yyextra->defExtraSpacing ;
1394 yyextra->quoteArg=
FALSE;
1395 yyextra->insideComment=
FALSE;
1399 yyextra->defVarArgs =
TRUE;
1400 yyextra->defArgsStr+=yytext;
1401 yyextra->argMap.emplace(std::string(
"__VA_ARGS__"),yyextra->defArgs);
1404<DefineArg>{ID}{B}*("..."?) {
1407 yyextra->defVarArgs = yytext[yyleng-1]==
'.';
1408 if (yyextra->defVarArgs)
1413 yyextra->defArgsStr+=yytext;
1414 yyextra->argMap.emplace(
toStdString(argName),yyextra->defArgs);
std::string toStdString(const QCString &s)
1430<DefineText>{CCS}[!*]? {
1431 yyextra->defText+=yytext;
1432 yyextra->defLitText+=yytext;
1433 yyextra->lastCContext=YY_START;
1434 yyextra->commentCount=1;
1435 BEGIN(CopyCComment);
1437<DefineText>{CPPC}[!/]? {
1439 yyextra->lastCPPContext=YY_START;
1440 yyextra->defLitText+=
' ';
1441 BEGIN(SkipCPPComment);
1443<SkipCComment>[/]?{CCE} {
1444 if (yytext[0]==
'/')
outputChar(yyscanner,
'/');
1446 if (--yyextra->commentCount<=0)
1448 if (yyextra->lastCContext==Start)
1452 YY_CURRENT_BUFFER->yy_at_bol=1;
1454 BEGIN(yyextra->lastCContext);
1457<SkipCComment>{CPPC}("/")* {
1460<SkipCComment>{CCS} {
1464<SkipCond>{CMD}{CMD} { }
1465<SkipCond>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
1467 if (!markdownSupport || !yyextra->isSpecialComment)
1473 yyextra->fenceChar=
'~';
1475 BEGIN(SkipCondVerbatim);
1478<SkipCond>^({B}*"*"+)?{B}{0,3}"```"[`]* {
1480 if (!markdownSupport || !yyextra->isSpecialComment)
1486 yyextra->fenceChar=
'`';
1488 BEGIN(SkipCondVerbatim);
1491<SkipCComment>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
1493 if (!markdownSupport || !yyextra->isSpecialComment)
1500 yyextra->fenceChar=
'~';
1502 BEGIN(SkipVerbatim);
1505<SkipCComment>^({B}*"*"+)?{B}{0,3}"```"[`]* {
1507 if (!markdownSupport || !yyextra->isSpecialComment)
1514 yyextra->fenceChar=
'`';
1516 BEGIN(SkipVerbatim);
1519<SkipCComment>{CMD}{VERBATIM_LINE} |
1520<SkipCComment>{CMD}{LITERAL_BLOCK} {
1524<SkipCComment>{VERBATIM_LINE}.*/\n {
1527<SkipCComment>{LITERAL_BLOCK} {
1531 BEGIN(SkipVerbatim);
1533<SkipCond>{CMD}{CMD}"cond"[ \t]+ {}
1534<SkipCond>{CMD}"cond"/\n |
1535<SkipCond>{CMD}"cond"[ \t]+ {
1539<SkipCComment>"{"[ \t]*"@code"/[ \t\n] {
1541 yyextra->javaBlock=1;
1542 BEGIN(JavaDocVerbatimCode);
1544<SkipCComment>"{"[ \t]*"@literal"/[ \t\n] {
1546 yyextra->javaBlock=1;
1547 BEGIN(JavaDocVerbatimCode);
1549<SkipCComment,SkipCPPComment>{CMD}{CMD}"cond"[ \t\n]+ {
1552<SkipCPPComment>{CMD}"cond"[ \t]+ {
1553 yyextra->ccomment=
TRUE;
1554 yyextra->condCtx=YY_START;
1557<SkipCComment>{CMD}"cond"[ \t]+ {
1558 yyextra->ccomment=
FALSE;
1559 yyextra->condCtx=YY_START;
1562<CondLineC,CondLineCpp>[!()&| \ta-z_A-Z0-9\x80-\xFF.\-]+ {
1566 if (YY_START==CondLineC)
1570 yyextra->ccomment=
TRUE;
1574 yyextra->ccomment=
FALSE;
1580 BEGIN(yyextra->condCtx);
1583<CondLineC,CondLineCpp>. {
1588 if (YY_START==CondLineC)
1592 yyextra->ccomment=
TRUE;
1596 yyextra->ccomment=
FALSE;
1602 BEGIN(yyextra->condCtx);
1605<SkipCComment,SkipCPPComment>{CMD}"cond"{WSopt}/\n {
1606 if (YY_START==SkipCComment)
1608 yyextra->ccomment=
TRUE;
1614 yyextra->ccomment=
FALSE;
1616 yyextra->condCtx=YY_START;
1620<SkipCond>\n { yyextra->yyLineNr++;
outputChar(yyscanner,
'\n'); }
1621<SkipCond>{VERBATIM_LINE}.*/\n { }
1622<SkipCond>{LITERAL_BLOCK} {
1624 yyextra->yyLineNr+=numNLs;
1625 for (
int i = 0; i < numNLs; i++)
outputChar(yyscanner,
'\n');
1627 BEGIN(SkipCondVerbatim);
1631<SkipCond>[^\/\!*\\@\n]+ { }
1632<SkipCond>{CPPC}[/!] { yyextra->ccomment=
FALSE; }
1633<SkipCond>{CCS}[*!] { yyextra->ccomment=
TRUE; }
1634<SkipCond,SkipCComment,SkipCPPComment>{CMD}{CMD}"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
1640<SkipCond>{CMD}"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
1641 bool oldSkip = yyextra->skip;
1643 if (oldSkip && !yyextra->skip)
1645 if (yyextra->ccomment)
1649 BEGIN(yyextra->condCtx);
1652<SkipCComment,SkipCPPComment>{CMD}"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
1653 bool oldSkip = yyextra->skip;
1655 if (oldSkip && !yyextra->skip)
1657 BEGIN(yyextra->condCtx);
1660<SkipCondVerbatim>{LITERAL_BLOCK_END} {
1661 if (yytext[1]==
'f' && yyextra->blockName==&yytext[2])
1665 else if (&yytext[4]==yyextra->blockName)
1670<SkipVerbatim>{LITERAL_BLOCK_END} {
1672 if (yytext[1]==
'f' && yyextra->blockName==&yytext[2])
1674 BEGIN(SkipCComment);
1676 else if (&yytext[4]==yyextra->blockName)
1678 BEGIN(SkipCComment);
1681<SkipCondVerbatim>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
1682 if (yyextra->fenceSize==
getFenceSize(yytext,yyleng) && yyextra->fenceChar==
'~')
1687<SkipCondVerbatim>^({B}*"*"+)?{B}{0,3}"```"[`]* {
1688 if (yyextra->fenceSize==
getFenceSize(yytext,yyleng) && yyextra->fenceChar==
'`')
1693<SkipVerbatim>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
1695 if (yyextra->fenceSize==
getFenceSize(yytext,yyleng) && yyextra->fenceChar==
'~')
1697 BEGIN(SkipCComment);
1700<SkipVerbatim>^({B}*"*"+)?{B}{0,3}"```"[`]* {
1702 if (yyextra->fenceSize==
getFenceSize(yytext,yyleng) && yyextra->fenceChar==
'`')
1704 BEGIN(SkipCComment);
1707<SkipCondVerbatim>{CCE}|{CCS} { }
1708<SkipVerbatim>{CCE}|{CCS} {
1711<JavaDocVerbatimCode>"{" {
1712 if (yyextra->javaBlock==0)
1718 yyextra->javaBlock++;
1722<JavaDocVerbatimCode>"}" {
1723 if (yyextra->javaBlock==0)
1729 yyextra->javaBlock--;
1730 if (yyextra->javaBlock==0)
1733 BEGIN(SkipCComment);
1741<JavaDocVerbatimCode>\n {
1744<JavaDocVerbatimCode>. {
1747<SkipCondVerbatim>[^{*\\@\x06~`\n\/]+ { }
1748<SkipCComment,SkipVerbatim>[^{*\\@\x06~`\n\/]+ {
1751<SkipCComment,SkipVerbatim,SkipCondVerbatim>\n {
1752 yyextra->yyLineNr++;
1755<SkipCondVerbatim>. { }
1756<SkipCComment,SkipVerbatim>. {
1759<CopyCComment>[^*a-z_A-Z\x80-\xFF\n]*[^*a-z_A-Z\x80-\xFF\\\n] {
1760 yyextra->defLitText+=yytext;
1761 yyextra->defText+=
escapeAt(yytext);
1763<CopyCComment>\\[\r]?\n {
1764 yyextra->defLitText+=yytext;
1765 yyextra->defText+=
" ";
1766 yyextra->yyLineNr++;
1767 yyextra->yyMLines++;
1769<CopyCComment>{CCE} {
1770 yyextra->defLitText+=yytext;
1771 yyextra->defText+=yytext;
1772 BEGIN(yyextra->lastCContext);
1775 yyextra->yyLineNr++;
1776 yyextra->defLitText+=yytext;
1777 yyextra->defText+=
' ';
1779<RemoveCComment>{CCE}{B}*"#" {
1780 if (yyextra->lastCContext==SkipCPPBlock)
1789<RemoveCComment>{CCE} { BEGIN(yyextra->lastCContext); }
1790<RemoveCComment>{CPPC}
1791<RemoveCComment>{CCS}
1792<RemoveCComment>[^*\x06\n]+
1793<RemoveCComment>\n { yyextra->yyLineNr++;
outputChar(yyscanner,
'\n'); }
1795<SkipCPPComment>[^\n\/\\@]+ {
1798<SkipCPPComment,RemoveCPPComment>\n {
1800 BEGIN(yyextra->lastCPPContext);
1802<SkipCPPComment>{CCS} {
1805<SkipCPPComment>{CPPC} {
1808<SkipCPPComment>[^\x06\@\\\n]+ {
1814<RemoveCPPComment>{CCS}
1815<RemoveCPPComment>{CPPC}
1816<RemoveCPPComment>[^\x06\n]+
1818<DefineText>"#"/{IDSTART} {
1820 yyextra->quoteArg=
TRUE;
1821 yyextra->idStart=
true;
1822 yyextra->defLitText+=yytext;
1824<DefineText,CopyCComment>{ID} {
1825 yyextra->defLitText+=yytext;
1826 if (YY_START == DefineText)
outputSpaces(yyscanner,yytext);
1827 if (yyextra->quoteArg)
1829 yyextra->defText+=
"\"";
1831 if (yyextra->defArgs>0)
1833 auto it = yyextra->argMap.find(yytext);
1834 if (it!=yyextra->argMap.end())
1837 yyextra->defText+=
'@';
1842 if (yyextra->idStart)
1844 warn(yyextra->fileName,yyextra->yyLineNr,
1845 "'#' is not followed by a macro parameter '{}': '{}'",
1846 yyextra->defName,yyextra->defLitText.stripWhiteSpace());
1848 yyextra->defText+=yytext;
1853 yyextra->defText+=yytext;
1855 if (yyextra->quoteArg)
1857 yyextra->defText+=
"\"";
1859 yyextra->quoteArg=
FALSE;
1860 yyextra->idStart=
false;
QCString & setNum(short n)
#define warn(file, line, fmt,...)
1863 yyextra->defLitText+=yytext;
1864 yyextra->defText+=yytext;
1866<DefineText>\\[\r]?\n {
1867 yyextra->defLitText+=yytext;
1870 yyextra->defText +=
' ';
1871 yyextra->yyLineNr++;
1872 yyextra->yyMLines++;
1876 yyextra->defText = yyextra->defText.stripWhiteSpace();
1877 if (yyextra->defText.startsWith(
"##"))
1879 warn(yyextra->fileName,yyextra->yyLineNr,
1880 "'##' cannot occur at the beginning of a macro definition '{}': '{}'",
1881 yyextra->defName,yyextra->defLitText.stripWhiteSpace());
1883 else if (yyextra->defText.endsWith(
"##"))
1885 warn(yyextra->fileName,yyextra->yyLineNr,
1886 "'##' cannot occur at the end of a macro definition '{}': '{}'",
1887 yyextra->defName,yyextra->defLitText.stripWhiteSpace());
1889 else if (yyextra->defText.endsWith(
"#"))
1891 warn(yyextra->fileName,yyextra->yyLineNr,
1892 "expected formal parameter after # in macro definition '{}': '{}'",
1893 yyextra->defName,yyextra->defLitText.stripWhiteSpace());
1898 yyextra->defLitText=yyextra->defLitText.left(yyextra->defLitText.length()-
comment.length()-1);
1901 yyextra->defLitText+=yytext;
1904 if (yyextra->includeStack.empty() || yyextra->curlyCount>0)
1908 def=
isDefined(yyscanner,yyextra->defName);
1922 def->
name = yyextra->defName;
1924 def->
nargs = yyextra->defArgs;
1926 def->
lineNr = yyextra->yyLineNr-yyextra->yyMLines;
1931 if (def->
fileName != yyextra->fileName && !yyextra->expandOnlyPredef)
addDefine(yyscanner);
1935 yyextra->argMap.clear();
1936 yyextra->yyLineNr++;
1938 yyextra->lastGuardName.clear();
1942 yyextra->defText +=
' ';
1943 yyextra->defLitText+=yytext;
1946 yyextra->defText +=
"##";
1947 yyextra->defLitText+=yytext;
1950 yyextra->defText +=
"@@";
1951 yyextra->defLitText+=yytext;
1955 yyextra->defText += *yytext;
1956 yyextra->defLitText+=yytext;
1957 if (!yyextra->insideComment)
1959 BEGIN(SkipDoubleQuote);
1964 yyextra->defText += *yytext;
1965 yyextra->defLitText+=yytext;
1966 if (!yyextra->insideComment)
1968 BEGIN(SkipSingleQuote);
1971<SkipDoubleQuote>{CPPC}[/]? {
outputSpaces(yyscanner,yytext);
1972 yyextra->defText += yytext;
1973 yyextra->defLitText+=yytext;
1975<SkipDoubleQuote>{CCS}[*]? {
outputSpaces(yyscanner,yytext);
1976 yyextra->defText += yytext;
1977 yyextra->defLitText+=yytext;
1979<SkipDoubleQuote>\" {
1981 yyextra->defText += *yytext;
1982 yyextra->defLitText+=yytext;
1985<SkipSingleQuote,SkipDoubleQuote>\\. {
1987 yyextra->defText += yytext;
1988 yyextra->defLitText+=yytext;
1990<SkipSingleQuote>\' {
1992 yyextra->defText += *yytext;
1993 yyextra->defLitText+=yytext;
1996<SkipDoubleQuote,SkipSingleQuote>. {
outputSpace(yyscanner,yytext[0]);
1997 yyextra->defText += *yytext;
1998 yyextra->defLitText += *yytext;
2001 yyextra->defText += *yytext;
2002 yyextra->defLitText += *yytext;
2005 TRACE(
"End of include file");
2007 if (yyextra->includeStack.empty())
2009 TRACE(
"Terminating scanner");
2014 QCString toFileName = yyextra->fileName;
2015 const std::unique_ptr<FileState> &fs=yyextra->includeStack.back();
2017 YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
2018 yy_switch_to_buffer( fs->bufState, yyscanner );
2019 yy_delete_buffer( oldBuf, yyscanner );
2020 yyextra->yyLineNr = fs->lineNr;
2022 yyextra->inputBuf = fs->oldFileBuf;
2023 yyextra->inputBufPos = fs->oldFileBufPos;
2024 yyextra->curlyCount = fs->curlyCount;
2026 TRACE(
"switching to {}",yyextra->fileName);
2031 lineStr.sprintf(
"# %d \"%s\" 2",yyextra->yyLineNr,
qPrint(yyextra->fileName));
2034 yyextra->includeStack.pop_back();
2057 for (
const auto &kv : yyextra->localDefines)
2059 auto pair = yyextra->contextDefines.insert(kv);
2062 yyextra->contextDefines.erase(pair.first);
2063 yyextra->contextDefines.insert(kv);
2066 yyextra->localDefines.clear();
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
const std::string & str() const
const char * qPrint(const char *s)
2071 if (YY_START==SkipVerbatim || YY_START == SkipCondVerbatim || YY_START==SkipCond || YY_START==IDLquote || YY_START == PragmaOnce)
2078 yyextra->lastCContext=YY_START;
2079 yyextra->commentCount=1;
2082 yyextra->isSpecialComment =
true;
2083 yyextra->lastGuardName.clear();
2087 yyextra->isSpecialComment =
false;
2089 BEGIN(SkipCComment);
2093 if (YY_START==SkipVerbatim || YY_START == SkipCondVerbatim || YY_START==SkipCond ||
getLanguageFromFileName(yyextra->fileName)==SrcLangExt::Fortran || YY_START==IDLquote || YY_START == PragmaOnce)
2097 else if (YY_START==RulesRoundDouble)
2104 yyextra->lastCPPContext=YY_START;
2107 yyextra->isSpecialComment =
true;
2108 yyextra->lastGuardName.clear();
2112 yyextra->isSpecialComment =
false;
2114 BEGIN(SkipCPPComment);
2119 yyextra->yyLineNr++;
2122 yyextra->expectGuard =
FALSE;
2132 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2133 int bytesInBuf =
static_cast<int>(state->inputBuf->size())-state->inputBufPos;
2134 int bytesToCopy = std::min(max_size,bytesInBuf);
2135 memcpy(buf,state->inputBuf->data()+state->inputBufPos,bytesToCopy);
2136 state->inputBufPos+=bytesToCopy;
2142 yy_size_t fenceSize = 0;
2143 for (
size_t i = 0; i < leng; i++)
2145 if (txt[i] !=
' ' && txt[i] !=
'*' && txt[i] !=
'\t')
break;
2148 return leng-fenceSize;
2153 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2158 if (state->yyFileDef==
nullptr)
2164 if (state->yyFileDef && state->yyFileDef->isReference()) state->yyFileDef=
nullptr;
2169 state->isSource = section.isHeader() || section.isSource();
2174 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2175 state->levelGuard.push(
false);
2181 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2183 if (!state->levelGuard.empty())
2185 state->levelGuard.pop();
2189 warn(state->fileName,state->yyLineNr,
"More #endif's than #if's found.");
2195 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2196 if (state->levelGuard.empty())
2198 warn(state->fileName,state->yyLineNr,
"Found an #else without a preceding #if.");
2203 return state->levelGuard.top();
2209 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2210 state->levelGuard.top()=value;
2216 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2217 alreadyProcessed =
FALSE;
2218 std::unique_ptr<FileState> fs;
2229 if (state->curlyCount==0)
2234 alreadyProcessed =
TRUE;
2241 alreadyProcessed = std::any_of(
2242 state->includeStack.begin(),
2243 state->includeStack.end(),
2244 [absName](
const std::unique_ptr<FileState> &lfs)
2245 { return lfs->fileName==absName; }
2248 if (alreadyProcessed)
2255 fs = std::make_unique<FileState>();
2264 fs->oldFileBuf = state->inputBuf;
2265 fs->oldFileBufPos = state->inputBufPos;
2273 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2284 else if (alreadyProcessed)
2289 if (localInclude && !state->fileName.isEmpty())
2291 FileInfo fi(state->fileName.str());
2302 else if (alreadyProcessed)
2308 if (state->pathList.empty())
2312 for (
auto path : state->pathList)
2314 std::string absName = (path+
"/"+fileName).str();
2324 else if (alreadyProcessed)
2357 if (i>=0 && s[i]==
'*')
2360 while (i>0 && !(s[i-1]==
'/' && s[i]==
'*')) i--;
2367 return ((s[i+1]==
'*' || s[i+1]==
'!') && s[i+2]==
'<') ? &s[i-1] :
"";
2399 bool inString=
FALSE;
2404 if (!inString && !inChar)
2406 while (i<s.
length() && !inString && !inChar)
2427 while (i<s.
length() && inChar)
2448 while (i<s.
length() && inString)
2477 std::string e = expr.
str();
2478 static const reg::Ex r(R
"(\s*##\s*)");
2487 const auto &match = *it;
2488 size_t n = match.position();
2489 size_t l = match.length();
2491 if (n+l+1<e.length() && e[
static_cast<int>(n+l)]==
'@' && expr[
static_cast<int>(n+l+1)]==
'-')
2498 e=e.substr(0,n)+e.substr(n+l);
2499 int k=
static_cast<int>(n)-1;
2500 while (k>=0 &&
isId(e[k])) k--;
2501 if (k>0 && e[k]==
'-' && e[k-1]==
'@')
2504 e=e.substr(0,k-1)+e.substr(k+1);
2522 struct yyguts_t * yyg = (
struct yyguts_t*)yyscanner;
2530 while ((cc=
getNextChar(yyscanner,expr,rest,pos))!=EOF && cc!=0)
2532 if (cc==
'\\') arg+=(char)cc,cc=
getNextChar(yyscanner,expr,rest,pos);
2533 else if (cc==
term)
return;
2539 int &cc, uint32_t &j,
int &len)
2541 bool changed =
false;
2546 while ((cc=
getCurrentChar(yyscanner,expr,rest,j))!=EOF && cc!=
'\n' && isspace(cc))
2554 int prevChar =
'\0';
2556 if ((cc=
getCurrentChar(yyscanner,expr,rest,j))!=EOF && cc ==
'*')
2558 while ((cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2560 if (cc ==
'/' && prevChar ==
'*')
break;
2563 if (cc != EOF) changed =
true;
2596 std::map<std::string,std::string> argTable;
2604 while ((cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2612 while (!done && (argCount<def->nargs || def->
varArgs) &&
2613 ((cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2622 while ((cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2626 if (c==
'\'' || c==
'\"')
2646 else if (c==
')' || c==
',')
2656 argKey.
sprintf(
"@%d",argCount++);
2671 while (!found && (cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2678 if ((cc=
getNextChar(yyscanner,expr,rest,j))==EOF || cc==0)
break;
2688 while (!found && (cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2695 if ((cc=
getNextChar(yyscanner,expr,rest,j))==EOF || cc==0)
break;
2703 char prevChar =
'\0';
2707 while ((cc=
getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
2711 if (c ==
'/' && prevChar ==
'*')
break;
2724 if (argCount==def->
nargs ||
2733 bool inString=
FALSE;
2743 else if (d.
at(k+1)==
'-')
2754 if (l>=0 && d.
at(l)==
'"') l--;
2755 while (l>=0 && d.
at(l)==
' ') l--;
2756 if (l>0 && d.
at(l)==
'#' && d.
at(l-1)==
'#') hash=
TRUE;
2759 while (k<d.
length() && d.
at(k)>=
'0' && d.
at(k)<=
'9') key+=d.
at(k++);
2764 if (l<(
int)d.
length() && d.
at(l)==
'"') l++;
2765 while (l<(
int)d.
length() && d.
at(l)==
' ') l++;
2766 if (l<(
int)d.
length()-1 && d.
at(l)==
'#' && d.
at(l+1)==
'#') hash=
TRUE;
2769 auto it = argTable.find(key.
str());
2770 if (it!=argTable.end())
2772 QCString substArg = it->second.c_str();
2790 if (hash && substArg.
isEmpty())
2801 if (!inString && d.
at(k)==
'\"')
2805 else if (k>2 && inString && d.
at(k)==
'\"' && (d.
at(k-1)!=
'\\' || d.
at(k-2)==
'\\'))
2829 while (p<(
int)expr.
length())
2831 char c=expr.
at(p++);
2836 else if (isalpha(c) || c==
'_')
2846 if (p<(
int)expr.
length()) c=expr.
at(p);
2847 while (p<(
int)expr.
length() && (c!=
'"' || (pc==
'\\' && ppc!=
'\\')))
2855 if (p<(
int)expr.
length()) ++p;
2861 if (p<(
int)expr.
length())
2867 while (p<(
int)expr.
length() && !(pc==
'*' && c==
'/'))
2880#define MAX_EXPANSION_DEPTH 50
2884 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2885 if (!state->nospaces)
2888 char ccPrev = pos==0 || (int)expr.
length()<pos ? state->prevChar : expr.
at(pos-1);
2889 QCString leftSpace = ccPrev!=
':' && ccPrev!=
' ' ?
" " :
"";
2894 uint32_t j=(uint32_t)resultExpr.
length();
2895 while ((ccNext=
getNextChar(yyscanner,resultExpr,
nullptr,j))!=EOF && ccNext==
' ') { }
2896 if (ccNext != EOF)
unputChar(yyscanner,resultExpr,
nullptr,j,(
char)ccNext);
2900 ccNext=restExpr.
at(0);
2903 QCString rightSpace = ccNext!=
':' && ccNext!=
' ' ?
" " :
"";
2906 resultExpr=leftSpace+resultExpr+rightSpace;
2916 struct yyguts_t * yyg = (
struct yyguts_t*)yyscanner;
2917 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
2924 if (state->expanded.find(expr.
str())!=state->expanded.end() &&
2932 state->expanded.insert(expr.
str());
2936 bool definedTest=
FALSE;
2937 int i=pos, l=0, p=0, len=0;
2942 bool replaced=
FALSE;
2943 macroName=expr.
mid(p,l);
2945 if (p<2 || !(expr.
at(p-2)==
'@' && expr.
at(p-1)==
'-'))
2947 if (state->expandedDict.find(macroName.
str())==state->expandedDict.end())
2952 if (yyextra->expandOnlyPredef && def && !def->
isPredefined) def=
nullptr;
2953 if (macroName==
"defined")
2958 else if (definedTest)
2960 if (def) expMacro =
" 1 ";
else expMacro =
" 0 ";
2965 else if (def && def->
nargs==-1)
2974 else if (def && def->
nargs>=0)
2991 bool expanded=
false;
2994 state->expandedDict.emplace(
toStdString(macroName),def);
2996 state->expandedDict.erase(
toStdString(macroName));
3005 expr=expr.
left(p)+resultExpr+restExpr;
3061 if (inputStr==
nullptr)
return inputStr;
3062 char term = *inputStr;
3063 if (
term!=
'\'' &&
term!=
'"')
return inputStr;
3068 while ((c=*inputStr))
3097 static const std::vector<std::string> signs = {
"signed",
"unsigned" };
3098 struct TypeInfo { std::string name;
size_t size; };
3099 static const std::vector<TypeInfo> types = {
3100 {
"short int",
sizeof(
short int) },
3101 {
"long long int",
sizeof(
long long int) },
3102 {
"long int",
sizeof(
long int) },
3103 {
"long long",
sizeof(
long long) },
3104 {
"long double",
sizeof(
long double) },
3105 {
"int",
sizeof(int) },
3106 {
"short",
sizeof(short) },
3107 {
"bool",
sizeof(bool) },
3108 {
"long",
sizeof(long) },
3109 {
"char",
sizeof(char) },
3110 {
"float",
sizeof(float) },
3111 {
"double",
sizeof(double) },
3117 auto process_cast_or_sizeof = [](
const char *p) -> std::pair<const char *,size_t>
3120 while (*q==
' ' || *q==
'\t') q++;
3122 size_t size =
sizeof(int);
3123 for (
const auto &sgn : signs)
3125 if (
qstrncmp(q,sgn.c_str(),sgn.length())==0) { q+=sgn.length(); found=
true; }
3127 if (!found || *q==
' ' || *q==
'\t' || *q==
')')
3129 while (*q==
' ' || *q==
'\t') q++;
3130 for (
const auto &t : types)
3132 if (
qstrncmp(q,t.name.c_str(),t.name.length())==0)
3134 q += t.name.length();
3139 while (*q==
' ' || *q==
'\t') q++;
3140 if (*q==
')')
return std::make_pair(++q,size);
3142 return std::make_pair(
nullptr,0);
3147 const char *p=s.
data();
3157 const char *q = process_cast_or_sizeof(p+1).first;
3167 const char *q = p+6;
3168 while (*q==
' ' || *q==
'\t') q++;
3171 auto r = process_cast_or_sizeof(q+1);
3188 else if (*(p+1)==
'E')
3194 else if (isdigit(c))
3204 else if (c==
'd' && !inNum)
3215 while ((c=*p) &&
isId(c)) p++;
3218 else if ((isalpha(c) || c==
'_') && !inNum)
3222 while ((c=*p) &&
isId(c)) p++;
3223 while ((c=*p) && isspace((uint8_t)c)) p++;
3230 if (c==
'(') count++;
3234 if (count==0)
break;
3242 while (*p && !(pc==
'*' && c==
'/'))
3259 while (*p && !(pc==
'*' && c==
'/'))
3276 char lc=(char)tolower(c);
3293 const char *p=s.
data();
3318 while (*p && !(pc==
'*' && c==
'/'))
3320 if (*p==
'@' && *(p+1)==
'@')
3327 if (*p) result+=c,p++;
3354 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3358 state->expanded.clear();
3364 return state->constExpParser.parse(state->fileName.data(),state->yyLineNr,e.
str(),ee.
str());
3373 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3374 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3375 state->prevChar = yyscanner->yytext_r > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ? *(yyscanner->yytext_r-1) : 0;
3377 state->expanded.
clear();
3387 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3389 def.
name = state->defName;
3391 def.
nargs = state->defArgs;
3393 def.
fileDef = state->yyFileDef;
3394 def.
lineNr = state->yyLineNr-state->yyMLines;
3396 def.
varArgs = state->defVarArgs;
3406 auto it = state->localDefines.find(def.
name.
str());
3407 if (it!=state->localDefines.end())
3409 state->localDefines.erase(it);
3411 state->localDefines.emplace(def.
name.
str(),def);
3416 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3417 if (state->skip)
return;
3422 define.
lineNr = state->yyLineNr - state->yyMLines;
3424 define.
name = state->defName;
3425 define.
args = state->defArgsStr;
3426 define.
fileDef = state->inputFileDef;
3428 QCString litText = state->defLitText;
3429 int l=litText.
find(
'\n');
3439 const char *p=litText.
data()+k;
3441 while ((c=*p++) && (c==
' ' || c==
'\t')) k++;
3445 if (litTextStripped.
contains(
'\n')>=1)
3454 state->macroDefinitions.push_back(define);
3460 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3461 if (state->includeStack.empty() || state->curlyCount>0) (*state->outputBuf)+=c;
3466 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3467 if (state->includeStack.empty() || state->curlyCount>0) (*state->outputBuf)+=std::string_view(a,len);
3472 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3473 if (state->includeStack.empty() || state->curlyCount>0) (*state->outputBuf)+=a.
str();
3495 struct yyguts_t * yyg = (
struct yyguts_t*)yyscanner;
3496 if (!yyextra->defContinue)
return;
3497 for (
int i=0; i< (int)yyleng; i++)
3499 if (yytext[i] ==
'\t')
3500 yyextra->defExtraSpacing+=
'\t';
3502 yyextra->defExtraSpacing+=
' ';
3508 struct yyguts_t * yyg = (
struct yyguts_t*)yyscanner;
3509 yyextra->fenceSize=0;
3511 if (yytext[1]==
'f' && ((c=yytext[2])==
'[' || c==
'{' || c==
'(' || c==
'$'))
3515 case '[': yyextra->blockName=
"]";
break;
3516 case '{': yyextra->blockName=
"}";
break;
3517 case '(': yyextra->blockName=
")";
break;
3518 case '$': yyextra->blockName=
"$";
break;
3521 yyextra->blockName=yyextra->blockName.stripWhiteSpace();
3528 yyextra->blockName=
"uml";
3532 int i = bn.
find(
'{');
3534 yyextra->blockName=bn;
3542 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3547 (inc.
at(i)==
' ' || inc.
at(i)==
'"' || inc.
at(i)==
'<')
3552 bool localInclude = s>0 && inc.
at(s-1)==
'"';
3555 while (i<inc.
length() && inc.
at(i)!=
'"' && inc.
at(i)!=
'>') i++;
3557 if (s<inc.
length() && i>s)
3567 QCString oldFileName = state->fileName;
3568 FileDef *oldFileDef = state->yyFileDef;
3569 int oldLineNr = state->yyLineNr;
3575 std::unique_ptr<FileState> fs;
3576 bool alreadyProcessed =
FALSE;
3578 fs=
findFile(yyscanner,absIncFileName,localInclude,alreadyProcessed);
3589 for (i=0;i<state->includeStack.size();i++)
3596 if (state->includeStack.empty() && oldFileDef)
3598 PreIncludeInfo *ii = state->includeRelations.find(absIncFileName);
3603 state->includeRelations.add(
3606 ambig ?
nullptr : incFd,
3614 struct yyguts_t * yyg = (
struct yyguts_t*)yyscanner;
3615 fs->bufState = YY_CURRENT_BUFFER;
3616 fs->lineNr = oldLineNr;
3617 fs->fileName = oldFileName;
3618 fs->curlyCount = state->curlyCount;
3620 fs->lexRulesPart = state->lexRulesPart;
3621 state->lexRulesPart =
false;
3624 state->includeStack.push_back(std::move(fs));
3634 state->expectGuard=
TRUE;
3635 state->inputBuf = &fs_ptr->
fileBuf;
3636 state->inputBufPos=0;
3637 yy_switch_to_buffer(yy_create_buffer(0,
YY_BUF_SIZE, yyscanner),yyscanner);
3641 if (alreadyProcessed)
3649 if (state->includeStack.empty() && oldFileDef)
3651 PreIncludeInfo *ii = state->includeRelations.find(absIncFileName);
3656 ii = state->includeRelations.add(absIncFileName,
3658 ambig ?
nullptr : incFd,
3668 for (i=0;i<state->includeStack.size();i++)
3672 if (alreadyProcessed)
3682 if (localInclude && !state->includeStack.empty() && state->curlyCount>0 && !alreadyProcessed)
3684 warn(state->fileName,state->yyLineNr,
"include file {} not found, perhaps you forgot to add its directory to INCLUDE_PATH?",incFileName);
3694 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3697 bool expResult = prs.
parse(state->fileName.data(),state->yyLineNr,sectId.
data());
3698 state->condStack.emplace(std::make_unique<preYY_CondCtx>(state->fileName,state->yyLineNr,sectId,state->skip));
3708 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3709 if (state->condStack.empty())
3711 warn(state->fileName,state->yyLineNr,
"the \\endcond does not have a corresponding \\cond in this file");
3716 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
3717 state->skip=ctx->skip;
3718 state->condStack.pop();
3725 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3726 while (!state->condStack.empty())
3728 state->condStack.pop();
3739 const char *p=text.
data();
3742 if (c==
'@') result+=
"@@";
else result+=c;
3752 case '=':
return '#';
3753 case '/':
return '\\';
3754 case '\'':
return '^';
3755 case '(':
return '[';
3756 case ')':
return ']';
3757 case '!':
return '|';
3758 case '<':
return '{';
3759 case '>':
return '}';
3760 case '-':
return '~';
3774 return expr.
at(pos++);
3776 else if (rest && !rest->
isEmpty())
3785 int cc=yyinput(yyscanner);
3797 return expr.
at(pos);
3799 else if (rest && !rest->
isEmpty())
3807 int cc=yyinput(yyscanner);
3824 char cs[2];cs[0]=c;cs[1]=
'\0';
3840 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3843 auto findDefine = [&undef,&name](
DefineMap &map)
3846 auto it = map.find(name.
str());
3859 Define *def = findDefine(state->localDefines);
3860 if (def==
nullptr && !undef)
3862 def = findDefine(state->contextDefines);
3869 YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
3873 for (
const auto &ds : predefList)
3875 size_t i_equals=ds.find(
'=');
3876 size_t i_obrace=ds.find(
'(');
3877 size_t i_cbrace=ds.find(
')');
3878 bool nonRecursive = i_equals!=std::string::npos && i_equals>0 && ds[i_equals-1]==
':';
3880 if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && ds[i_equals-1]==
':'))
3885 if (i_obrace<i_equals && i_cbrace<i_equals &&
3886 i_obrace!=std::string::npos && i_cbrace!=std::string::npos &&
3890 static const reg::Ex reId(R
"(\a\w*)");
3891 std::map<std::string,int> argMap;
3892 std::string args = ds.substr(i_obrace+1,i_cbrace-i_obrace-1);
3893 bool hasVarArgs = args.find(
"...")!=std::string::npos;
3899 for (; arg_it!=arg_end; ++arg_it)
3901 argMap.emplace(arg_it->
str(),count++);
3905 argMap.emplace(
"__VA_ARGS__",count++);
3909 std::string definition;
3910 std::string in=ds.substr(i_equals+1);
3916 for (; re_it!=re_end; ++re_it)
3918 const auto &match = *re_it;
3919 size_t pi = match.position();
3920 size_t l = match.length();
3921 if (pi>i) definition+=in.substr(i,pi-i);
3923 auto it = argMap.find(match.str());
3924 if (it!=argMap.end())
3926 int argIndex = it->second;
3928 marker.
sprintf(
" @%d ",argIndex);
3929 definition+=marker.
str();
3933 definition+=match.str();
3937 definition+=in.substr(i);
3940 std::string dname = ds.substr(0,i_obrace);
3949 def.
fileDef = state->yyFileDef;
3952 state->contextDefines.emplace(def.
name.
str(),def);
3958 else if (!ds.empty())
3962 if (i_equals==std::string::npos)
3969 int ine=
static_cast<int>(i_equals) - (nonRecursive ? 1 : 0);
3970 def.
name = ds.substr(0,ine);
3978 def.
fileDef = state->yyFileDef;
3980 state->contextDefines.emplace(def.
name.
str(),def);
3996 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4003 preYYlex_init_extra(&
p->state,&
p->yyscanner);
4009 preYYlex_destroy(
p->yyscanner);
4016 YY_EXTRA_TYPE state = preYYget_extra(
p->yyscanner);
4017 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4030 state->curlyCount=0;
4031 state->lexRulesPart=
false;
4032 state->nospaces=
FALSE;
4033 state->inputBuf=&input;
4034 state->inputBufPos=0;
4035 state->outputBuf=&output;
4036 state->includeStack.clear();
4037 state->expandedDict.clear();
4038 state->contextDefines.clear();
4039 state->pragmaSet.clear();
4040 while (!state->condStack.empty()) state->condStack.pop();
4044 state->inputFileDef = state->yyFileDef;
4049 state->yyLineNr = 1;
4055 state->expectGuard =
guessSection(fileName).isHeader();
4056 state->guardName.clear();
4057 state->lastGuardName.clear();
4058 state->guardExpr.clear();
4060 preYYlex(yyscanner);
4062 while (!state->condStack.empty())
4064 const std::unique_ptr<preYY_CondCtx> &ctx = state->condStack.top();
4066 if (ctx->sectionId!=
" ") sectionInfo.
sprintf(
" with label '%s' ",
qPrint(ctx->sectionId.stripWhiteSpace()));
4067 warn(ctx->fileName,ctx->lineNr,
"Conditional section{}does not have "
4068 "a corresponding \\endcond command within this file.",sectionInfo);
4069 state->condStack.pop();
4074 if (!state->levelGuard.empty())
4076 warn(state->fileName,state->yyLineNr,
"More #if's than #endif's found (might be in an included file).");
4083 std::string contents;
4091 bool startOfLine =
true;
4092 size_t content_size = output.size() +
4095 contents.reserve(content_size);
4097 while (pos<output.size())
4102 snprintf(lineNrStr,15,
"%05d ",line++);
4103 contents+=lineNrStr;
4105 contents += output[pos];
4106 startOfLine = output[pos]==
'\n';
4111 if (!contents.empty() && contents[contents.length()-1]!=
'\n')
4116 if (yyextra->contextDefines.size()>0)
4120 for (
auto &kv : yyextra->contextDefines)
4124 for (
auto &kv : yyextra->localDefines)
4138 for (
const auto &inc : state->includeRelations)
4140 auto toKind = [](
bool local,
bool imported) ->
IncludeKind
4156 if (inc->fromFileDef)
4158 inc->fromFileDef->addIncludeDependency(inc->toFileDef,inc->includeName,toKind(inc->local,inc->imported));
4160 if (inc->toFileDef && inc->fromFileDef)
4162 inc->toFileDef->addIncludedByDependency(inc->fromFileDef,inc->fromFileDef->docName(),toKind(inc->local,inc->imported));
Copyright (C) 1997-2015 by Dimitri van Heesch.
bool parse(const QCString &fileName, int lineNr, const QCString &expr)
Copyright (C) 1997-2015 by Dimitri van Heesch.
static StringUnorderedSet expandAsDefinedSet
static FileNameLinkedMap * inputNameLinkedMap
static DefinesPerFileList macroDefinitions
static FileNameLinkedMap * includeNameLinkedMap
Wrapper class for the Entry type.
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
std::string dirPath(bool absPath=true) const
std::string absFilePath() const
void processFile(const QCString &fileName, const std::string &input, std::string &output)
void addSearchDir(const QCString &dir)
std::unique_ptr< Private > p
int find(char c, int index=0, bool cs=TRUE) const
QCString & prepend(const char *s)
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
bool endsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
QCString & sprintf(const char *format,...)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Class representing a regular expression.
Class to iterate through matches.
std::string str() const
Return a string representing the matching part.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
#define Config_getList(name)
static FILE * findFile(const QCString &fileName)
DirIterator end(const DirIterator &) noexcept
#define AUTO_TRACE_ADD(...)
bool isAbsolutePath(const QCString &fileName)
static QCString stringize(const QCString &s)
static int getCurrentChar(yyscan_t yyscanner, const QCString &expr, QCString *rest, uint32_t pos)
static bool expandExpression(yyscan_t yyscanner, QCString &expr, QCString *rest, int pos, int level)
#define MAX_EXPANSION_DEPTH
static int getNextChar(yyscan_t yyscanner, const QCString &expr, QCString *rest, uint32_t &pos)
static QCString removeIdsAndMarkers(const QCString &s)
static void initPredefined(yyscan_t yyscanner, const QCString &fileName)
static void addSeparatorsIfNeeded(yyscan_t yyscanner, const QCString &expr, QCString &resultExpr, QCString &restExpr, int pos)
static int getNextId(const QCString &expr, int p, int *l)
static void returnCharToStream(yyscan_t yyscanner, char c)
static void addTillEndOfString(yyscan_t yyscanner, const QCString &expr, QCString *rest, uint32_t &pos, char term, QCString &arg)
static void forceEndCondSection(yyscan_t yyscanner)
static std::unique_ptr< FileState > checkAndOpenFile(yyscan_t yyscanner, const QCString &fileName, bool &alreadyProcessed)
static const char * processUntilMatchingTerminator(const char *inputStr, QCString &result)
Process string or character literal.
static void unputChar(yyscan_t yyscanner, const QCString &expr, QCString *rest, uint32_t &pos, char c)
static void processConcatOperators(QCString &expr)
static QCString removeMarkers(const QCString &s)
static bool replaceFunctionMacro(yyscan_t yyscanner, const QCString &expr, QCString *rest, int pos, int &len, const Define *def, QCString &result, int level)
static void skipCommentMacroName(yyscan_t yyscanner, const QCString &expr, QCString *rest, int &cc, uint32_t &j, int &len)
int qstrncmp(const char *str1, const char *str2, size_t len)
void addTerminalCharIfMissing(std::string &s, char c)
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
bool patternMatch(const FileInfo &fi, const StringVector &patList)
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
EntryType guessSection(const QCString &name)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)