Public Member Functions | List of all members
VHDLLanguageScanner Class Reference

VHDL parser using state-based lexical scanning. More...

#include <vhdljjparser.h>

Inheritance diagram for VHDLLanguageScanner:
ParserInterface

Public Member Functions

virtual ~VHDLLanguageScanner ()
 
void startTranslationUnit (const char *)
 
void finishTranslationUnit ()
 
void parseInput (const char *fileName, const char *fileBuf, Entry *root, bool sameTranslationUnit, QStrList &filesInSameTranslationUnit)
 
void parseCode (CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)
 
bool needsPreprocessing (const QCString &)
 
void resetCodeParserState ()
 
void parsePrototype (const char *text)
 
- Public Member Functions inherited from ParserInterface
virtual ~ParserInterface ()
 

Detailed Description

VHDL parser using state-based lexical scanning.

This is the VHDL language parser for doxygen.

Definition at line 41 of file vhdljjparser.h.

Constructor & Destructor Documentation

virtual VHDLLanguageScanner::~VHDLLanguageScanner ( )
inlinevirtual

Definition at line 44 of file vhdljjparser.h.

44 {}

Member Function Documentation

void VHDLLanguageScanner::finishTranslationUnit ( )
inlinevirtual

Called after all files in a translation unit have been processed.

Implements ParserInterface.

Definition at line 46 of file vhdljjparser.h.

46 {}
bool VHDLLanguageScanner::needsPreprocessing ( const QCString extension)
inlinevirtual

Returns TRUE if the language identified by extension needs the C preprocessor to be run before feed the result to the input parser.

See also
parseInput()

Implements ParserInterface.

Definition at line 68 of file vhdljjparser.h.

68 { return TRUE; }
const bool TRUE
Definition: qglobal.h:371
void VHDLLanguageScanner::parseCode ( CodeOutputInterface codeOutIntf,
const char *  scopeName,
const QCString input,
SrcLangExt  lang,
bool  isExampleBlock,
const char *  exampleName = 0,
FileDef fileDef = 0,
int  startLine = -1,
int  endLine = -1,
bool  inlineFragment = FALSE,
MemberDef memberDef = 0,
bool  showLineNumbers = TRUE,
Definition searchCtx = 0,
bool  collectXRefs = TRUE 
)
virtual

Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.

Parameters
[in]codeOutIntfAbstract interface for writing the result.
[in]langThe programming language of the code fragment.
[in]scopeNameName of scope to which the code belongs.
[in]inputActual code in the form of a string
[in]isExampleBlockTRUE iff the code is part of an example.
[in]exampleNameName of the example.
[in]fileDefFile definition to which the code is associated.
[in]startLineStarting line in case of a code fragment.
[in]endLineEnding line of the code fragment.
[in]inlineFragmentCode fragment that is to be shown inline as part of the documentation.
[in]memberDefMember definition to which the code is associated (non null in case of an inline fragment for a member).
[in]showLineNumbersif set to TRUE and also fileDef is not 0, line numbers will be added to the source fragement
[in]searchCtxcontext under which search data has to be stored.
[in]collectXRefscollect cross-reference relations.

Implements ParserInterface.

Definition at line 4524 of file vhdldocgen.cpp.

4539 {
4540 
4541 parseVhdlCode(codeOutIntf,
4542  scopeName,
4543  input,
4544  isExampleBlock,
4545  exampleName,
4546  fileDef,
4547  startLine,
4548  endLine,
4549  inlineFragment,
4550  memberDef,
4551  showLineNumbers,
4552  searchCtx,
4553  collectXRefs
4554 
4555 );
4556 
4557 
4558 
4559 
4560 
4561 
4562 }// class
void parseVhdlCode(CodeOutputInterface &od, const char *className, const QCString &s, bool, const char *exName, FileDef *fd, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool, Definition *searchCtx, bool)
Definition: vhdlcode.cpp:21974
bool collectXRefs
void VHDLLanguageScanner::parseInput ( const char *  fileName,
const char *  fileBuf,
Entry root,
bool  sameTranslationUnit,
QStrList filesInSameTranslationUnit 
)
virtual

