|
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 DString &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 DString &) 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 DString &text) override |
| Callback function called by the comment block scanner. | |
| void | setLineParsed (int tok) |
| int | getLine (int tok) |
| int | getLine () |
| void | lineCount (const DString &) |
| void | lineCount () |
| void | addProto (const DString &s1, const DString &s2, const DString &s3, const DString &s4, const DString &s5, const DString &s6) |
| void | createFunction (const DString &impure, VhdlSpecifier spec, const DString &fname) |
| void | addVhdlType (const DString &n, int startLine, EntryType section, VhdlSpecifier spec, const DString &args, const DString &type, Protection prot) |
| void | addCompInst (const DString &n, const DString &instName, const DString &comp, int iLine) |
| void | handleCommentBlock (const DString &doc, bool brief) |
| void | handleFlowComment (const DString &) |
| void | initEntry (Entry *e) |
| void | newEntry () |
| bool | isFuncProcProced () |
| void | pushLabel (DString &, DString &) |
| DString | popLabel (DString &q) |
| bool | addLibUseClause (const DString &type) |
| void | mapLibPackage (Entry *root) |
| void | createFlow () |
| void | error_skipto (int kind) |
| void | oneLineComment (DString qcs) |
| void | setMultCommentLine () |
| bool | checkMultiComment (DString &qcs, int line) |
| void | insertEntryAtLine (std::shared_ptr< Entry > ce, int line) |
| DString | getNameID () |
| returns a unique id for each record member. | |
| size_t | checkInlineCode (DString &doc) |
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 19 of file vhdljjparser.h.
| VHDLOutlineParser::VHDLOutlineParser | ( | ) |
Definition at line 123 of file vhdljjparser.cpp.
References p.
|
override |
Definition at line 127 of file vhdljjparser.cpp.
| void VHDLOutlineParser::addCompInst | ( | const DString & | n, |
| const DString & | instName, | ||
| const DString & | comp, | ||
| int | iLine ) |
Definition at line 477 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, DString::find(), g_instFiles, vhdl::parser::VhdlParser::SharedState::genLabels, initEntry(), INSTANTIATION, vhdl::parser::VhdlParser::SharedState::lastCompound, DString::left(), DString::lower(), DString::mid(), newEntry(), DString::npos, and p.
| bool VHDLOutlineParser::addLibUseClause | ( | const DString & | type | ) |
Definition at line 709 of file vhdljjparser.cpp.
References Config_getBool, DString::lower(), and DString::stripPrefix().
Referenced by mapLibPackage().
| void VHDLOutlineParser::addProto | ( | const DString & | s1, |
| const DString & | s2, | ||
| const DString & | s3, | ||
| const DString & | s4, | ||
| const DString & | s5, | ||
| const DString & | s6 ) |
Definition at line 631 of file vhdljjparser.cpp.
References Argument::attrib, vhdl::parser::VhdlParser::SharedState::current, Argument::defval, DString::empty(), GEN_SEC, Argument::name, p, PARAM_SEC, vhdl::parser::VhdlParser::SharedState::param_sec, vhdl::parser::VhdlParser::SharedState::parse_sec, split(), DString::str(), Argument::type, and UNKNOWN.
| void VHDLOutlineParser::addVhdlType | ( | const DString & | n, |
| int | startLine, | ||
| EntryType | section, | ||
| VhdlSpecifier | spec, | ||
| const DString & | args, | ||
| const DString & | type, | ||
| Protection | prot ) |
Definition at line 519 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(), DString::str(), and USE.
| size_t VHDLOutlineParser::checkInlineCode | ( | DString & | doc | ) |
Definition at line 276 of file vhdljjparser.cpp.
References Entry::bodyLine, Entry::brief, DString::contains(), vhdl::parser::VhdlParser::SharedState::current_root, Entry::doc, DString::empty(), Entry::endBodyLine, Entry::fileName, DString::find(), VhdlDocGen::getRecordNumber(), Entry::inbodyDocs, Entry::lang, vhdl::parser::VhdlParser::SharedState::lastCompound, vhdl::parser::VhdlParser::SharedState::lastEntity, DString::length(), DString::mid(), MISCELLANEOUS, Entry::name, DString::npos, p, VhdlDocGen::prepareComment(), reg::replace(), reg::search(), Entry::section, DString::simplifyWhiteSpace(), split(), Entry::startLine, DString::str(), stripLeadingAndTrailingEmptyLines(), Entry::type, and Entry::vhdlSpec.
Referenced by handleCommentBlock().
| bool VHDLOutlineParser::checkMultiComment | ( | DString & | qcs, |
| int | line ) |
Definition at line 806 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 741 of file vhdljjparser.cpp.
References FlowChart::addFlowChart(), FlowChart::alignFuncProc(), vhdl::parser::VhdlParser::SharedState::currP, DString::DString(), FlowChart::END_NO, FUNCTION, VhdlDocGen::getFlowMember(), p, DString::prepend(), PROCEDURE, FlowChart::START_NO, vhdl::parser::VhdlParser::SharedState::tempEntry, UNKNOWN, and FlowChart::writeFlowChart().
| void VHDLOutlineParser::createFunction | ( | const DString & | impure, |
| VhdlSpecifier | spec, | ||
| const DString & | fname ) |
Definition at line 556 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, vhdl::parser::VhdlParser::SharedState::currP, VhdlDocGen::deleteAllChars(), DString::empty(), GEN_SEC, GENERIC, Argument::name, p, vhdl::parser::VhdlParser::SharedState::parse_sec, PROCEDURE, PROCESS, split(), and DString::str().
| void VHDLOutlineParser::error_skipto | ( | int | kind | ) |
Definition at line 844 of file vhdljjparser.cpp.
References vhdl::parser::Token::kind, and p.
| int VHDLOutlineParser::getLine | ( | ) |
| int VHDLOutlineParser::getLine | ( | int | tok | ) |
Definition at line 732 of file vhdljjparser.cpp.
References p.
| DString 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 258 of file vhdljjparser.cpp.
References DString::DString(), idCounter, and DString::setNum().
| void VHDLOutlineParser::handleCommentBlock | ( | const DString & | doc, |
| bool | brief ) |
Definition at line 385 of file vhdljjparser.cpp.
References checkInlineCode(), checkMultiComment(), Config_getBool, vhdl::parser::VhdlParser::SharedState::current, DString::empty(), newEntry(), DString::npos, p, VhdlDocGen::prepareComment(), and Markdown::process().
Referenced by initEntry(), and oneLineComment().
| void VHDLOutlineParser::handleFlowComment | ( | const DString & | doc | ) |
Definition at line 263 of file vhdljjparser.cpp.
References FlowChart::addFlowChart(), FlowChart::COMMENT_NO, DString::DString(), VhdlDocGen::getFlowMember(), lineCount(), DString::stripPrefix(), and DString::stripWhiteSpace().
| void VHDLOutlineParser::initEntry | ( | Entry * | e | ) |
Definition at line 198 of file vhdljjparser.cpp.
References Entry::fileName, handleCommentBlock(), Entry::lang, and p.
Referenced by addCompInst(), newEntry(), and parseInput().
| void VHDLOutlineParser::insertEntryAtLine | ( | std::shared_ptr< Entry > | ce, |
| int | line ) |
Definition at line 826 of file vhdljjparser.cpp.
References insertEntryAtLine(), and p.
Referenced by checkMultiComment(), and insertEntryAtLine().
| bool VHDLOutlineParser::isFuncProcProced | ( | ) |
Definition at line 602 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::currP, FUNCTION, p, PROCEDURE, and PROCESS.
Referenced by addVhdlType().
| void VHDLOutlineParser::lineCount | ( | ) |
| void VHDLOutlineParser::lineCount | ( | const DString & | text | ) |
Definition at line 187 of file vhdljjparser.cpp.
References DString::data(), DString::empty(), and p.
Referenced by handleFlowComment().
| void VHDLOutlineParser::mapLibPackage | ( | Entry * | root | ) |
Definition at line 682 of file vhdljjparser.cpp.
References addLibUseClause(), Entry::children(), Entry::copyToSubEntry(), VhdlDocGen::isVhdlClass(), and p.
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 30 of file vhdljjparser.h.
| void VHDLOutlineParser::newEntry | ( | ) |
Definition at line 213 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 | ( | DString | qcs | ) |
Definition at line 796 of file vhdljjparser.cpp.
References checkMultiComment(), DString::find(), handleCommentBlock(), DString::mid(), DString::npos, and p.
|
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 131 of file vhdljjparser.cpp.
References vhdl::parser::VhdlParser::SharedState::current, vhdl::parser::VhdlParser::SharedState::current_root, DString::empty(), initEntry(), isConstraintFile(), vhdl::parser::VhdlParser::SharedState::lastCompound, vhdl::parser::VhdlParser::SharedState::lastEntity, mapLibPackage(), msg, p, and VhdlDocGen::parseUCF().
|
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 471 of file vhdljjparser.cpp.
References p.
Definition at line 621 of file vhdljjparser.cpp.
References DString::DString(), DString::left(), DString::npos, and DString::rfind().
Definition at line 615 of file vhdljjparser.cpp.
| void VHDLOutlineParser::setLineParsed | ( | int | tok | ) |
| void VHDLOutlineParser::setMultCommentLine | ( | ) |
Definition at line 791 of file vhdljjparser.cpp.
References p.
|
private |
Definition at line 64 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().