89 const QCString &inputBuffer,
bool inLine)
99 tokenManager->
ReInit(stream,0);
102 vhdlParser->setErrorHandler(parserErrHandler);
115 catch( std::exception &){ }
137 p->inputString=fileBuf;
141 bool inLine = fileName.
isEmpty();
143 if (!inLine)
msg(
"Parsing file %s...\n",
qPrint(fileName));
145 p->yyFileName=fileName;
166 p->oldEntry =
nullptr;
167 s->
current=std::make_shared<Entry>();
169 p->commentScanner.enterFile(fileName,
p->yyLineNr);
170 p->lineParse.reserve(200);
171 p->parseVhdlfile(fileName,fileBuf,inLine);
172 p->commentScanner.leaveFile(fileName,
p->yyLineNr);
179 p->yyFileName.clear();
192 for (
const char* c=text.
data() ; *c ; ++c )
194 if (*c ==
'\n')
p->yyLineNr++;
203 if (
p->str_doc.pending)
207 p->iDocLine=
p->str_doc.iDocLine;
211 p->commentScanner.initGroupInfo(e);
279 static const reg::Ex csRe(R
"([\\@]code)");
280 static const reg::Ex cendRe(R
"(\s*[\\@]endcode)");
281 static const reg::Ex cbriefRe(R
"([\\@]brief)");
284 auto findRe = [](
const QCString &str,
const reg::Ex &re,
int pos=0) ->
int
286 if ((
int)str.
length()<pos)
return -1;
288 const std::string s = str.
str();
291 return (
int)match.position();
303 int index = findRe(doc,csRe);
305 if (findRe(doc,cendRe)!=-1)
312 p->strComment += doc;
313 p->code = findRe(
p->inputString,csRe,
p->code + 1);
314 int com =
p->inputString.find(
p->strComment.data());
315 int ref = findRe(
p->inputString,cendRe,
p->code + 1);
316 int len =
static_cast<int>(
p->strComment.size());
319 int diff = ref - ll - 3;
320 QCString code =
p->inputString.mid(ll, diff);
329 for (
const auto &qcs_ : ql)
333 if (findRe(qcs,csRe)!=-1)
335 int i = qcs.
find(
'{');
336 int j = qcs.
find(
'}');
337 if (i > 0 && j > 0 && j > i)
339 na = qcs.
mid(i + 1, (j - i - 1));
343 qcs = replaceRe(qcs,cbriefRe,
"");
360 gBlock.
section = EntryType::makeVariable();
365 std::shared_ptr<Entry> compound;
376 compound->copyToSubEntry(&gBlock);
380 gBlock.
type =
"misc";
383 p->strComment.clear();
390 bool needsEntry =
FALSE;
399 p->strComment.clear();
412 if (
p->oldEntry == s->
current.get())
414 p->str_doc.doc = doc;
415 p->str_doc.iDocLine =
p->iDocLine;
416 p->str_doc.brief = brief;
417 p->str_doc.pending =
TRUE;
425 s->
current->briefLine =
p->yyLineNr;
435 int lineNr =
p->iDocLine;
439 while (
p->commentScanner.parseCommentBlock(
464 s->
current->section = EntryType::makeVariableDoc();
470 p->strComment.clear();
483 s->
current->section=EntryType::makeVariable();
513 s->
current=std::make_shared<Entry>();
535 for (
size_t u=0;u<ql.size();u++)
538 s->
current->startLine=startLine;
539 s->
current->bodyLine=startLine;
543 if (s->
current->args.isEmpty())
552 p->libUse.emplace_back(std::make_shared<Entry>(*s->
current));
563 s->
current->section=EntryType::makeFunction();
565 if (impure==
"impure" || impure==
"pure")
573 s->
current->section=EntryType::makeFunction();
594 for (
const auto &name : q1)
598 s->
current->argList.push_back(arg);
642 for (
const auto &n : ql)
669 s->
current->argList.push_back(arg);
689 for (
const auto &rt :
p->libUse)
694 for (
const auto ¤t : root->
children())
698 if (current->startLine > rt->startLine)
701 current->copyToSubEntry(rt);
733 if ((
int)
p->lineParse.size()<=tok)
p->lineParse.resize(tok+1);
734 p->lineParse[tok]=
p->yyLineNr;
739 int val=
p->lineParse[tok];
798 p->iDocLine=
p->yyLineNr;
803 int j=qcs.
find(
"--!");
817 if (
p->lineEntry.empty())
return false;
820 while (!
p->lineEntry.empty())
822 std::shared_ptr<Entry> e=
p->lineEntry.back();
826 p->lineEntry.pop_back();
834 for (
const auto &rt : ce->children())
836 if (rt->bodyLine==line)
838 p->lineEntry.push_back(rt);
855 p->vhdlParser->getNextToken();
856 op=
p->vhdlParser->getToken(1);
857 if (op==
nullptr)
break;
859 }
while (op->
kind != kind);
860 p->vhdlParser->clearError();
870 if (s.
length()<4)
return s;
872 const char *p=s.
data()+3;
874 while (*p ==
' ' || *p ==
'\t') p++;
881 while (*p ==
' ' || *p ==
'\t') p++;
882 while (*p ==
'*') p++;
888 size_t len = growBuf.
getPos();
889 if (len>=2 && growBuf.
at(len-1) ==
'/' && growBuf.
at(len-2) ==
'*')
892 while (len>0 && growBuf.
at(len-1) ==
'*') len--;
893 while (len>0 && ((c = growBuf.
at(len-1)) ==
' ' || c ==
'\t')) len--;
897 return growBuf.
get();
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Represents an unstructured piece of information, about an entity found in the sources.
VhdlSpecifier vhdlSpec
VHDL specifiers.
const std::vector< std::shared_ptr< Entry > > & children() const
int endBodyLine
line number where the definition ends
SrcLangExt lang
programming language in which this entry was found
QCString inbodyDocs
documentation inside the body of a function
QCString fileName
file this entry was extracted from
int startLine
start line of entry in the source
EntryType section
entry type (see Sections);
int bodyLine
line number of the body in the source
void copyToSubEntry(Entry *e)
QCString doc
documentation block (partly parsed)
QCString brief
brief description (doc block)
Wrapper class for the Entry type.
static void alignFuncProc(QCString &q, const ArgumentList &al, bool isFunc)
static void addFlowChart(int type, const QCString &text, const QCString &exp, const QCString &label=QCString())
static void writeFlowChart()
Class representing a string buffer optimized for growing.
const char & at(size_t i) const
void setPos(size_t newPos)
Helper class to process markdown formatted text.
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const std::string & str() const
QCString & setNum(short n)
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
QCString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
int contains(char c, bool cs=TRUE) const
bool stripPrefix(const QCString &prefix)
int checkInlineCode(QCString &doc)
void error_skipto(int kind)
void handleCommentBlock(const QCString &doc, bool brief)
void setLineParsed(int tok)
std::unique_ptr< Private > p
void addVhdlType(const QCString &n, int startLine, EntryType section, VhdlSpecifier spec, const QCString &args, const QCString &type, Protection prot)
~VHDLOutlineParser() override
void insertEntryAtLine(std::shared_ptr< Entry > ce, int line)
void oneLineComment(QCString qcs)
QCString popLabel(QCString &q)
void pushLabel(QCString &, QCString &)
bool addLibUseClause(const QCString &type)
void addCompInst(const QCString &n, const QCString &instName, const QCString &comp, int iLine)
bool checkMultiComment(QCString &qcs, int line)
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
void handleFlowComment(const QCString &)
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.
QCString getNameID()
returns a unique id for each record member.
void createFunction(const QCString &impure, VhdlSpecifier spec, const QCString &fname)
void setMultCommentLine()
void addProto(const QCString &s1, const QCString &s2, const QCString &s3, const QCString &s4, const QCString &s5, const QCString &s6)
void mapLibPackage(Entry *root)
static const MemberDef * getFlowMember()
static QCString getRecordNumber()
static bool isVhdlClass(const Entry *cu)
static void prepareComment(QCString &)
static void parseUCF(const QCString &input, Entry *entity, const QCString &f, bool vendor)
static void deleteAllChars(QCString &s, char c)
Class representing a regular expression.
Object representing the matching results.
This class describes a character stream that maintains line and column number positions of the charac...
Describes the input token stream.
int kind
An integer that describes the kind of this token.
void setLexParser(VhdlParser *p)
void ReInit(JAVACC_CHARSTREAM *stream, int lexState=0)
void setErrorHandler(TokenManagerErrorHandler *eh)
#define Config_getBool(name)
std::vector< int > IntVector
std::vector< std::string > StringVector
std::vector< std::shared_ptr< Entry > > EntryList
void msg(const char *fmt,...)
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
std::string replace(std::string_view str, const Ex &re, std::string_view replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
const char * qPrint(const char *s)
Web server based search engine.
This class contains the information about the argument of a function or template.
void parseVhdlfile(const QCString &fileName, const QCString &inputBuffer, bool inLine)
VHDLOutlineParser * thisParser
CommentScanner commentScanner
VhdlParser::SharedState shared
std::shared_ptr< Entry > lastEntity
std::shared_ptr< Entry > lastCompound
std::shared_ptr< Entry > current_root
std::shared_ptr< Entry > tempEntry
std::shared_ptr< Entry > current
This file contains a number of basic enums and types.
Protection
Protection level of members.
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
A bunch of utility functions.
const EntryList & getVhdlInstList()
QCString filter2008VhdlComment(const QCString &s)
static EntryList g_instFiles
static bool isConstraintFile(const QCString &fileName, const QCString &ext)