Root/
Source at commit 1322 created 12 years 7 months ago. By meklort, Add doxygen to utils folder | |
---|---|
1 | /******************************************************************************␊ |
2 | *␊ |
3 | * $Id: vhdlscanner.h,v 1.9 2001/03/19 19:27:39 root Exp $␊ |
4 | *␊ |
5 | * Copyright (C) 1997-2011 by Dimitri van Heesch.␊ |
6 | *␊ |
7 | * Permission to use, copy, modify, and distribute this software and its␊ |
8 | * documentation under the terms of the GNU General Public License is hereby ␊ |
9 | * granted. No representations are made about the suitability of this software ␊ |
10 | * for any purpose. It is provided "as is" without express or implied warranty.␊ |
11 | * See the GNU General Public License for more details.␊ |
12 | *␊ |
13 | * Documents produced by Doxygen are derivative works derived from the␊ |
14 | * input used in their production; they are not affected by this license.␊ |
15 | *␊ |
16 | */␊ |
17 | ␊ |
18 | #ifndef VHDLDOCGEN_H␊ |
19 | #define VHDLDOCGEN_H␊ |
20 | ␊ |
21 | /** ␊ |
22 | * This class implements functions for parsing and generating ␊ |
23 | * vhdl documents␊ |
24 | */␊ |
25 | ␊ |
26 | #include <qdict.h>␊ |
27 | #include <qcstring.h>␊ |
28 | ␊ |
29 | #include "memberlist.h"␊ |
30 | ␊ |
31 | class QStringList;␊ |
32 | class Entry;␊ |
33 | class ClassSDict;␊ |
34 | class FileStorage;␊ |
35 | class EntryNav;␊ |
36 | class ClassDef;␊ |
37 | class MemberDef;␊ |
38 | ␊ |
39 | class VhdlDocGen ␊ |
40 | {␊ |
41 | public:␊ |
42 | ␊ |
43 | enum VhdlClasses // Overlays: Protection␊ |
44 | {␊ |
45 | ENTITYCLASS, // Overlays: Public␊ |
46 | PACKBODYCLASS, // Overlays: Protected␊ |
47 | ARCHITECTURECLASS, // Overlays: Private␊ |
48 | PACKAGECLASS // Overlays: Package␊ |
49 | };␊ |
50 | enum VhdlKeyWords␊ |
51 | {␊ |
52 | LIBRARY=1,␊ |
53 | ENTITY,␊ |
54 | PACKAGE_BODY,␊ |
55 | ARCHITECTURE,␊ |
56 | PACKAGE,␊ |
57 | ATTRIBUTE,␊ |
58 | SIGNAL,␊ |
59 | COMPONENT,␊ |
60 | CONSTANT,␊ |
61 | TYPE,␊ |
62 | SUBTYPE,␊ |
63 | FUNCTION,␊ |
64 | RECORD,␊ |
65 | PROCEDURE,␊ |
66 | USE,␊ |
67 | PROCESS,␊ |
68 | PORT,␊ |
69 | DOCUMENT, //18 0x12␊ |
70 | UNITS,␉ ␊ |
71 | GENERIC,␊ |
72 | PORTMAP, // obsolete␊ |
73 | COMPONENT_INST,␊ |
74 | GROUP,␊ |
75 | VFILE, ␊ |
76 | SHAREDVARIABLE,␊ |
77 | CONFIG,␊ |
78 | ALIAS,␊ |
79 | MISCELLANEOUS␊ |
80 | };␊ |
81 | ␊ |
82 | VhdlDocGen();␊ |
83 | virtual ~VhdlDocGen();␊ |
84 | static void init();␊ |
85 | ␊ |
86 | // --- used by vhdlscanner.l -----------␊ |
87 | static QCString getIndexWord(const char* ,int index);␊ |
88 | static bool foundInsertedComponent(const QCString& name,Entry* root);␊ |
89 | static bool deleteCharRev(QCString &s,char c);␊ |
90 | static bool isFunctionProto(QCString& ss);␊ |
91 | static Entry* findFunction(Entry* func);␊ |
92 | static void deleteAllChars(QCString &s,char c);␊ |
93 | static bool getSigName(QList<QCString>& ql, ␊ |
94 | const char* str,␊ |
95 | QCString& buffer);␊ |
96 | static bool getSigTypeName(QList<QCString>& ql, ␊ |
97 | const char* str,␊ |
98 | QCString& buffer);␊ |
99 | static void parseFuncProto(const char* text,␊ |
100 | QList<Argument>& , ␊ |
101 | QCString& name,␊ |
102 | QCString& ret,␊ |
103 | bool doc=false);␊ |
104 | // -----------------------------------␊ |
105 | ␊ |
106 | static void debugClassName(ClassSDict*);␊ |
107 | //static void MergeFuncDoc(Entry* p,Entry* root);␊ |
108 | ␊ |
109 | static void computeVhdlComponentRelations();␊ |
110 | ␊ |
111 | //static void addVariableToComponents(EntryNav *rootNav,ClassDef *cd, MemberDef::MemberType mtype, const QCString &name, bool fromAnnScope,MemberDef *fromAnnMemb,Protection prot,bool related);␊ |
112 | ␊ |
113 | static QCString* findKeyWord(const QCString& word);␊ |
114 | static void addFuncDoc(EntryNav* root);␊ |
115 | ␊ |
116 | //static void MapArchitecturesToEntity(Entry* cur_root);␊ |
117 | ␊ |
118 | //static void MapComponentToEntity(const ClassSDict*);␊ |
119 | ␊ |
120 | static ClassDef* findComponent(int type);␊ |
121 | static ClassDef* getPackageName(const QCString& name);␊ |
122 | static MemberDef* findMember(const QCString& className, ␊ |
123 | const QCString& memName);␊ |
124 | static void findAllPackages(const QCString& className,␊ |
125 | QDict<QCString>&);␊ |
126 | static MemberDef* findMemberDef(ClassDef* cd,␊ |
127 | const QCString& key,␊ |
128 | MemberList::ListType type);␊ |
129 | static ClassDef *getClass(const char *name);␊ |
130 | static Entry* findFunction(Entry* root,Entry* func);␊ |
131 | static MemberDef* findFunction(const QList<Argument> &ql,␊ |
132 | const QCString& name,␊ |
133 | const QCString& package, bool type);␊ |
134 | static bool compareString(const QCString& s1,␊ |
135 | const QCString& s2);␊ |
136 | static QCString getClassTitle(const ClassDef*);␊ |
137 | static void writeInlineClassLink(const ClassDef*,␊ |
138 | OutputList &ol);␊ |
139 | ␊ |
140 | //static void writeVhdlComponentList(OutputList &ol,int type);␊ |
141 | static bool isMisc(const MemberDef *mdef) ␊ |
142 | { return mdef->getMemberSpecifiers()==VhdlDocGen::MISCELLANEOUS; } ␊ |
143 | static bool isConfig(const MemberDef *mdef) ␊ |
144 | { return mdef->getMemberSpecifiers()==VhdlDocGen::CONFIG; }␊ |
145 | static bool isAlias(const MemberDef *mdef) ␊ |
146 | { return mdef->getMemberSpecifiers()==VhdlDocGen::ALIAS; }␊ |
147 | static bool isLibrary(const MemberDef *mdef) ␊ |
148 | { return mdef->getMemberSpecifiers()==VhdlDocGen::LIBRARY; }␊ |
149 | static bool isGeneric(const MemberDef *mdef) ␊ |
150 | { return mdef->getMemberSpecifiers()==VhdlDocGen::GENERIC; }␊ |
151 | static bool isPort(const MemberDef *mdef) ␊ |
152 | { return mdef->getMemberSpecifiers()==VhdlDocGen::PORT; }␊ |
153 | static bool isComponent(const MemberDef *mdef) ␊ |
154 | { return mdef->getMemberSpecifiers()==VhdlDocGen::COMPONENT; }␊ |
155 | static bool isPackage(const MemberDef *mdef) ␊ |
156 | { return mdef->getMemberSpecifiers()==VhdlDocGen::USE; }␊ |
157 | static bool isEntity(const MemberDef *mdef) ␊ |
158 | { return mdef->getMemberSpecifiers()==VhdlDocGen::ENTITY; }␊ |
159 | static bool isConstant(const MemberDef *mdef) ␊ |
160 | { return mdef->getMemberSpecifiers()==VhdlDocGen::CONSTANT; }␊ |
161 | static bool isVType(const MemberDef *mdef) ␊ |
162 | { return mdef->getMemberSpecifiers()==VhdlDocGen::TYPE; }␊ |
163 | static bool isSubType(const MemberDef *mdef) ␊ |
164 | { return mdef->getMemberSpecifiers()==VhdlDocGen::SUBTYPE; }␊ |
165 | static bool isVhdlFunction(const MemberDef *mdef) ␊ |
166 | { return mdef->getMemberSpecifiers()==VhdlDocGen::FUNCTION; }␊ |
167 | static bool isProcess(const MemberDef *mdef) ␊ |
168 | { return mdef->getMemberSpecifiers()==VhdlDocGen::PROCESS; }␊ |
169 | static bool isSignal(const MemberDef *mdef) ␊ |
170 | { return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }␊ |
171 | static bool isAttribute(const MemberDef *mdef)␊ |
172 | { return mdef->getMemberSpecifiers()==VhdlDocGen::ATTRIBUTE; }␊ |
173 | static bool isSignals(const MemberDef *mdef)␊ |
174 | { return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }␊ |
175 | static bool isProcedure(const MemberDef *mdef) ␊ |
176 | { return mdef->getMemberSpecifiers()==VhdlDocGen::PROCEDURE; }␊ |
177 | static bool isRecord(const MemberDef *mdef) ␊ |
178 | { return mdef->getMemberSpecifiers()==VhdlDocGen::RECORD; }␊ |
179 | static bool isArchitecture(const MemberDef *mdef) ␊ |
180 | { return mdef->getMemberSpecifiers()==VhdlDocGen::ARCHITECTURE; }␊ |
181 | static bool isUnit(const MemberDef *mdef) ␊ |
182 | { return mdef->getMemberSpecifiers()==VhdlDocGen::UNITS; }␊ |
183 | static bool isPackageBody(const MemberDef *mdef) ␊ |
184 | { return mdef->getMemberSpecifiers()==VhdlDocGen::PACKAGE_BODY; }␊ |
185 | static bool isVariable(const MemberDef *mdef) ␊ |
186 | { return mdef->getMemberSpecifiers()==VhdlDocGen::SHAREDVARIABLE; }␊ |
187 | static bool isFile(const MemberDef *mdef) ␊ |
188 | { return mdef->getMemberSpecifiers()==VhdlDocGen::VFILE; }␊ |
189 | static bool isGroup(const MemberDef *mdef) ␊ |
190 | { return mdef->getMemberSpecifiers()==VhdlDocGen::GROUP; }␊ |
191 | static bool isCompInst(const MemberDef *mdef) ␊ |
192 | { return mdef->getMemberSpecifiers()==VhdlDocGen::COMPONENT_INST; }␊ |
193 | ␊ |
194 | //-----------------------------------------------------␊ |
195 | // translatable items␊ |
196 | ␊ |
197 | static QCString trTypeString(int type);␊ |
198 | static QCString trVhdlType(int type,bool sing=true);␊ |
199 | ␊ |
200 | // trClassHierarchy.␊ |
201 | static QCString trDesignUnitHierarchy();␊ |
202 | ␊ |
203 | // trCompoundList␊ |
204 | static QCString trDesignUnitList();␊ |
205 | ␊ |
206 | // trCompoundMembers.␊ |
207 | static QCString trDesignUnitMembers();␊ |
208 | ␊ |
209 | // trCompoundListDescription␊ |
210 | static QCString trDesignUnitListDescription();␊ |
211 | ␊ |
212 | // trCompounds␊ |
213 | static QCString trDesignUnits();␊ |
214 | ␊ |
215 | // trCompoundIndex␊ |
216 | static QCString trDesignUnitIndex();␊ |
217 | ␊ |
218 | // trFunctions␊ |
219 | static QCString trFunctionAndProc();␊ |
220 | ␊ |
221 | ␊ |
222 | //-----------------------------------------------------␊ |
223 | ␊ |
224 | static void prepareComment(QCString&);␊ |
225 | static QCString getpackname(const char* text,␊ |
226 | const char* word,␊ |
227 | const char* patter);␊ |
228 | static void parseProcessProto(const char* text,␊ |
229 | QCString&,␊ |
230 | QStringList&);␊ |
231 | static void formatString(QCString&,OutputList& ol,const MemberDef*);␊ |
232 | ␊ |
233 | static void writeFormatString(QCString&,OutputList& ol,const MemberDef*);␊ |
234 | static void writeFunctionProto(OutputList& ol,const ArgumentList *al,const MemberDef*);␊ |
235 | static void writeProcessProto(OutputList& ol,const ArgumentList *al,const MemberDef*);␊ |
236 | static void writeProcedureProto(OutputList& ol, const ArgumentList *al,const MemberDef*);␊ |
237 | static void writeFuncProcDocu(const MemberDef *mdef, OutputList& ol,const ArgumentList* al,bool type=false);␊ |
238 | static void writeRecordProto(const MemberDef *mdef, OutputList& ol,const ArgumentList *al);␊ |
239 | ␊ |
240 | static QCString convertArgumentListToString(const ArgumentList* al,bool f);␊ |
241 | static QCString getProcessNumber();␊ |
242 | static QCString getRecordNumber();␊ |
243 | ␊ |
244 | static void writeVHDLTypeDocumentation(const MemberDef* mdef, const Definition* d, OutputList &ol);␊ |
245 | ␊ |
246 | static void writeVhdlDeclarations(MemberList*,OutputList&,GroupDef*,ClassDef*,FileDef*);␊ |
247 | ␊ |
248 | static void writeVHDLDeclaration(MemberDef* mdef,OutputList &ol,␊ |
249 | ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,␊ |
250 | bool inGroup);␊ |
251 | ␊ |
252 | static void writePlainVHDLDeclarations(MemberList* ml,OutputList &ol,␊ |
253 | ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,int specifier);␊ |
254 | ␊ |
255 | static void writeVHDLDeclarations(MemberList* ml,OutputList &ol,␊ |
256 | ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,␊ |
257 | const char *title,const char *subtitle,bool showEnumValues,int type);␊ |
258 | ␊ |
259 | static QCString getClassName(const ClassDef*);␊ |
260 | static bool writeClassType(ClassDef *,OutputList &ol ,QCString & cname);␊ |
261 | static void adjustRecordMember(MemberDef *mdef);␊ |
262 | static bool writeDoc(EntryNav* rootNav);␊ |
263 | ␊ |
264 | static void writeLink(const MemberDef* mdef,OutputList &ol);␊ |
265 | static void adjustMemberName(QCString& nn);␊ |
266 | static bool membersHaveSpecificType(MemberList *ml,int type);␊ |
267 | static void startFonts(const QCString& q, const char *keyword,OutputList& ol);␊ |
268 | static bool isNumber(const QCString& s);␊ |
269 | static QCString getProtectionName(int prot);␊ |
270 | ␉static void writeSource(MemberDef *mdef,OutputList& ol,QCString &);␊ |
271 | private:␊ |
272 | static void getFuncParams(QList<Argument>&, const char* str);␊ |
273 | static bool compareArgList(ArgumentList*,ArgumentList*);␊ |
274 | static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh);␊ |
275 | static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);␊ |
276 | static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol);␊ |
277 | static void writeCodeFragment(MemberDef *mdef,OutputList& ol);␊ |
278 | ␊ |
279 | };␊ |
280 | ␊ |
281 | #endif␊ |
282 |