a0851d7ee205e2b9d875cd38aee56bda9ffb7fc9
[platform/upstream/doxygen.git] / src / vhdljjparser.h
1 #ifndef VHDLJJPARSER_H
2 #define VHDLJJPARSER_H
3
4 #include "parserintf.h"
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <assert.h>
8 #include <ctype.h>
9 #include <qarray.h>
10
11 #include <qfile.h>
12 #include <qdict.h>
13 #include <string>
14 #include "types.h"
15 #include "entry.h"
16 #include "vhdldocgen.h"
17 #include "qstringlist.h"
18 #include "vhdlcode.h"
19 #include "memberlist.h"
20 #include "config.h"
21
22
23
24
25 enum  { GEN_SEC=0x1, PARAM_SEC,CONTEXT_SEC,PROTECTED_SEC } ;
26 void  parserVhdlfile(const char* inputBuffer);
27
28 class Entry;
29 class ClassSDict;
30 class FileStorage;
31 class ClassDef;
32 class MemberDef;
33 class QStringList;
34 struct VhdlConfNode;
35
36
37 /** \brief VHDL parser using state-based lexical scanning.
38  *
39  * This is the VHDL language parser for doxygen.
40  */
41 class VHDLLanguageScanner : public ParserInterface
42 {
43   public:
44     virtual ~VHDLLanguageScanner() {}
45     void startTranslationUnit(const char *) {}
46     void finishTranslationUnit() {}
47     void parseInput(const char * fileName,
48                     const char *fileBuf,
49                     Entry *root,
50                     bool sameTranslationUnit,
51                     QStrList &filesInSameTranslationUnit);
52   
53  void parseCode(CodeOutputInterface &codeOutIntf,
54                    const char *scopeName,
55                    const QCString &input,
56                    SrcLangExt lang,
57                    bool isExampleBlock,
58                    const char *exampleName=0,
59                    FileDef *fileDef=0,
60                    int startLine=-1,
61                    int endLine=-1,
62                    bool inlineFragment=FALSE,
63                    MemberDef *memberDef=0,
64                    bool showLineNumbers=TRUE,
65                    Definition *searchCtx=0,
66                    bool collectXRefs=TRUE
67                                    );
68                 bool needsPreprocessing(const QCString &) { return TRUE; }
69                 void resetCodeParserState(){};
70             void parsePrototype(const char *text);
71 };
72
73 struct VhdlConfNode
74
75   VhdlConfNode(const char*  a,const char*  b,const char* config,const char* cs,bool leaf) 
76   { 
77     arch=a;              // architecture  e.g. for iobuffer
78     arch=arch.lower();
79     binding=b;           // binding e.g.  use entiy work.xxx(bev)
80     binding=binding.lower();
81     confVhdl=config;     // configuration foo is bar
82     compSpec=cs;        
83     isInlineConf=false;  // primary configuration?
84     isLeaf=leaf;
85   };
86
87   QCString confVhdl;
88   QCString arch;
89   QCString binding;
90   QCString compSpec;
91   int level;
92   bool isLeaf;
93   bool isInlineConf;
94
95 };
96
97 void vhdlscanFreeScanner();
98
99 QList<VhdlConfNode>& getVhdlConfiguration();
100 QList<Entry>& getVhdlInstList();
101
102 #endif