1 #ifndef VHDLJJPARSER_H 2 #define VHDLJJPARSER_H 3 4 #include <vector> 5 #include <memory> 6 #include <string> 7 8 #include "parserintf.h" 9 #include <stdio.h> 10 #include <stdlib.h> 11 #include <assert.h> 12 #include <ctype.h> 13 14 #include "types.h" 15 #include "entry.h" 16 #include "vhdldocgen.h" 17 #include "config.h" 18 #include "util.h" 19 20 enum { GEN_SEC=0x1, PARAM_SEC,CONTEXT_SEC,PROTECTED_SEC } ; 21 //void parserVhdlfile(const char* inputBuffer); 22 23 /** \brief VHDL parser using state-based lexical scanning. 24 * 25 * This is the VHDL language parser for doxygen. 26 */ 27 class VHDLOutlineParser : public OutlineParserInterface 28 { 29 public: 30 VHDLOutlineParser(); 31 virtual ~VHDLOutlineParser(); 32 void parseInput(const QCString &fileName, 33 const char *fileBuf, 34 const std::shared_ptr<Entry> &root, 35 ClangTUParser *clangParser); 36 needsPreprocessing(const QCString &)37 bool needsPreprocessing(const QCString &) const { return TRUE; } 38 void parsePrototype(const QCString &text); 39 40 41 // interface for generated parser code 42 43 void setLineParsed(int tok); 44 int getLine(int tok); 45 int getLine(); 46 void lineCount(const char*); 47 void lineCount(); 48 void addProto(const char *s1,const char *s2,const char *s3,const char *s4,const char *s5,const char *s6); 49 //void addConfigureNode(const char* a,const char*b, bool,bool isLeaf,bool inlineConf); 50 void createFunction(const char *impure,uint64 spec,const char *fname); 51 void addVhdlType(const char *n,int startLine,int section, uint64 spec,const char* args,const char* type,Protection prot); 52 void addCompInst(const char *n, const char* instName, const char* comp,int iLine); 53 void handleCommentBlock(const QCString &doc,bool brief); 54 void handleFlowComment(const char*); 55 void initEntry(Entry *e); 56 void newEntry(); 57 bool isFuncProcProced(); 58 void pushLabel(QCString &,QCString&); 59 QCString popLabel(QCString & q); 60 bool addLibUseClause(const QCString &type); 61 void mapLibPackage( Entry* root); 62 void createFlow(); 63 void error_skipto(int kind); 64 void oneLineComment(QCString qcs); 65 void setMultCommentLine(); 66 bool checkMultiComment(QCString& qcs,int line); 67 void insertEntryAtLine(std::shared_ptr<Entry> ce,int line); 68 QCString getNameID(); 69 int checkInlineCode(QCString & doc); 70 private: 71 struct Private; 72 std::unique_ptr<Private> p; 73 }; 74 75 76 const EntryList &getVhdlInstList(); 77 78 QCString filter2008VhdlComment(const char *s); 79 80 #endif 81