Doxygen
|
VHDL parser using state-based lexical scanning. More...
#include <src/vhdljjparser.h>
Classes | |
struct | Private |
Public Member Functions | |
VHDLOutlineParser () | |
~VHDLOutlineParser () override | |
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. | |
bool | needsPreprocessing (const QCString &) const override |
Returns TRUE if the language identified by extension needs the C preprocessor to be run before feed the result to the input parser. | |
void | parsePrototype (const QCString &text) override |
Callback function called by the comment block scanner. | |
void | setLineParsed (int tok) |
int | getLine (int tok) |
int | getLine () |
void | lineCount (const QCString &) |
void | lineCount () |
void | addProto (const QCString &s1, const QCString &s2, const QCString &s3, const QCString &s4, const QCString &s5, const QCString &s6) |
void | createFunction (const QCString &impure, VhdlSpecifier spec, const QCString &fname) |
void | addVhdlType (const QCString &n, int startLine, EntryType section, VhdlSpecifier spec, const QCString &args, const QCString &type, Protection prot) |
void | addCompInst (const QCString &n, const QCString &instName, const QCString &comp, int iLine) |
void | handleCommentBlock (const QCString &doc, bool brief) |
void | handleFlowComment (const QCString &) |
void | initEntry (Entry *e) |
void | newEntry () |
bool | isFuncProcProced () |
void | pushLabel (QCString &, QCString &) |
QCString | popLabel (QCString &q) |
bool | addLibUseClause (const QCString &type) |
void | mapLibPackage (Entry *root) |
void | createFlow () |
void | error_skipto (int kind) |
void | oneLineComment (QCString qcs) |
void | setMultCommentLine () |
bool | checkMultiComment (QCString &qcs, int line) |
void | insertEntryAtLine (std::shared_ptr< Entry > ce, int line) |
QCString | getNameID () |
returns a unique id for each record member. | |
int | checkInlineCode (QCString &doc) |
Public Member Functions inherited from OutlineParserInterface |
Private Attributes | |
std::unique_ptr< Private > | p |
VHDL parser using state-based lexical scanning.
This is the VHDL language parser for doxygen.
Definition at line 27 of file vhdljjparser.h.
VHDLOutlineParser::VHDLOutlineParser | ( | ) |
Definition at line 124 of file vhdljjparser.cpp.
References p.
|
override |
Definition at line 128 of file vhdljjparser.cpp.
void VHDLOutlineParser::addCompInst | ( | const QCString & | n, |
const QCString & | instName, | ||
const QCString & | comp, | ||
int | iLine ) |
Definition at line 479 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, QCString::find(), g_instFiles, vhdl::parser::VhdlParser::SharedState::genLabels, initEntry(), INSTANTIATION, vhdl::parser::VhdlParser::SharedState::lastCompound, QCString::left(), QCString::length(), QCString::lower(), newEntry(), p, and QCString::right().
bool VHDLOutlineParser::addLibUseClause | ( | const QCString & | type | ) |
Definition at line 714 of file vhdljjparser.cpp.
References Config_getBool, FALSE, QCString::lower(), QCString::stripPrefix(), and TRUE.
Referenced by mapLibPackage().
void VHDLOutlineParser::addProto | ( | const QCString & | s1, |
const QCString & | s2, | ||
const QCString & | s3, | ||
const QCString & | s4, | ||
const QCString & | s5, | ||
const QCString & | s6 ) |
Definition at line 634 of file vhdljjparser.cpp.
References Argument::attrib, vhdl::parser::VhdlParser::SharedState::current, Argument::defval, GEN_SEC, QCString::isEmpty(), Argument::name, p, PARAM_SEC, vhdl::parser::VhdlParser::SharedState::param_sec, vhdl::parser::VhdlParser::SharedState::parse_sec, split(), QCString::str(), Argument::type, and UNKNOWN.
void VHDLOutlineParser::addVhdlType | ( | const QCString & | n, |
int | startLine, | ||
EntryType | section, | ||
VhdlSpecifier | spec, | ||
const QCString & | args, | ||
const QCString & | type, | ||
Protection | prot ) |
Definition at line 521 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, GEN_SEC, GENERIC, VhdlDocGen::getFlowMember(), isFuncProcProced(), vhdl::parser::VhdlParser::SharedState::lastCompound, LIBRARY, newEntry(), p, vhdl::parser::VhdlParser::SharedState::parse_sec, split(), QCString::str(), and USE.
int VHDLOutlineParser::checkInlineCode | ( | QCString & | doc | ) |
Definition at line 277 of file vhdljjparser.cpp.
References Entry::bodyLine, Entry::brief, QCString::contains(), vhdl::parser::VhdlParser::SharedState::current_root, Entry::doc, Entry::endBodyLine, Entry::fileName, QCString::find(), VhdlDocGen::getRecordNumber(), Entry::inbodyDocs, QCString::isEmpty(), Entry::lang, vhdl::parser::VhdlParser::SharedState::lastCompound, vhdl::parser::VhdlParser::SharedState::lastEntity, QCString::length(), QCString::mid(), MISCELLANEOUS, Entry::name, p, VhdlDocGen::prepareComment(), reg::replace(), reg::search(), Entry::section, QCString::simplifyWhiteSpace(), split(), Entry::startLine, QCString::str(), stripLeadingAndTrailingEmptyLines(), Entry::type, VHDL, and Entry::vhdlSpec.
Referenced by handleCommentBlock().
bool VHDLOutlineParser::checkMultiComment | ( | QCString & | qcs, |
int | line ) |
Definition at line 812 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current_root, insertEntryAtLine(), p, and VhdlDocGen::prepareComment().
Referenced by handleCommentBlock(), and oneLineComment().
void VHDLOutlineParser::createFlow | ( | ) |
Definition at line 746 of file vhdljjparser.cpp.
References FlowChart::addFlowChart(), FlowChart::alignFuncProc(), vhdl::parser::VhdlParser::SharedState::currP, FlowChart::END_NO, FUNCTION, VhdlDocGen::getFlowMember(), p, QCString::prepend(), PROCEDURE, FlowChart::START_NO, vhdl::parser::VhdlParser::SharedState::tempEntry, UNKNOWN, and FlowChart::writeFlowChart().
void VHDLOutlineParser::createFunction | ( | const QCString & | impure, |
VhdlSpecifier | spec, | ||
const QCString & | fname ) |
Definition at line 559 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, vhdl::parser::VhdlParser::SharedState::currP, VhdlDocGen::deleteAllChars(), GEN_SEC, GENERIC, QCString::isEmpty(), Argument::name, p, vhdl::parser::VhdlParser::SharedState::parse_sec, PROCEDURE, PROCESS, split(), and QCString::str().
void VHDLOutlineParser::error_skipto | ( | int | kind | ) |
Definition at line 850 of file vhdljjparser.cpp.
References vhdl::parser::Token::kind, and p.
int VHDLOutlineParser::getLine | ( | ) |
int VHDLOutlineParser::getLine | ( | int | tok | ) |
Definition at line 737 of file vhdljjparser.cpp.
References p.
QCString VHDLOutlineParser::getNameID | ( | ) |
returns a unique id for each record member.
type first_rec is record RE: data_type; end;
type second_rec is record RE: data_type; end;
Definition at line 259 of file vhdljjparser.cpp.
References idCounter, and QCString::setNum().
void VHDLOutlineParser::handleCommentBlock | ( | const QCString & | doc, |
bool | brief ) |
Definition at line 387 of file vhdljjparser.cpp.
References checkInlineCode(), checkMultiComment(), Config_getBool, vhdl::parser::VhdlParser::SharedState::current, FALSE, QCString::isEmpty(), newEntry(), p, VhdlDocGen::prepareComment(), Markdown::process(), Public, and TRUE.
Referenced by initEntry(), and oneLineComment().
void VHDLOutlineParser::handleFlowComment | ( | const QCString & | doc | ) |
Definition at line 264 of file vhdljjparser.cpp.
References FlowChart::addFlowChart(), FlowChart::COMMENT_NO, VhdlDocGen::getFlowMember(), lineCount(), QCString::stripPrefix(), and QCString::stripWhiteSpace().
void VHDLOutlineParser::initEntry | ( | Entry * | e | ) |
Definition at line 199 of file vhdljjparser.cpp.
References FALSE, Entry::fileName, handleCommentBlock(), Entry::lang, p, and VHDL.
Referenced by addCompInst(), newEntry(), and parseInput().
void VHDLOutlineParser::insertEntryAtLine | ( | std::shared_ptr< Entry > | ce, |
int | line ) |
Definition at line 832 of file vhdljjparser.cpp.
References insertEntryAtLine(), and p.
Referenced by checkMultiComment(), and insertEntryAtLine().
bool VHDLOutlineParser::isFuncProcProced | ( | ) |
Definition at line 605 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::currP, FALSE, FUNCTION, p, PROCEDURE, PROCESS, and TRUE.
Referenced by addVhdlType().
void VHDLOutlineParser::lineCount | ( | ) |
void VHDLOutlineParser::lineCount | ( | const QCString & | text | ) |
Definition at line 188 of file vhdljjparser.cpp.
References QCString::data(), QCString::isEmpty(), and p.
void VHDLOutlineParser::mapLibPackage | ( | Entry * | root | ) |
Definition at line 687 of file vhdljjparser.cpp.
References addLibUseClause(), Entry::children(), Entry::copyToSubEntry(), FALSE, VhdlDocGen::isVhdlClass(), p, and TRUE.
Referenced by parseInput().
|
inlineoverridevirtual |
Returns TRUE if the language identified by extension needs the C preprocessor to be run before feed the result to the input parser.
Implements OutlineParserInterface.
Definition at line 38 of file vhdljjparser.h.
References TRUE.
void VHDLOutlineParser::newEntry | ( | ) |
Definition at line 214 of file vhdljjparser.cpp.
References ARCHITECTURE, vhdl::parser::VhdlParser::SharedState::current, vhdl::parser::VhdlParser::SharedState::current_root, ENTITY, initEntry(), vhdl::parser::VhdlParser::SharedState::lastCompound, vhdl::parser::VhdlParser::SharedState::lastEntity, p, PACKAGE, and PACKAGE_BODY.
Referenced by addCompInst(), addVhdlType(), and handleCommentBlock().
void VHDLOutlineParser::oneLineComment | ( | QCString | qcs | ) |
Definition at line 801 of file vhdljjparser.cpp.
References checkMultiComment(), QCString::find(), handleCommentBlock(), QCString::length(), p, QCString::right(), and TRUE.
|
overridevirtual |
Parses a single input file with the goal to build an Entry tree.
[in] | fileName | The full name of the file. |
[in] | fileBuf | The contents of the file (zero terminated). |
[in,out] | root | The root of the tree of Entry *nodes representing the information extracted from the file. |
[in] | clangParser | The clang translation unit parser object or nullptr if disabled. |
Implements OutlineParserInterface.
Definition at line 132 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, vhdl::parser::VhdlParser::SharedState::current_root, FALSE, initEntry(), isConstraintFile(), QCString::isEmpty(), vhdl::parser::VhdlParser::SharedState::lastCompound, vhdl::parser::VhdlParser::SharedState::lastEntity, mapLibPackage(), msg(), p, VhdlDocGen::parseUCF(), qPrint(), and TRUE.
|
overridevirtual |
Callback function called by the comment block scanner.
It provides a string text containing the prototype of a function or variable. The parser should parse this and store the information in the Entry node that corresponds with the node for which the comment block parser was invoked.
Implements OutlineParserInterface.
Definition at line 473 of file vhdljjparser.cpp.
Definition at line 624 of file vhdljjparser.cpp.
References QCString::findRev(), and QCString::left().
Definition at line 618 of file vhdljjparser.cpp.
void VHDLOutlineParser::setLineParsed | ( | int | tok | ) |
void VHDLOutlineParser::setMultCommentLine | ( | ) |
Definition at line 796 of file vhdljjparser.cpp.
References p.
|
private |
Definition at line 72 of file vhdljjparser.h.
Referenced by addCompInst(), addProto(), addVhdlType(), checkInlineCode(), checkMultiComment(), createFlow(), createFunction(), error_skipto(), getLine(), getLine(), handleCommentBlock(), initEntry(), insertEntryAtLine(), isFuncProcProced(), lineCount(), lineCount(), mapLibPackage(), newEntry(), oneLineComment(), parseInput(), parsePrototype(), setLineParsed(), setMultCommentLine(), and VHDLOutlineParser().