Parses a single input file with the goal to build an Entry tree.

Parameters
[in]fileNameThe full name of the file.
[in]fileBufThe contents of the file (zero terminated).
[in,out]rootThe root of the tree of Entry *nodes representing the information extracted from the file.
[in]sameTranslationUnitTRUE if this file was found in the same translation unit (in the filesInSameTranslationUnit list returned for another file).
[in,out]filesInSameTranslationUnitother files expected to be found in the same translation unit (used for libclang)

Implements ParserInterface.

Definition at line 161 of file vhdljjparser.cpp.

163 {
164  g_thisParser=this;
165  bool inLine=false;
166  inputString=fileBuf;
167 
168  // fprintf(stderr,"\n ============= %s\n ==========\n",fileBuf);
169 
170  if (strlen(fileName)==0)
171  {
172  inLine=true;
173  }
174 
176 
177  bool xilinx_ucf=isConstraintFile(yyFileName,".ucf");
178  bool altera_qsf=isConstraintFile(yyFileName,".qsf");
179 
180  // support XILINX(ucf) and ALTERA (qsf) file
181 
182  if (xilinx_ucf)
183  {
184  VhdlDocGen::parseUCF(fileBuf,root,yyFileName,FALSE);
185  return;
186  }
187  if (altera_qsf)
188  {
189  VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE);
190  return;
191  }
192  libUse.setAutoDelete(true);
193  yyLineNr=1;
195  VhdlParser::lastCompound=0;
196  VhdlParser::lastEntity=0;
197  VhdlParser::currentCompound=0;
198  VhdlParser::lastEntity=0;
202  lineParse=new int[200]; // Dimitri: dangerous constant: should be bigger than largest token id in VhdlParserConstants.h
203  VhdlParserIF::parseVhdlfile(fileBuf,inLine);
204 
205  delete VhdlParser::current;
207 
208  if (!inLine)
209  VhdlParser::mapLibPackage(root);
210 
211  delete[] lineParse;
212  yyFileName.resize(0);
213  libUse.clear();
215 }
bool resize(uint newlen)
Definition: qcstring.h:225
Definition: entry.h:63
static int * lineParse
const bool FALSE
Definition: qglobal.h:370
static void resetCodeVhdlParserState()
static Entry * current_root
static int yyLineNr
void groupEnterFile(const char *fileName, int)
fileName
Definition: dumpTree.py:9
static QCString yyFileName
static QCString inputString
void clear()
Definition: qlist.h:82
static Entry * current
bool isConstraintFile(const QCString &fileName, const QCString &ext)
static void parseUCF(const char *input, Entry *entity, QCString f, bool vendor)
static ParserInterface * g_thisParser
static void initEntry()
static void parseVhdlfile(const char *inputBuffer, bool inLine)
static QList< Entry > libUse
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
void VHDLLanguageScanner::parsePrototype ( const char *  text)
virtual

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 ParserInterface.

Definition at line 410 of file vhdljjparser.cpp.

411 {
412  varName=text;
413  varr=TRUE;
414 }
static bool varr
static QCString varName
const bool TRUE
Definition: qglobal.h:371
void VHDLLanguageScanner::resetCodeParserState ( )
inlinevirtual

Resets the state of the code parser. Since multiple code fragments can together form a single example, an explicit function is used to reset the code parser state.

See also
parseCode()

Implements ParserInterface.

Definition at line 69 of file vhdljjparser.h.

69 {};
void VHDLLanguageScanner::startTranslationUnit ( const char *  fileName)
inlinevirtual

Starts processing a translation unit (source files + headers). After this call parseInput() is called with sameTranslationUnit set to FALSE. If parseInput() returns additional include files, these are also processed using parseInput() with sameTranslationUnit set to TRUE. After that finishTranslationUnit() is called.

Implements ParserInterface.

Definition at line 45 of file vhdljjparser.h.

45 {}

The documentation for this class was generated from the following files: