15%option never-interactive
16%option prefix="lexscannerYY"
18%option extra-type="struct lexscannerYY_state *"
24#define YY_TYPEDEF_YY_SCANNER_T
53#define YY_NO_UNISTD_H 1
55#define repeatChar(chr, cnt) std::string(cnt, chr).c_str()
101#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
C-like language parser using state-based lexical scanning.
Clang parser object for a single translation unit, which consists of a source file and the directly o...
This is an alternative implementation of QCString.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static const char * stateToString(int state)
static void handleCCode(yyscan_t yyscanner)
static const char * getLexerFILE()
int lastPreLineCtrlContext
ClangTUParser * clangParser
std::shared_ptr< Entry > current
std::shared_ptr< Entry > current_root
COutlineParser cOutlineParser
SrcLangExt
Language as given by extension.
A bunch of utility functions.
119RulesSharp "<"[^>\n]*">"
120RulesCurly "{"[^{}\n]*"}"
125EscapeRulesCharOpen "\\["|"\<"|"\\{"|"\\("|"\\\""|"\\ "|"\\\\"
126EscapeRulesCharClose "\\]"|"\>"|"\\}"|"\\)"
127EscapeRulesChar {EscapeRulesCharOpen}|{EscapeRulesCharClose}
134ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
137RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
138RAWEND ")"[^ \t\(\)\\]{0,16}\"
139CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
150DCOMM ("/\*!"|"/\**"|"/\/!"|"/\/\/")
191<DefSection>{Option} {
194<Option>"prefix"{ws}*"="{ws}* {
197<OptPrefix>"\""[^\"]*"\"" {
198 yyextra->prefix = yytext;
199 yyextra->prefix = yyextra->prefix.mid(1,yyleng-2);
203 yyextra-> reentrant =
true;
205<Option>"bison-bridge" {
206 yyextra-> bison_bridge =
true;
208<Option>"bison-locations" {
209 yyextra-> bison_bridge =
true;
210 yyextra-> bison_locations =
true;
215 yyextra->cCodeBuffer += yytext;
218<DefSection>^{RulesStart} {
221 yyextra->cCodeBuffer +=
"int " + yyextra->prefix +
"lex (";
222 if (yyextra->bison_bridge )
224 if (fill) yyextra->cCodeBuffer +=
",";
225 yyextra->cCodeBuffer +=
"YYSTYPE * yylval_param";
228 if (yyextra->bison_locations)
230 if (fill) yyextra->cCodeBuffer +=
",";
231 yyextra->cCodeBuffer +=
"YYLTYPE * yylloc_param";
234 if (yyextra->reentrant)
236 if (fill) yyextra->cCodeBuffer +=
",";
237 yyextra->cCodeBuffer +=
"yyscan_t yyscanner";
240 if (!yyextra->bison_bridge && !yyextra->bison_locations && !yyextra->reentrant)
242 yyextra->cCodeBuffer +=
"void";
244 yyextra->cCodeBuffer +=
") {\n";
246 BEGIN (RulesSectionInit);
248<DefSection>^{TopStart} {
249 yyextra->cCodeBuffer +=
"\n";
250 yyextra->lastContext = YY_START;
253<DefSection>^{LiteralStart} {
254 yyextra->cCodeBuffer +=
"\n";
255 yyextra->lastContext = YY_START;
256 BEGIN (LiteralSection);
258<TopSection>^{TopEnd} {
259 yyextra->cCodeBuffer +=
"\n";
260 BEGIN( yyextra->lastContext ) ;
263 yyextra->cCodeBuffer += yytext;
265<LiteralSection>^{LiteralEnd} {
266 yyextra->cCodeBuffer +=
"\n";
267 BEGIN( yyextra->lastContext ) ;
269<LiteralSection>.*{nl} {
270 yyextra->cCodeBuffer += yytext;
273 BEGIN(DefSectionLine);
275<DefSection>{CPPC}.*{nl} {
276 yyextra->cCodeBuffer += yytext;
278<DefSection>^{ws}*{CCS} {
279 yyextra->cCodeBuffer += yytext;
280 yyextra->lastContext = YY_START;
283<COMMENT>{CCE}{ws}*{nl} {
284 yyextra->cCodeBuffer+=yytext;
285 BEGIN(yyextra->lastContext);
288 yyextra->cCodeBuffer+=yytext;
289 BEGIN(yyextra->lastContext);
292 yyextra->cCodeBuffer += yytext;
294<COMMENT>{CPPC}|{CCS} {
295 yyextra->cCodeBuffer += yytext;
298 yyextra->cCodeBuffer += yytext;
301 yyextra->cCodeBuffer += yytext;
304 yyextra->cCodeBuffer +=
"\n";
306<DefSection>^{ws}.*{nl} {
307 yyextra->cCodeBuffer += yytext;
309<DefSectionLine>.*{nl} {
310 yyextra->cCodeBuffer +=
"\n";
313<RulesSectionInit,RulesPattern>^{RulesEnd} {
314 yyextra->cCodeBuffer +=
"}\n";
317<RulesSectionInit>^{nws} {
321<RulesSectionInit>^{ws}.*{nl} {
322 yyextra->cCodeBuffer += yytext;
324<RulesSectionInit>^{nl} {
325 yyextra->cCodeBuffer += yytext;
327<RulesPattern>"<<EOF>>" {
328 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
#define repeatChar(chr, cnt)
330<RulesPattern>{EscapeRulesChar} {
331 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
333<RulesPattern>{RulesSharp} {
334 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
336<RulesPattern>{RulesCurly} {
337 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
339<RulesPattern>{StartDouble} {
340 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
341 yyextra->lastContext = YY_START;
344<RulesDouble,RulesRoundDouble>"\\\\" {
345 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
347<RulesDouble,RulesRoundDouble>"\\\"" {
348 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
351 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
352 BEGIN( yyextra->lastContext ) ;
354<RulesRoundDouble>"\"" {
355 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
358<RulesDouble,RulesRoundDouble>. {
359 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
361<RulesPattern>{StartSquare} {
362 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
363 yyextra->lastContext = YY_START;
366<RulesSquare,RulesRoundSquare>{CHARCE} {
367 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
369<RulesSquare,RulesRoundSquare>"\\[" |
370<RulesSquare,RulesRoundSquare>"\\]" {
371 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
374 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
377<RulesRoundSquare>"]" {
378 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
381<RulesSquare,RulesRoundSquare>"\\\\" {
382 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
384<RulesSquare,RulesRoundSquare>. {
385 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
387<RulesPattern>{StartRoundQuest} {
388 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
389 yyextra->lastContext = YY_START;
390 BEGIN(RulesRoundQuest);
392<RulesRoundQuest>{nl} {
393 yyextra->cCodeBuffer +=
"\n";
395<RulesRoundQuest>[^)] {
396 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
398<RulesRoundQuest>")" {
399 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
400 BEGIN(yyextra->lastContext);
402<RulesPattern>{StartRound} {
403 yyextra->roundCount++;
404 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
405 yyextra->lastContext = YY_START;
408<RulesRound>{RulesCurly} {
409 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
411<RulesRound>{StartSquare} {
412 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
413 BEGIN(RulesRoundSquare);
415<RulesRound>{StartDouble} {
416 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
417 BEGIN(RulesRoundDouble);
419<RulesRound>{EscapeRulesChar} {
420 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
423 yyextra->roundCount++;
424 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
427 yyextra->roundCount--;
428 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
429 if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
432 yyextra->cCodeBuffer +=
"\n";
435 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
438 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
440<RulesPattern>{ws}+"|" {
441 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
442 yyextra->curlyCount = 0;
445<RulesPattern>^{ws}*{nl} {
446 yyextra->cCodeBuffer +=
"\n";
448<RulesPattern>^{ws}+ {
451<RulesPattern>({ws}|{nl}) {
453 yyextra->curlyCount = 0;
456<RulesPattern>"\\\\" {
457 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
460 yyextra->cCodeBuffer += yytext;
461 yyextra->lastContext = YY_START;
465 yyextra->cCodeBuffer +=
repeatChar(
' ', yyleng);
467<SkipCurly>{B}*"#"{B}+[0-9]+{B}+/"\"" {
468 yyextra->cCodeBuffer += yytext;
469 yyextra->lastPreLineCtrlContext = YY_START;
470 BEGIN( PreLineCtrl );
472<PreLineCtrl>"\""[^\n\"]*"\"" {
473 yyextra->cCodeBuffer += yytext;
476 yyextra->cCodeBuffer += yytext;
479 yyextra->cCodeBuffer += yytext;
480 BEGIN( yyextra->lastPreLineCtrlContext );
483 yyextra->cCodeBuffer += yytext;
484 ++yyextra->curlyCount ;
486<SkipCurly>"}"/{BN}*{DCOMM}"<!--" |
488 yyextra->cCodeBuffer += yytext;
489 if( yyextra->curlyCount )
491 --yyextra->curlyCount ;
494<SkipCurly>"}"{BN}*{DCOMM}"<" {
495 yyextra->cCodeBuffer += yytext;
496 if ( yyextra->curlyCount )
498 --yyextra->curlyCount ;
502 yyextra->docBlockContext = SkipCurlyEndDoc;
503 if (yytext[yyleng-3]==
'/')
514 yyextra->cCodeBuffer += yytext;
515 yyextra->lastStringContext=SkipCurly;
519 yyextra->cCodeBuffer += yytext;
520 yyextra->lastPreLineCtrlContext = YY_START;
521 BEGIN( PreLineCtrl );
523<SkipCurly>{B}*{RAWBEGIN} {
525 yyextra->delimiter = raw.
mid(2);
526 yyextra->delimiter=yyextra->delimiter.
left(yyextra->delimiter.length()-1);
527 yyextra->lastRawStringContext = YY_START;
528 yyextra->cCodeBuffer += yytext;
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
QCString left(size_t len) const
531<SkipCurly>[^\n#"'@\\/{}<]+ {
532 yyextra->cCodeBuffer += yytext;
535 yyextra->cCodeBuffer += yytext;
536 yyextra->lastCContext = YY_START;
540 yyextra->cCodeBuffer += yytext;
541 yyextra->lastCContext = YY_START;
542 BEGIN(SkipCxxComment);
544<SkipCurly>{CHARLIT} {
545 yyextra->cCodeBuffer += yytext;
548 yyextra->cCodeBuffer += yytext;
551 yyextra->cCodeBuffer += yytext;
553<SkipCurly>({CPPC}{B}*)?{CCS}"!" {
554 yyextra->cCodeBuffer += yytext;
555 yyextra->docBlockContext = YY_START;
558<SkipCurly>{CCS}"*"[*]+{BL} {
560 yyextra->cCodeBuffer += yytext;
563 yyextra->docBlockContext = YY_START;
#define Config_getBool(name)
571<SkipCurly>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
572 yyextra->cCodeBuffer += yytext;
573 yyextra->docBlockContext = YY_START;
576<SkipCurly>{CPPC}"!" {
577 yyextra->cCodeBuffer += yytext;
578 yyextra->docBlockContext = YY_START;
581<SkipCurly>{CPPC}"/"/[^/] {
582 yyextra->cCodeBuffer += yytext;
583 yyextra->docBlockContext = YY_START;
588 yyextra->cCodeBuffer += yytext;
589 if (yyextra->curlyCount<=0)
595 yyextra->cCodeBuffer += yytext;
598 yyextra->cCodeBuffer += yytext;
599 BEGIN( yyextra->lastStringContext );
601<SkipString>{CCS}|{CCE}|{CPPC} {
602 yyextra->cCodeBuffer += yytext;
605 yyextra->cCodeBuffer += yytext;
608 yyextra->cCodeBuffer += yytext;
610<SkipCxxComment>.*"\\\n" {
611 yyextra->cCodeBuffer += yytext;
613<SkipCxxComment>{ANYopt}/\n {
614 yyextra->cCodeBuffer += yytext;
615 BEGIN( yyextra->lastCContext ) ;
618 yyextra->cCodeBuffer += yytext ;
620<Comment>{CCS} { yyextra->cCodeBuffer += yytext ; }
621<Comment>{CPPC} { yyextra->cCodeBuffer += yytext ; }
622<Comment>{CMD}("code"|"verbatim"|"iliteral") {
623 yyextra->insideCode=
TRUE;
624 yyextra->cCodeBuffer += yytext ;
626<Comment>{CMD}("endcode"|"endverbatim"|"endiliteral") {
627 yyextra->insideCode=
FALSE;
628 yyextra->cCodeBuffer += yytext ;
630<Comment>[^ \.\t\r\n\/\*]+ { yyextra->cCodeBuffer += yytext ; }
631<Comment>{CCE} { yyextra->cCodeBuffer += yytext ;
632 if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
634<Comment>. { yyextra->cCodeBuffer += *yytext ; }
636<SkipComment>{CPPC}|{CCS} {
637 yyextra->cCodeBuffer += yytext;
639<SkipComment>[^\*\n]+ {
640 yyextra->cCodeBuffer += yytext;
643 yyextra->cCodeBuffer += yytext;
645<SkipComment>{B}*{CCE} {
646 yyextra->cCodeBuffer += yytext;
647 BEGIN( yyextra->lastCContext );
650 yyextra->cCodeBuffer += yytext;
653 yyextra->cCodeBuffer += yytext;
655 delimiter=delimiter.
left(delimiter.
length()-1);
656 if (delimiter==yyextra->delimiter)
658 BEGIN(yyextra->lastRawStringContext);
size_t length() const
Returns the length of the string, not counting the 0-terminator.
662 yyextra->cCodeBuffer += yytext;
665 yyextra->cCodeBuffer += yytext;
668 yyextra->cCodeBuffer += yytext;
673<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? {
674 yyextra->cCodeBuffer += yytext;
676<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" {
677 yyextra->cCodeBuffer += yytext;
678 BEGIN( yyextra->docBlockContext );
680<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" {
681 yyextra->cCodeBuffer += yytext;
682 BEGIN( yyextra->docBlockContext );
684<DocLine>{NONLopt}/"\n" {
685 yyextra->cCodeBuffer += yytext;
686 BEGIN( yyextra->docBlockContext );
692 yyextra->cCodeBuffer += yytext;
693 BEGIN(yyextra->docBlockContext);
695<DocBlock>^{B}*"*"+/[^/] {
696 yyextra->cCodeBuffer += yytext;
698<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] {
699 yyextra->cCodeBuffer += yytext;
701<DocBlock>^{B}*({CPPC}){B}* {
702 yyextra->cCodeBuffer += yytext;
705 yyextra->cCodeBuffer += yytext;
709 yyextra->cCodeBuffer += yytext;
711<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] {
712 yyextra->cCodeBuffer += yytext;
714<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
715 yyextra->cCodeBuffer += yytext;
716 yyextra->docBlockName=&yytext[1];
717 if (yyextra->docBlockName.at(1)==
'[')
719 yyextra->docBlockName.at(1)=
']';
721 if (yyextra->docBlockName.at(1)==
'{')
723 yyextra->docBlockName.at(1)=
'}';
725 if (yyextra->docBlockName.at(1)==
'(')
727 yyextra->docBlockName.at(1)=
')';
729 yyextra->fencedSize=0;
730 yyextra->nestedComment=
FALSE;
733<DocBlock>{B}*"<"{PRE}">" {
734 yyextra->cCodeBuffer += yytext;
735 yyextra->docBlockName=
"<pre>";
736 yyextra->fencedSize=0;
737 yyextra->nestedComment=
FALSE;
740<DocBlock>{CMD}"startuml"/[^a-z_A-Z0-9\-] {
741 yyextra->cCodeBuffer += yytext;
742 yyextra->docBlockName=
"uml";
743 yyextra->fencedSize=0;
744 yyextra->nestedComment=
FALSE;
747<DocBlock>{CMD}("verbatim"|"iliteral"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"msc"|"code")/[^a-z_A-Z0-9\-] {
748 yyextra->cCodeBuffer += yytext;
749 yyextra->docBlockName=&yytext[1];
750 yyextra->fencedSize=0;
751 yyextra->nestedComment=
FALSE;
754<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
755 yyextra->cCodeBuffer += yytext;
757 yyextra->docBlockName=
"~~~";
759 yyextra->nestedComment=
FALSE;
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
762<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
763 yyextra->cCodeBuffer += yytext;
765 yyextra->docBlockName=
"```";
767 yyextra->nestedComment=
FALSE;
770<DocBlock>{B}*"<code>" {
773<DocBlock>[^@*~\/\\\n]+ {
774 yyextra->cCodeBuffer += yytext;
777 yyextra->cCodeBuffer += yytext;
780 yyextra->cCodeBuffer += yytext;
784<DocCopyBlock>"</"{PRE}">" {
785 yyextra->cCodeBuffer += yytext;
786 if (yyextra->docBlockName==
"<pre>")
791<DocCopyBlock>"</"{CODE}">" {
792 yyextra->cCodeBuffer += yytext;
793 if (yyextra->docBlockName==
"<code>")
798<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
799 yyextra->cCodeBuffer += yytext;
800 if (yyextra->docBlockName==&yytext[1])
805<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] {
806 yyextra->cCodeBuffer += yytext;
807 if (yyextra->docBlockName==&yytext[4])
812<DocCopyBlock>^{B}*"*"+/{BN}+ {
813 yyextra->cCodeBuffer += yytext;
814 if ((yyextra->docBlockName==
"verbatim") || (yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
820 yyextra->cCodeBuffer += yytext;
823<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* {
824 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
826 yyextra->cCodeBuffer += yytext;
833<DocCopyBlock>^{B}*"*"+/({ID}|"(") {
834 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
836 yyextra->cCodeBuffer += yytext;
843<DocCopyBlock>^{B}*"*"+/{BN}* {
844 if ((yyextra->docBlockName==
"code") || (yyextra->docBlockName==
"iliteral"))
846 if (yyextra->nestedComment)
848 yyextra->cCodeBuffer += yytext;
852 yyextra->cCodeBuffer += yytext;
860<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
861 yyextra->cCodeBuffer += yytext;
868<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
869 yyextra->cCodeBuffer += yytext;
876<DocCopyBlock>[^<@/\*\]~\$\\\n]+ {
877 yyextra->cCodeBuffer += yytext;
879<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
882 yyextra->nestedComment=
TRUE;
884 else if (yytext[0]==
'*')
886 yyextra->nestedComment=
FALSE;
888 yyextra->cCodeBuffer += yytext;
891 yyextra->cCodeBuffer += yytext;
894 yyextra->cCodeBuffer += yytext;
896<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" {
897 yyextra->docBlockContext = SkipCurlyEndDoc;
898 yyextra->cCodeBuffer += yytext;
899 if (yytext[yyleng-3]==
'/')
908<SkipCurlyEndDoc>"}" {
909 yyextra->cCodeBuffer += yytext;
914 yyextra->cCodeBuffer += yytext;
static void handleCCode(yyscan_t yyscanner)
931 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
933 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
935 *buf = yyextra->inputString[yyextra->inputPosition++] ;
947 const std::shared_ptr<Entry> &rt,
950 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
952 yyextra->inputString = fileBuf;
953 yyextra->inputPosition = 0;
954 lexscannerYYrestart(0,yyscanner);
956 yyextra->current_root = rt;
957 yyextra->fileName = fileName;
958 yyextra->clangParser = clangParser;
960 rt->lang = yyextra->language;
961 msg(
"Parsing file %s...\n",
qPrint(yyextra->fileName));
963 yyextra->current_root = rt;
964 yyextra->current = std::make_shared<Entry>();
968 yyextra->current->name = yyextra->fileName;
969 yyextra->current->section =
EntryType(sec);
970 yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
972 yyextra->current->reset();
975 lexscannerYYlex(yyscanner);
977 rt->program.str(std::string());
985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
987 if (yyextra->cCodeBuffer.isEmpty())
return;
988 yyextra->cOutlineParser.parseInput(yyextra->fileName,
989 yyextra->cCodeBuffer.data(),
990 yyextra->current_root,
991 yyextra->clangParser);
992 yyextra->cCodeBuffer.clear();
1005 lexscannerYYlex_init_extra(&
p->state,&
p->yyscanner);
1013 lexscannerYYlex_destroy(
p->yyscanner);
1017 const char *fileBuf,
1018 const std::shared_ptr<Entry> &root,
1021 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
1023 yyextra->fileName = fileName;
1026 ::parseMain(
p->yyscanner,fileName,fileBuf,root,clangParser);
1032#include "lexscanner.l.h"
static bool isFlagSet(const DebugMask mask)
Wrapper class for the Entry type.
~LexOutlineParser() override
std::unique_ptr< Private > p
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.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static void parseMain(yyscan_t yyscanner, const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, FortranFormat format)
void msg(const char *fmt,...)
const char * qPrint(const char *s)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
EntryType guessSection(const QCString &name)