1 /******************************************************************************
5 * Copyright (C) 1997-2014 by Dimitri van Heesch.
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.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
21 #include "parserintf.h"
31 #include "vhdldocgen.h"
43 /** VHDL parser using state-based lexical scanning.
45 * This is the VHDL language parser for doxygen.
47 class VHDLLanguageScanner : public ParserInterface
50 virtual ~VHDLLanguageScanner() {}
51 void startTranslationUnit(const char *) {}
52 void finishTranslationUnit() {}
53 void parseInput(const char * fileName,
56 bool sameTranslationUnit,
57 QStrList &filesInSameTranslationUnit);
58 bool needsPreprocessing(const QCString &extension);
59 void parseCode(CodeOutputInterface &codeOutIntf,
60 const char *scopeName,
61 const QCString &input,
64 const char *exampleName=0,
68 bool inlineFragment=FALSE,
69 MemberDef *memberDef=0,
70 bool showLineNumbers=TRUE,
71 Definition *searchCtx=0,
72 bool collectXRefs=TRUE
74 void resetCodeParserState();
75 void parsePrototype(const char *text);
78 /** Container for vhdlscanner */
81 int yyLineNr; // current line no
82 int iLine; // line no of last t_identifier
83 QCString qstr; // t_identifier
84 QCString fileName; // current file
88 /** Configuration node for VHDL */
91 VhdlConfNode(const char* a,const char* b,const char* config,const char* cs,bool leaf)
93 arch=a; // architecture e.g. for iobuffer
95 binding=b; // binding e.g. use entiy work.xxx(bev)
96 binding=binding.lower();
97 confVhdl=config; // configuration foo is bar
99 isInlineConf=false; // primary configuration?
115 // returns the current conpound entity,architecture, package,package body
116 Entry* getVhdlCompound();
118 // return the current parsed entry
119 Entry* getCurrentVhdlEntry();
123 void initVhdlParser();
125 struct VhdlContainer* getVhdlCont();
127 // returns the parsed line
128 // @ param object index of vhdl keyword like t_Identifier t_Entity
129 int getParsedLine(int object);
131 void vhdlscanFreeScanner();
135 // return the list of component instantiations e.g. foo: component bar
136 QList<Entry> & getVhdlInstList();
138 // returns configuration list
139 QList<VhdlConfNode>& getVhdlConfiguration();
141 // returns library/used list
142 QList<Entry> & getLibUse();
144 void isVhdlDocPending();