20%option never-interactive
21%option case-insensitive
22%option prefix="vhdlcodeYY"
24%option extra-type="struct vhdlcodeYY_state *"
28#define YY_TYPEDEF_YY_SCANNER_T
35#include <unordered_set>
63#define YY_NO_UNISTD_H 1
67#define DBG_CTX(x) do { } while(0)
150#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
The common base class of all entity definitions found in the sources.
A model of a file symbol.
A model of a class/file/namespace member symbol.
Class representing a list of different code generators.
This is an alternative implementation of QCString.
Web server based search engine.
const Definition * searchCtx
int yyLineNr
current line number
std::vector< const Definition * > foldStack
std::unique_ptr< FileDef > exampleFileDef
const MemberDef * vhdlMember
TooltipManager tooltipManager
int lastCopyCommentContext
std::unordered_set< std::string > vhdlKeyDict
const Definition * currentDefinition
bool insideSpecialComment
int inputPosition
read offset during parsing
const FileDef * sourceFileDef
const MemberDef * currentMemberDef
const char * inputString
the code fragment as text
const char * currentFontClass
int inputLines
number of line in the code fragment
A bunch of utility functions.
static void generateMemLink(yyscan_t yyscanner, OutputCodeList &ol, QCString &clName, QCString &memberName)
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, const Definition *d, const QCString &text)
static void endCodeLine(yyscan_t yyscanner)
static void generateClassOrGlobalLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &clName, bool typeOnly=false, const QCString &curr_class=QCString())
static void appStringLower(QCString &qcs, const char *text)
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void codifyLines(yyscan_t yyscanner, const QCString &text, const QCString &cl=QCString(), bool classlink=false, bool comment=false)
static void writeWord(yyscan_t yyscanner, const QCString &word, const QCString &curr_class=QCString(), bool classLink=false)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static void addToSearchIndex(yyscan_t yyscanner, const QCString &text)
static const char * stateToString(int state)
static bool writeColoredWord(yyscan_t yyscanner, QCString &word)
static void generateFuncLink(yyscan_t yyscanner, OutputCodeList &ol, const MemberDef *mdef)
static void writeProcessProto(yyscan_t yyscanner)
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void codifyMapLines(yyscan_t yyscanner, const QCString &text)
static bool checkVhdlString(yyscan_t yyscanner, QCString &name)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
static const char * getLexerFILE()
static void writeFuncProto(yyscan_t yyscanner)
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
static void writeFont(yyscan_t yyscanner, const char *s, const QCString &text, bool specialComment=false)
162NAME [a-z_A-Z][ a-z_A-Z0-9]*
163FUNCNAME [a-z_A-Z"][a-z_A-Z0-9+*"/=<>-]*
164ID "$"?[a-z_A-Z][a-z_A-Z0-9]*
165SPECSIGN [:;, +*&\/=<>'\t]*
166DIGITSS [0-9]+|[0-9]+("#")*[0-9_a-fA-F\+\.\-]+("#")*
167ALLTYPESMAP {B}*[_a-zA-Z0-9. ]+{BN}*
168ALLTYPESMAP1 {BN}*[_a-zA-Z0-9.() ]+{BN}*
170ARCHITECTURE ^{B}*("architecture"){BN}+{FUNCNAME}{BN}+("of"){BN}+{FUNCNAME}{BN}+("is")
171PROCESS ({BN}*{FUNCNAME}{BN}*[:]+{BN}*("process"){BN}*[(]*)|[^a-zA-Z]("process "|"process("){BN}*[ (]*|[^a-zA-Z]("process"){BN}+
173END1 {B}*("end "){BN}+("if"|"case"|"loop"|"generate"|"for")
174END2 [^a-zA-Z_]("end"){BN}*[;]
175END3 {BN}*[^a-zA-Z]("end"){BN}+{FUNCNAME}{BN}*[;]
176END4 {B}*("end"){BN}+"function"{BN}+{FUNCNAME}{BN}*[;]
177ENDEFUNC {END3}|{END4}|{END2}
179KEYWORD ("of"|"new"|"event"|"break"|"case"|"end"|"loop"|"else"|"for"|"goto"|"if"|"return"|"generate"|"is"|"while"|"in")
180TYPEKW ^{B}*("type"|"subtype"|"constant"|"attribute"|"signal"|"variable","alias","configuration")
181FUNC ^{B}*("function"|"procedure"){BN}*{FUNCNAME}{BN}*("(")
183ARITHOP "+"|"-"|"/"|"*"|"%"|"/="|":="
184ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
185LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"
186BITOP "&"|"|"|"^"|"<<"|">>"|"~"
187OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
189PORT {B}*("port"){BN}*("(")
190GENERIC {B}*("generic"){BN}*("(")
197MAPCOMPONENT1 ({ALLTYPESMAP}[:]{ALLTYPESMAP}{TEXTT}*{BN}+("port"|"generic"){BN}+("map"){BN}*("("){1})
198MAPCOMPONENT2 {BN}*("port"|"generic"){BN}+("map"){BN}*("("){1}
199MAPCOMPONENT3 ({ALLTYPESMAP}[:]{BN}*{ALLTYPESMAP1}{TEXTT}*{BN}+("port"|"generic"){BN}+("map"){BN}*("("){1})
200MAPCOMPONENT4 ({ALLTYPESMAP}[:]{BN}*("entity"|"component"|"configuration"){BN}+{ALLTYPESMAP1}{TEXTT}*{BN}*("port"|"generic"){BN}*("map"){BN}*("("){1})
202XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFIG"|"CONFIG_MODE"|"COOL_CLK"|"DATA_GATE"|"DCI_VALUE"|"DISABLE"|"DRIVE"|"DROP_SPEC"|"ENABLE"|"FAST"|"FEEDBACK"|"FILE"|"FLOAT"|"FROM-THRU-TO"|"FROM-TO"|"HBLKNM"|"HU_SET"|"INREG"|"IOB"|"IOBDELAY"|"IOSTANDARD"|"KEEP"|"KEEPER"|"LOC"|"LOCATE"|"LOCK_PINS"|"MAP"|"MAXDELAY"|"MAXPT"|"MAXSKEW"|"NODELAY"|"NOREDUCE"|"OFFSET"|"OPEN_DRAIN"|"OPT_EFFORT"|"OPTIMIZE"|"PERIOD"|"PIN"|"PRIORITY"|"PROHIBIT"|"PULLDOWN"|"PULLUP"|"PWR_MODE"|"REG"|"RLOC"|"RLOC_ORIGIN"|"RLOC_RANGE"|"SAVE NET"|"FLAG"|"SYSTEM_JITTER"|"TEMPERATURE"|"TIMEGRP"|"TIMESPEC"|"VOLTAGE"
225 yyextra->braceCount++;
233 auto ql =
split(tt.str(),
"=>");
236 unsigned int index=0;
238 char cc=t1.at(index);
239 while (cc==
' ' || cc==
'\t')
244 yyextra->code->codify(c2);
246 if (index>=t1.size())
break;
255 while (index++<t1.size())
258 if (cc==
' ' || cc==
'\t')
263 yyextra->code->codify(c2);
271 while (cc==
' ' || cc==
'\t')
276 yyextra->code->codify(c2);
278 if (index>=t1.size())
break;
281 s2=s2.stripWhiteSpace();
286 while (index++<t1.size())
288 if (t1.at(index)==
' ')
290 yyextra->code->codify(
" ");
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
static void deleteAllChars(QCString &s, char c)
static void codifyLines(yyscan_t yyscanner, const QCString &text)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
307 yyextra->braceCount--;
309 if (yyextra->braceCount==0)
315<ParseFuncProto>{NAME} {
317 tmp=tmp.stripWhiteSpace();
319 yyextra->vhdlKeyDict.insert(yyextra->prevString.str());
static bool isNumber(const std::string &s)
342 yyextra->funcProto.append(yytext);
343 if (yyextra->isProto)
352 yyextra->funcProto.append(yytext);
353 if (yyextra->isProto)
360<ParseType>{ENDEFUNC} {
365 tt.stripWhiteSpace();
366 static const reg::Ex regg(R
"(\s+)");
367 auto ql =
split(tt.str(),regg);
Class representing a regular expression.
int findIndex(const StringVector &sv, const std::string &s)
find the index of a string in a vector of strings, returns -1 if the string could not be found
384 yyextra->vhdlKeyDict.clear();
387<ParseType>^{B}*("begin "|"begin") {
389 yyextra->isFuncProto=
false;
392<ParseType>{SPECSIGN} {
393 yyextra->funcProto.append(yytext);
394 if (yyextra->isProto)
400<ParseType>["_a-zA-Z0-9]* {
402 yyextra->funcProto.append(yytext);
405 if (yyextra->isFuncProto && yyextra->braceCount==0)
407 yyextra->vhdlKeyDict.insert(yyextra->prevString.str());
410 if (yyextra->isProto)
414 if (!yyextra->isFuncProto &&
415 yyextra->vhdlKeyDict.find(yyextra->prevString.str())==yyextra->vhdlKeyDict.end())
417 val=val.stripWhiteSpace();
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
438<ParseType>{BRACEOPEN} {
439 yyextra->braceCount++;
440 yyextra->funcProto+=
'(';
441 if (yyextra->isProto)
448<ParseType>{BRACECLOSE} {
449 yyextra->braceCount--;
450 yyextra->funcProto+=
')';
451 if (yyextra->isProto)
455 if (yyextra->braceCount==0 && !yyextra->isProto)
457 yyextra->isProto=
true;
462 if (yyextra->isPackageBody)
469<ClassesName>{FUNCNAME} {
471 yyextra->currClass.clear();
472 yyextra->currClass.append(yytext);
473 yyextra->currClass=yyextra->currClass.stripWhiteSpace();
static void generateClassOrGlobalLink(yyscan_t yyscanner, OutputCodeList &ol, const QCString &clName, bool typeOnly=FALSE, bool varOnly=FALSE)
480<ParseComponent>{BRACEOPEN} {
481 yyextra->braceCount++;
482 yyextra->code->codify(yytext);
486<ParseComponent>{BRACECLOSE} {
487 yyextra->braceCount--;
488 yyextra->code->codify(yytext);
489 if (yyextra->braceCount==0 && !yyextra->isComponent)
491 yyextra->tempComp.clear();
496 BEGIN(ParseComponent);
500<ParseComponent>{B}*"-" {
501 if (strlen(yytext)>=2)
511<ParseComponent>{SPECSIGN} {
517<ParseComponent>"\n"|" " {
521<ParseComponent>{DIGITSS} {
527<ParseComponent>{PORT} {
529 yyextra->braceCount=1;
530 yyextra->isComponent=
false;
533<ParseComponent>{GENERIC} {
535 yyextra->braceCount=1;
538<ParseComponent>[_a-zA_Z][_a-zA-Z0-9]* {
550<ParseComponent>{STRING} {
559<ParseProcessProto>[^()]* {
560 yyextra->funcProto.append(yytext);
565<ParseProcessProto>{BRACEOPEN} {
566 yyextra->funcProto.append(yytext);
567 yyextra->braceCount++;
570<ParseProcessProto>{BRACECLOSE} {
571 yyextra->funcProto.append(yytext);
572 yyextra->braceCount--;
573 if (yyextra->braceCount==0)
580<ParsePackage>[^:;]* {
584 std::string s1=strl[0];
585 std::string s2=strl[1];
586 std::string s3=strl[2];
589 codifyLines(yyscanner,s1.c_str(),yyextra->currClass);
603 writeFont(yyscanner,
"keywordflow",yytext);
A abstract class representing of a compound symbol.
QCString & append(char c)
QCString & insert(size_t index, const QCString &s)
static ClassDef * getPackageName(const QCString &name)
std::vector< std::string > StringVector
608<Bases>{MAPCOMPONENT1}|{MAPCOMPONENT2}|{MAPCOMPONENT3}|{MAPCOMPONENT4} {
616 tt=tt.right(tt.length()-j-1);
620 j=left.
find(
'(',
false);
625 yyextra->PortMapComp=name;
632 tt.stripPrefix(left);
634 yyextra->PortMapComp=left;
641 if (tt.contains(
':',
false))
650 yyextra->braceCount=1;
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.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString right(size_t len) const
QCString left(size_t len) const
static QCString getIndexWord(const QCString &, int index)
654<Bases>^{B}*("component"){BN}+{FUNCNAME} {
659 yyextra->tempComp=temp;
661 yyextra->braceCount=0;
662 yyextra->isComponent=
true;
663 BEGIN(ParseComponent);
668<Bases>{ARCHITECTURE} {
669 yyextra->PortMapComp.clear();
671 yyextra->currArch =
true;
674 yyextra->currClass=temp;
677 yyextra->isPackageBody=
false;
681<Bases>^{B}*("package "){BN}*("body"){BN}*{FUNCNAME} {
685 std::string ll=ql[0];
686 codifyLines(yyscanner,ll.c_str(),yyextra->currClass);
690 yyextra->currClass.clear();
691 yyextra->currClass=temp;
692 yyextra->isProto=
false;
693 yyextra->isPackageBody=
true;
QCString & prepend(const char *s)
const std::string & str() const
697 yyextra->isFuncProto=
true;
698 yyextra->funcProto.clear();
699 yyextra->funcProto.append(yytext);
700 yyextra->vhdlKeyDict.clear();
702 if (yyextra->prevString.contains(
'('))
704 yyextra->braceCount=1;
705 BEGIN(ParseProcessProto);
713<Bases>("end"){BN}+("process") {
714 yyextra->isFuncProto=
false;
720<Bases>^{B}*("begin "|"begin") {
721 yyextra->isFuncProto=
false;
722 writeFont(yyscanner,
"vhdlkeyword",yytext);
725<Bases>^{B}*("use"|"library"){BN}+ {
726 writeFont(yyscanner,
"vhdlkeyword",yytext);
731<Bases>^{B}*("use"){BN}+("configuration")[^\n]* {
736 yyextra->vhdlKeyDict.clear();
737 yyextra->funcProto.clear();
738 yyextra->isProto=
false;
739 yyextra->funcProto.append(yytext);
740 yyextra->braceCount=1;
744<Bases>^{B}*("entity"|"package"){BN}+ {
746 writeFont(yyscanner,
"keywordflow",yytext);
747 yyextra->isPackageBody=
false;
751<Bases>"end"{BN}+"architecture"{BN}+{FUNCNAME} {
752 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
753 yyextra->currArch =
false;
755<Bases>"end"{BN}+{FUNCNAME} {
756 if (yyextra->currArch)
758 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
759 yyextra->currArch =
false;
793 yyextra->code->codify(yytext);
812<Bases,ParseComponent>{DIGITSS} {
818<Bases>^{B}*("use"){BN}+("entity"|"component")[^\n]* {
819 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
825 if (yyextra->isFuncProto)
827 BEGIN(ParseFuncProto);
837 yyextra->code->codify(yytext);
841<Bases>","|"."|":"|"'"|"("|")" {
843 yyextra->code->codify(yytext);
862<Bases>{B}*"#"[^\n]* {
866<Bases>^{B}*{XILINX}/[^a-zA-Z0-9_] {
871<Bases>^{B}*"set_"[^\n]* {
881 yyextra->code->codify(yytext);
884 yyextra->code->codify(yytext);
888<*>\n?"--!"[^\n]*/\n{B}*"--!" {
889 if (YY_START!=CopyComment)
892 yyextra->lastCopyCommentContext=YY_START;
899 int i=text.
find(
"--");
900 bool isSpecialComment = i!=-1 && yytext[i+2]==
'!';
901 if (isSpecialComment && YY_START!=CopyComment)
906 if (isSpecialComment)
910 if (YY_START==CopyComment)
912 BEGIN(yyextra->lastCopyCommentContext);
917 int i=text.
find(
"--");
918 bool isSpecialComment = i!=-1 && yytext[i+2]==
'!';
919 if (isSpecialComment)
924 if (isSpecialComment)
937 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
938 int inputPosition = yyextra->inputPosition;
939 const char *s = yyextra->inputString + inputPosition;
941 while( c < max_size && *s)
946 yyextra->inputPosition += c;
952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
955 if (yyextra->searchCtx)
968 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
969 if (name.
isEmpty())
return false;
972 if (len>2 && name.
at(0)==
'"' && name.
at(len-1)==
'"')
974 std::string inside = name.
str().substr(1,len-2);
975 static const reg::Ex regg(R
"(\s+)");
976 auto qrl=
split(inside,regg);
979 yyextra->code->codify(
"\"");
981 yyextra->code->codify(inside.c_str());
983 yyextra->code->codify(
"\"");
988 yyextra->code->codify(name);
997 yyextra->code->codify(name);
1017 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1018 while (!yyextra->foldStack.empty())
1020 const Definition *dd = yyextra->foldStack.back();
1023 yyextra->code->endFold();
1025 yyextra->foldStack.pop_back();
1036 if (endLine!=-1 && startLine!=endLine && (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
1039 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
1040 yyextra->foldStack.push_back(d);
1052 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1054 if (yyextra->sourceFileDef)
1061 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
1063 if (!yyextra->includeCodeFragment && d)
1065 yyextra->currentDefinition = d;
1066 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
1067 if (!yyextra->tempComp.isEmpty() && yyextra->currentMemberDef )
1070 QCString nn=yyextra->currentMemberDef->name();
1074 yyextra->currentMemberDef=mdeff;
1079 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
1080 if (yyextra->currentMemberDef)
1083 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
1084 yyextra->currentMemberDef->getOutputFileBase(),
1085 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
1086 !yyextra->includeCodeFragment);
1095 !yyextra->includeCodeFragment);
1107 !yyextra->includeCodeFragment);
1110 yyextra->code->startCodeLine(yyextra->yyLineNr);
1111 yyextra->insideCodeLine=
true;
1112 if (yyextra->currentFontClass)
1114 yyextra->code->startFontClass(yyextra->currentFontClass);
1120 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1122 yyextra->code->endCodeLine();
1123 yyextra->insideCodeLine=
false;
1128 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1129 if (yyextra->insideCodeLine)
1133 const char *fc = yyextra->currentFontClass;
1134 if (yyextra->yyLineNr<yyextra->inputLines)
1136 yyextra->currentFontClass = fc;
1148 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1154 for (
unsigned int j=0;j<ttt.
length();j++)
1157 if (c==
' '|| c==
',' || c==
';' || c==
':' || c==
'(' || c==
')' || c==
'\r' || c==
'\t' || c==
'.')
1181 yyextra->code->codify(temp);
1192 yyextra->code->codify(cc);
1222 yyextra->code->codify(temp);
1227 yyextra->code->codify(temp);
1240 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1243 const char *p=text.
data(),*sp=p;
1249 while ((c=*p++) && c!=
'\n') {}
1252 yyextra->yyLineNr++;
1254 line = line.
left((
int)(p-sp)-1);
1288 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1291 yyextra->tooltipManager.addTooltip(d);
1296 if (!sourceTooltips)
1301 const char *p=text.
data();
1306 while ((c=*p++) && c!=
'\n') {}
1309 yyextra->yyLineNr++;
1342 if (memberName.
isEmpty())
return;
1382 if (className.
isEmpty())
return;
1389 if (!cd && !curr_class.
isEmpty())
1435 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1436 const char *p=yyextra->inputString;
1442 if (c==
'\n') count++;
1444 if (p>yyextra->inputString && *(p-1)!=
'\n')
1454 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1457 if (yyextra->currentFontClass)
1459 yyextra->code->endFontClass();
1460 yyextra->currentFontClass=0;
1462 if (specialComment && yyextra->insideSpecialComment)
1464 yyextra->code->endSpecialComment();
1465 yyextra->insideSpecialComment=
false;
1471 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1472 if (s==
nullptr)
return;
1477 yyextra->code->startSpecialComment();
1478 yyextra->insideSpecialComment =
true;
1480 if (
qstrcmp(yyextra->currentFontClass,s)!=0)
1483 yyextra->code->startFontClass(s);
1484 yyextra->currentFontClass=s;
1490 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1491 if (s==
nullptr || text.
isEmpty())
return;
1494 yyextra->code->codify(text);
1510 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1517 const char *p=text.
data();
1523 while ((c=*p++) && c!=
'\n' && c!=
':' && c !=
' ' && c !=
'(' && c!=
'\0' && c!=
'\t')
1528 if (c==
'\0')
return;
1529 if (!temp.
isEmpty()) wordCounter++;
1537 if (wordCounter==2 || wordCounter==3)
1540 if (q==
"entity" || q==
"component" || q==
"configuration" || q==
"port" || q==
"generic")
1546 yyextra->PortMapComp=temp;
1568 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1574 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1580 yyextra->funcProto.stripPrefix(temp);
1582 temp=yyextra->currClass;
1583 if (yyextra->isPackageBody)
1592 yyextra->funcProto.stripPrefix(name);
1593 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1597 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1605 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1606 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1607 yyextra->vhdlKeyDict.clear();
1634 vhdlcodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1643 vhdlcodeYYlex_destroy(
p->yyscanner);
1648 p->state.vhdlKeyDict.clear();
1655 bool stripCodeComments,
1661 bool inlineFragment,
1668 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1672 yyextra->fileName = fd ? fd->
fileName():
"";
1676 if (dd) yyextra->currClass=dd->
name();
1680 yyextra->code = &od;
1681 yyextra->inputString = s.
data();
1682 yyextra->inputPosition = 0;
1683 yyextra->currentFontClass =
nullptr;
1684 yyextra->insideCodeLine =
false;
1685 yyextra->searchCtx = searchCtx;
1686 yyextra->foldStack.clear();
1687 yyextra->insideSpecialComment =
false;
1690 yyextra->yyLineNr = startLine;
1692 yyextra->yyLineNr = 1;
1695 yyextra->inputLines = endLine+1;
1697 yyextra->inputLines = yyextra->yyLineNr +
countLines(yyscanner) - 1;
1701 yyextra->exampleBlock = exBlock;
1702 yyextra->exampleName = exName;
1703 yyextra->sourceFileDef = fd;
1704 if (exBlock && fd==
nullptr)
1708 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1710 if (yyextra->sourceFileDef)
1714 yyextra->currentDefinition =
nullptr;
1715 yyextra->currentMemberDef =
nullptr;
1716 yyextra->vhdlMember =
nullptr;
1717 if (!yyextra->exampleName.isEmpty())
1721 yyextra->includeCodeFragment = inlineFragment;
1723 if (!yyextra->lexInit)
1726 yyextra->lexInit=
true;
1728 vhdlcodeYYrestart(
nullptr, yyscanner );
1730 vhdlcodeYYlex(yyscanner);
1731 if (yyextra->insideCodeLine)
1737 while (!yyextra->foldStack.empty())
1739 yyextra->code->endFold();
1740 yyextra->foldStack.pop_back();
1743 if (yyextra->exampleFileDef)
1746 yyextra->exampleFileDef.reset();
1747 yyextra->sourceFileDef =
nullptr;
1751 yyextra->tooltipManager.writeTooltips(od);
1754#include "vhdlcode.l.h"
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
static bool isFlagSet(const DebugMask mask)
virtual int getEndBodyLine() const =0
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual QCString briefDescriptionAsTooltip() const =0
virtual bool isLinkableInProject() const =0
virtual int getStartDefLine() const =0
virtual QCString getReference() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual const QCString & name() const =0
static SearchIndexIntf searchIndex
virtual QCString fileName() const =0
virtual const ClassDef * getClassDef() const =0
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip)
void stripCodeComments(bool b)
void fill(char c, int len=-1)
Fills a string with a predefined character.
char & at(size_t i)
Returns a reference to the character at index i.
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.
bool stripPrefix(const QCString &prefix)
void parseCode(OutputCodeList &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE) override
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
void resetCodeParserState() override
Resets the state of the code parser.
~VHDLCodeParser() override
std::unique_ptr< Private > p
static const MemberDef * findFunction(const QCString &name, const QCString &package)
static void parseFuncProto(const QCString &text, QCString &name, QCString &ret, bool doc=false)
static ClassDef * getClass(const QCString &name)
static const MemberDef * findMember(const QCString &className, const QCString &memName)
static const char * findKeyWord(const QCString &word)
ClassDef * getClass(const QCString &n)
ClassDef * toClassDef(Definition *d)
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, const Definition *d, const QCString &text)
static void endCodeLine(yyscan_t yyscanner)
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static void addToSearchIndex(yyscan_t yyscanner, const QCString &text)
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
static void codeFolding(yyscan_t yyscanner, const Definition *d)
#define Config_getBool(name)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
const char * qPrint(const char *s)
int qstrcmp(const char *str1, const char *str2)
SrcLangExt
Language as given by extension.
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)