浏览该文件的文档.
60 void parseVhdlfile(
const QCString &fileName,
const char* inputBuffer,
bool inLine);
90 const char* inputBuffer,
bool inLine)
97 vhdlParser->setOutlineParser(thisParser);
98 vhdlParser->setSharedState(&shared);
100 tokenManager->
ReInit(stream,0);
103 vhdlParser->setErrorHandler(parserErrHandler);
108 vhdlParser->parseInline();
112 vhdlParser->design_file();
115 catch( std::exception &){ }
137 p->inputString=fileBuf;
141 bool inLine = fileName.
isEmpty();
143 p->yyFileName=fileName;
166 s->
current=std::make_shared<Entry>();
168 p->commentScanner.enterFile(fileName,
p->yyLineNr);
169 p->lineParse.reserve(200);
170 p->parseVhdlfile(fileName,fileBuf,inLine);
171 p->commentScanner.leaveFile(fileName,
p->yyLineNr);
178 p->yyFileName.resize(0);
189 for (
const char* c=text ; *c ; ++c )
191 if (*c ==
'\n')
p->yyLineNr++;
199 if (
p->str_doc.pending)
203 p->iDocLine=
p->str_doc.iDocLine;
207 p->commentScanner.initGroupInfo(e);
275 static const reg::Ex csRe(R
"([\\@]code)");
276 static const reg::Ex cendRe(R
"(\s*[\\@]endcode)");
277 static const reg::Ex cbriefRe(R
"([\\@]brief)");
280 auto findRe = [](
const QCString &str,
const reg::Ex &re,
int pos=0) ->
int
282 if ((
int)str.
length()<pos)
return -1;
284 const std::string s = str.
str();
287 return (
int)
match.position();
299 int index = findRe(doc,csRe);
301 if (findRe(doc,cendRe)!=-1)
308 p->strComment += doc;
309 p->code = findRe(
p->inputString,csRe,
p->code + 1);
310 int com =
p->inputString.find(
p->strComment.data());
311 int ref = findRe(
p->inputString,cendRe,
p->code + 1);
312 int len =
p->strComment.size();
315 int diff = ref - ll - 3;
316 QCString code =
p->inputString.mid(ll, diff);
325 for (
const auto &qcs_ : ql)
329 if (findRe(qcs,csRe)!=-1)
331 int i = qcs.
find(
'{');
332 int j = qcs.
find(
'}');
333 if (i > 0 && j > 0 && j > i)
335 na = qcs.
mid(i + 1, (j - i - 1));
339 qcs = replaceRe(qcs,cbriefRe,
"");
361 std::shared_ptr<Entry> compound;
372 compound->copyToSubEntry(&gBlock);
376 gBlock.
type =
"misc";
379 p->strComment.resize(0);
386 bool needsEntry =
FALSE;
395 p->strComment.resize(0);
407 if (
p->oldEntry == s->
current.get())
409 p->str_doc.doc = doc;
410 p->str_doc.iDocLine =
p->iDocLine;
411 p->str_doc.brief = brief;
412 p->str_doc.pending =
TRUE;
420 s->
current->briefLine =
p->yyLineNr;
430 int lineNr =
p->iDocLine;
433 while (
p->commentScanner.parseCommentBlock(
462 p->strComment.resize(0);
505 s->
current=std::make_shared<Entry>();
527 for (
size_t u=0;u<ql.size();u++)
530 s->
current->startLine=startLine;
531 s->
current->bodyLine=startLine;
535 if (s->
current->args.isEmpty())
544 p->libUse.emplace_back(std::make_shared<Entry>(*s->
current));
559 if (impure==
"impure" || impure==
"pure")
588 for (
const auto &name : q1)
592 s->
current->argList.push_back(arg);
629 const char *s4,
const char *s5,
const char *s6)
636 for (
const auto &n : ql)
663 s->
current->argList.push_back(arg);
683 for (
const auto &rt :
p->libUse)
688 for (
const auto ¤t : root->
children())
692 if (current->startLine > rt->startLine)
695 current->copyToSubEntry(rt);
727 if ((
int)
p->lineParse.size()<=tok)
p->lineParse.resize(tok+1);
728 p->lineParse[tok]=
p->yyLineNr;
733 int val=
p->lineParse[tok];
792 p->iDocLine=
p->yyLineNr;
797 int j=qcs.
find(
"--!");
811 if (
p->lineEntry.empty())
return false;
814 while (!
p->lineEntry.empty())
816 std::shared_ptr<Entry> e=
p->lineEntry.back();
820 p->lineEntry.pop_back();
828 for (
const auto &rt : ce->children())
830 if (rt->bodyLine==line)
832 p->lineEntry.push_back(rt);
849 p->vhdlParser->getNextToken();
850 op=
p->vhdlParser->getToken(1);
853 }
while (op->
kind != kind);
854 p->vhdlParser->clearError();
867 while (*p ==
' ' || *p ==
'\t') p++;
874 while (*p ==
' ' || *p ==
'\t') p++;
875 while (*p ==
'*') p++;
881 int len = growBuf.
getPos();
882 if (growBuf.
at(len-1) ==
'/' && growBuf.
at(len-2) ==
'*')
885 while (growBuf.
at(len-1) ==
'*') len--;
886 c = growBuf.
at(len-1);
887 while ((c = growBuf.
at(len-1)) ==
' ' || c ==
'\t') len--;
891 return growBuf.
get();
static const MemberDef * getFlowMember()
std::vector< std::string > StringVector
static void writeFlowChart()
void addVhdlType(const char *n, int startLine, int section, uint64 spec, const char *args, const char *type, Protection prot)
void handleCommentBlock(const QCString &doc, bool brief)
std::string replace(const std::string &str, const Ex &re, const std::string &replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Protection
Protection level of members
void setMultCommentLine()
int startLine
start line of entry in the source
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
std::shared_ptr< Entry > current
Describes the input token stream.
QCString getNameID()
returns a unique id for each record member.
This file contains a number of basic enums and types.
static void alignFuncProc(QCString &q, const ArgumentList &al, bool isFunc)
std::unique_ptr< Private > p
uint length() const
Returns the length of the string, not counting the 0-terminator.
void setLexParser(VhdlParser *p)
int findRev(char c, int index=-1, bool cs=TRUE) const
uint64 spec
class/member specifiers
bool isEmpty() const
Returns TRUE iff the string is empty
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
void handleFlowComment(const char *)
static std::vector< QCString > split(const QCString &str, const QCString &sep, bool allowEmptyEntries=FALSE, bool cleanup=TRUE)
void insertEntryAtLine(std::shared_ptr< Entry > ce, int line)
void mapLibPackage(Entry *root)
std::vector< int > IntVector
int find(char c, int index=0, bool cs=TRUE) const
int checkInlineCode(QCString &doc)
bool checkMultiComment(QCString &qcs, int line)
void parseInput(const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser)
Parses a single input file with the goal to build an Entry tree.
QCString filter2008VhdlComment(const char *s)
QCString doc
documentation block (partly parsed)
Class representing a string buffer optimised for growing.
void setErrorHandler(TokenManagerErrorHandler *eh)
int contains(char c, bool cs=TRUE) const
QCString inbodyDocs
documentation inside the body of a function
static void addFlowChart(int type, const QCString &text, const QCString &exp, const QCString &label=QCString())
static EntryList g_instFiles
const EntryList & getVhdlInstList()
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
std::shared_ptr< Entry > lastCompound
QCString left(size_t len) const
bool addLibUseClause(const QCString &type)
VhdlParser::SharedState shared
static void parseUCF(const char *input, Entry *entity, const QCString &f, bool vendor)
void error_skipto(int kind)
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
int section
entry type (see Sections);
void addProto(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6)
void ReInit(JAVACC_CHARSTREAM *stream, int lexState=0)
int endBodyLine
line number where the definition ends
This class contains the information about the argument of a function or template
std::shared_ptr< Entry > current_root
virtual ~VHDLOutlineParser()
static QCString getRecordNumber()
Object representing the matching results.
static bool isVhdlClass(const Entry *cu)
void addCompInst(const char *n, const char *instName, const char *comp, int iLine)
void pushLabel(QCString &, QCString &)
void parsePrototype(const QCString &text)
Callback function called by the comment block scanner.
void copyToSubEntry(Entry *e)
static void deleteAllChars(QCString &s, char c)
CommentScanner commentScanner
QCString & setNum(short n)
std::vector< std::shared_ptr< Entry > > EntryList
QCString fileName
file this entry was extracted from
SrcLangExt lang
programming language in which this entry was found
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
QCString brief
brief description (doc block)
void setLineParsed(int tok)
int bodyLine
line number of the body in the source
Represents an unstructured piece of information, about an entity found in the sources.
#define Config_getBool(name)
const std::vector< std::shared_ptr< Entry > > & children() const
std::shared_ptr< Entry > tempEntry
VHDL parser using state-based lexical scanning.
Class representing a regular expression.
Helper class to process markdown formatted text
static bool isConstraintFile(const QCString &fileName, const QCString &ext)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
void createFunction(const char *impure, uint64 spec, const char *fname)
#define JAVACC_STRING_TYPE
std::shared_ptr< Entry > lastEntity
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Clang parser object for a single translation unit, which consists of a source file and the directly o...
QCString popLabel(QCString &q)
bool search(const std::string &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.
This class describes a character stream that maintains line and column number positions of the charac...
A bunch of utility functions.
static void prepareComment(QCString &)
bool stripPrefix(const QCString &prefix)
int kind
An integer that describes the kind of this token.
QCString right(size_t len) const
QCString & prepend(const char *s)
void parseVhdlfile(const QCString &fileName, const char *inputBuffer, bool inLine)
void oneLineComment(QCString qcs)
This is an alternative implementation of QCString.