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>
64#define YY_NO_UNISTD_H 1
68#define DBG_CTX(x) do { } while(0)
152#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
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.
static void generateClassOrGlobalLink(yyscan_t yyscanner, OutputCodeList &ol, const DString &clName, bool typeOnly=false, bool varOnly=false)
static void endCodeLine(yyscan_t yyscanner)
static void nextCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void setCurrentDoc(yyscan_t yyscanner, const DString &anchor)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static int countLines(yyscan_t yyscanner)
static const char * stateToString(int state)
static void addToSearchIndex(yyscan_t yyscanner, const DString &text)
static void codifyLines(yyscan_t yyscanner, const DString &text)
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
static void writeMultiLineCodeLink(yyscan_t yyscanner, OutputCodeList &ol, const Definition *d, const DString &text)
static const char * getLexerFILE()
Web server based search engine.
Some helper functions for std::string.
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 appStringLower(DString &qcs, const char *text)
static void generateFuncLink(yyscan_t yyscanner, OutputCodeList &ol, const MemberDef *mdef)
static void codifyMapLines(yyscan_t yyscanner, const DString &text)
static void writeProcessProto(yyscan_t yyscanner)
static bool writeColoredWord(yyscan_t yyscanner, DString &word)
static void generateMemLink(yyscan_t yyscanner, OutputCodeList &ol, DString &clName, DString &memberName)
static void writeFuncProto(yyscan_t yyscanner)
static void writeFont(yyscan_t yyscanner, const char *s, const DString &text, bool specialComment=false)
static void writeWord(yyscan_t yyscanner, const DString &word, const DString &curr_class=DString(), bool classLink=false)
static bool checkVhdlString(yyscan_t yyscanner, DString &name)
164NAME [a-z_A-Z][ a-z_A-Z0-9]*
165FUNCNAME [a-z_A-Z"][a-z_A-Z0-9+*"/=<>-]*
166ID "$"?[a-z_A-Z][a-z_A-Z0-9]*
167SPECSIGN [:;, +*&\/=<>'\t]*
168DIGITSS [0-9]+|[0-9]+("#")*[0-9_a-fA-F\+\.\-]+("#")*
169ALLTYPESMAP {B}*[_a-zA-Z0-9. ]+{BN}*
170ALLTYPESMAP1 {BN}*[_a-zA-Z0-9.() ]+{BN}*
172ARCHITECTURE ^{B}*("architecture"){BN}+{FUNCNAME}{BN}+("of"){BN}+{FUNCNAME}{BN}+("is")
173PROCESS ({BN}*{FUNCNAME}{BN}*[:]+{BN}*("process"){BN}*[(]*)|[^a-zA-Z]("process "|"process("){BN}*[ (]*|[^a-zA-Z]("process"){BN}+
175END1 {B}*("end "){BN}+("if"|"case"|"loop"|"generate"|"for")
176END2 [^a-zA-Z_]("end"){BN}*[;]
177END3 {BN}*[^a-zA-Z]("end"){BN}+{FUNCNAME}{BN}*[;]
178END4 {B}*("end"){BN}+"function"{BN}+{FUNCNAME}{BN}*[;]
179ENDEFUNC {END3}|{END4}|{END2}
181KEYWORD ("of"|"new"|"event"|"break"|"case"|"end"|"loop"|"else"|"for"|"goto"|"if"|"return"|"generate"|"is"|"while"|"in")
182TYPEKW ^{B}*("type"|"subtype"|"constant"|"attribute"|"signal"|"variable","alias","configuration")
183FUNC ^{B}*("function"|"procedure"){BN}*{FUNCNAME}{BN}*("(")
185ARITHOP "+"|"-"|"/"|"*"|"%"|"/="|":="
186ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
187LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"
188BITOP "&"|"|"|"^"|"<<"|">>"|"~"
189OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
191PORT {B}*("port"){BN}*("(")
192GENERIC {B}*("generic"){BN}*("(")
199MAPCOMPONENT1 ({ALLTYPESMAP}[:]{ALLTYPESMAP}{TEXTT}*{BN}+("port"|"generic"){BN}+("map"){BN}*("("){1})
200MAPCOMPONENT2 {BN}*("port"|"generic"){BN}+("map"){BN}*("("){1}
201MAPCOMPONENT3 ({ALLTYPESMAP}[:]{BN}*{ALLTYPESMAP1}{TEXTT}*{BN}+("port"|"generic"){BN}+("map"){BN}*("("){1})
202MAPCOMPONENT4 ({ALLTYPESMAP}[:]{BN}*("entity"|"component"|"configuration"){BN}+{ALLTYPESMAP1}{TEXTT}*{BN}*("port"|"generic"){BN}*("map"){BN}*("("){1})
204XILINX "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"
227 yyextra->braceCount++;
235 auto ql =
split(tt.str(),
"=>");
238 unsigned int index=0;
240 char cc=t1.at(index);
241 while (cc==
' ' || cc==
'\t')
246 yyextra->code->codify(c2);
248 if (index>=t1.size())
break;
257 while (index++<t1.size())
260 if (cc==
' ' || cc==
'\t')
265 yyextra->code->codify(c2);
273 while (cc==
' ' || cc==
'\t')
278 yyextra->code->codify(c2);
280 if (index>=t1.size())
break;
283 s2=s2.stripWhiteSpace();
288 while (index++<t1.size())
290 if (t1.at(index)==
' ')
292 yyextra->code->codify(
" ");
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
static void deleteAllChars(DString &s, char c)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
309 yyextra->braceCount--;
311 if (yyextra->braceCount==0)
317<ParseFuncProto>{NAME} {
319 tmp=tmp.stripWhiteSpace();
321 yyextra->vhdlKeyDict.insert(yyextra->prevString.str());
static bool isNumber(const std::string &s)
344 yyextra->funcProto.append(yytext);
345 if (yyextra->isProto)
354 yyextra->funcProto.append(yytext);
355 if (yyextra->isProto)
362<ParseType>{ENDEFUNC} {
367 tt.stripWhiteSpace();
368 static const reg::Ex regg(R
"(\s+)");
369 auto ql =
split(tt.str(),regg);
374 if (index1==std::string::npos &&
375 index2==std::string::npos &&
376 index3==std::string::npos &&
377 index4==std::string::npos)
Class representing a regular expression.
size_t findIndex(const StringVector &sv, const std::string &s)
find the index of a string in a vector of strings, returns std::string::npos if the string could not ...
389 yyextra->vhdlKeyDict.clear();
392<ParseType>^{B}*("begin "|"begin") {
394 yyextra->isFuncProto=
false;
397<ParseType>{SPECSIGN} {
398 yyextra->funcProto.append(yytext);
399 if (yyextra->isProto)
405<ParseType>["_a-zA-Z0-9]* {
407 yyextra->funcProto.append(yytext);
410 if (yyextra->isFuncProto && yyextra->braceCount==0)
412 yyextra->vhdlKeyDict.insert(yyextra->prevString.str());
415 if (yyextra->isProto)
419 if (!yyextra->isFuncProto &&
420 yyextra->vhdlKeyDict.find(yyextra->prevString.str())==yyextra->vhdlKeyDict.end())
422 val=val.stripWhiteSpace();
443<ParseType>{BRACEOPEN} {
444 yyextra->braceCount++;
445 yyextra->funcProto+=
'(';
446 if (yyextra->isProto)
453<ParseType>{BRACECLOSE} {
454 yyextra->braceCount--;
455 yyextra->funcProto+=
')';
456 if (yyextra->isProto)
460 if (yyextra->braceCount==0 && !yyextra->isProto)
462 yyextra->isProto=
true;
467 if (yyextra->isPackageBody)
474<ClassesName>{FUNCNAME} {
476 yyextra->currClass.clear();
477 yyextra->currClass.append(yytext);
478 yyextra->currClass=yyextra->currClass.stripWhiteSpace();
485<ParseComponent>{BRACEOPEN} {
486 yyextra->braceCount++;
487 yyextra->code->codify(yytext);
491<ParseComponent>{BRACECLOSE} {
492 yyextra->braceCount--;
493 yyextra->code->codify(yytext);
494 if (yyextra->braceCount==0 && !yyextra->isComponent)
496 yyextra->tempComp.clear();
501 BEGIN(ParseComponent);
505<ParseComponent>{B}*"-" {
506 if (strlen(yytext)>=2)
516<ParseComponent>{SPECSIGN} {
522<ParseComponent>"\n"|" " {
526<ParseComponent>{DIGITSS} {
532<ParseComponent>{PORT} {
534 yyextra->braceCount=1;
535 yyextra->isComponent=
false;
538<ParseComponent>{GENERIC} {
540 yyextra->braceCount=1;
543<ParseComponent>[_a-zA_Z][_a-zA-Z0-9]* {
555<ParseComponent>{STRING} {
564<ParseProcessProto>[^()]* {
565 yyextra->funcProto.append(yytext);
570<ParseProcessProto>{BRACEOPEN} {
571 yyextra->funcProto.append(yytext);
572 yyextra->braceCount++;
575<ParseProcessProto>{BRACECLOSE} {
576 yyextra->funcProto.append(yytext);
577 yyextra->braceCount--;
578 if (yyextra->braceCount==0)
585<ParsePackage>[^:;]* {
608 writeFont(yyscanner,
"keywordflow",yytext);
A abstract class representing of a compound symbol.
DString & prepend(const char *s)
static ClassDef * getPackageName(const DString &name)
std::vector< std::string > StringVector
613<Bases>{MAPCOMPONENT1}|{MAPCOMPONENT2}|{MAPCOMPONENT3}|{MAPCOMPONENT4} {
615 size_t j=tt.find(
'.');
630 yyextra->PortMapComp=name;
637 tt.stripPrefix(left);
639 yyextra->PortMapComp=left;
646 if (tt.contains(
':',
false))
655 yyextra->braceCount=1;
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
size_t find(char c, size_t pos=0) const
DString left(size_t len) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
static DString getIndexWord(const DString &, int index)
659<Bases>^{B}*("component"){BN}+{FUNCNAME} {
664 yyextra->tempComp=temp;
666 yyextra->braceCount=0;
667 yyextra->isComponent=
true;
668 BEGIN(ParseComponent);
673<Bases>{ARCHITECTURE} {
674 yyextra->PortMapComp.clear();
676 yyextra->currArch =
true;
679 yyextra->currClass=temp;
682 yyextra->isPackageBody=
false;
686<Bases>^{B}*("package "){BN}*("body"){BN}*{FUNCNAME} {
695 yyextra->currClass.clear();
696 yyextra->currClass=temp;
697 yyextra->isProto=
false;
698 yyextra->isPackageBody=
true;
const std::string & str() const
702 yyextra->isFuncProto=
true;
703 yyextra->funcProto.clear();
704 yyextra->funcProto.append(yytext);
705 yyextra->vhdlKeyDict.clear();
707 if (yyextra->prevString.contains(
'('))
709 yyextra->braceCount=1;
710 BEGIN(ParseProcessProto);
718<Bases>("end"){BN}+("process") {
719 yyextra->isFuncProto=
false;
725<Bases>^{B}*("begin "|"begin") {
726 yyextra->isFuncProto=
false;
727 writeFont(yyscanner,
"vhdlkeyword",yytext);
730<Bases>^{B}*("use"|"library"){BN}+ {
731 writeFont(yyscanner,
"vhdlkeyword",yytext);
736<Bases>^{B}*("use"){BN}+("configuration")[^\n]* {
741 yyextra->vhdlKeyDict.clear();
742 yyextra->funcProto.clear();
743 yyextra->isProto=
false;
744 yyextra->funcProto.append(yytext);
745 yyextra->braceCount=1;
749<Bases>^{B}*("entity"|"package"){BN}+ {
751 writeFont(yyscanner,
"keywordflow",yytext);
752 yyextra->isPackageBody=
false;
756<Bases>"end"{BN}+"architecture"{BN}+{FUNCNAME} {
757 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
758 yyextra->currArch =
false;
760<Bases>"end"{BN}+{FUNCNAME} {
761 if (yyextra->currArch)
763 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
764 yyextra->currArch =
false;
798 yyextra->code->codify(yytext);
817<Bases,ParseComponent>{DIGITSS} {
823<Bases>^{B}*("use"){BN}+("entity"|"component")[^\n]* {
824 codifyLines(yyscanner,yytext,yyextra->currClass,
true);
830 if (yyextra->isFuncProto)
832 BEGIN(ParseFuncProto);
842 yyextra->code->codify(yytext);
846<Bases>","|"."|":"|"'"|"("|")" {
848 yyextra->code->codify(yytext);
867<Bases>{B}*"#"[^\n]* {
871<Bases>^{B}*{XILINX}/[^a-zA-Z0-9_] {
876<Bases>^{B}*"set_"[^\n]* {
886 yyextra->code->codify(yytext);
889 yyextra->code->codify(yytext);
893<*>\n?"--!"[^\n]*/\n{B}*"--!" {
894 if (YY_START!=CopyComment)
897 yyextra->lastCopyCommentContext=YY_START;
904 size_t i=text.
find(
"--");
905 bool isSpecialComment = i!=
DString::npos && yytext[i+2]==
'!';
906 if (isSpecialComment && YY_START!=CopyComment)
911 if (isSpecialComment)
915 if (YY_START==CopyComment)
917 BEGIN(yyextra->lastCopyCommentContext);
922 size_t i=text.
find(
"--");
923 bool isSpecialComment = i!=
DString::npos && yytext[i+2]==
'!';
924 if (isSpecialComment)
929 if (isSpecialComment)
942 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
943 int inputPosition = yyextra->inputPosition;
944 const char *s = yyextra->inputString + inputPosition;
946 while( c < max_size && *s)
951 yyextra->inputPosition += c;
957 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
960 if (yyextra->searchCtx)
973 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
974 if (name.
empty())
return false;
977 if (len>2 && name.
at(0)==
'"' && name.
at(len-1)==
'"')
980 static const reg::Ex regg(R
"(\s+)");
984 yyextra->code->codify(
"\"");
986 yyextra->code->codify(inside);
988 yyextra->code->codify(
"\"");
993 yyextra->code->codify(name);
1002 yyextra->code->codify(name);
1022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1023 while (!yyextra->foldStack.empty())
1025 const Definition *dd = yyextra->foldStack.back();
1028 yyextra->code->endFold();
1030 yyextra->foldStack.pop_back();
1041 if (endLine!=-1 && startLine!=endLine && (yyextra->foldStack.empty() || yyextra->foldStack.back()->getEndBodyLine()!=startLine))
1044 yyextra->code->startFold(yyextra->yyLineNr,
"",
"");
1045 yyextra->foldStack.push_back(d);
1057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1059 if (yyextra->sourceFileDef && yyextra->lineNumbers)
1066 const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
1068 if (!yyextra->includeCodeFragment && d)
1070 yyextra->currentDefinition = d;
1071 yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
1072 if (!yyextra->tempComp.empty() && yyextra->currentMemberDef )
1075 DString nn=yyextra->currentMemberDef->name();
1079 yyextra->currentMemberDef=mdeff;
1084 lineAnchor.
sprintf(
"l%05d",yyextra->yyLineNr);
1085 if (yyextra->currentMemberDef)
1088 yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
1089 yyextra->currentMemberDef->getOutputFileBase(),
1090 yyextra->currentMemberDef->anchor(),yyextra->yyLineNr,
1091 !yyextra->includeCodeFragment);
1100 !yyextra->includeCodeFragment);
1112 !yyextra->includeCodeFragment);
1115 yyextra->code->startCodeLine(yyextra->yyLineNr);
1116 yyextra->insideCodeLine=
true;
1117 if (yyextra->currentFontClass)
1119 yyextra->code->startFontClass(yyextra->currentFontClass);
1125 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1127 yyextra->code->endCodeLine();
1128 yyextra->insideCodeLine=
false;
1133 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1134 if (yyextra->insideCodeLine)
1138 const char *fc = yyextra->currentFontClass;
1139 if (yyextra->yyLineNr<yyextra->inputLines)
1141 yyextra->currentFontClass = fc;
1153 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1158 if (ttt.
empty())
return;
1159 for (
unsigned int j=0;j<ttt.
length();j++)
1162 if (c==
' '|| c==
',' || c==
';' || c==
':' || c==
'(' || c==
')' || c==
'\r' || c==
'\t' || c==
'.')
1171 if (!tclass.
empty())
1186 yyextra->code->codify(temp);
1197 yyextra->code->codify(cc);
1210 if (!tclass.
empty())
1227 yyextra->code->codify(temp);
1232 yyextra->code->codify(temp);
1245 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1246 if (text.
empty())
return;
1248 const char *p=text.
data(),*sp=p;
1254 while ((c=*p++) && c!=
'\n') {}
1257 yyextra->yyLineNr++;
1259 line = line.
left((
int)(p-sp)-1);
1293 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1294 if (text.
empty())
return;
1296 yyextra->tooltipManager.addTooltip(d);
1301 if (!sourceTooltips)
1306 const char *p=text.
data();
1311 while ((c=*p++) && c!=
'\n') {}
1314 yyextra->yyLineNr++;
1347 if (memberName.
empty())
return;
1387 if (className.
empty())
return;
1394 if (!cd && !curr_class.
empty())
1440 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1441 const char *p=yyextra->inputString;
1447 if (c==
'\n') count++;
1449 if (p>yyextra->inputString && *(p-1)!=
'\n')
1459 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1462 if (yyextra->currentFontClass)
1464 yyextra->code->endFontClass();
1465 yyextra->currentFontClass=0;
1467 if (specialComment && yyextra->insideSpecialComment)
1469 yyextra->code->endSpecialComment();
1470 yyextra->insideSpecialComment=
false;
1476 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1477 if (s==
nullptr)
return;
1482 yyextra->code->startSpecialComment();
1483 yyextra->insideSpecialComment =
true;
1485 if (
dstrcmp(yyextra->currentFontClass,s)!=0)
1488 yyextra->code->startFontClass(s);
1489 yyextra->currentFontClass=s;
1495 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1496 if (s==
nullptr || text.
empty())
return;
1499 yyextra->code->codify(text);
1515 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1516 if (text.
empty())
return;
1522 const char *p=text.
data();
1528 while ((c=*p++) && c!=
'\n' && c!=
':' && c !=
' ' && c !=
'(' && c!=
'\0' && c!=
'\t')
1533 if (c==
'\0')
return;
1534 if (!temp.
empty()) wordCounter++;
1542 if (wordCounter==2 || wordCounter==3)
1545 if (q==
"entity" || q==
"component" || q==
"configuration" || q==
"port" || q==
"generic")
1551 yyextra->PortMapComp=temp;
1573 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1579 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1585 yyextra->funcProto.stripPrefix(temp);
1587 temp=yyextra->currClass;
1588 if (yyextra->isPackageBody)
1597 yyextra->funcProto.stripPrefix(name);
1598 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1602 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1610 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1611 codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
1612 yyextra->vhdlKeyDict.clear();
1639 vhdlcodeYYlex_init_extra(&
p->state,&
p->yyscanner);
1648 vhdlcodeYYlex_destroy(
p->yyscanner);
1653 p->state.vhdlKeyDict.clear();
1660 bool stripCodeComments,
1665 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
1667 if (s.
empty())
return;
1673 if (dd) yyextra->currClass = dd->
name();
1677 yyextra->code = &od;
1678 yyextra->inputString = s.
data();
1679 yyextra->inputPosition = 0;
1680 yyextra->currentFontClass =
nullptr;
1681 yyextra->insideCodeLine =
false;
1682 yyextra->searchCtx = options.
searchCtx();
1683 yyextra->insideSpecialComment =
false;
1686 yyextra->foldStack.clear();
1689 yyextra->exampleBlock = options.
isExample();
1691 yyextra->sourceFileDef = options.
fileDef();
1697 yyextra->sourceFileDef = yyextra->exampleFileDef.get();
1699 if (yyextra->sourceFileDef)
1703 yyextra->currentDefinition =
nullptr;
1704 yyextra->currentMemberDef =
nullptr;
1705 yyextra->vhdlMember =
nullptr;
1706 if (!yyextra->exampleName.empty())
1712 if (!yyextra->lexInit)
1715 yyextra->lexInit=
true;
1717 vhdlcodeYYrestart(
nullptr, yyscanner );
1719 vhdlcodeYYlex(yyscanner);
1720 if (yyextra->insideCodeLine)
1726 while (!yyextra->foldStack.empty())
1728 yyextra->code->endFold();
1729 yyextra->foldStack.pop_back();
1732 if (yyextra->exampleFileDef)
1735 yyextra->exampleFileDef.reset();
1736 yyextra->sourceFileDef =
nullptr;
1740 yyextra->tooltipManager.writeTooltips(od);
1743#include "vhdlcode.l.h"
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
DString fill(char c, size_t len)
Fills a string with a predefined character.
char & at(size_t i)
Returns a reference to the character at index i.
DString right(size_t len) const
DString & sprintf(const char *format,...)
bool stripPrefix(const DString &prefix)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
static bool isFlagSet(const DebugMask mask)
virtual int getEndBodyLine() const =0
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual DString briefDescriptionAsTooltip() const =0
virtual bool isLinkableInProject() const =0
virtual DString anchor() const =0
virtual int getStartDefLine() const =0
virtual DString getReference() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual Definition * getOuterScope() const =0
virtual DString getOutputFileBase() const =0
static SearchIndexIntf searchIndex
virtual DString fileName() const =0
virtual const ClassDef * getClassDef() const =0
void writeCodeLink(CodeSymbolType type, const DString &ref, const DString &file, const DString &anchor, const DString &name, const DString &tooltip)
void stripCodeComments(bool b)
void addWord(const DString &word, bool hiPriority)
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
void resetCodeParserState() override
Resets the state of the code parser.
void parseCode(OutputCodeList &codeOutIntf, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options) override
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
~VHDLCodeParser() override
std::unique_ptr< Private > p
static const char * findKeyWord(const DString &word)
static const MemberDef * findFunction(const DString &name, const DString &package)
static void parseFuncProto(const DString &text, DString &name, DString &ret, bool doc=false)
static const MemberDef * findMember(const DString &className, const DString &memName)
static ClassDef * getClass(const DString &name)
ClassDef * getClass(const DString &n)
ClassDef * toClassDef(Definition *d)
static void codeFolding(yyscan_t yyscanner, const Definition *d)
#define Config_getBool(name)
int dstrcmp(const char *str1, const char *str2)
const char * qPrint(const char *s)
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Options to configure the code parser.
const Definition * searchCtx() const
DString exampleName() const
const FileDef * fileDef() const
const MemberDef * memberDef() const
bool showLineNumbers() const
bool inlineFragment() const
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
static void endCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void setCurrentDoc(yyscan_t yyscanner, const DString &anchor)
static int countLines(yyscan_t yyscanner)