Commit bc7aedbf authored by Dimitri van Heesch's avatar Dimitri van Heesch

Merge branch 'vhdl'

parents c9d816aa 36122e49
......@@ -17,6 +17,8 @@
/libmd5/Makefile.libmd5
/qtools/Makefile
/qtools/Makefile.qtools
/vhdlparser/Makefile
/vhdlparser/Makefile.vhdlparser
/src/Makefile.doxygen
/src/Makefile.libdoxycfg
/src/Makefile.libdoxygen
......
......@@ -21,6 +21,7 @@ clean: FORCE
- cd qtools ; $(MAKE) clean
- cd src ; $(MAKE) clean
- cd libmd5 ; $(MAKE) clean
- cd vhdlparser ; $(MAKE) clean
-cd addon/doxywizard ; $(MAKE) clean
-cd addon/doxysearch ; $(MAKE) clean
-cd addon/doxyapp ; $(MAKE) clean
......@@ -33,6 +34,7 @@ clean: FORCE
distclean: clean
-cd src ; $(MAKE) distclean
-cd libmd5 ; $(MAKE) distclean
-cd vhdlparser ; $(MAKE) distclean
-cd addon/doxywizard ; $(MAKE) distclean
-cd addon/doxysearch ; $(MAKE) distclean
-cd addon/doxyapp ; $(MAKE) distclean
......@@ -52,8 +54,9 @@ distclean: clean
-rm -f src/Makefile.doxygen src/Makefile.libdoxygen
-rm -f src/Makefile.libdoxycfg src/libdoxycfg.t src/libdoxygen.t
-rm -f libmd5/Makefile.libmd5
-rm -f vhdlparser/Makefile.vhdlparser
-rm -f .makeconfig .tmakeconfig
-rm -f src/doxygen.pro src/libdoxygen.pro qtools/qtools.pro src/libdoxycfg.pro libmd5/libmd5.pro
-rm -f src/doxygen.pro src/libdoxygen.pro qtools/qtools.pro src/libdoxycfg.pro libmd5/libmd5.pro vhdlparser/vhdlparser.pro
-rm -rf generated_src
-rm -f addon/doxywizard/doxywizard.pro
-rm -f VERSION
......@@ -95,7 +98,7 @@ docs: FORCE
pdf: docs
cd latex ; $(MAKE)
DISTFILES = Doxyfile libmd5 addon tmake doc examples bin lib objects testing \
DISTFILES = Doxyfile vhdlparser libmd5 addon tmake doc examples bin lib objects testing \
qtools src configure configure.bin Makefile.in Makefile.win_nmake.in \
Makefile.win_make.in INSTALL LANGUAGE.HOWTO LICENSE PLATFORMS \
VERSION README.md packages winbuild jquery
......
......@@ -868,7 +868,7 @@ INCLUDEPATH += $XAPIAN/include
EOF
fi
f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in addon/doxmlparser/examples/metrics/Makefile.in libmd5/Makefile.in addon/doxyapp/Makefile.in addon/doxysearch/Makefile.in"
f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in addon/doxmlparser/examples/metrics/Makefile.in libmd5/Makefile.in addon/doxyapp/Makefile.in addon/doxysearch/Makefile.in vhdlparser/Makefile.in"
for i in $f_inmakefiles ; do
SRC=$i
......@@ -893,7 +893,9 @@ EOF
echo "all: generated_src/doxygen/version.cpp $EXTRADEPS" >> $DST
echo " \$(MAKE) -C qtools" >> $DST
echo " \$(MAKE) -C libmd5" >> $DST
echo " \$(MAKE) -C vhdlparser" >> $DST
echo " \$(MAKE) -C src" >> $DST
if test $f_wizard = YES; then
echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard" >> $DST
fi
......@@ -930,7 +932,7 @@ done
cat src/libdoxycfg.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" -e "s|%%PYTHON%%|$f_python|g" > src/libdoxycfg.t
cat src/libdoxygen.t.in | sed -e "s|%%FLEX%%|$f_flex|g" -e "s|%%BISON%%|$f_bison|g" -e "s|%%PYTHON%%|$f_python|g" > src/libdoxygen.t
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libmd5/libmd5.pro.in addon/doxyapp/doxyapp.pro.in addon/doxysearch/doxysearch.pro.in addon/doxysearch/doxyindexer.pro.in"
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libmd5/libmd5.pro.in addon/doxyapp/doxyapp.pro.in addon/doxysearch/doxysearch.pro.in addon/doxysearch/doxyindexer.pro.in vhdlparser/vhdlparser.pro.in"
for i in $f_inprofiles ; do
SRC=$i
......
......@@ -2908,6 +2908,7 @@ void DocVhdlFlow::parse()
DBG(("DocVhdlFlow::parse() end\n"));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
VhdlDocGen::createFlowChart(g_memberDef);
}
......
......@@ -79,7 +79,7 @@
#include "store.h"
#include "marshal.h"
#include "portable.h"
#include "vhdlscanner.h"
#include "vhdljjparser.h"
#include "vhdldocgen.h"
#include "eclipsehelp.h"
#include "cite.h"
......
......@@ -18,18 +18,18 @@ TEMPLATE = app.t
CONFIG = console warn_on $extraopts
HEADERS = doxygen.h
SOURCES = main.cpp
unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5 -lpthread %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%%
unix:LIBS += -L../lib -ldoxygen -lvhdlparser -ldoxycfg -lqtools -lmd5 -lpthread %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%%
win32:INCLUDEPATH += .
win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5 -lpthread -llibiconv -lole32 %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%%
win32-msvc:LIBS += qtools.lib md5.lib doxygen.lib doxycfg.lib shell32.lib iconv.lib
win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lvhdlparser -lqtools -lmd5 -lpthread -llibiconv -lole32 %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%%
win32-msvc:LIBS += qtools.lib md5.lib doxygen.lib doxycfg.lib vhdlparser.lib shell32.lib iconv.lib
win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\lib
win32-borland:LIBS += qtools.lib md5.lib doxygen.lib doxycfg.lib shell32.lib iconv.lib
win32-borland:LIBS += qtools.lib md5.lib doxygen.lib doxycfg.lib vhdlparser.lib shell32.lib iconv.lib
win32-borland:TMAKE_LFLAGS += -L..\lib -L$(BCB)\lib\psdk
win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5 -liconv -lpthread %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%% -Wl,--as-needed -lole32
win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lvhdlparser -lqtools -lmd5 -liconv -lpthread %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%% -Wl,--as-needed -lole32
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
DEPENDPATH += ../generated_src/doxygen
INCLUDEPATH += ../qtools ../libmd5 .
INCLUDEPATH += ../qtools ../libmd5 . ../vhdlparser
DESTDIR = ../bin
TARGET = doxygen
unix:TARGETDEPS = ../lib/libdoxygen.a ../lib/libdoxycfg.a
......
......@@ -1773,14 +1773,35 @@ void HtmlDocVisitor::visitPost(DocHtmlBlockQuote *b)
forceStartParagraph(b);
}
void HtmlDocVisitor::visitPre(DocVhdlFlow *)
void HtmlDocVisitor::visitPre(DocVhdlFlow *vf)
{
if (m_hide) return;
if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
{
forceEndParagraph(vf);
QCString fname=FlowChart::convertNameToFileName();
m_t << "<p>";
m_t << "flowchart: " ; // TODO: translate me
m_t << "<a href=\"";
m_t << fname.data();
m_t << ".svg\">";
m_t << VhdlDocGen::getFlowMember()->name().data();
m_t << "</a>";
if (vf->hasCaption())
{
m_t << "<br />";
}
}
}
void HtmlDocVisitor::visitPost(DocVhdlFlow *)
void HtmlDocVisitor::visitPost(DocVhdlFlow *vf)
{
if (m_hide) return;
if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
{
m_t << "</p>";
forceStartParagraph(vf);
}
}
void HtmlDocVisitor::visitPre(DocParBlock *)
......
......@@ -115,11 +115,12 @@ HEADERS = arguments.h \
version.h \
vhdlcode.h \
vhdldocgen.h \
vhdlscanner.h \
xmldocvisitor.h \
xmlgen.h \
docbookvisitor.h \
docbookgen.h \
vhdljjparser.h
SOURCES = arguments.cpp \
cite.cpp \
......@@ -198,10 +199,10 @@ SOURCES = arguments.cpp \
xmlgen.cpp \
docbookvisitor.cpp \
docbookgen.cpp \
vhdljjparser.cpp \
../generated_src/doxygen/ce_parse.cpp \
../generated_src/doxygen/constexp.cpp \
../generated_src/doxygen/vhdlcode.cpp \
../generated_src/doxygen/vhdlscanner.cpp \
../generated_src/doxygen/code.cpp \
../generated_src/doxygen/commentcnv.cpp \
../generated_src/doxygen/commentscan.cpp \
......@@ -217,11 +218,13 @@ SOURCES = arguments.cpp \
../generated_src/doxygen/fortranscanner.cpp \
../generated_src/doxygen/version.cpp
win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-msvc:TMAKE_CXXFLAGS += -Zm200
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions
linux-g++:TMAKE_CXXFLAGS += -fno-exceptions
INCLUDEPATH += ../generated_src/doxygen ../src ../qtools ../libmd5
INCLUDEPATH += ../generated_src/doxygen ../src ../qtools ../libmd5 ../vhdlparser
INCLUDEPATH += %%SQLITE3_INC%%
DEPENDPATH += ../generated_src/doxygen
win32:INCLUDEPATH += .
......
......@@ -111,8 +111,7 @@ sub GenerateLex {
$(YACC) -l -d -p ce_parsexpYY constexp.y -o \$(GENERATED_SRC)/ce_parse.c
-rm $(GENERATED_SRC)/ce_parse.c
#$ GenerateDep("\$(GENERATED_SRC)/vhdlscanner.cpp","vhdlscanner.l");
#$ GenerateLex("vhdlscanner",1);
TO_C_CMD=$(PYTHON) to_c_cmd.py < $< > $@
......
......@@ -37,7 +37,7 @@
#include "parserintf.h"
#include "marshal.h"
#include "objcache.h"
#include "vhdlscanner.h"
#include "vhdldocgen.h"
#include "arguments.h"
#include "memberlist.h"
......
......@@ -169,6 +169,7 @@ void OutputList::writeDoc(DocRoot *root,Definition *ctx,MemberDef *md)
// ctx?ctx->getDefFileExtension().data():"<null>");
if (og->isEnabled()) og->writeDoc(root,ctx,md);
}
VhdlDocGen::setFlowMember(0);
}
bool OutputList::parseText(const QCString &textStr)
......
......@@ -1576,6 +1576,8 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString
// g_args.resize(0);
g_parmName.resize(0);
g_parmType.resize(0);
if(!g_lexInit)
VhdlDocGen::init();
if (memberDef)
{
setParameterList(memberDef);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/******************************************************************************
*
*
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
* Copyright (C) 1997-2013 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
......@@ -24,20 +22,24 @@
*/
#include <qdict.h>
#include <qlist.h>
#include <qcstring.h>
#include "layout.h"
#include "arguments.h"
#include "entry.h"
#include "memberlist.h"
class QStringList;
class Entry;
class ClassSDict;
class FileStorage;
class EntryNav;
class ClassDef;
class MemberList;
class MemberDef;
class FTextStream;
class OutputList;
class Definition;
class GroupDef;
class FileDef;
class NamespaceDef;
struct Argument;
/** Class for generating documentation specific for VHDL */
class VhdlDocGen
{
public:
......@@ -49,6 +51,7 @@ class VhdlDocGen
ARCHITECTURECLASS, // Overlays: Private
PACKAGECLASS // Overlays: Package
};
enum VhdlKeyWords
{
LIBRARY=1,
......@@ -68,10 +71,9 @@ class VhdlDocGen
USE,
PROCESS,
PORT,
DOCUMENT, //18 0x12
UNITS,
GENERIC,
COMPONENT_INST,
INSTANTIATION,
GROUP,
VFILE,
SHAREDVARIABLE,
......@@ -84,16 +86,14 @@ class VhdlDocGen
VhdlDocGen();
virtual ~VhdlDocGen();
static void init();
static QCString convertFileNameToClassName(QCString name);
// --- used by vhdlscanner.l -----------
static bool isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level);
static QCString getIndexWord(const char* ,int index);
static bool foundInsertedComponent(const QCString& name,Entry* root);
static bool deleteCharRev(QCString &s,char c);
static bool isFunctionProto(QCString& ss);
static Entry* findFunction(Entry* func);
static void deleteAllChars(QCString &s,char c);
static bool getSigName(QList<QCString>& ql, const char* str,QCString& buffer);
static bool getSigTypeName(QList<QCString>& ql,const char* str,QCString& buffer);
static void parseFuncProto(const char* text,
QList<Argument>& ,
QCString& name,
......@@ -104,13 +104,7 @@ class VhdlDocGen
static void computeVhdlComponentRelations();
static QCString* findKeyWord(const QCString& word);
static void addFuncDoc(EntryNav* root);
//static void MapArchitecturesToEntity(Entry* cur_root);
//static void MapComponentToEntity(const ClassSDict*);
static ClassDef* findComponent(int type);
static ClassDef* getPackageName(const QCString& name);
static MemberDef* findMember(const QCString& className,
const QCString& memName);
......@@ -120,69 +114,40 @@ class VhdlDocGen
const QCString& key,
MemberListType type);
static ClassDef *getClass(const char *name);
static Entry* findFunction(Entry* root,Entry* func);
static MemberDef* findFunction(const QList<Argument> &ql,
const QCString& name,
const QCString& package, bool type);
static bool compareString(const QCString& s1,
const QCString& s2);
static QCString getClassTitle(const ClassDef*);
static void writeInlineClassLink(const ClassDef*,
OutputList &ol);
//static void writeVhdlComponentList(OutputList &ol,int type);
static bool isMisc(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::MISCELLANEOUS; }
static bool isConfig(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::CONFIG; }
static bool isAlias(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::ALIAS; }
static bool isLibrary(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::LIBRARY; }
static bool isGeneric(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::GENERIC; }
static bool isPort(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::PORT; }
static bool isComponent(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::COMPONENT; }
static bool isPackage(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::USE; }
static bool isEntity(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::ENTITY; }
static bool isConstant(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::CONSTANT; }
static bool isVType(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::TYPE; }
static bool isSubType(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::SUBTYPE; }
static bool isVhdlFunction(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::FUNCTION; }
static bool isProcess(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::PROCESS; }
static bool isSignal(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }
static bool isAttribute(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::ATTRIBUTE; }
static bool isSignals(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }
static bool isProcedure(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::PROCEDURE; }
static bool isRecord(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::RECORD; }
static bool isArchitecture(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::ARCHITECTURE; }
static bool isUnit(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::UNITS; }
static bool isPackageBody(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::PACKAGE_BODY; }
static bool isVariable(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::SHAREDVARIABLE; }
static bool isFile(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::VFILE; }
static bool isGroup(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::GROUP; }
static bool isCompInst(const MemberDef *mdef)
{ return mdef->getMemberSpecifiers()==VhdlDocGen::COMPONENT_INST; }
static bool isConstraint(const MemberDef *mdef);
static bool isConfig(const MemberDef *mdef);
static bool isAlias(const MemberDef *mdef);
static bool isLibrary(const MemberDef *mdef);
static bool isGeneric(const MemberDef *mdef);
static bool isPort(const MemberDef *mdef);
static bool isComponent(const MemberDef *mdef);
static bool isPackage(const MemberDef *mdef);
static bool isEntity(const MemberDef *mdef);
static bool isConstant(const MemberDef *mdef);
static bool isVType(const MemberDef *mdef);
static bool isSubType(const MemberDef *mdef);
static bool isVhdlFunction(const MemberDef *mdef);
static bool isProcess(const MemberDef *mdef);
static bool isSignal(const MemberDef *mdef);
static bool isAttribute(const MemberDef *mdef);
static bool isSignals(const MemberDef *mdef);
static bool isProcedure(const MemberDef *mdef);
static bool isRecord(const MemberDef *mdef);
static bool isArchitecture(const MemberDef *mdef);
static bool isUnit(const MemberDef *mdef);
static bool isPackageBody(const MemberDef *mdef);
static bool isVariable(const MemberDef *mdef);
static bool isFile(const MemberDef *mdef);
static bool isGroup(const MemberDef *mdef);
static bool isCompInst(const MemberDef *mdef);
static bool isMisc(const MemberDef *mdef);
//-----------------------------------------------------
// translatable items
......@@ -211,17 +176,10 @@ class VhdlDocGen
// trFunctions
static QCString trFunctionAndProc();
//-----------------------------------------------------
static void prepareComment(QCString&);
static QCString getpackname(const char* text,
const char* word,
const char* patter);
static void parseProcessProto(const char* text,
QCString&,
QStringList&);
static void formatString(QCString&,OutputList& ol,const MemberDef*);
static void formatString(const QCString&,OutputList& ol,const MemberDef*);
static void writeFormatString(const QCString&,OutputList& ol,const MemberDef*);
static void writeFunctionProto(OutputList& ol,const ArgumentList *al,const MemberDef*);
......@@ -230,10 +188,6 @@ class VhdlDocGen
static bool writeFuncProcDocu(const MemberDef *mdef, OutputList& ol,const ArgumentList* al,bool type=false);
static void writeRecordProto(const MemberDef *mdef, OutputList& ol,const ArgumentList *al);
static QCString convertArgumentListToString(const ArgumentList* al,bool f);
static QCString getProcessNumber();
static QCString getRecordNumber();
static bool writeVHDLTypeDocumentation(const MemberDef* mdef, const Definition* d, OutputList &ol);
static void writeVhdlDeclarations(MemberList*,OutputList&,GroupDef*,ClassDef*,FileDef*,NamespaceDef*);
......@@ -249,28 +203,144 @@ class VhdlDocGen
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
const char *title,const char *subtitle,bool showEnumValues,int type);
static bool writeClassType(ClassDef *&,OutputList &ol ,QCString & cname);
static QCString convertArgumentListToString(const ArgumentList* al,bool f);
static QCString getProcessNumber();
static QCString getRecordNumber();
static QCString getClassName(const ClassDef*);
static bool writeClassType(ClassDef *,OutputList &ol ,QCString & cname);
static void adjustRecordMember(MemberDef *mdef);
static bool writeDoc(EntryNav* rootNav);
static void writeLink(const MemberDef* mdef,OutputList &ol);
static void adjustMemberName(QCString& nn);
static bool membersHaveSpecificType(MemberList *ml,uint64 type);
static void startFonts(const QCString& q, const char *keyword,OutputList& ol);
static bool isNumber(const QCString& s);
static QCString getProtectionName(int prot);
static void writeSource(MemberDef *mdef,OutputList& ol,QCString &);
static void writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef);
static void parseUCF(const char* input,Entry* entity,QCString f,bool vendor);
static bool findConstraintFile( LayoutNavEntry *lne);
static ClassDef* findArchitecture(const ClassDef *cd);
static ClassDef* findArchitecture(QCString identifier, QCString entity_name);
static void writeSource(MemberDef *mdef,OutputList& ol,QCString & cname);
static void writeAlphbeticalClass(OutputList& ol,const ClassDef* cd,const QCString &);
static QCString parseForConfig(QCString & entity,QCString & arch);
static QCString parseForBinding(QCString & entity,QCString & arch);
static void addBaseClass(ClassDef* cd,ClassDef *ent);
static ClassDef* findVhdlClass(const char *className );
static void writeOverview(OutputList &ol);
static void writeOverview();
// flowcharts
static void createFlowChart(const MemberDef*);
//static void addFlowImage(const FTextStream &,const QCString &);
static void setFlowMember( const MemberDef *flowMember);
static const MemberDef *getFlowMember();
static bool isVhdlClass (const Entry *cu)
{
return cu->spec==VhdlDocGen::ENTITY ||
cu->spec==VhdlDocGen::PACKAGE ||
cu->spec==VhdlDocGen::ARCHITECTURE ||
cu->spec==VhdlDocGen::PACKAGE_BODY;
}
private:
static void getFuncParams(QList<Argument>&, const char* str);
static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);
static bool compareArgList(ArgumentList*,ArgumentList*);
static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh);
static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);
static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol);
static void writeCodeFragment(MemberDef *mdef,OutputList& ol);
static void writeRecUnitDocu( const MemberDef *md, OutputList& ol,QCString largs);
static void writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef);
};
//-------------------------------------------------------------------------------------------------------------------
//-------------- VHDL Flowcharts -------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------
//#define DEBUGFLOW
class FlowChart
{
public:
enum nodeTypes {
IF_NO = 1<<1,
ELSIF_NO = 1<<2,
ELSE_NO = 1<<3,
CASE_NO = 1<<4,
WHEN_NO = 1<<5,
EXIT_NO = 1<<6,
END_NO = 1<<7,
TEXT_NO = 1<<8,
START_NO = 1<<9,
ENDIF_NO = 1<<10,
FOR_NO = 1<<11,
WHILE_NO = 1<<12,
END_LOOP = 1<<13,
END_CASE = 1<<14,
VARIABLE_NO = 1<<15,
RETURN_NO = 1<<16,
LOOP_NO = 1<<17,
NEXT_NO = 1<<18,
EMPTY_NO = 1<<19,
COMMENT_NO = 1<<20,
BEGIN_NO = 1<<21
};
//---------- create svg -------------------------------------------------------------
static void createSVG();
static void startDot(FTextStream &t);
static void endDot(FTextStream &t);
static void codify(FTextStream &t,const char *str);
static void writeShape(FTextStream &t,const FlowChart* fl);
static void writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom=FALSE,bool bTo=FALSE);
static void writeEdge(FTextStream &t,const FlowChart* fl_from,const FlowChart* fl_to,int i);
static void writeFlowLinks(FTextStream &t);
static QCString getNodeName(int n);
static void colTextNodes();
static int getNextTextLink(const FlowChart* fl,uint index);
static int getNextIfLink(const FlowChart*,uint);
static int getNextNode(int,int);
static int findNode(int index,int stamp,int type);
static int findNode(int index,int type);
static int findNextLoop(int j,int stamp);
static int findPrevLoop(int j,int stamp,bool endif=FALSE);
static int findLabel(int j,QCString &);
static void delFlowList();
static const char* getNodeType(int c);
static void addFlowChart(int type,const char* text,const char* exp,const char * label=NULL);
static void moveToPrevLevel();
static int getTimeStamp();
static void writeFlowChart();
static void alignFuncProc(QCString & q,const ArgumentList* al,bool isFunc);
static QCString convertNameToFileName();
static void printNode(const FlowChart* n);
static void printFlowTree();
static void buildCommentNodes(FTextStream &t);
static void alignCommentNode(FTextStream &t,QCString com);
static QList<FlowChart> flowList;
FlowChart(int typ,const char* t,const char* ex,const char* label=0);
~FlowChart();
private:
int id;
int stamp;
int type;
int line;
QCString label;
QCString text;
QCString exp;
};
#endif
/******************************************************************************
*
* Copyright (C) 2014 by M. Kreis
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
*/
#include <qcstring.h>
#include <qfileinfo.h>
#include <qstringlist.h>
#include "vhdljjparser.h"
#include "vhdlcode.h"
#include "vhdldocgen.h"
#include "message.h"
#include "config.h"
#include "doxygen.h"
#include "util.h"
#include "language.h"
#include "commentscan.h"
#include "index.h"
#include "definition.h"
#include "searchindex.h"
#include "outputlist.h"
#include "arguments.h"
#include "types.h"
#include "VhdlParserIF.h"
using namespace vhdl::parser;
using namespace std;
static ParserInterface *g_thisParser;
static QCString yyFileName;
static int yyLineNr = 1;
static bool docBlockAutoBrief = FALSE;
static char docBlockTerm = FALSE;
static int iDocLine = -1;
static int lineParseSize = 200;
static int* lineParse;
//-------------------------------------------------------
static QList<Entry> instFiles;
static QList<Entry> libUse;
Entry* VhdlParser::currentCompound=0;
Entry* VhdlParser::tempEntry=0;
Entry* VhdlParser::lastEntity=0 ;
Entry* VhdlParser::lastCompound=0 ;
Entry* VhdlParser::current=0;
Entry* VhdlParser::current_root = 0;
QCString VhdlParser::compSpec;
QCString VhdlParser::currName;
QCString VhdlParser::confName;
QCString VhdlParser::genLabels;
QCString VhdlParser::lab;
QCString VhdlParser::forL;
int VhdlParser::param_sec = 0;
int VhdlParser::parse_sec=0;
int VhdlParser::currP=0;
int VhdlParser::levelCounter;
static QList<VhdlConfNode> configL;
//-------------------------------------
QList<VhdlConfNode>& getVhdlConfiguration() { return configL; }
QList<Entry>& getVhdlInstList() { return instFiles; }
bool isConstraintFile(const QCString &fileName,const QCString &ext)
{
return fileName.right(ext.length())==ext;
}
void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root,
bool ,QStrList&)
{
bool inLine=false;
if (strlen(fileName)==0)
{
inLine=true;
}
yyFileName+=fileName;
bool xilinx_ucf=isConstraintFile(yyFileName,".ucf");
bool altera_qsf=isConstraintFile(yyFileName,".qsf");
// support XILINX(ucf) and ALTERA (qsf) file
if (xilinx_ucf)
{
VhdlDocGen::parseUCF(fileBuf,root,yyFileName,FALSE);
return;
}
if (altera_qsf)
{
VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE);
return;
}
libUse.setAutoDelete(true);
yyLineNr=1;
VhdlParser::current_root=root;
VhdlParser::lastCompound=0;
VhdlParser::lastEntity=0;
VhdlParser::currentCompound=0;
VhdlParser::lastEntity=0;
VhdlParser::current=new Entry();
VhdlParser::initEntry(VhdlParser::current);
groupEnterFile(fileName,yyLineNr);
lineParse=new int[lineParseSize];
VhdlParserIF::parseVhdlfile(fileBuf,inLine);
delete VhdlParser::current;
VhdlParser::current=0;
if (!inLine)
{
VhdlParser::mapLibPackage(root);
}
delete lineParse;
yyFileName.resize(0);
libUse.clear();
}
void VhdlParser::lineCount()
{
yyLineNr++;
}
void VhdlParser::lineCount(const char* text)
{
for (const char* c=text ; *c ; ++c )
{
yyLineNr += (*c == '\n') ;
}
}
void VhdlParser::initEntry(Entry *e)
{
e->fileName = yyFileName;
e->lang = SrcLangExt_VHDL;
initGroupInfo(e);
}
void VhdlParser::newEntry()
{
if (current->spec==VhdlDocGen::ENTITY ||
current->spec==VhdlDocGen::PACKAGE ||
current->spec==VhdlDocGen::ARCHITECTURE ||
current->spec==VhdlDocGen::PACKAGE_BODY)
{
current_root->addSubEntry(current);
}
else
{
if (lastCompound)
{
lastCompound->addSubEntry(current);
}
else
{
if (lastEntity)
{
lastEntity->addSubEntry(current);
}
else
{
current_root->addSubEntry(current);
}
}
}
//previous = current;
current = new Entry ;
initEntry(current);
}
void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
{
int position=0;
QCString doc(doc1);
VhdlDocGen::prepareComment(doc);
bool needsEntry=FALSE;
Protection protection=Public;
int lineNr = iDocLine;
if (brief)
current->briefLine = yyLineNr;
else
current->docLine = yyLineNr;
//printf("parseCommentBlock %p [%s]\n",current,doc.data());
while (parseCommentBlock(
g_thisParser,
current,
doc, // text
yyFileName, // file
lineNr, // line of block start
brief,
docBlockAutoBrief,
FALSE,
protection,
position,
needsEntry
)
)
{
//printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
if (needsEntry) newEntry();
}
if (needsEntry)
{
newEntry();
}
if (docBlockTerm)
{
// unput(docBlockTerm);
docBlockTerm=0;
}
lineCount(doc1);
}
void VhdlParser::addCompInst(char *n, char* instName, char* comp,int iLine)
{
current->spec=VhdlDocGen::INSTANTIATION;
current->section=Entry::VARIABLE_SEC;
current->startLine=iLine;
current->bodyLine=iLine;
current->type=instName; // foo:instname e.g proto or work. proto(ttt)
current->exception=genLabels.lower(); // |arch|label1:label2...
current->name=n; // foo
current->args=lastCompound->name; // architecture name
current->includeName=comp; // component/enity/configuration
int u=genLabels.find("|",1);
if (u>0)
{
current->write=genLabels.right(genLabels.length()-u);
current->read=genLabels.left(u);
}
//printf (" \n genlable: [%s] inst: [%s] name: [%s] %d\n",n,instName,comp,iLine);
if (lastCompound)
{
current->args=lastCompound->name;
if (true) // !findInstant(current->type))
{
initEntry(current);
instFiles.append(new Entry(*current));
}
Entry *temp=current; // hold current pointer (temp=oldEntry)
current=new Entry; // (oldEntry != current)
delete temp;
}
else
{
newEntry();
}
}
void VhdlParser::addVhdlType(const char *n,int startLine,int section,
uint64 spec,const char* args,const char* type,Protection prot)
{
static QRegExp reg("[\\s]");
QCString name(n);
if (isFuncProcProced() || VhdlDocGen::getFlowMember()) return;
if (parse_sec==GEN_SEC)
spec= VhdlDocGen::GENERIC;
QStringList ql=QStringList::split(",",name,FALSE);
for (uint u=0;u<ql.count();u++)
{
current->name=ql[u].utf8();
current->startLine=startLine;
current->bodyLine=startLine;
current->section=section;
current->spec=spec;
current->fileName=yyFileName;
if (current->args.isEmpty())
{
current->args=args;
}
current->type=type;
current->protection=prot;
if (!lastCompound && (section==Entry::VARIABLE_SEC) && (spec == VhdlDocGen::USE || spec == VhdlDocGen::LIBRARY) )
{
libUse.append(new Entry(*current));
current->reset();
}
newEntry();
}
}
void VhdlParser::createFunction(const char *imp,uint64 spec,
const char *fn)
{
QCString impure(imp);
QCString fname(fn);
current->spec=spec;
current->section=Entry::FUNCTION_SEC;
if (impure=="impure" || impure=="pure")
{
current->exception=impure;
}
if (parse_sec==GEN_SEC)
{
current->spec= VhdlDocGen::GENERIC;
current->section=Entry::FUNCTION_SEC;
}
if (currP==VhdlDocGen::PROCEDURE)
{
current->name=impure;
current->exception="";
}
else
{
current->name=fname;
}
if (spec==VhdlDocGen::PROCESS)
{
current->args=fname;
current->name=impure;
VhdlDocGen::deleteAllChars(current->args,' ');
if (!fname.isEmpty())
{
QStringList q1=QStringList::split(",",fname);
for (uint ii=0;ii<q1.count();ii++)
{
Argument *arg=new Argument;
arg->name=q1[ii].utf8();
current->argList->append(arg);
}
}
return;
}
}
bool VhdlParser::isFuncProcProced()
{
if (currP==VhdlDocGen::FUNCTION ||
currP==VhdlDocGen::PROCEDURE ||
currP==VhdlDocGen::PROCESS
)
{
return TRUE;
}
return FALSE;
}
void VhdlParser::pushLabel( QCString &label,QCString & val)
{
label+="|";
label+=val;
}
QCString VhdlParser::popLabel(QCString & q)
{
QCString u=q;
int i=q.findRev("|");
if (i<0) return "";
q = q.left(i);
return q;
}
void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,bool inlineConf)
{
VhdlConfNode* co=0;
QCString ent,arch,lab;
QCString l=genLabels;
ent=a;
// lab = VhdlDocGen::parseForConfig(ent,arch);
if (b)
{
ent=b;
// lab=VhdlDocGen::parseForBinding(ent,arch);
}
int level=0;
if(!configL.isEmpty())
{
VhdlConfNode* vc=configL.getLast();
level=vc->level;
if (levelCounter==0)
pushLabel(forL,ent);
else if (level<levelCounter)
{
if (!isLeaf)
{
pushLabel(forL,ent);
}
}
else if (level>levelCounter)
{
forL=popLabel(forL);
}
}
else
{
pushLabel(forL,ent);
}
if (inlineConf)
{
confName=lastCompound->name;
}
//fprintf(stderr,"\n[%s %d %d]\n",forL.data(),levelCounter,level);
co=new VhdlConfNode(a,b,confName.lower().data(),forL.lower().data(),isLeaf);
if (inlineConf)
{
co->isInlineConf=TRUE;
}
configL.append(co);
}// addConfigure
void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
const char *s4,const char *s5,const char *s6)
{
(void)s5; // avoid unused warning
static QRegExp reg("[\\s]");
QCString name=s2;
QStringList ql=QStringList::split(",",name,FALSE);
for (uint u=0;u<ql.count();u++)
{
Argument *arg=new Argument;
arg->name=ql[u].utf8();
if (s3)
{
arg->type=s3;
}
arg->type+=" ";
arg->type+=s4;
if (s6)
{
arg->type+=s6;
}
if (parse_sec==GEN_SEC && param_sec==0)
{
arg->defval="gen!";
}
if (parse_sec==PARAM_SEC)
{
// assert(false);
}
arg->defval+=s1;
arg->attrib="";//s6;
current->argList->append(arg);
current->args+=s2;
current->args+=",";
}
}
/*
* adds the library|use statements to the next class (entity|package|architecture|package body
* library ieee
* entity xxx
* .....
* library
* package
* enity zzz
* .....
* and so on..
*/
void VhdlParser::mapLibPackage( Entry* root)
{
QList<Entry> epp=libUse;
EntryListIterator eli(epp);
Entry *rt;
for (;(rt=eli.current());++eli)
{
if (addLibUseClause(rt->name))
{
Entry *current;
EntryListIterator eLib(*root->children());
bool bFound=FALSE;
for (eLib.toFirst();(current=eLib.current());++eLib)
{
if (VhdlDocGen::isVhdlClass(current))
if (current->startLine > rt->startLine)
{
bFound=TRUE;
current->addSubEntry(new Entry(*rt));
break;
}
}//for
if (!bFound)
{
root->addSubEntry(new Entry(*rt));
}
} //if
}// for
}//MapLib
bool VhdlParser::addLibUseClause(const QCString &type)
{
static bool showIEEESTD=Config_getBool("FORCE_LOCAL_INCLUDES");
if (showIEEESTD) // all standard packages and libraries will not be shown
{
if (type.lower().stripPrefix("ieee")) return FALSE;
if (type.lower().stripPrefix("std")) return FALSE;
}
return TRUE;
}
int VhdlParser::getLine()
{
return yyLineNr;
}
void VhdlParser::setLineParsed(int tok)
{
if (tok<lineParseSize) lineParse[tok]=yyLineNr;
}
int VhdlParser::getLine(int tok)
{
int val=lineParse[tok];
if(val<0) val=0;
//assert(val>=0 && val<=yyLineNr);
return val;
}
void VhdlParser::createFlow()
{
if (!VhdlDocGen::getFlowMember())
{
return;
}
QCString q,ret;
if (currP==VhdlDocGen::FUNCTION)
{
q=":function( ";
FlowChart::alignFuncProc(q,tempEntry->argList,true);
q+=")";
}
else if (currP==VhdlDocGen::PROCEDURE)
{
q=":procedure (";
FlowChart::alignFuncProc(q,tempEntry->argList,false);
q+=")";
}
else
{
q=":process( "+tempEntry->args;
q+=")";
}
q.prepend(VhdlDocGen::getFlowMember()->name().data());
FlowChart::addFlowChart(FlowChart::START_NO,q,0);
if (currP==VhdlDocGen::FUNCTION)
{
ret="end function ";
}
else if (currP==VhdlDocGen::PROCEDURE)
{
ret="end procedure";
}
else
{
ret="end process ";
}
FlowChart::addFlowChart(FlowChart::END_NO,ret,0);
// FlowChart::printFlowList();
FlowChart::writeFlowChart();
currP=0;
}
/******************************************************************************
*
*
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef VHDLSCANNER_H
#define VHDLSCANNER_H
#ifndef VHDLJJPARSER_H
#define VHDLJJPARSER_H
#include "parserintf.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <qarray.h>
#include <unistd.h>
#include <qfile.h>
#include <qdict.h>
#include "entry.h"
#include <string>
#include "memberlist.h"
#include "types.h"
#include "entry.h"
#include "vhdldocgen.h"
#include "qstringlist.h"
#include "vhdlcode.h"
#include "config.h"
enum { GEN_SEC=0x1, PARAM_SEC,CONTEXT_SEC,PROTECTED_SEC } ;
void parserVhdlfile(const char* inputBuffer);
class Entry;
class ClassSDict;
......@@ -38,7 +29,7 @@ class FileStorage;
class ClassDef;
class MemberDef;
class QStringList;
class VhdlConfNode;
/** \brief VHDL parser using state-based lexical scanning.
*
......@@ -55,7 +46,7 @@ class VHDLLanguageScanner : public ParserInterface
Entry *root,
bool sameTranslationUnit,
QStrList &filesInSameTranslationUnit);
bool needsPreprocessing(const QCString &extension);
void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName,
const QCString &input,
......@@ -69,14 +60,39 @@ class VHDLLanguageScanner : public ParserInterface
MemberDef *memberDef=0,
bool showLineNumbers=TRUE,
Definition *searchCtx=0,
bool collectXRefs=TRUE
);
void resetCodeParserState();
void parsePrototype(const char *text);
bool collectXRefs=TRUE);
bool needsPreprocessing(const QCString &) { return TRUE; }
void resetCodeParserState() {}
void parsePrototype(const char *) {}
};
void vhdlscanFreeScanner();
class VhdlConfNode
{
public:
VhdlConfNode(const char* a,const char* b,const char* config,const char* cs,bool leaf)
{
arch=a; // architecture e.g. for iobuffer
arch=arch.lower();
binding=b; // binding e.g. use entiy work.xxx(bev)
binding=binding.lower();
confVhdl=config; // configuration foo is bar
compSpec=cs;
isInlineConf=false; // primary configuration?
isLeaf=leaf;
};
//---------------------------------------------------------------------------------
QCString confVhdl;
QCString arch;
QCString binding;
QCString compSpec;
int level;
bool isLeaf;
bool isInlineConf;
};
void vhdlscanFreeScanner();
QList<VhdlConfNode>& getVhdlConfiguration();
QList<Entry>& getVhdlInstList();
#endif
/******************************************************************************
*
* Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
/******************************************************************************
* Parser for VHDL subset
* written by M. Kreis
* supports VHDL-87/93
* does not support VHDL-AMS
******************************************************************************/
%{
// global includes
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <qcstring.h>
#include <qfileinfo.h>
#include <qstringlist.h>
/* --------------------------------------------------------------- */
// local includes
#include "vhdlscanner.h"
#include "vhdlcode.h"
#include "vhdldocgen.h"
#include "message.h"
#include "config.h"
#include "doxygen.h"
#include "util.h"
#include "language.h"
#include "commentscan.h"
#include "index.h"
#include "definition.h"
#include "searchindex.h"
#include "outputlist.h"
#include "arguments.h"
/* --------------------------------------------------------------- */
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1
//#define theTranslator_vhdlType theTranslator->trVhdlType
#define theTranslator_vhdlType VhdlDocGen::getVhdlType
static QStringList qrl;
static int openGroups;
static ParserInterface *g_thisParser;
static const char * inputString;
static int inputPosition;
static int inputLen;
static int startComment = 0;
static QFile inputFile;
static QCString inbuf;
static Entry* global_root = 0;
static Entry* current_root = 0;
static Entry* current = 0;
static Entry* previous = 0;
static Entry* functionEntry = 0;
static Entry* lastEntity = 0;
static Entry* lastCompound = 0;
static int genPort = 0;
static QCString yyFileName;
static int iFuncLine = 1;
static bool g_inputFromFile ;
static bool g_lexInit = FALSE;
static int isBody=0;
static int isFunc=0;
static int yyLineNr = 1;
static char * g_buf = 0;
static uint g_bufSize = 0;
static int iTextCounter = 0;
static int iCounter = 0;
static int bropen = 0;
static int scantype = 0;
static int g_lastCommentContext = 0;
static bool docBlockAutoBrief;
static char docBlockTerm;
static int iDocLine = -1;
static Entry gBlock;
static int num_chars;
//#define YY_A_INTERACTIVE 1
#define YY_NEVER_INTERACTIVE 1
//-----------------------------------------------------------------------------
#define YY_USER_ACTION num_chars += yyleng;
static void parserInit();
static void deleteSpecChars(char* str,char *buf);
static void handleCommentBlock(const QCString &doc,bool brief);
static void newEntry();
static void initEntry(Entry *e);
static int iCodeLen;
static void makeInline()
{
int diff=num_chars-iCodeLen;
assert(inputLen>iCodeLen+diff);
QCString par(&inputString[iCodeLen],diff);
int index=par.findRev("\\endcode");
int tt=par.length()-par.find("\n",index);
QCString qc(&inputString[iCodeLen-tt],diff);
index=qc.findRev("--!");
if (index<=0) return;
par=qc.left(index);
/*
fprintf(stderr,"\n-------------------------------------------------------------------------------- ");
fprintf(stderr,"\n bytes since %d %d \n %s",num_chars,iCodeLen,par.data());
fprintf(stderr,"\n-------------------------------------------------------------------------------- ");
*/
gBlock.doc=par;
gBlock.section=Entry::VARIABLE_SEC;
gBlock.spec=VhdlDocGen::MISCELLANEOUS;
gBlock.fileName = yyFileName;
gBlock.endBodyLine=yyLineNr-1;
Entry *temp=new Entry(gBlock);
if (lastCompound)
lastCompound->addSubEntry(temp);
else if (lastEntity)
lastEntity->addSubEntry(temp);
else
{
temp->type="misc"; // global code
current_root->addSubEntry(temp);
}
gBlock.reset();
}// makeInline
static void addSubEntry(Entry* root, Entry* e)
{
if (e==0 || root==0) return;
//if (isPrevDoc)
//{
// e->brief=prevDocEntry.brief;
// e->briefLine=prevDocEntry.briefLine;
// prevDocEntry.reset();
// isPrevDoc=FALSE;
//}
root->addSubEntry(e);
}
static void bufferClear()
{
int j;
for (j=0;j<iCounter+1;j++)
{
g_buf[j]=0;
}
iCounter=0;
}
static void addText (char *word, int llen)
{
if ((uint)(iCounter + llen) > g_bufSize)
{
char *pTmp = (char*)realloc(g_buf,iCounter+llen+2048);
if (pTmp)
{
g_buf = pTmp;
}
else
{
fprintf(stderr,"\n not enough memory for realloc\n");
return;
}
}
while (llen>0)
{
g_buf[iCounter]=*word++;
iCounter++;
llen--;
}
g_buf[iCounter]='\0';
}
static void getBufText(QCString& qc,int start)
{
while (start < iCounter)
{
qc+=(g_buf[start]);
start++;
}
}
static void lineCount()
{
for ( const char* c = yytext ; *c ; ++c )
{
yyLineNr += (*c == '\n') ;
}
}
static void deleteSpecChars(char* str,char *buf)
{
while (*str)
{
if ((*str == '\t') || (*str == '\n') || (*str == '\r') || (*str == ' '))
{
str++;
}
else
{
*buf++ = *str++;
}
}
*buf='\0';
}
static void getType(Entry* p,char* text)
{
QCString name(text);
name=name.stripWhiteSpace();
if (qstricmp(name.data(),"signal" )==0)
{
p->spec=VhdlDocGen::SIGNAL;
}
else if (qstricmp(name.data(),"type" )==0)
{
p->spec=VhdlDocGen::TYPE;
}
else if (qstricmp(name.data(),"subtype" )==0)
{
p->spec=VhdlDocGen::SUBTYPE;
}
else if (qstricmp(name.data(),"constant" )==0)
{
p->spec=VhdlDocGen::CONSTANT;
}
else if (qstricmp(name.data(),"attribute" )==0)
{
p->spec=VhdlDocGen::ATTRIBUTE;
}
else if (qstricmp(name.data(),"function" )==0)
{
p->spec=VhdlDocGen::FUNCTION;
}
else if (qstricmp(name.data(),"procedure" )==0)
{
p->spec=VhdlDocGen::PROCEDURE;
}
else if (qstricmp(name.data(),"units" )==0)
{
p->spec=VhdlDocGen::UNITS;
}
else if (name.contains("shared",false) && name.contains("variable",false))
{
p->spec=VhdlDocGen::SHAREDVARIABLE;
}
else if (qstricmp(name.data(),"file" )==0)
{
p->spec=VhdlDocGen::VFILE;
}
else if (qstricmp(name.data(),"group" )==0)
{
p->spec=VhdlDocGen::GROUP;
}
else if (qstricmp(name.data(),"alias" )==0)
{
p->spec=VhdlDocGen::ALIAS;
}
else
{
err("wrong type");
}
p->section=Entry::VARIABLE_SEC;
}
//-------------------------------------------------------------------------
/*
* adds signals found in entities|records|units
*/
static void addSignals(const char* str,int line, Entry *e,const char *comment=0)
{
//printf("===> addSignals (%s) comment='%s'\n",str,comment);
QList<QCString> ql;
QCString bufio;
ql.setAutoDelete(TRUE);
VhdlDocGen::getSigName(ql,str,bufio);
int count = ql.count();
QCString brief = current->brief;
QCString doc = current->doc;
Entry *tmpEntry = current;
current = new Entry;
initEntry(current);
handleCommentBlock(comment,TRUE);
if (!current->brief.isEmpty())
{
if (doc.isEmpty())
{
doc = brief;
}
else if (!brief.isEmpty())
{
doc = brief + "<p>" + doc;
}
brief = current->brief;
}
delete current;
current = tmpEntry;
current->brief.resize(0);
current->doc.resize(0);
if (genPort!=3) // not a unit
{
for (int k=1;k<count;k++)
{
//printf("adding '%s' '%s'\n",ql.at(0)->data(),ql.at(k)->data());
Entry *pTemp=new Entry;
initEntry(pTemp);
pTemp->startLine = line;
pTemp->bodyLine = line;
pTemp->name = ql.at(k)->data();
pTemp->section = Entry::VARIABLE_SEC;
pTemp->brief = brief;
pTemp->doc = doc;
pTemp->mGrpId = current->mGrpId; // copy member group id
QCString stSpec = ql.at(0)->data();
if (genPort==1) // found port
{
pTemp->spec = VhdlDocGen::PORT;
stSpec.stripPrefix(bufio.data());
stSpec=stSpec.stripWhiteSpace();
pTemp->args = stSpec;
pTemp->type = bufio;
addSubEntry(e,pTemp);
}
else if (genPort==2) // found record
{
pTemp->spec = VhdlDocGen::RECORD;
pTemp->type = stSpec;
pTemp->name.prepend(VhdlDocGen::getRecordNumber());
delete current;
current = new Entry(*pTemp); // make a deep copy of pTemp
newEntry(); // add it to lastCompound and make a new current
delete pTemp;
}
else
{
pTemp->spec = VhdlDocGen::GENERIC;
pTemp->type = stSpec;
addSubEntry(e,pTemp);
}
}// for
}
else // found a unit
{
Entry *pTemp=new Entry;
initEntry(pTemp);
QCString tt(str);
QStringList ql=QStringList::split("=",tt,FALSE);
pTemp->spec = VhdlDocGen::UNITS;
pTemp->section = Entry::VARIABLE_SEC;
pTemp->startLine = line;
pTemp->bodyLine = line;
pTemp->brief = brief; // adds brief description to the unit member
pTemp->doc = doc; // adds doc to the unit member
pTemp->type = ql[1].utf8();
pTemp->name = ql[0].utf8().stripWhiteSpace();
pTemp->name.prepend(VhdlDocGen::getRecordNumber());
delete current;
current = new Entry(*pTemp); // make a deep copy
newEntry(); // add it to lastCompound
delete pTemp;
}
}
/*
* this function parses a process prototype
* and adds the signal to the process
*/
static void parseProcessProto()
{
QStringList ql;
QCString qcs;
bool sem=FALSE;
//Entry* ppEntry=new Entry;
//ppEntry->fileName=yyFileName;
//processEntry=ppEntry;
QCString name;
scantype=0;
getBufText(qcs,0);
if (qcs.contains('(') != qcs.contains(')')) return;
VhdlDocGen::deleteAllChars(qcs,'\n');
VhdlDocGen::parseProcessProto(qcs,name,ql);
current->section=Entry::FUNCTION_SEC;
//current->stat=TRUE;
current->spec=VhdlDocGen::PROCESS;
current->startLine=iFuncLine;
current->bodyLine=iFuncLine;
current->fileName=yyFileName;
if (!name.isEmpty())
{
current->name=name.stripWhiteSpace();
}
else // found an anonymous process, so we add a generated name
{
current->name=VhdlDocGen::getProcessNumber();
}
current->args+=" ( ";
if (!ql.isEmpty())
{
QValueList<QString>::Iterator iter = ql.begin();
for ( ; iter != ql.end(); ++iter)
{
if (sem)
{
current->args+=',';
}
Argument *arg=new Argument;
arg->name=(*iter).utf8().stripWhiteSpace();
current->argList->append(arg);
current->args+=(*iter).utf8();
sem = TRUE;
}
}
current->args+=" ) ";
bufferClear();
}//parseProcessProto
/*
* parses a function|procedure protoype
*/
static void parseFunctionProto()
{
QCString name,ret,qcs,temp;
bool sem=FALSE;
QList<Argument> ql;
ql.setAutoDelete(TRUE);
getBufText(qcs,0);
if (qcs.contains('(') != qcs.contains(')'))
return; // function without a prototype
if (qcs.contains("function",FALSE)==0 && qcs.contains("procedure",FALSE)==0)
return;
qcs=qcs.stripWhiteSpace();
temp=qcs.lower();
if (temp.stripPrefix("impure"))
{
current->exception="impure";
qcs=qcs.remove(0,6);
}
else if (temp.stripPrefix("pure"))
{
current->exception="pure";
qcs=qcs.remove(0,4);
}
VhdlDocGen::parseFuncProto(qcs.data(),ql,name,ret);
//printf("parseFuncProto(%s)=%s,%s\n",qcs.data(),name.data(),ret.data());
VhdlDocGen::deleteAllChars(name,';');
current->name=name;
current->startLine=iFuncLine;
current->bodyLine=iFuncLine;
int count = ql.count();
current->args+" ( ";
for (int k=0;k<count;k++)
{
if (sem)
{
current->args+=",";
}
Argument *arg=new Argument;
Argument *hh=(Argument*)ql.at(k);
arg->name=hh->name;
arg->type=hh->type;
arg->defval=hh->defval;
arg->attrib=hh->attrib;
current->argList->append(arg);
current->args+=hh->name;
sem=TRUE;
}
current->args+" )";
if (!ret.isEmpty())
current->spec=VhdlDocGen::FUNCTION;
else
current->spec=VhdlDocGen::PROCEDURE;
current->section=Entry::FUNCTION_SEC;
current->type=ret;
//addSubEntry(ee,ppEntry);
if (lastCompound)
{
lastCompound->addSubEntry(current);
current = new Entry;
initEntry(current);
}
else
{
newEntry();
}
bufferClear();
}//parseFunctionProto
static Entry* getEntryAtLine(const Entry* ce,int line)
{
EntryListIterator eli(*ce->children());
Entry *found=0;
Entry *rt;
for (;(rt=eli.current());++eli)
{
if (rt->bodyLine==line)
{
found=rt;
} // if
if (!found)
{
found=getEntryAtLine(rt,line);
}
}
return found;
}// getEntryAtLine
//-------------------------------------------------------------------------
static void parserInit()
{
iCounter=0;
iTextCounter=0;
yyLineNr=1;
current=0;
previous=0;
isFunc=0;
isBody=0;
scantype=0;
lastCompound=0;
lastEntity=0;
bropen=0;
openGroups=0;
iDocLine=-1;
qrl.clear();
num_chars=0;
if (!g_lexInit)
{
VhdlDocGen::init();
}
g_bufSize=inputFile.size()+1024;
if (g_buf==0) free(g_buf);
g_buf=(char*)(calloc(g_bufSize,sizeof(char)));
if (g_buf==0)
{
fprintf(stderr,"\n not enough memory");
return;
}
g_buf[g_bufSize-1]='\0';
}
bool VHDLLanguageScanner::needsPreprocessing(const QCString &)
{
return FALSE;
}
void VHDLLanguageScanner::resetCodeParserState()
{
}
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
static int yyread(char *buf,int max_size)
{
int c=0;
if (g_inputFromFile)
{
c = inputFile.readBlock(buf,max_size);
if (c==-1) yy_fatal_error("input in flex scanner failed");
}
else
{
while ( c < max_size && inputString[inputPosition] )
{
*buf = inputString[inputPosition++] ;
c++;
buf++;
}
}
return c;
}
%}
/* start command character */
/* -------------- VHDL SECTION -----------------------------------*/
B [ \t]
CR [\r\n]
BR [ \t\n\r]
DIGIT [0-9]
LOWER_CASE_LETTER [a-z]
UPPER_CASE_LETTER [A-Z]
LETTER [a-zA-Z_0-9]
SPACE_CHARACTER [ \t]
SPECIAL_CHARACTER [#&'()*+,\-\./:;<=>_|]
OTHER_SPECIAL_CHARACTER [~!$§%?@\[\\\]^{}]
BASIC_GRAPHIC_CHARACTER {UPPER_CASE_LETTER}|{DIGIT}|{SPECIAL_CHARACTER}|{SPACE_CHARACTER}
GRAPHIC_CHARACTER {BASIC_GRAPHIC_CHARACTER}|{LOWER_CASE_LETTER}|{OTHER_SPECIAL_CHARACTER}
EXTENDED_CHARACTER [\\]{GRAPHIC_CHARACTER}*[\\]
NAME ({LETTER}[a-zA-Z0-9_.]*)|{EXTENDED_CHARACTER}
STRING_LITERAL \"{GRAPHIC_CHARACTER}*\"
FUNCNAME ([a-zA-Z"][*+\-_a-zA-Z0-9"\/=<>]*)|{EXTENDED_CHARACTER}
DIGITS [0-9]+|[0-9]+"."[0-9]+|[0-9]+"#"[0-9_a-fA-F\+\.]+"#"
COMMENT "--"[^\n]*
LABELID [a-z_A-Z][^\;]*";"({B}*{COMMENT})*
PROTO [ (]*
TEXTT "--"[^\/\@\*\#][^\n]*
PROC ("function"|"procedure")
ENDE ({BR}*("end"){BR}*{PROC}*{BR}*[;]{1})
ENDEFF ("if"|"case"|"loop"|"generate"){BR}*[;]
ENDE3 ({BR}*("end"){BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;])|{ENDE}
ENDFUNC {B}*"end"{BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;]
FUNCIMPURE "impure"|"pure"
FUNCPROC ^{B}*{FUNCIMPURE}*{BR}*("function"|"procedure"){B}*
ARCHITECTURE ("architecture"){BR}+{NAME}{BR}*("of")
/* Removed due to bug 538239
POST "postponed"
PROCESS ({BR}*{FUNCNAME}{B}*[:]{BR}*({POST}{BR}+)?("process"){BR}*{PROTO})|("process"){BR}*("("){BR}*{PROTO}|[^a-zA-Z]("process"){CR}|[^a-zA-Z]("process"){BR}+("is")
*/
PROCESS ({B}*{FUNCNAME}{B}*:{BR}*)?({B}*("postponed"){BR}+)?{B}*("process"){BR}*{PROTO}
ENDPROCESS ("end"){BR}*("postponed")*("process"){BR}*{FUNCNAME}*{BR}*[;]
LIBUSE ^{B}*("use"|"library"){BR}+
ENTITY ^{B}*("component"|"entity"|"package"){BR}+
PBODY ("package"){B}+("body"){BR}+{NAME}
SHARED ("shared"){BR}+("variable")
SIGTYPES ^{B}*({SHARED}|"alias"|"file"|"group"|"subtype"|"type"|"constant"|"attribute"|"signal"|"units"){BR}+
CONFIG ("configuration"){BR}+{NAME}{BR}*("of"){BR}+{NAME}{BR}+"is"
ALLTYPESMAP {B}*[_a-zA-ZA_Z0-9.() ]*{B}*
MAPCOMPONENT ({ALLTYPESMAP}{BR}*[:]{BR}*("component"|"configuration")*{ALLTYPESMAP}{BR}*{TEXTT}*{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1})
MAPCOMPONENT1 ({ALLTYPESMAP}{BR}*[:]{BR}*("entity"){BR}*{ALLTYPESMAP}{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1})
BRACEOPEN [(]{1}
BRACECLOSE [)]{1}
ALLID [^;()\t ]
/* VHDL 2001 */
ENDPROTECTED ("end"{BR}+"protected"{BR}+{NAME}{BR}*";")|("end"{BR}+"protected"{BR}*";")
ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME}
%option noyywrap
/* language parsing states */
%x Start
%x Comment
%x FindTypeName
%x ParseType
%x ParseRecord
%x ParseUnits
%x ParseProcess
%x ParseFunc
%x FindName
%x FindEntityName
%x FindGenPort
%x FindTypes
%x FindSigName
%x FindFuncName
%x FindBegin
%%
<Start>{ENDPROTECTED}|{ENDPROTECEDBODY} {
lineCount();
}
<Start>{CONFIG} { // found configuration
QCString qcs(vhdlscannerYYtext);
current->name=VhdlDocGen::getIndexWord(qcs,1);
current->type=VhdlDocGen::getIndexWord(qcs,3);
current->startLine=yyLineNr;
current->bodyLine=yyLineNr;
current->section=Entry::VARIABLE_SEC;
current->spec=VhdlDocGen::CONFIG;
current->args="configuration";
newEntry();
BEGIN(Start);
}
<Start>{SIGTYPES} { // found type constant|type|attribute and so on..
bropen=0;
lineCount();
bufferClear();
//pEntry=current;
getType(current,yytext);
current->bodyLine=yyLineNr;
if (current->spec==VhdlDocGen::UNITS)
{
//addSubEntry(current,pEntry);
current->startLine=yyLineNr;
current->bodyLine=yyLineNr;
newEntry(); // adds the unit to the lastCompound
genPort=3;
BEGIN(ParseRecord);
}
else
{
BEGIN(FindTypeName);
}
}
<Start>{ARCHITECTURE} { //found architecure
lineCount();
bropen=0;
bufferClear();
isBody=0;
lastCompound = current;
QCString curName=VhdlDocGen::getIndexWord(yytext,1);
current->section=Entry::CLASS_SEC; //Entry::CLASS_SEC;
current->spec=VhdlDocGen::ARCHITECTURE;
current->protection=Private;
current->name=curName;
current->fileName=yyFileName;
current->startLine=yyLineNr;
current->bodyLine=yyLineNr;
//printf("-> Architecture at line %d\n",yyLineNr);
BEGIN(FindName);
}
<Start>{PROCESS} { //found process
lineCount();
iFuncLine=yyLineNr;
bropen=0;
//printf("--> Process: line=%d\n",yyLineNr);
bufferClear();
addText(yytext,yyleng);
QCString qcs(yytext);
if (qcs.contains('('))
{
bropen=1;
scantype=2;
BEGIN(ParseType);
}
else
{
// iFuncLine--;
parseProcessProto();
BEGIN(ParseProcess);
}
}
<Start>{LIBUSE}{BR}* { // found library or package
bropen=0;
bufferClear();
isBody=0;
QCString qcs=QCString(yytext);
// lowerString(qcs);
qcs=qcs.stripWhiteSpace();
if (qstricmp(qcs.data(),"use")==0)
{
current->spec=VhdlDocGen::USE;
current->type="package";
}
else
{
current->spec=VhdlDocGen::LIBRARY;
current->type="library";
}
current->section=Entry::VARIABLE_SEC;
current->bodyLine=yyLineNr;
lineCount();
BEGIN(FindName);
}
<Start>{FUNCPROC} { // found a new function|procedure
lineCount();
iFuncLine=yyLineNr;
bropen=0;
bufferClear();
isFunc=1;
addText(yytext,yyleng);
BEGIN(FindFuncName);
}
<Start>{ENTITY} { // found entity|component|package
lineCount();
//printf("--> Entity at line %d\n",yyLineNr);
bropen=0;
bufferClear();
QCString word = QCString(yytext).lower().stripWhiteSpace();
if (word=="entity")
{
isBody=0;
scantype=0;
lastCompound=0;
current->section=Entry::CLASS_SEC;
current->spec=VhdlDocGen::ENTITY;
current->protection=Public;
current->bodyLine=yyLineNr;
current->fileName=yyFileName;
lastEntity = current;
}
else if (word=="component")
{
current->section=Entry::VARIABLE_SEC;
// current->stat=TRUE;
current->spec=VhdlDocGen::COMPONENT;
current->bodyLine=yyLineNr;
scantype=1;
}
else if (word=="package")
{
isBody=0;
scantype=0;
lastCompound = current;
current->section=Entry::NAMESPACE_SEC;
current->spec=VhdlDocGen::PACKAGE;
current->protection=Package; //VhdlDocGen::PACKAGE;
current->bodyLine=yyLineNr;
current->fileName=yyFileName;
}
else
err("\n found wrong component at line [%d]",yyLineNr);
BEGIN(FindEntityName);
}
<Start>{MAPCOMPONENT}|{MAPCOMPONENT1} { // found component instantiation
// lineCount();
QCString type;
QCString tt(yytext);
QRegExp regg("[\\s:.()-]");
QStringList qsl=QStringList::split(regg,tt,false);
// consider upper/lower-case letters
QStringList qsltemp=QStringList::split(regg,tt.lower(),false);
int index=qsltemp.findIndex(QCString("entity"))+1;
index+=qsltemp.findIndex(QCString("component"))+1;
index+=qsltemp.findIndex(QCString("configuration"))+1;
int len=qsltemp.count();
current->spec=VhdlDocGen::COMPONENT_INST;
current->section=Entry::VARIABLE_SEC;
current->startLine=yyLineNr;
current->bodyLine=yyLineNr;
if (index!=0 && tt.contains(')')==0) // found component instantiation xxx: configuration/component/entity yyy
{
current->type=qsl[len-3].utf8();
}
else if (index!=0 && tt.contains(')')) // found component instantiation xxx: entity www.yyy(zzz)
{
current->type=qsl[len-4].utf8();
}
else
{
current->type=qsl[1].utf8(); // found component instantiation xxx:yyy
}
current->name=qsl[0].utf8();
#if 0
if (lastCompound)
{
if (!VhdlDocGen::foundInsertedComponent(current->type,lastCompound))
{
printf("** %s: new BaseInfo(%s)\n",lastCompound->name.data(),current->type.data());
BaseInfo *bb=new BaseInfo(current->type,Public,Normal);
lastCompound->extends->append(bb);
}
lastCompound->addSubEntry(current);
current = new Entry;
initEntry(current);
}
else
#endif
{
newEntry();
}
lineCount();
}
<Start>{CR}* {
lineCount();
addText(yytext,yyleng);
BEGIN(Start);
}
<ParseProcess>[^;()] {
// eat process body
lineCount();
BEGIN(ParseProcess);
}
<ParseProcess,ParseType>{ENDPROCESS} { // find end of process
lineCount();
current->endBodyLine=yyLineNr;
//printf("Process: start=%d end=%d\n",current->bodyLine,current->endBodyLine);
if (lastCompound)
{
lastCompound->addSubEntry(current);
current = new Entry;
initEntry(current);
}
else
{
newEntry();
}
BEGIN(Start);
}
<ParseUnits>{BR}* {
lineCount();
}
<ParseUnits>{B}*[a-z_][^\n;]* { // parse record|unit body
lineCount();
QCString zz(yytext);
addSignals(zz.data(),yyLineNr,current);
BEGIN(ParseUnits);
}
<FindName>{NAME} { // found entity|architecture|component name
lineCount();
QCString qcs(yytext);
qcs=qcs.stripWhiteSpace();
if (current->spec==VhdlDocGen::USE || current->spec==VhdlDocGen::LIBRARY)
{
int j=qcs.length();
int i=qcs.find(".");
if (i>0)
qcs=qcs.right(j-i-1);
i=qcs.find(".");
if (i>0)
qcs=qcs.left(i);
/*
-- Consider the case we have more than one entity in one file.Each entity has its own package/library
-- declaration. In this case package yyy will be added [with newEntry()] to architecture aaa !! instead to entity
-- bbb. We must place these constructs to current_root and the function mapLibPackage() will finish the rest.
-- package xxx;
-- entity aaa
-- ....
-- end entity aaa;
-- architecture aaa
-- ...
-- end architecture aaa;
-- package yyy;
-- entity bbb;
*/
current->name=qcs;
Entry *copy=new Entry(*current);
current->reset();
addSubEntry(current_root,copy); // insert into entry list with mapLibPackage()
}
else if (current->spec==VhdlDocGen::ARCHITECTURE)
{
//current->name+=qcs.lower();
current->name.prepend(qcs+"::");
//if (lastEntity)
//{
// inherit private inheritance relation between entity and architecture
//if (!VhdlDocGen::foundInsertedComponent(current->name,lastEntity))
//{
// BaseInfo *bb=new BaseInfo(current->name,Private,Normal);
// lastEntity->extends->append(bb);
//}
//}
}
else if (current->spec==VhdlDocGen::PACKAGE_BODY)
{
current->name+=qcs;
}
else
{
current->name+=qcs;
}
if (!(current->spec==VhdlDocGen::USE || current->spec==VhdlDocGen::LIBRARY))
newEntry();
BEGIN(Start);
}
<FindFuncName>{FUNCNAME} { // found name of a process|function|procedure
lineCount();
addText(yytext,yyleng);
BEGIN(ParseType);
}
<FindTypeName>{NAME}{BR}* {
lineCount();
current->name=QCString(yytext);
BEGIN(ParseType);
}
<ParseType>("is"){BR}+("protected"){BR}+("body") {lineCount(); BEGIN(Start); }
<ParseType>("is"){BR}+("protected"){BR}+ {
lineCount();
current->section=Entry::VARIABLE_SEC;
current->spec=VhdlDocGen::TYPE;
current->type="protected";
newEntry();
BEGIN(Start);
}
<ParseType>("is"){BR}*("record") { // find record
lineCount();
if (isFunc)
{
BEGIN(Start);
}
genPort=2;
current->section=Entry::VARIABLE_SEC;
current->spec=VhdlDocGen::RECORD;
addText(yytext,yyleng);
newEntry(); // adds the record to the last compound
BEGIN(ParseRecord);
}
<ParseRecord>{BR}* {
lineCount();
}
<ParseRecord>("end"){BR}*("record"){BR}*{LETTER}*{BR}*[;]|("end"){BR}*("units"){BR}*[;] {
lineCount();
genPort=0;
bufferClear();
BEGIN(Start);
}
<ParseRecord>[a-z_A-Z0-9][^\n;]*";"({B}*{COMMENT})* { // parse record body
lineCount();
QCString comment;
QCString zz(yytext);
VhdlDocGen::deleteAllChars(zz,';'); //delete ; in unit construct
if (zz.contains("--!"))
{
QStringList ql=QStringList::split("--!",zz,FALSE);
comment = ql[1].utf8();
zz = ql[0].utf8();
}
else if (zz.contains("--"))
{
QStringList ql=QStringList::split("--",zz,FALSE);
zz = ql[0].utf8();
}
initEntry(current);
addSignals(zz,yyLineNr,current,comment);
addText(yytext,yyleng);
BEGIN(ParseRecord);
}
<ParseType>{BR}+("is"){BR}+|{BR}+("is"){B}*"--" { // found a new function in an architecture ?
addText(yytext,yyleng);
lineCount();
QCString ttt;
bool bb=TRUE;
getBufText(ttt,0);
if (ttt.contains("--"))
{
unput('-');unput('-');
VhdlDocGen::deleteCharRev(ttt,'-');
VhdlDocGen::deleteCharRev(ttt,'-');
}
if (ttt.contains('(') != ttt.contains(')'))
{
bb=FALSE;
}
bool ss = VhdlDocGen::isFunctionProto(ttt);
//printf("VhdlDocGen::isFunctionProto(%s)=%d\n",ttt.data(),ss);
if (ss && bb)
{
bufferClear();
addText(ttt.data(),ttt.length());
functionEntry=0;
//eFuncBody=new Entry;
::parseFunctionProto();
}
bufferClear();
BEGIN(ParseType);
}
<ParseType>[^;()\t ] {
lineCount();
addText(yytext,yyleng);
BEGIN(ParseType);
}
<ParseType>{BRACEOPEN} {
lineCount();
bropen++;
addText(yytext,yyleng);
BEGIN(ParseType);
}
<ParseType>{BRACECLOSE} {
lineCount();
bropen--;
addText(yytext,yyleng);
if (bropen==0 && scantype==2) // process
{
::parseProcessProto();
BEGIN(ParseProcess);
} // if
else
{
BEGIN(ParseType);
}
}
<ParseType>{ENDE}|{ENDFUNC} { // found end of function|process
QRegExp regg("[\\s;]");
lineCount();
QCString tt(yytext);
tt=tt.lower();
QStringList ql=QStringList::split(regg,tt,FALSE);
int index=ql.findIndex(QCString("if"))+1;
index+=ql.findIndex(QCString("case"))+1;
index+=ql.findIndex(QCString("loop"))+1;
index+=ql.findIndex(QCString("generate"))+1;
bufferClear();
if (index==0)
{
if (isFunc)
{
Entry* pFunc=getEntryAtLine(current_root,iFuncLine);
if (pFunc && pFunc->section==Entry::FUNCTION_SEC)
{
pFunc->endBodyLine=yyLineNr;
}
isFunc=0;
BEGIN(Start);
}
}
}
<ParseFunc>[^;()] {
// eat process body
lineCount();
BEGIN(ParseFunc);
}
<ParseFunc>{ENDE3} {
QRegExp regg("[\\s;]");
lineCount();
QCString tt(yytext);
tt=tt.lower();
QStringList ql=QStringList::split(regg,tt,FALSE);
int index=ql.findIndex(QCString("if"))+1;
index+=ql.findIndex(QCString("case"))+1;
index+=ql.findIndex(QCString("loop"))+1;
index+=ql.findIndex(QCString("generate"))+1;
bufferClear();
if (index==0 && isFunc)
{
Entry* pFunc=getEntryAtLine(current_root,iFuncLine);
if (pFunc && pFunc->section==Entry::FUNCTION_SEC)
{
pFunc->endBodyLine=yyLineNr;
}
isFunc=0;
BEGIN(Start);
}
}
<ParseType>";" {
lineCount();
addText(yytext,yyleng);
if (bropen==0 && !(isFunc==1 && isBody==1) )
{
if (isFunc)
{
parseFunctionProto();
bufferClear();
if (lastCompound && lastCompound->spec==VhdlDocGen::PACKAGE)
{
isFunc=0;
BEGIN(Start);
}
else
{
BEGIN(ParseFunc);
}
}//if
else
{
QCString qcs;
getBufText(qcs,0);
qcs=qcs.stripWhiteSpace();
current->section=Entry::VARIABLE_SEC;
current->type+=qcs.data();
if ((current->spec==VhdlDocGen::SIGNAL ||
current->spec==VhdlDocGen::CONSTANT ||
current->spec==VhdlDocGen::TYPE ||
current->spec==VhdlDocGen::SUBTYPE ||
current->spec==VhdlDocGen::SHAREDVARIABLE
) &&
qcs.stripPrefix(","))
{
QList<QCString> ql;
ql.setAutoDelete(TRUE);
QCString buffer;
if (current->spec==VhdlDocGen::SUBTYPE ||
current->spec==VhdlDocGen::TYPE
)
{
VhdlDocGen::getSigTypeName(ql,qcs.data(),buffer);
}
else
{
VhdlDocGen::getSigName(ql,qcs.data(),buffer);
}
QCString doc = current->doc;
QCString brief = current->brief;
if (ql.count()>0)
{
for (uint j=1;j<ql.count();j++)
{
Entry *ppt = new Entry;
initEntry(ppt);
ppt->type += ql.at(0)->data();
ppt->section = Entry::VARIABLE_SEC;
ppt->spec = current->spec;
ppt->name += ql.at(j)->data();
ppt->bodyLine = yyLineNr;
ppt->startLine = yyLineNr;
ppt->brief = brief;
ppt->doc = doc;
if (lastCompound)
{
lastCompound->addSubEntry(ppt);
}
else
{
current->addSubEntry(ppt);
}
}
current->type=ql.at(0)->data();
ql.clear();
}
}
if (lastCompound)
{
lastCompound->addSubEntry(current);
current = new Entry;
initEntry(current);
}
else
{
newEntry();
}
isFunc=0;
bufferClear();
BEGIN(Start);
}
}
else
{
BEGIN(ParseType);
}
}
<ParseType>{BR}* {
lineCount();
addText(yytext,yyleng);
BEGIN(ParseType);
}
<FindEntityName>{NAME} { // found name of an entity/architecture/package
lineCount();
QCString qcs(yytext);
qcs=qcs.stripWhiteSpace();
qcs=qcs.lower();
if (qcs=="body") // found package body
{
current->spec=VhdlDocGen::PACKAGE_BODY;
current->section=Entry::CLASS_SEC;
current->protection=Protected;
current->name+=QCString("_");
isBody=1;
BEGIN(FindName);
}
else if (scantype==1) // found a component
{
QCString qq(yytext);
qq=qq.stripWhiteSpace();
//qq=qq.lower();
current->name=qq;
qq=qq.lower();
if (lastCompound)
{
if (lastCompound->spec==VhdlDocGen::PACKAGE)
{
if (!VhdlDocGen::foundInsertedComponent(qq,lastCompound))
{
BaseInfo *bb=new BaseInfo(qq,Private,Normal);
lastCompound->extends->append(bb);
}
}
lastCompound->addSubEntry(current);
current = new Entry;
initEntry(current);
}
else
{
newEntry();
}
BEGIN(Start);
}
else
{
QCString qq(yytext);
qq=qq.stripWhiteSpace();
current->name=qq;
newEntry();
//QCString qreal=QCString(yytext);
BEGIN(Start);
}
}
<Start>{B}*("generic"|"port"){BR}*[(]+ { // found generic|port in entity
QCString genp(yyleng+1);
deleteSpecChars(yytext,genp.data());
VhdlDocGen::deleteCharRev(genp,'(');
if (qstricmp(genp.data(),"port" )==0)
{
genPort=1;
}
else
{
genPort=0;
}
bropen=1;
bufferClear();
lineCount();
BEGIN(FindSigName);
}
<FindSigName>{BRACECLOSE} {
lineCount();
bropen--;
addText(yytext,yyleng);
if (bropen==0)
{
bufferClear();
BEGIN(Start);
}
else
{
BEGIN(FindSigName);
}
}
<FindSigName>{LABELID} { // found signals in entity
QCString line(yytext);
// note that line can be something like:
// "var1, var2, var3 : in std_logic_vector(8 downto 0); --! Some comment"
// but also
// "var4 --! Some comment
// );"
// which marks the end of a port
// and also
// "-- Some comment
// var1 : in std_logic;"
//printf("--> labelid='%s'\n",line.data());
QStringList ql;
QCString comment;
int openCount=line.contains('(');
int closeCount=line.contains(')');
int semi = line.find(';');
int pos = line.find("--");
int pos1 = line.find("--!");
if (pos!=-1 && pos<pos1) // strip normal comment before special one
{
line = line.remove(pos,pos1-pos);
}
//printf("=> signal: line='%s'\n",line.data());
if (semi!=-1 && pos!=-1)
{
int eol = line.findRev('\n');
//printf("pos=%d eol=%d\n",pos,eol);
if (eol>=pos+2)
{
QRegExp re("\\n[\\s]*--!"); // comment continuation
comment=line.mid(pos+2,eol-pos-2);
//printf("Comment: '%s'\n",comment.data());
int p,l;
while ((p=re.match(comment,0,&l))!=-1)
{
comment.remove(p,l);
}
line=line.left(pos)+line.right(line.length()-eol);
}
else
{
comment=line.mid(pos+2);
line=line.left(pos);
}
comment.stripWhiteSpace();
// must subtract "(" and ")" in comments because they are used for determining the
// end of a port/generic construct
openCount-=comment.contains('(');
closeCount-=comment.contains(')');
if (!comment.stripPrefix("!")) // not a special comment
{
comment.resize(0);
}
}
else
{
//printf("no ; or --: pos=%d semi=%d\n",pos,semi);
}
int diff=openCount-closeCount;
if (diff<0)
{
VhdlDocGen::deleteCharRev(line,')');
}
if (scantype!=1) // not a component
{
addText(yytext,yyleng);
addSignals(line,yyLineNr,lastEntity,comment);
}
lineCount();
if ((bropen+openCount-closeCount)==0)
{
bufferClear();
BEGIN(Start);
}
}
<FindSigName>{BRACEOPEN} {
lineCount();
bropen++;
addText(yytext,yyleng);
}
<FindSigName>{CR} {
lineCount();
addText(yytext,yyleng);
//BEGIN(FindSigName);
}
<*>^{B}*("for ")[^;]* {
//printf("\n found for[%s] [%d]",yytext,yyLineNr);
lineCount();
}
<*>{DIGITS} { // found digit
addText(yytext,yyleng);
lineCount();
}
<*>{STRING_LITERAL} {
// Make sure string literals get transfered to the output
// We have to match these because the comment characters (--)
// can exist inside a string literal.
// We shouldn't have to call lineCount because newlines
// are not allowed inside string literals
addText(yytext,yyleng);
}
/*
<*>{BR}*"--!"{B}*"@}" { // end group
if (current)
{
Entry *pg=new Entry;
addSubEntry(current,pg);
pg->startLine=yyLineNr;
pg->name="endgroup";
}
lineCount();
}
<*>{BR}*"--!"{B}*"@{" { // start group
if (current)
{
Entry *pg=new Entry;
addSubEntry(current,pg);
pg->startLine=yyLineNr;
pg->name="startgroup";
}
lineCount();
}
*/
<*>{BR}*"--!"[^{}\n][^\n]*\n/{B}*"--!" { // multi line comment
if (iDocLine==-1) iDocLine=yyLineNr;
// signal clk :in std_logic; --!@brief global clock
// --!@brief global reset
// signal reset:in std_logic;
// these two comments are detected as a multi line comment
QCString qc(yytext);
int len=qc.contains('\n')+yyLineNr-1;
if (YY_START!=Comment) // Start of the comment block
{
bufferClear();
iTextCounter=0;
startComment=yyLineNr;
g_lastCommentContext=YY_START;
}
Entry* pTemp=getEntryAtLine(current_root,len);
if (pTemp)
{ // found one line comment, add it to the entry on this line
pTemp->briefLine=yyLineNr;
pTemp->brief+=yytext;
VhdlDocGen::prepareComment(pTemp->brief);
}
else
{
addText(yytext,yyleng);
}
lineCount();
BEGIN(Comment);
}
<Comment>^{B}*"--!"[^\n]* {
if (iDocLine==-1) iDocLine=yyLineNr;
addText(yytext,yyleng);
lineCount();
}
<Comment>.|\n {
// found end of comment block
QCString qcs;
getBufText(qcs,iTextCounter);
VhdlDocGen::prepareComment(qcs);
int ii =qcs.find("\\code");
if (ii>0)
{
iCodeLen=num_chars;
gBlock.reset();
int len=qcs.length();
QCString name=qcs.right(len-ii);
name=VhdlDocGen::getIndexWord(name.data(),1);
if (!name)
gBlock.name="misc"+ VhdlDocGen::getRecordNumber();
else
gBlock.name=name;
qcs=qcs.left(ii);
gBlock.startLine=yyLineNr+1;
gBlock.bodyLine=yyLineNr+1;
gBlock.brief+=qcs;
iTextCounter=0;
}
if (ii==-1)
{
handleCommentBlock(qcs,FALSE);
}
bufferClear();
unput(*yytext);
BEGIN(g_lastCommentContext);
}
<*>"--!"[^\n]* { // one line comment
if (iDocLine==-1) iDocLine=yyLineNr;
QCString qcs(yytext);
int j=qcs.find("--!");
qcs=qcs.right(qcs.length()-3-j);
bool isEndCode=qcs.contains("\\endcode");
if (isEndCode)
makeInline();
//printf("--> handleCommentBlock line %d\n",yyLineNr);
Entry* pTemp=getEntryAtLine(current_root,yyLineNr);
if (!isEndCode)
{
if (pTemp)
{
pTemp->briefLine=yyLineNr;
pTemp->brief+=qcs;
iDocLine=-1;
}
else
{
handleCommentBlock(qcs,TRUE);
}
}
bufferClear();
}// one line
<*>{COMMENT} {
}
<*>\n {
lineCount();
addText(yytext,yyleng);
// printf("\n new-line [%d]",yyLineNr);
BEGIN(Start);
}
<*>{NAME} {
addText(yytext,yyleng);
lineCount();
}
<*>{B}* {
addText(yytext,yyleng);
lineCount();
}
<*>. {
addText(yytext,yyleng);
lineCount();
}
%%
static void initEntry(Entry *e)
{
e->fileName = yyFileName;
e->lang = SrcLangExt_VHDL;
initGroupInfo(e);
}
static void newEntry()
{
// Add only enties/architectures/packages to root
// and signals to classes where they were found
// ENTITY dlatch_93 IS -- VHDL'93-Syntax !!!
// PORT (d, clk : IN bit;
// q, qbar : OUT bit);
// GROUP path IS (SIGNAL, SIGNAL);
// GROUP d_to_q : path (d, q);
// ATTRIBUTE propagation : time;
// END dlatch_93;
if (current->spec==VhdlDocGen::ENTITY ||
current->spec==VhdlDocGen::PACKAGE ||
current->spec==VhdlDocGen::ARCHITECTURE ||
current->spec==VhdlDocGen::PACKAGE_BODY)
{
current_root->addSubEntry(current);
}
else
{
if (lastCompound)
{
lastCompound->addSubEntry(current);
}
else
{
if (lastEntity)
{
lastEntity->addSubEntry(current);
}
else
{
current_root->addSubEntry(current); // should not happen!
}
}
}
previous = current;
current = new Entry ;
initEntry(current);
}
static void handleCommentBlock(const QCString &doc,bool brief)
{
int position=0;
bool needsEntry=FALSE;
Protection protection=Public;
int lineNr = iDocLine;
if (brief)
current->briefLine = iDocLine;
else
current->docLine = iDocLine;
//printf("parseCommentBlock %p [%s]\n",current,doc.data());
while (parseCommentBlock(
g_thisParser,
current,
doc, // text
yyFileName, // file
lineNr, // line of block start
brief,
docBlockAutoBrief,
FALSE,
protection,
position,
needsEntry
)
)
{
//printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
if (needsEntry) newEntry();
}
if (needsEntry)
{
newEntry();
}
if (docBlockTerm)
{
unput(docBlockTerm);
docBlockTerm=0;
}
iDocLine=-1;
}
#if 0
/*!
* adds grouping to the entries
*/
static void mergeGrouping(const Entry* ce,int)
{
EntryListIterator eli(*ce->children());
Entry *rt;
for (;(rt=eli.current());++eli)
{
if (rt->section==Entry::GROUPDOC_SEC)
{
if (openGroups)
{
QCString tt=(QCString)qrl.last();
if (!tt.isEmpty())
{
rt->groups->append(new Grouping(tt.data(),Grouping::GROUPING_LOWEST));
}
}
qrl.append(rt->name);
}
if ((strcmp(rt->name.data(),"endgroup")==0) && !qrl.isEmpty())
{
qrl.remove((QCString)qrl.last());
openGroups--;
}
if ((strcmp(rt->name.data(),"startgroup")==0))
{
openGroups++;
}
if (rt->section!=Entry::GROUPDOC_SEC && openGroups && !qrl.isEmpty())
{
rt->groups->append(new Grouping(qrl.last().data(),Grouping::GROUPING_LOWEST));
}
mergeGrouping(rt,openGroups);
}
}
#endif
/*
* adds the library|use statements to the next class (entity|package|architecture|package body
* library ieee
* entity xxx
* .....
* library
* package
* enity zzz
* .....
* and so on..
*/
static void mapLibPackage(const Entry* ce)
{
Entry *lastComp=0;
while (TRUE)
{
bool found = FALSE;
Entry *rt=0;
//const QList<Entry> *epp=ce->children();
EntryListIterator eli(*ce->children());
EntryListIterator eli1=eli;
for (;(rt=eli.current()),eli1=eli;++eli)
{
if (rt->spec==VhdlDocGen::LIBRARY || rt->spec==VhdlDocGen::USE)
// top level library or use statement
{
Entry *temp=0;
for (;(temp=eli1.current());++eli1) // find next entity
{
if (temp->spec==VhdlDocGen::ENTITY || temp->spec==VhdlDocGen::PACKAGE || temp->spec==VhdlDocGen::ARCHITECTURE || temp->spec==VhdlDocGen::PACKAGE_BODY)
{
Entry *ee=new Entry(*rt); //append a copy to entries sublist
temp->addSubEntry(ee);
found=TRUE;
rt->spec=-1; //nullify entry
rt->section=0;
lastComp=temp;
break;
}
}//for
if (lastComp && rt->spec)
{
Entry *ee=new Entry(*rt); //append a copy to entries sublist
lastComp->addSubEntry(ee);
found=TRUE;
rt->spec=-1; //nullify entry
rt->section=0;
}
}//if
}//for
if (!found) // nothing left to do
{
return;
}
}//while
}//MapLib
#if 0
/*!
* merges a brief descriptions to the next entry
*/
void mergeBrief(const Entry* ce)
{
EntryListIterator eli(*ce->children());
Entry *rt;
for (;(rt=eli.current());++eli)
{
if (found && (!eMerge.brief.isEmpty() || !eMerge.doc.isEmpty()))
{
rt->doc+=eMerge.doc.data();
rt->docLine=eMerge.docLine;
rt->brief+=eMerge.brief.data();
rt->briefLine=eMerge.briefLine;
found=FALSE;
}
if ((strcmp(rt->name.data(),"string")==0))
{
eMerge.reset();
eMerge.doc+=rt->doc.data();
eMerge.docLine=rt->docLine;
eMerge.brief+=rt->brief.data();
eMerge.briefLine=rt->briefLine;
found=TRUE;
}
MergeBrief(rt);
}
}
#endif
void vhdlscanFreeScanner()
{
#if defined(YY_FLEX_SUBMINOR_VERSION)
if (g_lexInit)
{
vhdlscannerYYlex_destroy();
}
if (g_buf)
{
free(g_buf);
}
g_buf=0;
#endif
}
void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root,
bool,QStrList&)
{
inputFile.setName(fileName);
//uint jfile=inputFile.size();
::parserInit();
yyFileName=QCString(fileName);
groupEnterFile(fileName,yyLineNr);
g_thisParser = this;
g_inputFromFile = FALSE;
inputPosition = 0;
assert(root!=0);
inputString=fileBuf;
inputLen=strlen(fileBuf);
current_root = root;
global_root = root;
current=new Entry;
initEntry(current);
//current_root->name=QCString("XXX"); // dummy name for root
if (!inputFile.open(IO_ReadOnly))
{
err("\n\n could not open file: %s !!\n\n",yyFileName.data());
return ;
}
if (g_lexInit)
{
vhdlscannerYYrestart(vhdlscannerYYin);
unput(' ');
BEGIN(Start);
}
vhdlscannerYYlex();
g_lexInit=TRUE;
free(g_buf);
g_buf=0;
delete current;
current=0;
groupLeaveFile(yyFileName,yyLineNr);
inputFile.close();
//mergeBrief(current_root);
//mergeGrouping(current_root,0);
mapLibPackage(current_root);
}
void VHDLLanguageScanner::parsePrototype(const char *text)
{
// will be called when a \fn command is found in a comment block
QCString ss,ret;
bool sem=FALSE;
bool func=FALSE;
QList<Argument> qs;
qs.setAutoDelete(TRUE);
VhdlDocGen::parseFuncProto(text,qs,ss,ret,TRUE);
int count=qs.count();
if (qstricmp(ret.data(),"function")==0)
{
func=TRUE;
}
if (count<1 && !func)
{
return;
}
Entry *pp = new Entry;
initEntry(pp);
pp->name=ss.stripWhiteSpace();
pp->args+='(';
for (int j=0;j<count;j++)
{
if (sem)
{
pp->args+=',';
}
Argument *ars=(Argument*)(qs.at(j));
Argument *arg=new Argument;
arg->attrib = ars->attrib;
arg->name = ars->name;
arg->type = ars->type;
pp->args+=ars->name.data();
pp->args+=" ";
pp->args+=ars->type.data();
pp->argList->append(arg);
sem=TRUE;
}
pp->args+=')';
if (!ret.isEmpty())
pp->spec=VhdlDocGen::FUNCTION;
else
pp->spec=VhdlDocGen::PROCEDURE;
if (pp->section == Entry::MEMBERDOC_SEC && pp->args.isEmpty())
pp->section = Entry::VARIABLEDOC_SEC;
pp->type=ret;
current_root->addSubEntry(pp);
}
void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
const char *exampleName,
FileDef *fileDef,
int startLine,
int endLine,
bool inlineFragment,
MemberDef *memberDef,
bool showLineNumbers,
Definition *searchCtx,
bool collectXRefs
)
{
(void)lang;
::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx,collectXRefs);
}
/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "CharStream.h"
namespace {
template <class T>
void ArrayCopy(T* src, int src_offset, T* dest, int dest_offset, int len) {
for (int i = 0; i < len; i++) {
dest[dest_offset + i] = src[src_offset + i];
}
}
class StringReaderStream : public ReaderStream {
public:
StringReaderStream(const JAVACC_STRING_TYPE& str) : str_(str), cur_(0), max_(str.size()) {}
virtual size_t read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len) {
size_t count = str_.copy(bufptr + offset, len > max_ ? max_ : len, cur_);
cur_ += count;
max_ -= count;
return count;
}
virtual ~StringReaderStream() {}
virtual bool endOfInput() {
return max_ == 0;
}
private:
const JAVACC_STRING_TYPE str_;
size_t cur_;
size_t max_;
};
}
namespace vhdl {
namespace parser {
void CharStream::ReInit(const JAVACC_STRING_TYPE& str, int startline,
int startcolumn, int buffersize) {
StringReaderStream *stream = new StringReaderStream(str);
ReInit(stream, startline, startcolumn, buffersize);
deleteStream = true;
}
void CharStream::ReInit(ReaderStream *input_stream, int startline,
int startcolumn, int buffersize) {
if (deleteStream) {
delete inputStream;
}
if (buffer != NULL) {
DeleteBuffers();
}
available = bufsize = buffersize;
buffer = new JAVACC_CHAR_TYPE[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
column = startcolumn - 1;
inputStream = input_stream;
line = startline;
prevCharIsLF = prevCharIsCR = false;
tokenBegin = inBuf = maxNextCharInd = 0;
bufpos = -1;
deleteStream = false;
}
void CharStream::DeleteBuffers() {
delete[] buffer;
delete[] bufline;
delete[] bufcolumn;
}
void CharStream::adjustBeginLineColumn(int newLine, int newCol) {
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin) {
len = bufpos - tokenBegin + inBuf + 1;
} else {
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = 0, columnDiff = 0;
while (i < len && bufline[j = start % bufsize] ==
bufline[k = (start + 1) % bufsize]) {
bufline[j] = newLine;
nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
bufcolumn[j] = newCol + columnDiff;
columnDiff = nextColDiff;
i++;
start++;
}
if (i < len) {
bufline[j] = newLine++;
bufcolumn[j] = newCol + columnDiff;
while (i++ < len) {
if (bufline[j = start % bufsize] != bufline[(start + 1) % bufsize])
bufline[j] = newLine++;
else
bufline[j] = newLine;
start++;
}
}
line = bufline[j];
column = bufcolumn[j];
}
void CharStream::ExpandBuff(bool wrapAround) {
JAVACC_CHAR_TYPE *newbuffer = new JAVACC_CHAR_TYPE[bufsize + 2048];
int *newbufline = new int[bufsize + 2048];
int *newbufcolumn = new int[bufsize + 2048];
if (wrapAround) {
ArrayCopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
ArrayCopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
ArrayCopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
ArrayCopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
ArrayCopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
ArrayCopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
bufpos += (bufsize - tokenBegin);
} else {
ArrayCopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
ArrayCopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
ArrayCopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
bufpos -= tokenBegin;
}
maxNextCharInd = bufpos;
DeleteBuffers();
buffer = newbuffer;
bufline = newbufline;
bufcolumn = newbufcolumn;
bufsize += 2048;
available = bufsize;
tokenBegin = 0;
}
void CharStream::FillBuff() {
if (maxNextCharInd == available) {
if (available == bufsize) {
if (tokenBegin > 2048) {
bufpos = maxNextCharInd = 0;
available = tokenBegin;
} else if (tokenBegin < 0) {
bufpos = maxNextCharInd = 0;
} else {
ExpandBuff(false);
}
} else if (available > tokenBegin) {
available = bufsize;
} else if ((tokenBegin - available) < 2048) {
ExpandBuff(true);
} else {
available = tokenBegin;
}
}
int i = inputStream->read(buffer, maxNextCharInd, available - maxNextCharInd);
if (i > 0) {
maxNextCharInd += i;
} else {
--bufpos;
backup(0);
if (tokenBegin == -1) {
tokenBegin = bufpos;
}
}
}
void CharStream::UpdateLineColumn(JAVACC_CHAR_TYPE c) {
column++;
if (prevCharIsLF) {
prevCharIsLF = false;
column = 1;
line++;
} else if (prevCharIsCR) {
prevCharIsCR = false;
if (c == '\n') {
prevCharIsLF = true;
} else {
column = 1;
line++;
}
}
switch (c) {
case '\r' :
prevCharIsCR = true;
break;
case '\n' :
prevCharIsLF = true;
break;
case '\t' :
column--;
column += (tabSize - (column % tabSize));
break;
default :
break;
}
bufline[bufpos] = line;
bufcolumn[bufpos] = column;
}
}
}
/* JavaCC - OriginalChecksum=e709b9ee1adf0fcb6b1c5e1641f10348 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef CHARSTREAM_H
#define CHARSTREAM_H
#include "JavaCC.h"
#ifndef INITIAL_BUFFER_SIZE
#define INITIAL_BUFFER_SIZE 4096
#endif
namespace vhdl {
namespace parser {
/**
* This class describes a character stream that maintains line and
* column number positions of the characters. It also has the capability
* to backup the stream to some extent. An implementation of this
* class is used in the TokenManager implementation generated by
* JavaCCParser.
*
* All the methods except backup can be implemented in any fashion. backup
* needs to be implemented correctly for the correct operation of the lexer.
* Rest of the methods are all used to get information like line number,
* column number and the string that constitutes a token and are not used
* by the lexer. Hence their implementation won't affect the generated lexer's
* operation.
*/
class CharStream {
public:
void setTabSize(int i) { tabSize = i; }
int getTabSize(int) { return tabSize; }
virtual int getColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; }
virtual int getLine() { return trackLineColumn ? bufline[bufpos] : -1; }
virtual int getEndColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; }
virtual int getEndLine() { return trackLineColumn ? bufline[bufpos] : -1; }
virtual int getBeginColumn() { return trackLineColumn ? bufcolumn[tokenBegin] : -1; }
virtual int getBeginLine() { return trackLineColumn ? bufline[tokenBegin] : -1; }
virtual bool getTrackLineColumn() { return trackLineColumn; }
virtual void setTrackLineColumn(bool val) { trackLineColumn = val; }
/**
* Backs up the input stream by amount steps. Lexer calls this method if it
* had already read some characters, but could not use them to match a
* (longer) token. So, they will be used again as the prefix of the next
* token and it is the implemetation's responsibility to do this right.
*/
virtual inline void backup(int amount) {
inBuf += amount;
bufpos -= amount;
if (bufpos < 0) {
bufpos += bufsize;
}
}
/**
* Returns the next character that marks the beginning of the next token.
* All characters must remain in the buffer between two successive calls
* to this method to implement backup correctly.
*/
virtual inline JAVACC_CHAR_TYPE BeginToken() {
tokenBegin = -1;
JAVACC_CHAR_TYPE c = readChar();
tokenBegin = bufpos;
return c;
}
/**
* Returns the next character from the selected input. The method
* of selecting the input is the responsibility of the class
* implementing this class.
*/
virtual inline JAVACC_CHAR_TYPE readChar() {
if (inBuf > 0) {
--inBuf;
++bufpos;
if (bufpos == bufsize) {
bufpos = 0;
}
return buffer[bufpos];
}
++bufpos;
if (bufpos >= maxNextCharInd) {
FillBuff();
}
JAVACC_CHAR_TYPE c = buffer[bufpos];
if (trackLineColumn) {
UpdateLineColumn(c);
}
return c;
}
virtual void ExpandBuff(bool wrapAround);
virtual void FillBuff();
/**
* Returns a string made up of characters from the marked token beginning
* to the current buffer position. Implementations can return
* anything that they want to. For example, for efficiency, one might decide
* to just return NULL, which is a valid implementation.
*/
virtual JAVACC_STRING_TYPE GetImage() {
if (bufpos >= tokenBegin)
return JAVACC_STRING_TYPE(buffer + tokenBegin, bufpos - tokenBegin + 1);
else
return JAVACC_STRING_TYPE(buffer + tokenBegin, bufsize - tokenBegin)
.append(buffer, bufpos + 1);
}
/**
* Returns an array of characters that make up the suffix of length 'len' for
* the currently matched token. This is used to build up the matched string
* for use in actions in the case of MORE. A simple and inefficient
* implementation of this is as follows :
*/
virtual JAVACC_STRING_TYPE GetSuffix(int len) {
if ((bufpos + 1) >= len) {
return JAVACC_STRING_TYPE(buffer + bufpos - len + 1, len);
}
return JAVACC_STRING_TYPE(buffer + bufsize - (len - bufpos - 1), len - bufpos - 1)
.append(buffer, bufpos + 1);
}
/**
* The lexer calls this function to indicate that it is done with the stream
* and hence implementations can free any resources held by this class.
*/
virtual void DeleteBuffers();
virtual ~CharStream() {
if (deleteStream) {
delete inputStream;
}
DeleteBuffers();
}
bool endOfInput() {
return inBuf == 0 && bufpos + 1 >= maxNextCharInd &&
inputStream->endOfInput();
}
CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline,
int startcolumn, int buffersize) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, buffersize);
}
CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, INITIAL_BUFFER_SIZE);
}
CharStream(const JAVACC_STRING_TYPE& str, int startline,
int startcolumn, int buffersize) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(str, startline, startcolumn, buffersize);
}
CharStream(const JAVACC_STRING_TYPE& str, int startline, int startcolumn) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0) ,tabSize(8), trackLineColumn(true){
ReInit(str, startline, startcolumn, INITIAL_BUFFER_SIZE);
}
CharStream(ReaderStream *input_stream, int startline,
int startcolumn, int) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
}
CharStream(ReaderStream *input_stream, int startline, int startcolumn) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
}
CharStream(ReaderStream *input_stream) :
bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
inBuf(0),tabSize(8), trackLineColumn(true) {
ReInit(input_stream, 1, 1, INITIAL_BUFFER_SIZE);
}
virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn,
int buffersize);
virtual void ReInit(ReaderStream *input_stream, int startline,
int startcolumn) {
ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
}
virtual void ReInit(ReaderStream *input_stream) {
ReInit(input_stream, 1, 1, INITIAL_BUFFER_SIZE);
}
virtual void ReInit(const JAVACC_STRING_TYPE& str, int startline,
int startcolumn, int buffersize);
virtual void ReInit(const JAVACC_STRING_TYPE& str, int startline,
int startcolumn) {
ReInit(str, startline, startcolumn, INITIAL_BUFFER_SIZE);
}
virtual void adjustBeginLineColumn(int newLine, int newCol);
protected:
virtual void UpdateLineColumn(JAVACC_CHAR_TYPE c);
int *bufline;
int *bufcolumn;
ReaderStream *inputStream;
bool deleteStream;
JAVACC_CHAR_TYPE * buffer;
int bufpos;
int bufsize;
int tokenBegin;
int column;
int line;
bool prevCharIsCR ;
bool prevCharIsLF ;
int available;
int maxNextCharInd;
int inBuf ;
int tabSize ;
bool trackLineColumn;
};
}
}
#endif
/* JavaCC - OriginalChecksum=5eaf75ef6a2c7859369c80cf6fd037e0 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef ERRORHANDLER_H
#define ERRORHANDLER_H
#include <string>
#include "JavaCC.h"
#include "Token.h"
namespace vhdl {
namespace parser {
class VhdlParser;
class ErrorHandler {
protected:
int error_count;
public:
// Called when the parser encounters a different token when expecting to
// consume a specific kind of token.
// expectedKind - token kind that the parser was trying to consume.
// expectedToken - the image of the token - tokenImages[expectedKind].
// actual - the actual token that the parser got instead.
virtual void handleUnexpectedToken(int, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *) {
error_count++;
fprintf(stderr, "Expecting %s at: %d:%d but got %s\n", addUnicodeEscapes(expectedToken).c_str(), actual->beginLine, actual->beginColumn, addUnicodeEscapes(actual->image).c_str());
}
// Called when the parser cannot continue parsing.
// last - the last token successfully parsed.
// unexpected - the token at which the error occurs.
// production - the production in which this error occurrs.
virtual void handleParseError(Token *, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *) {
error_count++;
fprintf(stderr, "Encountered: %s at: %d:%d while parsing: %s\n", addUnicodeEscapes(unexpected->image).c_str(), unexpected->beginLine, unexpected->beginColumn, production.c_str());
}
virtual int getErrorCount() {
return error_count;
}
virtual ~ErrorHandler() {}
ErrorHandler() { error_count = 0; }
};
}
}
#endif
/* JavaCC - OriginalChecksum=282223c3bcb53b7ff385aed35944d185 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef __JAVACC_H
#define __JAVACC_H
#include <stdio.h>
#include <string>
#include <memory.h>
#include <assert.h>
#include <cstring>
#include "vhdlstring.h"
#ifndef JAVACC_CHAR_TYPE
#define JAVACC_CHAR_TYPE char
#endif
#ifndef JAVACC_STRING_TYPE
#define JAVACC_STRING_TYPE VhdlString
#endif
#define finally // TODO(Sreeni): Get rid of when we fix jjtree
#define JAVACC_SIMPLE_STRING VhdlString
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str);
typedef JAVACC_STRING_TYPE StringBuffer;
typedef JAVACC_STRING_TYPE String;
// Abstraction on stream classes to read a block of data into a buffer.
class ReaderStream {
public:
// Read block of data into a buffer and return the actual number read.
virtual size_t read(JAVACC_CHAR_TYPE *, int, size_t) {
return 0;
}
virtual bool endOfInput() { return true; }
virtual ~ReaderStream() {}
};
const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#endif
/* JavaCC - OriginalChecksum=775c677272b259e2a33aac80851ba9f1 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef __JAVACC_H
#define __JAVACC_H
#include <stdio.h>
#include <string>
#include <memory.h>
#include <assert.h>
#include <cstring>
#include "vhdlstring.h"
#ifndef JAVACC_CHAR_TYPE
#define JAVACC_CHAR_TYPE char
#endif
#ifndef JAVACC_STRING_TYPE
#define JAVACC_STRING_TYPE VhdlString
#endif
#define finally // TODO(Sreeni): Get rid of when we fix jjtree
#define JAVACC_SIMPLE_STRING VhdlString
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str);
typedef JAVACC_STRING_TYPE StringBuffer;
typedef JAVACC_STRING_TYPE String;
// Abstraction on stream classes to read a block of data into a buffer.
class ReaderStream {
public:
// Read block of data into a buffer and return the actual number read.
virtual size_t read(JAVACC_CHAR_TYPE *, int, size_t) {
return 0;
}
virtual bool endOfInput() { return true; }
virtual ~ReaderStream() {}
};
const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#endif
/* JavaCC - OriginalChecksum=775c677272b259e2a33aac80851ba9f1 (do not edit this line) */
#
#
#
# Copyright (C) 1997-2000 by Dimitri van Heesch.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation under the terms of the GNU General Public License is hereby
# granted. No representations are made about the suitability of this software
# for any purpose. It is provided "as is" without express or implied warranty.
# See the GNU General Public License for more details.
#
# Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license.
#
all: Makefile.vhdlparser Makefile
$(MAKE) -f Makefile.vhdlparser $@
Makefile.vhdlparser: vhdlparser.pro
$(ENV) $(PERL) "$(TMAKE)" vhdlparser.pro >Makefile.vhdlparser
tmake:
$(ENV) $(PERL) "$(TMAKE)" vhdlparser.pro >Makefile.vhdlparser
clean: Makefile.vhdlparser
$(MAKE) -f Makefile.vhdlparser clean
regenerate:
$(RM) CharStream.cc CharStream.h ErrorHandler.h ParseException.cc ParseException.h \
Token.cc Token.h TokenManager.h TokenMgrError.cc TokenMgrError.h VhdlParser.cc VhdlParser.h \
VhdlParserConstants.h VhdlParserTokenManager.cc VhdlParserTokenManager.h \
JavaCC.h
javacc vhdlparser.jj
patch <vhdlparser.patch
$(CP) JavaCC.h.in JavaCC.h
distclean: clean
$(RM) Makefile vhdlparser.pro
FORCE:
/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "ParseException.h"
namespace vhdl {
namespace parser {
/**
* This exception is thrown when parse errors are encountered.
* You can explicitly create objects of this exception type by
* calling the method generate_ParseException in the generated
* parser.
*
* You can modify this class to customize your error reporting
* mechanisms so long as you retain the fields.
*/
/**
* This constructor is used by the method "generate_ParseException"
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields "currentToken",
* "expectedTokenSequences", and "tokenImage" set.
*/
ParseException::ParseException(Token currentTokenVal,
int** expectedTokenSequencesVal,
JAVACC_STRING_TYPE* tokenImageVal
)
{
initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal);
currentToken = currentTokenVal;
expectedTokenSequences = expectedTokenSequencesVal;
tokenImage = tokenImageVal;
}
/**
* The following constructors are for use by you for whatever
* purpose you can think of. Constructing the exception in this
* manner makes the exception behave in the normal way - i.e., as
* documented in the class "Throwable". The fields "errorToken",
* "expectedTokenSequences", and "tokenImage" do not contain
* relevant information. The JavaCC generated code does not use
* these constructors.
*/
ParseException::ParseException() {
}
/** Constructor with message. */
ParseException::ParseException(JAVACC_STRING_TYPE message) {
}
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
* followng this token will (therefore) be the first error token.
*/
Token currentToken;
/**
* Each entry in this array is an array of integers. Each array
* of integers represents a sequence of tokens (by their ordinal
* values) that is expected at this point of the parse.
*/
int** expectedTokenSequences;
/**
* This is a reference to the "tokenImage" array of the generated
* parser within which the parse error occurred. This array is
* defined in the generated ...Constants class.
*/
JAVACC_STRING_TYPE* tokenImage;
/**
* It uses "currentToken" and "expectedTokenSequences" to generate a parse
* error message and returns it. If this object has been created
* due to a parse error, and you do not catch it (it gets thrown
* from the parser) the correct error message
* gets displayed.
*/
JAVACC_STRING_TYPE ParseException::initialise(Token currentToken,
int** expectedTokenSequences,
JAVACC_STRING_TYPE* tokenImage) {
#if 0
//JAVACC_STRING_TYPE eol = System.getProperty("line.separator", "\n");
expected = new JAVACC_STRING_TYPE();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
maxSize = expectedTokenSequences[i].length;
}
for (int j = 0; j < expectedTokenSequences[i].length; j++) {
expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
}
if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
expected.append((JAVACC_CHAR_TYPE*)"...");
}
expected.append(eol).append(" ");
}
JAVACC_STRING_TYPE retval = (JAVACC_CHAR_TYPE*)"Encountered \"";
Token tok = currentToken.next;
for (int i = 0; i < maxSize; i++) {
if (i != 0) retval += (JAVACC_CHAR_TYPE*)" ";
if (tok.kind == 0) {
retval += tokenImage[0];
break;
}
retval += (JAVACC_CHAR_TYPE*)" " + tokenImage[tok.kind];
retval += (JAVACC_CHAR_TYPE*)" \"";
retval += add_escapes(tok.image);
retval += (JAVACC_CHAR_TYPE*)" \"";
tok = tok.next;
}
retval += (JAVACC_CHAR_TYPE*)"\" at line " + currentToken.next.beginLine + (JAVACC_CHAR_TYPE*)", column " + currentToken.next.beginColumn;
retval += (JAVACC_CHAR_TYPE*)"." + eol;
if (expectedTokenSequences.length == 1) {
retval += (JAVACC_CHAR_TYPE*)"Was expecting:" + eol + (JAVACC_CHAR_TYPE*)" ";
} else {
retval += (JAVACC_CHAR_TYPE*)"Was expecting one of:" + eol + (JAVACC_CHAR_TYPE*)" ";
}
retval += expected.toString();
return retval;
#endif
return (JAVACC_CHAR_TYPE*)"Parse exception";
}
/**
* The end of line JAVACC_STRING_TYPE for this machine.
*/
#define eol "\n"
/**
* Used to convert raw characters to their escaped version
* when these raw version cannot be used as part of an ASCII
* string literal.
*/
JAVACC_STRING_TYPE ParseException::add_escapes(JAVACC_STRING_TYPE str) {
/*
JAVACC_STRING_TYPE *retval = new JAVACC_STRING_TYPE();
JAVACC_CHAR_TYPE ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
case 0 :
continue;
case '\b':
retval.append("\\b");
continue;
case '\t':
retval.append("\\t");
continue;
case '\n':
retval.append("\\n");
continue;
case '\f':
retval.append("\\f");
continue;
case '\r':
retval.append("\\r");
continue;
case '\"':
retval.append("\\\"");
continue;
case '\'':
retval.append("\\\'");
continue;
case '\\':
retval.append("\\\\");
continue;
default:
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
JAVACC_STRING_TYPE s = "0000" + Integer.toString(ch, 16);
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
} else {
retval.append(ch);
}
continue;
}
}
return retval.toString();
*/ return str;
}
}
}
/* JavaCC - OriginalChecksum=99d488e13335cf377284c90700f070ed (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef _PARSE_EXCEPTION_H
#define _PARSE_EXCEPTION_H
#include "JavaCC.h"
#include "Token.h"
namespace vhdl {
namespace parser {
/**
* This exception is thrown when parse errors are encountered.
* You can explicitly create objects of this exception type by
* calling the method generateParseException in the generated
* parser.
*
* You can modify this class to customize your error reporting
* mechanisms so long as you retain the fields.
*/
class ParseException {
public:
/**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields "currentToken",
* "expectedTokenSequences", and "tokenImage" set.
*/
ParseException(Token currentTokenVal,
int** expectedTokenSequencesVal,
JAVACC_STRING_TYPE* tokenImageVal
);
/**
* The following constructors are for use by you for whatever
* purpose you can think of. Constructing the exception in this
* manner makes the exception behave in the normal way - i.e., as
* documented in the class "Throwable". The fields "errorToken",
* "expectedTokenSequences", and "tokenImage" do not contain
* relevant information. The JavaCC generated code does not use
* these constructors.
*/
ParseException();
/** Constructor with message. */
ParseException(JAVACC_STRING_TYPE message);
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
* followng this token will (therefore) be the first error token.
*/
Token currentToken;
/**
* Each entry in this array is an array of integers. Each array
* of integers represents a sequence of tokens (by their ordinal
* values) that is expected at this point of the parse.
*/
int** expectedTokenSequences;
/**
* This is a reference to the "tokenImage" array of the generated
* parser within which the parse error occurred. This array is
* defined in the generated ...Constants class.
*/
JAVACC_STRING_TYPE* tokenImage;
/**
* It uses "currentToken" and "expectedTokenSequences" to generate a parse
* error message and returns it. If this object has been created
* due to a parse error, and you do not catch it (it gets thrown
* from the parser) the correct error message
* gets displayed.
*/
private: JAVACC_STRING_TYPE initialise(Token currentToken,
int** expectedTokenSequences,
JAVACC_STRING_TYPE* tokenImage);
/**
* The end of line string for this machine.
*/
#define eol "\n"
/**
* Used to convert raw characters to their escaped version
* when these raw version cannot be used as part of an ASCII
* string literal.
*/
JAVACC_STRING_TYPE add_escapes(JAVACC_STRING_TYPE str);
};
}
}
#endif
/* JavaCC - OriginalChecksum=8c47c56fc2030f05b43e20cae6ca5d66 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
#include "Token.h"
namespace vhdl {
namespace parser {
/**
* Describes the input token stream.
*/
/**
* An optional attribute value of the Token.
* Tokens which are not used as syntactic sugar will often contain
* meaningful values that will be used later on by the compiler or
* interpreter. This attribute value is often different from the image.
* Any subclass of Token that actually wants to return a non-NULL value can
* override this method as appropriate.
*/
void * Token::getValue() {
return NULL;
}
/**
* No-argument constructor
*/
Token::Token() {
this->next = NULL;
this->specialToken = NULL;
}
/**
* Constructs a new token for the specified Image.
*/
Token::Token(int kind)
{
this->kind = kind;
this->next = NULL;
this->specialToken = NULL;
}
/**
* Constructs a new token for the specified Image and Kind.
*/
Token::Token(int kind, JAVACC_STRING_TYPE image)
{
this->kind = kind;
this->image = image;
this->next = NULL;
this->specialToken = NULL;
}
/**
* Returns the image.
*/
JAVACC_STRING_TYPE Token::toString()
{
return image;
}
/**
* Returns a new Token object, by default. However, if you want, you
* can create and return subclass objects based on the value of ofKind.
* Simply add the cases to the switch for all those special cases.
* For example, if you have a subclass of Token called IDToken that
* you want to create if ofKind is ID, simply add something like :
*
* case MyParserConstants.ID : return new IDToken(ofKind, image);
*
* to the following switch statement. Then you can cast matchedToken
* variable to the appropriate type and use sit in your lexical actions.
*/
Token *Token::newToken(int ofKind, JAVACC_STRING_TYPE image)
{
switch(ofKind)
{
default : return new Token(ofKind, image);
}
}
Token *Token::newToken(int ofKind)
{
return newToken(ofKind, JAVACC_STRING_TYPE((JAVACC_CHAR_TYPE*)""));
}
Token::~Token() {
if (specialToken) delete specialToken;
}
}
}
/* JavaCC - OriginalChecksum=9db9ca693072c4c37bb7cc933c0c5e35 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
#ifndef TOKEN_H
#define TOKEN_H
#include "JavaCC.h"
namespace vhdl {
namespace parser {
/**
* Describes the input token stream.
*/
class Token
{
public:
/**
* An integer that describes the kind of this token. This numbering
* system is determined by JavaCCParser, and a table of these numbers is
* stored in the file ...Constants.java.
*/
int kind;
/** The line number of the first character of this Token. */
int beginLine;
/** The column number of the first character of this Token. */
int beginColumn;
/** The line number of the last character of this Token. */
int endLine;
/** The column number of the last character of this Token. */
int endColumn;
/**
* The string image of the token.
*/
JAVACC_STRING_TYPE image;
/**
* A reference to the next regular (non-special) token from the input
* stream. If this is the last token from the input stream, or if the
* token manager has not read tokens beyond this one, this field is
* set to NULL. This is true only if this token is also a regular
* token. Otherwise, see below for a description of the contents of
* this field.
*/
Token *next;
/**
* This field is used to access special tokens that occur prior to this
* token, but after the immediately preceding regular (non-special) token.
* If there are no such special tokens, this field is set to NULL.
* When there are more than one such special token, this field refers
* to the last of these special tokens, which in turn refers to the next
* previous special token through its specialToken field, and so on
* until the first special token (whose specialToke_ field is NULL).
* The next fields of special tokens refer to other special tokens that
* immediately follow it (without an intervening regular token). If there
* is no such token, this field is NULL.
*/
Token *specialToken;
/**
* An optional attribute value of the Token.
* Tokens which are not used as syntactic sugar will often contain
* meaningful values that will be used later on by the compiler or
* interpreter. This attribute value is often different from the image.
* Any subclass of Token that actually wants to return a non-NULL value can
* override this method as appropriate.
*/
void * getValue();
/**
* No-argument constructor
*/
Token();
/**
* Constructs a new token for the specified Image.
*/
Token(int kind);
/**
* Constructs a new token for the specified Image and Kind.
*/
Token(int kind, JAVACC_STRING_TYPE image);
/**
* Returns the image.
*/
JAVACC_STRING_TYPE toString();
public: virtual ~Token();
/**
* Returns a new Token void *, by default. However, if you want, you
* can create and return subclass objects based on the value of ofKind.
* Simply add the cases to the switch for all those special cases.
* For example, if you have a subclass of Token called IDToken that
* you want to create if ofKind is ID, simply add something like :
*
* case MyParserConstants.ID : return new IDToken(ofKind, image);
*
* to the following switch statement. Then you can cast matchedToken
* variable to the appropriate type and use sit in your lexical actions.
*/
static Token *newToken(int ofKind, JAVACC_STRING_TYPE image);
static Token *newToken(int ofKind);
};
}
}
#endif
/* JavaCC - OriginalChecksum=2f5eb1c937adc983dfa2008c4fe383a7 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef TOKENMANAGER_H
#define TOKENMANAGER_H
#include "JavaCC.h"
#include "Token.h"
namespace vhdl {
namespace parser {
/**
* An implementation for this interface is generated by
* JavaCCParser. The user is free to use any implementation
* of their choice.
*/
class TokenManager {
public:
/** This gets the next token from the input stream.
* A token of kind 0 (<EOF>) should be returned on EOF.
*/
public: virtual Token *getNextToken() = 0;
public: virtual ~TokenManager() { }
public: virtual void lexicalError() {
fprintf(stderr, "Lexical error encountered\n");
}
};
}
}
#endif
/* JavaCC - OriginalChecksum=d4725ee75465725057819b3b07fadaa7 (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "TokenMgrError.h"
namespace vhdl {
namespace parser {
/**
* Returns a detailed message for the Error when it is thrown by the
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
* curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curJAVACC_CHAR_TYPE : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
JAVACC_STRING_TYPE TokenMgrError::LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar) {
#if 0
JAVACC_STRING_TYPE s;
stringstream<JAVACC_STRING_TYPE> ss;
ss << "Lexical error at line " << errorLine << " column " << errorColumn
<< ". Encountered: " << curChar << "(" << (int)curChar
<< ") after : \"" << errorAfter.c_str() << "\"";
return (JAVACC_STRING_TYPE)ss.rdbuf()->str();
#endif
return EMPTY;
}
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
JAVACC_STRING_TYPE TokenMgrError::getMessage() {
return message;
}
/*
* Constructors of various flavors follow.
*/
/** No arg constructor. */
TokenMgrError::TokenMgrError() {
}
/** Constructor with message and reason. */
TokenMgrError::TokenMgrError(JAVACC_STRING_TYPE message, int reason) {
errorCode = reason;
}
/** Full Constructor. */
TokenMgrError::TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) {
message = LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar);
errorCode = reason;
}
}
}
// i < 16 - guaranteed
static char hexChar(int i) {
if (i < 10) {
return i - '0';
}
return 'a' + (i - 10);
}
/**
* Replaces unprintable characters by their escaped (or unicode escaped)
* equivalents in the given string
*/
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) {
JAVACC_SIMPLE_STRING retval;
for (size_t i = 0; i < str.size(); i++) {
JAVACC_CHAR_TYPE ch = str[i];
switch (ch)
{
case 0 :
retval += EMPTY[0];
continue;
case '\b':
retval.append("\\b");
continue;
case '\t':
retval.append("\\t");
continue;
case '\n':
retval.append("\\n");
continue;
case '\f':
retval.append("\\f");
continue;
case '\r':
retval.append("\\r");
continue;
case '\\':
retval.append("\\\\");
continue;
default:
if (ch < 0xff) {
retval += ch;
continue;
}
retval.append("\\u");
retval += (hexChar(ch >> 12));
retval += (hexChar((ch & 0x0f00) >> 8));
retval += (hexChar((ch & 0x00f0) >> 4));
retval += (hexChar(ch & 0x000f));
continue;
}
}
return retval;
}
/* JavaCC - OriginalChecksum=7f80e3c4eac120168f5e81d4ddb72e4b (do not edit this line) */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef _TOKENMGRERROR_H
#define _TOKENMGRERROR_H
#include "JavaCC.h"
namespace vhdl {
namespace parser {
enum LexerErrors {
/**
* Lexical error occurred.
*/
LEXICAL_ERROR = 0,
/**
* An attempt was made to create a second instance of a token manager.
*/
STATIC_LEXER_ERROR = 1,
/**
* Tried to change to an invalid lexical state.
*/
INVALID_LEXICAL_STATE = 2,
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
LOOP_DETECTED = 3,
};
class TokenMgrError
{
public:
/*
* Ordinals for various reasons why an Error of this type can be thrown.
*/
/**
* Indicates the reason why the exception is thrown. It will have
* one of the above 4 values.
*/
int errorCode;
/**
* Returns a detailed message for the Error when it is thrown by the
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
* curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
JAVACC_STRING_TYPE LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar);
private: JAVACC_STRING_TYPE message;
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
JAVACC_STRING_TYPE getMessage() ;
/*
* Constructors of various flavors follow.
*/
/** No arg constructor. */
public: TokenMgrError() ;
/** Constructor with message and reason. */
public: TokenMgrError(JAVACC_STRING_TYPE message, int reason) ;
/** Full Constructor. */
public: TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) ;
};
}
}
#endif
/* JavaCC - OriginalChecksum=c7d825cb4d037b031ae43569d383f738 (do not edit this line) */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Generated By:JavaCC: Do not edit this line. VhdlParserConstants.java */
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
#ifndef VHDLPARSERCONSTANTS_H
#define VHDLPARSERCONSTANTS_H
namespace vhdl {
namespace parser {
/** End of File. */
const int _EOF = 0;
/** RegularExpression Id. */
const int DOXYGEN_VHDL_COMMENT = 5;
/** RegularExpression Id. */
const int MULT_DOXYGEN_COMMENT = 6;
/** RegularExpression Id. */
const int VHDL_COMMENT = 7;
/** RegularExpression Id. */
const int MULT_DOXYGEN_VHDL_COMMENT_2008 = 8;
/** RegularExpression Id. */
const int MULT_VHDL_2008_COMMENT = 9;
/** RegularExpression Id. */
const int ABS_T = 10;
/** RegularExpression Id. */
const int ACCESS_T = 11;
/** RegularExpression Id. */
const int AFTER_T = 12;
/** RegularExpression Id. */
const int ALIAS_T = 13;
/** RegularExpression Id. */
const int ALL_T = 14;
/** RegularExpression Id. */
const int AND_T = 15;
/** RegularExpression Id. */
const int ARCHITECTURE_T = 16;
/** RegularExpression Id. */
const int ARRAY_T = 17;
/** RegularExpression Id. */
const int ASSERT_T = 18;
/** RegularExpression Id. */
const int ASSUME_T = 19;
/** RegularExpression Id. */
const int ASSUME_GUARANTEE_T = 20;
/** RegularExpression Id. */
const int ATTRIBUTE_T = 21;
/** RegularExpression Id. */
const int BEGIN_T = 22;
/** RegularExpression Id. */
const int BLOCK_T = 23;
/** RegularExpression Id. */
const int BODY_T = 24;
/** RegularExpression Id. */
const int BUFFER_T = 25;
/** RegularExpression Id. */
const int BUS_T = 26;
/** RegularExpression Id. */
const int COMPONENT_T = 27;
/** RegularExpression Id. */
const int CASE_T = 28;
/** RegularExpression Id. */
const int CONFIGURATION_T = 29;
/** RegularExpression Id. */
const int CONSTANT_T = 30;
/** RegularExpression Id. */
const int CONTEXT_T = 31;
/** RegularExpression Id. */
const int COVER_T = 32;
/** RegularExpression Id. */
const int DEFAULT_T = 33;
/** RegularExpression Id. */
const int DISCONNECT_T = 34;
/** RegularExpression Id. */
const int DOWNTO_T = 35;
/** RegularExpression Id. */
const int ELSE_T = 36;
/** RegularExpression Id. */
const int ELSIF_T = 37;
/** RegularExpression Id. */
const int END_T = 38;
/** RegularExpression Id. */
const int ENTITY_T = 39;
/** RegularExpression Id. */
const int EXIT_T = 40;
/** RegularExpression Id. */
const int FAIRNESS_T = 41;
/** RegularExpression Id. */
const int FILE_T = 42;
/** RegularExpression Id. */
const int FOR_T = 43;
/** RegularExpression Id. */
const int FORCE_T = 44;
/** RegularExpression Id. */
const int FUNCTION_T = 45;
/** RegularExpression Id. */
const int GENERATE_T = 46;
/** RegularExpression Id. */
const int GENERIC_T = 47;
/** RegularExpression Id. */
const int GROUP_T = 48;
/** RegularExpression Id. */
const int GUARDED_T = 49;
/** RegularExpression Id. */
const int IF_T = 50;
/** RegularExpression Id. */
const int IMPURE_T = 51;
/** RegularExpression Id. */
const int IN_T = 52;
/** RegularExpression Id. */
const int INERTIAL_T = 53;
/** RegularExpression Id. */
const int INOUT_T = 54;
/** RegularExpression Id. */
const int IS_T = 55;
/** RegularExpression Id. */
const int LABEL_T = 56;
/** RegularExpression Id. */
const int LIBRARY_T = 57;
/** RegularExpression Id. */
const int LINKAGE_T = 58;
/** RegularExpression Id. */
const int LITERAL_T = 59;
/** RegularExpression Id. */
const int LOOP_T = 60;
/** RegularExpression Id. */
const int MAP_T = 61;
/** RegularExpression Id. */
const int MOD_T = 62;
/** RegularExpression Id. */
const int NAND_T = 63;
/** RegularExpression Id. */
const int NEW_T = 64;
/** RegularExpression Id. */
const int NEXT_T = 65;
/** RegularExpression Id. */
const int NOR_T = 66;
/** RegularExpression Id. */
const int NOT_T = 67;
/** RegularExpression Id. */
const int NULL_T = 68;
/** RegularExpression Id. */
const int OF_T = 69;
/** RegularExpression Id. */
const int ON_T = 70;
/** RegularExpression Id. */
const int OPEN_T = 71;
/** RegularExpression Id. */
const int OR_T = 72;
/** RegularExpression Id. */
const int OTHER_T = 73;
/** RegularExpression Id. */
const int OUT_T = 74;
/** RegularExpression Id. */
const int PACKAGE_T = 75;
/** RegularExpression Id. */
const int PARAMETER_T = 76;
/** RegularExpression Id. */
const int PORT_T = 77;
/** RegularExpression Id. */
const int POSTPONED_T = 78;
/** RegularExpression Id. */
const int PROCEDURE_T = 79;
/** RegularExpression Id. */
const int PROCESS_T = 80;
/** RegularExpression Id. */
const int PROPERTY_T = 81;
/** RegularExpression Id. */
const int PROTECTED_T = 82;
/** RegularExpression Id. */
const int PURE_T = 83;
/** RegularExpression Id. */
const int RANGE_T = 84;
/** RegularExpression Id. */
const int RECORD_T = 85;
/** RegularExpression Id. */
const int REGISTER_T = 86;
/** RegularExpression Id. */
const int REJECT_T = 87;
/** RegularExpression Id. */
const int RELEASE_T = 88;
/** RegularExpression Id. */
const int RESTRICT_T = 89;
/** RegularExpression Id. */
const int RESTRICT_GUARANTEE_T = 90;
/** RegularExpression Id. */
const int REM_T = 91;
/** RegularExpression Id. */
const int REPORT_T = 92;
/** RegularExpression Id. */
const int ROL_T = 93;
/** RegularExpression Id. */
const int ROR_T = 94;
/** RegularExpression Id. */
const int RETURN_T = 95;
/** RegularExpression Id. */
const int SELECT_T = 96;
/** RegularExpression Id. */
const int SEQUENCE_T = 97;
/** RegularExpression Id. */
const int SEVERITY_T = 98;
/** RegularExpression Id. */
const int SIGNAL_T = 99;
/** RegularExpression Id. */
const int SHARED_T = 100;
/** RegularExpression Id. */
const int SLA_T = 101;
/** RegularExpression Id. */
const int SLL_T = 102;
/** RegularExpression Id. */
const int SRA_T = 103;
/** RegularExpression Id. */
const int SRL_T = 104;
/** RegularExpression Id. */
const int STRONG_T = 105;
/** RegularExpression Id. */
const int SUBTYPE_T = 106;
/** RegularExpression Id. */
const int THEN_T = 107;
/** RegularExpression Id. */
const int TO_T = 108;
/** RegularExpression Id. */
const int TRANSPORT_T = 109;
/** RegularExpression Id. */
const int TYPE_T = 110;
/** RegularExpression Id. */
const int UNAFFECTED_T = 111;
/** RegularExpression Id. */
const int UNITS_T = 112;
/** RegularExpression Id. */
const int UNTIL_T = 113;
/** RegularExpression Id. */
const int USE_T = 114;
/** RegularExpression Id. */
const int VARIABLE_T = 115;
/** RegularExpression Id. */
const int VMODE_T = 116;
/** RegularExpression Id. */
const int VPROP_T = 117;
/** RegularExpression Id. */
const int VUNIT_T = 118;
/** RegularExpression Id. */
const int WAIT_T = 119;
/** RegularExpression Id. */
const int WHEN_T = 120;
/** RegularExpression Id. */
const int WHILE_T = 121;
/** RegularExpression Id. */
const int WITH_T = 122;
/** RegularExpression Id. */
const int XOR_T = 123;
/** RegularExpression Id. */
const int XNOR_T = 124;
/** RegularExpression Id. */
const int AMPERSAND_T = 125;
/** RegularExpression Id. */
const int APOSTROPHE_T = 126;
/** RegularExpression Id. */
const int LPAREN_T = 127;
/** RegularExpression Id. */
const int RPAREN_T = 128;
/** RegularExpression Id. */
const int DOUBLEMULT_T = 129;
/** RegularExpression Id. */
const int MULT_T = 130;
/** RegularExpression Id. */
const int PLUS_T = 131;
/** RegularExpression Id. */
const int MINUS_T = 132;
/** RegularExpression Id. */
const int COMMA_T = 133;
/** RegularExpression Id. */
const int VARASSIGN_T = 134;
/** RegularExpression Id. */
const int COLON_T = 135;
/** RegularExpression Id. */
const int SEMI_T = 136;
/** RegularExpression Id. */
const int LESSTHAN_T = 137;
/** RegularExpression Id. */
const int GREATERTHAN_T = 138;
/** RegularExpression Id. */
const int LT_T = 139;
/** RegularExpression Id. */
const int GT_T = 140;
/** RegularExpression Id. */
const int EQU_T = 141;
/** RegularExpression Id. */
const int NOTEQU_T = 142;
/** RegularExpression Id. */
const int ARROW_T = 143;
/** RegularExpression Id. */
const int BOX_T = 144;
/** RegularExpression Id. */
const int SLSL_T = 145;
/** RegularExpression Id. */
const int RSRS_T = 146;
/** RegularExpression Id. */
const int QQ_T = 147;
/** RegularExpression Id. */
const int QGT_T = 148;
/** RegularExpression Id. */
const int QLT_T = 149;
/** RegularExpression Id. */
const int QG_T = 150;
/** RegularExpression Id. */
const int QL_T = 151;
/** RegularExpression Id. */
const int QEQU_T = 152;
/** RegularExpression Id. */
const int QNEQU_T = 153;
/** RegularExpression Id. */
const int Q_T = 154;
/** RegularExpression Id. */
const int BAR_T = 155;
/** RegularExpression Id. */
const int DOT_T = 156;
/** RegularExpression Id. */
const int SLASH_T = 157;
/** RegularExpression Id. */
const int AT_T = 158;
/** RegularExpression Id. */
const int NEG_T = 159;
/** RegularExpression Id. */
const int LBRACKET_T = 160;
/** RegularExpression Id. */
const int RBRACKET_T = 161;
/** RegularExpression Id. */
const int LBRACE = 162;
/** RegularExpression Id. */
const int RBRACE = 163;
/** RegularExpression Id. */
const int INTEGER = 164;
/** RegularExpression Id. */
const int STRINGLITERAL = 165;
/** RegularExpression Id. */
const int BASIC_IDENTIFIER = 166;
/** RegularExpression Id. */
const int EXTENDED_CHARACTER = 167;
/** RegularExpression Id. */
const int CHARACTER_LITERAL = 168;
/** RegularExpression Id. */
const int DECIMAL_LITERAL = 169;
/** RegularExpression Id. */
const int BASED_INTEGER = 170;
/** RegularExpression Id. */
const int BASED_LITERAL = 171;
/** RegularExpression Id. */
const int EXPONENT = 172;
/** RegularExpression Id. */
const int BASIC_GRAPHIC_CHARACTER = 173;
/** RegularExpression Id. */
const int GRAPHIC_CHARACTER = 174;
/** RegularExpression Id. */
const int LETTER_OR_DIGIT = 175;
/** RegularExpression Id. */
const int LETTER = 176;
/** RegularExpression Id. */
const int UPPER_CASE_LETTER = 177;
/** RegularExpression Id. */
const int BIT_STRING_LITERAL = 178;
/** RegularExpression Id. */
const int BASE_SPECIFIER = 179;
/** RegularExpression Id. */
const int DIGIT = 180;
/** RegularExpression Id. */
const int SPECIAL_CHARACTER = 181;
/** RegularExpression Id. */
const int OTHER_SPECIAL_CHARACTER = 182;
/** RegularExpression Id. */
const int SPACE_CHARACTER = 183;
/** RegularExpression Id. */
const int LOWER_CASE_LETTER = 184;
/** RegularExpression Id. */
const int VHDL2008TOOLDIR = 185;
/** Lexical state. */
const int DEFAULT = 0;
/** Literal token values. */
static JAVACC_CHAR_TYPE tokenImage_arr_0[] =
{0x3c, 0x45, 0x4f, 0x46, 0x3e, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_1[] =
{0x22, 0x20, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_2[] =
{0x22, 0x9, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_3[] =
{0x22, 0xa, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_4[] =
{0x22, 0xd, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_5[] =
{0x22, 0x3c, 0x44, 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e, 0x5f, 0x56, 0x48, 0x44, 0x4c, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_6[] =
{0x22, 0x3c, 0x4d, 0x55, 0x4c, 0x54, 0x5f, 0x44, 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_7[] =
{0x22, 0x3c, 0x56, 0x48, 0x44, 0x4c, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_8[] =
{0x22, 0x3c, 0x4d, 0x55, 0x4c, 0x54, 0x5f, 0x44, 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e, 0x5f, 0x56, 0x48, 0x44, 0x4c, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x32, 0x30, 0x30, 0x38, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_9[] =
{0x22, 0x3c, 0x4d, 0x55, 0x4c, 0x54, 0x5f, 0x56, 0x48, 0x44, 0x4c, 0x5f, 0x32, 0x30, 0x30, 0x38, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_10[] =
{0x22, 0x61, 0x62, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_11[] =
{0x22, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_12[] =
{0x22, 0x61, 0x66, 0x74, 0x65, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_13[] =
{0x22, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_14[] =
{0x22, 0x61, 0x6c, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_15[] =
{0x22, 0x61, 0x6e, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_16[] =
{0x22, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_17[] =
{0x22, 0x61, 0x72, 0x72, 0x61, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_18[] =
{0x22, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_19[] =
{0x22, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_20[] =
{0x22, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x67, 0x75, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_21[] =
{0x22, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_22[] =
{0x22, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_23[] =
{0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_24[] =
{0x22, 0x62, 0x6f, 0x64, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_25[] =
{0x22, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_26[] =
{0x22, 0x62, 0x75, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_27[] =
{0x22, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_28[] =
{0x22, 0x63, 0x61, 0x73, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_29[] =
{0x22, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_30[] =
{0x22, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_31[] =
{0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_32[] =
{0x22, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_33[] =
{0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_34[] =
{0x22, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_35[] =
{0x22, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x6f, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_36[] =
{0x22, 0x65, 0x6c, 0x73, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_37[] =
{0x22, 0x65, 0x6c, 0x73, 0x69, 0x66, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_38[] =
{0x22, 0x65, 0x6e, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_39[] =
{0x22, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_40[] =
{0x22, 0x65, 0x78, 0x69, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_41[] =
{0x22, 0x66, 0x61, 0x69, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_42[] =
{0x22, 0x66, 0x69, 0x6c, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_43[] =
{0x22, 0x66, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_44[] =
{0x22, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_45[] =
{0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_46[] =
{0x22, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_47[] =
{0x22, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_48[] =
{0x22, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_49[] =
{0x22, 0x67, 0x75, 0x61, 0x72, 0x64, 0x65, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_50[] =
{0x22, 0x69, 0x66, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_51[] =
{0x22, 0x69, 0x6d, 0x70, 0x75, 0x72, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_52[] =
{0x22, 0x69, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_53[] =
{0x22, 0x69, 0x6e, 0x65, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_54[] =
{0x22, 0x69, 0x6e, 0x6f, 0x75, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_55[] =
{0x22, 0x69, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_56[] =
{0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_57[] =
{0x22, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_58[] =
{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_59[] =
{0x22, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_60[] =
{0x22, 0x6c, 0x6f, 0x6f, 0x70, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_61[] =
{0x22, 0x6d, 0x61, 0x70, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_62[] =
{0x22, 0x6d, 0x6f, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_63[] =
{0x22, 0x6e, 0x61, 0x6e, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_64[] =
{0x22, 0x6e, 0x65, 0x77, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_65[] =
{0x22, 0x6e, 0x65, 0x78, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_66[] =
{0x22, 0x6e, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_67[] =
{0x22, 0x6e, 0x6f, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_68[] =
{0x22, 0x6e, 0x75, 0x6c, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_69[] =
{0x22, 0x6f, 0x66, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_70[] =
{0x22, 0x6f, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_71[] =
{0x22, 0x6f, 0x70, 0x65, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_72[] =
{0x22, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_73[] =
{0x22, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_74[] =
{0x22, 0x6f, 0x75, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_75[] =
{0x22, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_76[] =
{0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_77[] =
{0x22, 0x70, 0x6f, 0x72, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_78[] =
{0x22, 0x70, 0x6f, 0x73, 0x74, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_79[] =
{0x22, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x64, 0x75, 0x72, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_80[] =
{0x22, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_81[] =
{0x22, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_82[] =
{0x22, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_83[] =
{0x22, 0x70, 0x75, 0x72, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_84[] =
{0x22, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_85[] =
{0x22, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_86[] =
{0x22, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_87[] =
{0x22, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_88[] =
{0x22, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_89[] =
{0x22, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_90[] =
{0x22, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x5f, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_91[] =
{0x22, 0x72, 0x65, 0x6d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_92[] =
{0x22, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_93[] =
{0x22, 0x72, 0x6f, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_94[] =
{0x22, 0x72, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_95[] =
{0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_96[] =
{0x22, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_97[] =
{0x22, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_98[] =
{0x22, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_99[] =
{0x22, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_100[] =
{0x22, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_101[] =
{0x22, 0x73, 0x6c, 0x61, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_102[] =
{0x22, 0x73, 0x6c, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_103[] =
{0x22, 0x73, 0x72, 0x61, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_104[] =
{0x22, 0x73, 0x72, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_105[] =
{0x22, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_106[] =
{0x22, 0x73, 0x75, 0x62, 0x74, 0x79, 0x70, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_107[] =
{0x22, 0x74, 0x68, 0x65, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_108[] =
{0x22, 0x74, 0x6f, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_109[] =
{0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_110[] =
{0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_111[] =
{0x22, 0x75, 0x6e, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_112[] =
{0x22, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_113[] =
{0x22, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_114[] =
{0x22, 0x75, 0x73, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_115[] =
{0x22, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_116[] =
{0x22, 0x76, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_117[] =
{0x22, 0x76, 0x70, 0x72, 0x6f, 0x70, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_118[] =
{0x22, 0x76, 0x75, 0x6e, 0x69, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_119[] =
{0x22, 0x77, 0x61, 0x69, 0x74, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_120[] =
{0x22, 0x77, 0x68, 0x65, 0x6e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_121[] =
{0x22, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_122[] =
{0x22, 0x77, 0x69, 0x74, 0x68, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_123[] =
{0x22, 0x78, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_124[] =
{0x22, 0x78, 0x6e, 0x6f, 0x72, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_125[] =
{0x22, 0x26, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_126[] =
{0x22, 0x27, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_127[] =
{0x22, 0x28, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_128[] =
{0x22, 0x29, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_129[] =
{0x22, 0x2a, 0x2a, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_130[] =
{0x22, 0x2a, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_131[] =
{0x22, 0x2b, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_132[] =
{0x22, 0x2d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_133[] =
{0x22, 0x2c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_134[] =
{0x22, 0x3a, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_135[] =
{0x22, 0x3a, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_136[] =
{0x22, 0x3b, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_137[] =
{0x22, 0x3c, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_138[] =
{0x22, 0x3e, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_139[] =
{0x22, 0x3c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_140[] =
{0x22, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_141[] =
{0x22, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_142[] =
{0x22, 0x2f, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_143[] =
{0x22, 0x3d, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_144[] =
{0x22, 0x3c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_145[] =
{0x22, 0x3c, 0x3c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_146[] =
{0x22, 0x3e, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_147[] =
{0x22, 0x3f, 0x3f, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_148[] =
{0x22, 0x3f, 0x3e, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_149[] =
{0x22, 0x3f, 0x3c, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_150[] =
{0x22, 0x3f, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_151[] =
{0x22, 0x3f, 0x3c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_152[] =
{0x22, 0x3f, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_153[] =
{0x22, 0x3f, 0x2f, 0x3d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_154[] =
{0x22, 0x3f, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_155[] =
{0x22, 0x7c, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_156[] =
{0x22, 0x2e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_157[] =
{0x22, 0x2f, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_158[] =
{0x22, 0x40, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_159[] =
{0x22, 0x5e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_160[] =
{0x22, 0x5b, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_161[] =
{0x22, 0x5d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_162[] =
{0x22, 0x7b, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_163[] =
{0x22, 0x7d, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_164[] =
{0x22, 0x3c, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_165[] =
{0x22, 0x3c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_166[] =
{0x22, 0x3c, 0x42, 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x46, 0x49, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_167[] =
{0x22, 0x3c, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x44, 0x45, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_168[] =
{0x22, 0x3c, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_169[] =
{0x22, 0x3c, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x5f, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_170[] =
{0x22, 0x3c, 0x42, 0x41, 0x53, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_171[] =
{0x22, 0x3c, 0x42, 0x41, 0x53, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_172[] =
{0x22, 0x3c, 0x45, 0x58, 0x50, 0x4f, 0x4e, 0x45, 0x4e, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_173[] =
{0x22, 0x3c, 0x42, 0x41, 0x53, 0x49, 0x43, 0x5f, 0x47, 0x52, 0x41, 0x50, 0x48, 0x49, 0x43, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_174[] =
{0x22, 0x3c, 0x47, 0x52, 0x41, 0x50, 0x48, 0x49, 0x43, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_175[] =
{0x22, 0x3c, 0x4c, 0x45, 0x54, 0x54, 0x45, 0x52, 0x5f, 0x4f, 0x52, 0x5f, 0x44, 0x49, 0x47, 0x49, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_176[] =
{0x22, 0x3c, 0x4c, 0x45, 0x54, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_177[] =
{0x22, 0x3c, 0x55, 0x50, 0x50, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x5f, 0x4c, 0x45, 0x54, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_178[] =
{0x22, 0x3c, 0x42, 0x49, 0x54, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_179[] =
{0x22, 0x3c, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_180[] =
{0x22, 0x3c, 0x44, 0x49, 0x47, 0x49, 0x54, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_181[] =
{0x22, 0x3c, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_182[] =
{0x22, 0x3c, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_183[] =
{0x22, 0x3c, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_184[] =
{0x22, 0x3c, 0x4c, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x53, 0x45, 0x5f, 0x4c, 0x45, 0x54, 0x54, 0x45, 0x52, 0x3e, 0x22, 0};
static JAVACC_CHAR_TYPE tokenImage_arr_185[] =
{0x22, 0x3c, 0x56, 0x48, 0x44, 0x4c, 0x32, 0x30, 0x30, 0x38, 0x54, 0x4f, 0x4f, 0x4c, 0x44, 0x49, 0x52, 0x3e, 0x22, 0};
static JAVACC_STRING_TYPE tokenImage[] = {
tokenImage_arr_0,
tokenImage_arr_1,
tokenImage_arr_2,
tokenImage_arr_3,
tokenImage_arr_4,
tokenImage_arr_5,
tokenImage_arr_6,
tokenImage_arr_7,
tokenImage_arr_8,
tokenImage_arr_9,
tokenImage_arr_10,
tokenImage_arr_11,
tokenImage_arr_12,
tokenImage_arr_13,
tokenImage_arr_14,
tokenImage_arr_15,
tokenImage_arr_16,
tokenImage_arr_17,
tokenImage_arr_18,
tokenImage_arr_19,
tokenImage_arr_20,
tokenImage_arr_21,
tokenImage_arr_22,
tokenImage_arr_23,
tokenImage_arr_24,
tokenImage_arr_25,
tokenImage_arr_26,
tokenImage_arr_27,
tokenImage_arr_28,
tokenImage_arr_29,
tokenImage_arr_30,
tokenImage_arr_31,
tokenImage_arr_32,
tokenImage_arr_33,
tokenImage_arr_34,
tokenImage_arr_35,
tokenImage_arr_36,
tokenImage_arr_37,
tokenImage_arr_38,
tokenImage_arr_39,
tokenImage_arr_40,
tokenImage_arr_41,
tokenImage_arr_42,
tokenImage_arr_43,
tokenImage_arr_44,
tokenImage_arr_45,
tokenImage_arr_46,
tokenImage_arr_47,
tokenImage_arr_48,
tokenImage_arr_49,
tokenImage_arr_50,
tokenImage_arr_51,
tokenImage_arr_52,
tokenImage_arr_53,
tokenImage_arr_54,
tokenImage_arr_55,
tokenImage_arr_56,
tokenImage_arr_57,
tokenImage_arr_58,
tokenImage_arr_59,
tokenImage_arr_60,
tokenImage_arr_61,
tokenImage_arr_62,
tokenImage_arr_63,
tokenImage_arr_64,
tokenImage_arr_65,
tokenImage_arr_66,
tokenImage_arr_67,
tokenImage_arr_68,
tokenImage_arr_69,
tokenImage_arr_70,
tokenImage_arr_71,
tokenImage_arr_72,
tokenImage_arr_73,
tokenImage_arr_74,
tokenImage_arr_75,
tokenImage_arr_76,
tokenImage_arr_77,
tokenImage_arr_78,
tokenImage_arr_79,
tokenImage_arr_80,
tokenImage_arr_81,
tokenImage_arr_82,
tokenImage_arr_83,
tokenImage_arr_84,
tokenImage_arr_85,
tokenImage_arr_86,
tokenImage_arr_87,
tokenImage_arr_88,
tokenImage_arr_89,
tokenImage_arr_90,
tokenImage_arr_91,
tokenImage_arr_92,
tokenImage_arr_93,
tokenImage_arr_94,
tokenImage_arr_95,
tokenImage_arr_96,
tokenImage_arr_97,
tokenImage_arr_98,
tokenImage_arr_99,
tokenImage_arr_100,
tokenImage_arr_101,
tokenImage_arr_102,
tokenImage_arr_103,
tokenImage_arr_104,
tokenImage_arr_105,
tokenImage_arr_106,
tokenImage_arr_107,
tokenImage_arr_108,
tokenImage_arr_109,
tokenImage_arr_110,
tokenImage_arr_111,
tokenImage_arr_112,
tokenImage_arr_113,
tokenImage_arr_114,
tokenImage_arr_115,
tokenImage_arr_116,
tokenImage_arr_117,
tokenImage_arr_118,
tokenImage_arr_119,
tokenImage_arr_120,
tokenImage_arr_121,
tokenImage_arr_122,
tokenImage_arr_123,
tokenImage_arr_124,
tokenImage_arr_125,
tokenImage_arr_126,
tokenImage_arr_127,
tokenImage_arr_128,
tokenImage_arr_129,
tokenImage_arr_130,
tokenImage_arr_131,
tokenImage_arr_132,
tokenImage_arr_133,
tokenImage_arr_134,
tokenImage_arr_135,
tokenImage_arr_136,
tokenImage_arr_137,
tokenImage_arr_138,
tokenImage_arr_139,
tokenImage_arr_140,
tokenImage_arr_141,
tokenImage_arr_142,
tokenImage_arr_143,
tokenImage_arr_144,
tokenImage_arr_145,
tokenImage_arr_146,
tokenImage_arr_147,
tokenImage_arr_148,
tokenImage_arr_149,
tokenImage_arr_150,
tokenImage_arr_151,
tokenImage_arr_152,
tokenImage_arr_153,
tokenImage_arr_154,
tokenImage_arr_155,
tokenImage_arr_156,
tokenImage_arr_157,
tokenImage_arr_158,
tokenImage_arr_159,
tokenImage_arr_160,
tokenImage_arr_161,
tokenImage_arr_162,
tokenImage_arr_163,
tokenImage_arr_164,
tokenImage_arr_165,
tokenImage_arr_166,
tokenImage_arr_167,
tokenImage_arr_168,
tokenImage_arr_169,
tokenImage_arr_170,
tokenImage_arr_171,
tokenImage_arr_172,
tokenImage_arr_173,
tokenImage_arr_174,
tokenImage_arr_175,
tokenImage_arr_176,
tokenImage_arr_177,
tokenImage_arr_178,
tokenImage_arr_179,
tokenImage_arr_180,
tokenImage_arr_181,
tokenImage_arr_182,
tokenImage_arr_183,
tokenImage_arr_184,
tokenImage_arr_185,
};
}
}
#endif
#ifndef VHDLPARSERERRORHANDLER_H
#define VHDLPARSERERRORHANDLER_H
#include <stdio.h>
#include <stdlib.h>
#include <exception>
#include "VhdlParser.h"
#include "ErrorHandler.h"
namespace vhdl { namespace parser {
class VhdlErrorHandler: public ErrorHandler
{
virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
{
fprintf(stderr,"\n\n syntax error at line: %d : %s\n", actual->beginLine,actual->image.data());
error_count++;
throw std::exception();
}
virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
{
fprintf(stderr,"\n\n unexpected token at line: %d %s\n", last->beginLine,unexpected->image.data());
error_count++;
throw std::exception();
}
virtual void handleOtherError(JAVACC_STRING_TYPE message, VhdlParser *parser)
{
fprintf(stderr, "\n\n unexpected error: %s\n", (char*)message.c_str());
error_count++;
throw std::exception();
}
};
}
}
#endif
#include "VhdlParserTokenManager.h"
#include "VhdlParserErrorHandler.hpp"
#include "VhdlParser.h"
#include "VhdlParserIF.h"
#include "CharStream.h"
using namespace vhdl::parser;
static VhdlParser * myParser;
void VhdlParserIF::parseVhdlfile(const char* inputBuffer,bool inLine)
{
JAVACC_STRING_TYPE s =inputBuffer;
CharStream *stream = new CharStream(s.c_str(), (int)s.size(), 1, 1);
VhdlParserTokenManager *tokenManager = new VhdlParserTokenManager(stream);
myParser=new VhdlParser(tokenManager);
VhdlErrorHandler *myErr=new VhdlErrorHandler();
myParser->setErrorHandler(myErr);
try
{
if(inLine)
{
myParser->parseInline();
}
else
{
myParser->design_file();
}
}
catch( std::exception &)
{
/* fprintf(stderr,"\n[%s]",e.what()); */
}
// fprintf(stderr,"\n\nparsed lines: %d\n",yyLineNr);
// fprintf(stderr,"\n\nerrors : %d\n\n",myErr->getErrorCount());
delete myParser;
}
void VhdlParser::error_skipto(int kind)
{
Token *op;
do
{
op=myParser->getToken(1);
if (op==0) break;
//fprintf(stderr,"\n %s",t->image.data());
} while (op->kind != kind);
myParser->hasError=false;
// The above loop consumes tokens all the way up to a token of
// "kind". We use a do-while loop rather than a while because the
// current token is the one immediately before the erroneous token
// (in our case the token immediately before what should have been
// "if"/"while".
}
#ifndef VHDLPARSERIF
#define VHDLPARSERIF
#include "VhdlParser.h"
class VhdlParserIF
{
public:
static void parseVhdlfile(const char* inputBuffer,bool inLine);
};
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
#ifndef VHDLPARSERTOKENMANAGER_H
#define VHDLPARSERTOKENMANAGER_H
#include "JavaCC.h"
#include "CharStream.h"
#include "Token.h"
#include "TokenManager.h"
#include "VhdlParserConstants.h"
#include "VhdlParser.h"
namespace vhdl {
namespace parser {
class VhdlParser;
/** Token Manager. */
class VhdlParserTokenManager : public TokenManager {
public:
/** Debug output. */
FILE *debugStream;
/** Set debug output. */
void setDebugStream(FILE *ds);
int jjStopAtPos(int pos, int kind);
int jjMoveStringLiteralDfa0_0();
int jjMoveStringLiteralDfa1_0(unsigned long long active0, unsigned long long active1, unsigned long long active2);
int jjMoveStringLiteralDfa2_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);
int jjMoveStringLiteralDfa3_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);
int jjMoveStringLiteralDfa4_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa5_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa6_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa7_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa8_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa9_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa10_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa11_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa12_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa13_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa14_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa15_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa16_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa17_0(unsigned long long old1, unsigned long long active1);
int jjMoveNfa_0(int startState, int curPos);
bool jjCanMove_0(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);
bool jjCanMove_1(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);
Token * jjFillToken();
public: int curLexState;
public: int jjnewStateCnt;
public: int jjround;
public: int jjmatchedPos;
public: int jjmatchedKind;
Token * getNextToken();
void SkipLexicalActions(Token *matchedToken);
void MoreLexicalActions();
void TokenLexicalActions(Token *matchedToken);
#define jjCheckNAdd(state)\
{\
if (jjrounds[state] != jjround)\
{\
jjstateSet[jjnewStateCnt++] = state;\
jjrounds[state] = jjround;\
}\
}
#define jjAddStates(start, end)\
{\
for (int x = start; x <= end; x++) {\
jjstateSet[jjnewStateCnt++] = jjnextStates[x];\
} /*while (start++ != end);*/\
}
#define jjCheckNAddTwoStates(state1, state2)\
{\
jjCheckNAdd(state1);\
jjCheckNAdd(state2);\
}
#define jjCheckNAddStates(start, end)\
{\
for (int x = start; x <= end; x++) {\
jjCheckNAdd(jjnextStates[x]);\
} /*while (start++ != end);*/\
}
#ifndef JAVACC_CHARSTREAM
#define JAVACC_CHARSTREAM CharStream
#endif
private: VhdlParser*parser;
private: void ReInitRounds();
public: VhdlParserTokenManager(JAVACC_CHARSTREAM *stream, int lexState = 0, VhdlParser *parserArg = NULL);
public: virtual ~VhdlParserTokenManager();
void ReInit(JAVACC_CHARSTREAM *stream, int lexState = 0, VhdlParser *parserArg = NULL);
void SwitchTo(int lexState);
const JAVACC_SIMPLE_STRING jjKindsForBitVector(int i, unsigned long long vec);
const JAVACC_SIMPLE_STRING jjKindsForStateVector(int lexState, int vec[], int start, int end);
JAVACC_CHARSTREAM *input_stream;
int jjrounds[65];
int jjstateSet[2 * 65];
JAVACC_STRING_TYPE jjimage;
JAVACC_STRING_TYPE image;
int jjimageLen;
int lengthOfMatch;
JAVACC_CHAR_TYPE curChar;
};
}
}
#endif
/******************************************************************************
*
* Copyright (C) 2014 by M. Kreis
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
*/
options {
JAVA_UNICODE_ESCAPE = true;
OUTPUT_LANGUAGE = "c++";
NAMESPACE = "vhdl::parser";
STATIC=false;
PARSER_INCLUDES="VhdlParser.h";
TOKEN_MANAGER_INCLUDES="VhdlParser.h";
//OUTPUT_DIRECTORY = ".";
//DEBUG_PARSER=true;
//DEBUG_LOOKAHEAD=true;
}
PARSER_BEGIN(VhdlParser)
typedef unsigned long long uint64;
static Entry* current_root;
static Entry* tempEntry;
static Entry* lastEntity ;
static Entry* lastCompound ;
static Entry* current;
static QCString compSpec;
static QCString currName;
static int levelCounter;
static QCString confName;
static QCString genLabels;
static QCString lab;
static QCString forL;
static int param_sec ;
static int parse_sec;
static int currP;
static Entry* currentCompound;
//----------------------------------------
static void setLineParsed(int tok);
static int getLine(int tok);
static int getLine();
static void lineCount(const char*);
static void lineCount();
static void addProto(const char *s1,const char *s2,const char *s3,const char *s4,const char *s5,const char *s6);
static void addConfigureNode(const char* a,const char*b, bool,bool isLeaf,bool inlineConf);
static void createFunction(const char *impure,uint64 spec,const char *fname);
static void addVhdlType(const char *n,int startLine,int section, uint64 spec,const char* args,const char* type,Protection prot);
static void addCompInst(char *n, char* instName, char* comp,int iLine);
static void handleCommentBlock(const char* doc,bool brief);
static void initEntry(Entry *e);
static void newEntry();
static bool isFuncProcProced();
static void pushLabel(QCString &,QCString&);
static QCString popLabel(QCString & q);
static bool addLibUseClause(const QCString &type);
static void mapLibPackage( Entry* root);
static void createFlow();
static void error_skipto(int kind);
PARSER_END(VhdlParser)
SKIP :
{
" "
| "\t"
| "\n" {::vhdl::parser::VhdlParser::lineCount();}
| "\r"
}
MORE :
{
// VHDL comment -- ......
// VHDL doxygen comment --! ....
<#DOXYGEN_VHDL_COMMENT: "--!" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?>
| <MULT_DOXYGEN_COMMENT: (<DOXYGEN_VHDL_COMMENT>)+ > {::vhdl::parser::VhdlParser::handleCommentBlock(image.data(),TRUE);image.clear();}
| <VHDL_COMMENT: "--" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?> { ::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();}
}
// VHDL 2008 comment /* .... */
// VHDL 2008 doxygen comment /*! .... */
MORE :
{
<MULT_DOXYGEN_VHDL_COMMENT_2008 : "/*!" (~[])* "*/" > {::vhdl::parser::VhdlParser::handleCommentBlock(image.data(),TRUE);image.clear();}
| <MULT_VHDL_2008_COMMENT : "/*" (~[])* "*/" > {::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();}
}
/* KEYWORDS */
TOKEN [IGNORE_CASE] :
{
<ABS_T: "abs">
| <ACCESS_T: "access">
| <AFTER_T: "after">
| <ALIAS_T: "alias">
| <ALL_T: "all">
| <AND_T: "and">
| <ARCHITECTURE_T: "architecture"> {::vhdl::parser::VhdlParser::setLineParsed(ARCHITECTURE_T);}
| <ARRAY_T: "array"> {::vhdl::parser::VhdlParser::setLineParsed(ARRAY_T);}
| <ASSERT_T: "assert">
| <ASSUME_T: "assume">
| <ASSUME_GUARANTEE_T: "assume_guarentee">
| <ATTRIBUTE_T: "attribute"> {::vhdl::parser::VhdlParser::setLineParsed(ATTRIBUTE_T);}
| <BEGIN_T: "begin">
| <BLOCK_T: "block">
| <BODY_T: "body"> {::vhdl::parser::VhdlParser::setLineParsed(BODY_T);}
| <BUFFER_T: "buffer">
| <BUS_T: "bus">
| <COMPONENT_T: "component"> {::vhdl::parser::VhdlParser::setLineParsed(COMPONENT_T);}
| <CASE_T: "case">
| <CONFIGURATION_T: "configuration"> {::vhdl::parser::VhdlParser::setLineParsed(CONFIGURATION_T);}
| <CONSTANT_T: "constant"> {::vhdl::parser::VhdlParser::setLineParsed(CONSTANT_T);}
| <CONTEXT_T: "context"> {::vhdl::parser::VhdlParser::setLineParsed(CONTEXT_T);}
| <COVER_T: "cover">
| <DEFAULT_T: "default">
| <DISCONNECT_T: "disconnect">
| <DOWNTO_T: "downto">
| <ELSE_T: "else">
| <ELSIF_T: "elsif">
| <END_T: "end"> {::vhdl::parser::VhdlParser::setLineParsed(END_T);}
| <ENTITY_T: "entity"> {::vhdl::parser::VhdlParser::setLineParsed(ENTITY_T);}
| <EXIT_T: "exit">
| <FAIRNESS_T: "fairness">
| <FILE_T: "file"> {::vhdl::parser::VhdlParser::setLineParsed(FILE_T);}
| <FOR_T: "for">
| <FORCE_T: "force">
| <FUNCTION_T: "function"> {::vhdl::parser::VhdlParser::setLineParsed(FUNCTION_T);}
| <GENERATE_T: "generate">
| <GENERIC_T: "generic">
| <GROUP_T: "group"> {::vhdl::parser::VhdlParser::setLineParsed(GROUP_T);}
| <GUARDED_T: "guarded">
| <IF_T: "if">
| <IMPURE_T: "impure">
| <IN_T: "in">
| <INERTIAL_T: "inertial">
| <INOUT_T: "inout">
| <IS_T: "is">
| <LABEL_T: "label">
| <LIBRARY_T: "library"> {::vhdl::parser::VhdlParser::setLineParsed(LIBRARY_T);}
| <LINKAGE_T: "linkage">
| <LITERAL_T: "literal">
| <LOOP_T: "loop">
| <MAP_T: "map">
| <MOD_T: "mod">
| <NAND_T: "nand">
| <NEW_T: "new">
| <NEXT_T: "next">
| <NOR_T: "nor">
| <NOT_T: "not">
| <NULL_T: "null">
| <OF_T: "of">
| <ON_T: "on">
| <OPEN_T: "open">
| <OR_T: "or">
| <OTHER_T: "others">
| <OUT_T: "out">
| <PACKAGE_T: "package"> {::vhdl::parser::VhdlParser::setLineParsed(PACKAGE_T);}
| <PARAMETER_T: "parameter">
| <PORT_T: "port"> {::vhdl::parser::VhdlParser::setLineParsed(PORT_T);}
| <POSTPONED_T: "postponed">
| <PROCEDURE_T: "procedure"> {::vhdl::parser::VhdlParser::setLineParsed(PROCEDURE_T);}
| <PROCESS_T: "process"> {::vhdl::parser::VhdlParser::setLineParsed(PROCESS_T);}
| <PROPERTY_T: "property">
| <PROTECTED_T: "protected">
| <PURE_T: "pure">
| <RANGE_T: "range">
| <RECORD_T: "record"> {::vhdl::parser::VhdlParser::setLineParsed(RECORD_T);}
| <REGISTER_T: "register">
| <REJECT_T: "reject">
| <RELEASE_T: "release">
| <RESTRICT_T: "restrict">
| <RESTRICT_GUARANTEE_T: "restrict_guarantee">
| <REM_T: "rem">
| <REPORT_T: "report">
| <ROL_T: "rol">
| <ROR_T: "ror">
| <RETURN_T: "return">
| <SELECT_T: "select">
| <SEQUENCE_T: "sequence">
| <SEVERITY_T: "severity">
| <SIGNAL_T: "signal"> {::vhdl::parser::VhdlParser::setLineParsed(SIGNAL_T);}
| <SHARED_T: "shared">
| <SLA_T: "sla">
| <SLL_T: "sll">
| <SRA_T: "sra">
| <SRL_T: "srl">
| <STRONG_T: "strong">
| <SUBTYPE_T: "subtype"> {::vhdl::parser::VhdlParser::setLineParsed(SUBTYPE_T);}
| <THEN_T: "then">
| <TO_T: "to">
| <TRANSPORT_T: "transport">
| <TYPE_T: "type"> {::vhdl::parser::VhdlParser::setLineParsed(TYPE_T);}
| <UNAFFECTED_T: "unaffected">
| <UNITS_T: "units"> {::vhdl::parser::VhdlParser::setLineParsed(UNITS_T);}
| <UNTIL_T: "until">
| <USE_T: "use">
| <VARIABLE_T: "variable">
| <VMODE_T: "vmode">
| <VPROP_T: "vprop">
| <VUNIT_T: "vunit">
| <WAIT_T: "wait">
| <WHEN_T: "when">
| <WHILE_T: "while">
| <WITH_T: "with">
| <XOR_T: "xor">
| <XNOR_T: "xnor">
}
/* OPERATORS */
TOKEN :
{
< AMPERSAND_T: "&" >
| < APOSTROPHE_T: "'" >
| < LPAREN_T: "(" >
| < RPAREN_T: ")" >
| < DOUBLEMULT_T: "**" >
| < MULT_T: "*" >
| < PLUS_T: "+" >
| < MINUS_T: "-" >
| < COMMA_T: "," >
| < VARASSIGN_T: ":=" >
| < COLON_T: ":" >
| < SEMI_T: ";" >
| < LESSTHAN_T: "<=" >
| < GREATERTHAN_T: ">=" >
| < LT_T: "<" >
| < GT_T: ">" >
| < EQU_T: "=" >
| < NOTEQU_T: "/=" >
| < ARROW_T: "=>" >
| < BOX_T: "<>" >
| < SLSL_T: "<<" >
| < RSRS_T: ">>" >
| < QQ_T: "??" >
| < QGT_T: "?>=" >
| < QLT_T: "?<=" >
| < QG_T: "?>" >
| < QL_T: "?<" >
| < QEQU_T: "?=" >
| < QNEQU_T: "?/=" >
| < Q_T: "?" >
| < BAR_T: "|" >
| <DOT_T: "." >
| < SLASH_T: "/" >
| < AT_T: "@" >
| < NEG_T: "^" >
| < LBRACKET_T: "[" >
| < RBRACKET_T: "]" >
| < LBRACE: "{" >
| < RBRACE: "}" >
}
TOKEN:
{
<INTEGER: <DIGIT> ((["_"])? (<DIGIT>))* >
| <STRINGLITERAL: (( ["\""](<GRAPHIC_CHARACTER>)*) "\"")+ >
| <BASIC_IDENTIFIER: (<LETTER> ( (["_"])* <LETTER_OR_DIGIT> )*) >
| <EXTENDED_CHARACTER: ( ["\\"](<GRAPHIC_CHARACTER>)*["\\"] ) >
| <CHARACTER_LITERAL: (["'"]<GRAPHIC_CHARACTER>["'"]) >
| <DECIMAL_LITERAL: (<INTEGER> (["."]<INTEGER>)? (<EXPONENT>)? ) >
| <BASED_INTEGER: <LETTER_OR_DIGIT>( <LETTER_OR_DIGIT>)* >
| <BASED_LITERAL: <INTEGER>["#"]<BASED_INTEGER>(["."] <BASED_INTEGER>)? ["#"] (<EXPONENT>)? >
| <#EXPONENT: (["e","E"] (["+","-"])? (<INTEGER>)+) >
| < #BASIC_GRAPHIC_CHARACTER: (<UPPER_CASE_LETTER>|<DIGIT>|<SPECIAL_CHARACTER>|<SPACE_CHARACTER>) >
| < #GRAPHIC_CHARACTER: ( <BASIC_GRAPHIC_CHARACTER>|<LOWER_CASE_LETTER>|<OTHER_SPECIAL_CHARACTER> ) >
| < #LETTER_OR_DIGIT: ( <LETTER> | <DIGIT> ) >
| < #LETTER: (<UPPER_CASE_LETTER>|<LOWER_CASE_LETTER>) >
| < #UPPER_CASE_LETTER: ["A"-"Z"] >
| <BIT_STRING_LITERAL : <BASE_SPECIFIER >["\""](<LETTER_OR_DIGIT>)* ["\""] >
| <#BASE_SPECIFIER:["B","O","X","b","o","x"]>
| < #DIGIT: ["0"-"9"] >
| < #SPECIAL_CHARACTER: ["#","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","_","|"] >
| < #OTHER_SPECIAL_CHARACTER: ["%","!","$","@","?","[","\\","]","^","`","{","}","~","\u00A0"-"\u00FF"]>
| < #SPACE_CHARACTER: [" ","\t"] >
| < #LOWER_CASE_LETTER: ["a"-"z"] >
| <VHDL2008TOOLDIR : ["`"](<GRAPHIC_CHARACTER>)+ >
}
QCString abstract_literal() :
{Token *tok;}
{
tok=<DECIMAL_LITERAL> { return tok->image.c_str(); }
| tok=<INTEGER> { return tok->image.c_str(); }
| tok=<BASED_LITERAL> { return tok->image.c_str(); }
}
QCString access_type_definition() :
{Token *tok;QCString str,str1;}
{
tok=<ACCESS_T> str1=subtype_indication() {str=tok->image.c_str(); return str+str1;}
}
QCString actual_designator() :
{QCString str;Token *t;}
{
t=<OPEN_T> { return t->image.c_str(); }
|
LOOKAHEAD(expression())
str=expression() { return str; }
|
LOOKAHEAD(name())
str=name() { return str; }
}
QCString actual_parameter_part() :
{QCString s;}
{
s=association_list() { return s;}
}
QCString actual_part() :
{QCString s,s1;}
{
LOOKAHEAD(actual_designator())
s=actual_designator() { return s;}
|
<BOX_T> { return "<>";}
|
s=name() <LPAREN_T> s1=actual_designator() <RPAREN_T> {s+="(";s+=s1+")";return s;}
}
QCString adding_operator () :
{}
{
<PLUS_T> { return "+";}
| <MINUS_T> { return "-";}
|<AMPERSAND_T> { return "&";}
}
QCString aggregate() : {QCString s,s1,s2;}
{
<LPAREN_T> s=element_association() (LOOKAHEAD(1)<COMMA_T> s1=element_association(){s+=","+s1;})* <RPAREN_T> { return s;}
}
QCString alias_declaration() : {QCString s,s1,s2;}
{
<ALIAS_T> s2=alias_designator()
[ <COLON_T>{ s+=":"; } s1=subtype_indication() { s+=s1; }]
<IS_T> { s+=" is "; } s1=name() {s+=s1;} [s1=signature() {s+=s1;}]
<SEMI_T>
{
addVhdlType(s2.data(),getLine(ALIAS_T),Entry::VARIABLE_SEC,VhdlDocGen::ALIAS,0,s.data(),Public);
return s2+" "+s+";";
}
}
QCString alias_designator() : {Token *tok=0;QCString s;}
{
s=identifier() { return s;}
| tok=<CHARACTER_LITERAL> { return tok->image.c_str(); }
| s=operator_symbol() { return s; }
}
void allocator() :{}
{
LOOKAHEAD(3)
<NEW_T> qualified_expression()
| <NEW_T> subtype_indication()
}
void architecture_body() : {QCString s,s1;}
{
<ARCHITECTURE_T> s=identifier() <OF_T> s1=name() <IS_T>
{
QCString t=s1+"::"+s;
genLabels.resize(0);
pushLabel(genLabels,s1);
lastCompound=current;
addVhdlType(t,getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
}
try{
architecture_declarative_part()
}catch(...){error_skipto(BEGIN_T);}
<BEGIN_T>
architecture_statement_part()
<END_T> [<ARCHITECTURE_T>] [name()] <SEMI_T>
{ lastEntity=0;lastCompound=0; genLabels.resize(0); }
}
void architecture_declarative_part() : {}
{
(block_declarative_item() )*
}
void architecture_statement_part() : {}
{
(concurrent_statement())*
}
QCString array_type_definition (): { QCString s;}
{
LOOKAHEAD(unconstraint_array_definition())
s=unconstraint_array_definition() {return s;}
| s=constraint_array_definition() {return s;}
}
QCString assertion() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
{
<ASSERT_T> s=condition() [ t=<REPORT_T> s1=expression() ] [t1=<SEVERITY_T> s2=expression()]
{
s.prepend("assert ");
if(t) s1.prepend(" report ");
if(t1) s2.prepend(" report ");
return s+s1+s2;
}
}
QCString assertion_statement() : {QCString s,s1,s2;Token *t=0;}
{
[ s=label() t=<COLON_T> ] s1=assertion() <SEMI_T>
{
if(t) s+=":";
return s+s1+";";
}
}
QCString association_element() : {}
{
[LOOKAHEAD(formal_part() <ARROW_T>) formal_part() <ARROW_T> ] actual_part()
{ return " ";}
}
QCString association_list (): {QCString s,s1;}
{
s=association_element() (<COMMA_T> s1=association_element() { s+=","+s1; })* { return s; }
}
QCString attribute_declaration() : {QCString s,s1;}
{
<ATTRIBUTE_T> s=identifier() <COLON_T> s1=type_mark() <SEMI_T>
{
addVhdlType(s.data(),getLine(ATTRIBUTE_T),Entry::VARIABLE_SEC,VhdlDocGen::ATTRIBUTE,0,s1.data(),Public);
return " attribute "+s+":"+s1+";";
}
}
QCString attribute_designator (): {QCString s;Token *tok;}
{
s=identifier() { return s;}
| tok=<RANGE_T> { return tok->image.c_str(); }
}
QCString attribute_name (): {QCString s,s1;}
{
s=identifier() <APOSTROPHE_T> s1=name(){ s+="'"+s1; }[LOOKAHEAD(1)<LPAREN_T>s1=expression() <RPAREN_T> {s+"("+s1+")";}] { return s; }
}
QCString attribute_specification(): {QCString s,s1,s2;}
{
<ATTRIBUTE_T> s=attribute_designator() <OF_T> s1=entity_specification() <IS_T> s2=expression() <SEMI_T>
{
QCString t= s1+" is "+s2;
addVhdlType(s.data(),getLine(ATTRIBUTE_T),Entry::VARIABLE_SEC,VhdlDocGen::ATTRIBUTE,0,t.data(),Public);
return " attribute "+s+" of "+s1+ " is "+s2+";";
}
}
QCString base() : {Token *tok;}
{
tok=<INTEGER> { return tok->image.c_str();}
}
QCString base_specifier (): {Token *tok;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
QCString base_unit_declaration() :
{QCString s;}
{
s=identifier() { return s; }
}
QCString based_integer() : {Token *tok;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
QCString based_literal(): {Token *tok;}
{
tok=<BASED_LITERAL> { return tok->image.c_str();}
}
QCString basic_identifier() : {Token *tok;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
void binding_indication() : {}
{
[ <USE_T> entity_aspect() ]
[ generic_map_aspect() ]
[ port_map_aspect() ]
}
QCString bit_string_literal (): {Token *tok;}
{
tok=<BIT_STRING_LITERAL> { return tok->image.c_str();}
}
QCString bit_value() : {Token *tok;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
void block_configuration() : {}
{
<FOR_T> block_specification()
( use_clause() )*
( configuration_item())*
<END_T> <FOR_T> <SEMI_T>
}
void block_declarative_item (): {}
{
subprogram_declaration()
//| subprogram_body()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| signal_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
| component_declaration()
|
LOOKAHEAD(attribute_declaration())
attribute_declaration()
| attribute_specification()
| configuration_specification()
| disconnection_specification ()
| use_clause()
|
LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
}
void block_declarative_part() : {}
{
(block_declarative_item() )*
}
void block_header() : {}
{
[LOOKAHEAD(generic_clause()) generic_clause()[ generic_map_aspect() <SEMI_T> ] ]
[ port_clause() [ port_map_aspect() <SEMI_T> ] ]
}
void block_specification() : {}
{
name()[LOOKAHEAD(1) <LPAREN_T> index_specification() <RPAREN_T>]
}
void block_statement() : {QCString s;}
{
s=identifier() <COLON_T>
<BLOCK_T> { pushLabel(genLabels,s); }[ <LPAREN_T> expression() <RPAREN_T> ] [ <IS_T> ]
block_header()
block_declarative_part()
<BEGIN_T>
block_statement_part()
<END_T> <BLOCK_T> [ identifier() ] <SEMI_T>
{
genLabels=popLabel(genLabels);
}
}
void block_statement_part() : {}
{
( concurrent_statement() )*
}
void case_statement() : {QCString s;}
{
[ identifier() <COLON_T> ]
<CASE_T> s=expression()
{
QCString ca="case "+s;
FlowChart::addFlowChart(FlowChart::CASE_NO,0,ca);
}
<IS_T>
case_statement_alternative()
( case_statement_alternative ())*
<END_T> <CASE_T> [ identifier() ] <SEMI_T>
{
FlowChart::moveToPrevLevel();
FlowChart::addFlowChart(FlowChart::END_CASE,0,0);
}
}
void case_statement_alternative() : {QCString s;}
{
<WHEN_T> s=choices() <ARROW_T>
{
QCString t="when ";
t+=s+"=> ";
FlowChart::addFlowChart(FlowChart::WHEN_NO,s.data(),t);
}
sequence_of_statement(){FlowChart::moveToPrevLevel(); }
}
QCString character_literal() : {Token *tok;}
{
tok=<CHARACTER_LITERAL>{ return tok->image.c_str();}
}
QCString choice() : {QCString s;}
{
LOOKAHEAD(discrete_range())
s=discrete_range(){ return s; }
|
LOOKAHEAD(simple_expression())
s=simple_expression(){ return s; }
| s=identifier(){ return s; }
| <OTHER_T> { return " others "; }
}
QCString choices() : {QCString s,s1;}
{
s=choice() (<BAR_T> choice(){s+="|";s+=s1;})* { return s; }
}
void component_configuration () :{}
{
<FOR_T> component_specification()
[ binding_indication() <SEMI_T> ]
[ block_configuration() ]
<END_T> <FOR_T> <SEMI_T>
}
void component_declaration() : {QCString s;}
{
<COMPONENT_T> s=identifier() [ <IS_T> ]
{ currP=VhdlDocGen::COMPONENT; }
[ generic_clause() ]
[ port_clause() ]
{
addVhdlType(s.data(),getLine(COMPONENT_T),Entry::VARIABLE_SEC,VhdlDocGen::COMPONENT,0,0,Public);
currP=0;
}
<END_T> <COMPONENT_T> [ identifier() ] <SEMI_T>
}
void component_instantiation_statement() : {QCString s,s1;}
{
s=identifier() <COLON_T>
s1=instantiation_unit()
{
addCompInst(s.lower().data(),s1.lower().data(),0,getLine());
}
[ LOOKAHEAD(generic_map_aspect()) generic_map_aspect() ]
[ port_map_aspect() ] <SEMI_T>
}
void component_specification() : {}
{
instantiation_list() <COLON_T> name()
}
QCString composite_type_definition() : { QCString s,s1;}
{
s=array_type_definition(){ return s; }
| record_type_definition(){ return s; }
}
void concurrent_assertion_statement() : {}
{
[ LOOKAHEAD(2) identifier() <COLON_T> ] [ <POSTPONED_T> ] assertion() <SEMI_T>
}
void concurrent_procedure_call_statement() : {}
{
[ LOOKAHEAD(2) identifier() <COLON_T> ] [ <POSTPONED_T> ] procedure_call() <SEMI_T>
}
void concurrent_signal_assignment_statement() : {}
{
[ LOOKAHEAD(2) identifier() <COLON_T> ] [<POSTPONED_T> ]
(
LOOKAHEAD(conditional_signal_assignment() )
conditional_signal_assignment()
| selected_signal_assignment()
)
}
void concurrent_statement() : {}
{
// try {
LOOKAHEAD([identifier() ":"] <BLOCK_T>)
block_statement()
|
LOOKAHEAD([identifier() ":"] [<POSTPONED_T>] <PROCESS_T>)
process_statement()
|
LOOKAHEAD(generate_statement())
generate_statement()
|
case_scheme()
|
LOOKAHEAD([identifier() ":"] [<POSTPONED_T>] <ASSERT_T>)
concurrent_assertion_statement()
|
LOOKAHEAD(concurrent_signal_assignment_statement())
concurrent_signal_assignment_statement()
|
LOOKAHEAD(component_instantiation_statement() )
component_instantiation_statement()
|
LOOKAHEAD(concurrent_procedure_call_statement())
concurrent_procedure_call_statement()
/*
}
catch( ParseException e )
{
error_skipto(SEMI_T, "syntax error in declarative item");
}
*/
}
QCString condition() : {QCString s;}
{
s=expression() { return s; }
}
QCString condition_clause() : {QCString s;}
{
<UNTIL_T> s=condition()
{
return " until "+s;
}
}
void conditional_signal_assignment() : {}
{
// LOOKAHEAD( target() "<=" options_() conditional_waveforms() ";")
target() <LESSTHAN_T> options() conditional_waveforms() <SEMI_T>
}
void conditional_waveforms() : {}
{
waveform()
( LOOKAHEAD(<WHEN_T> condition() <ELSE_T>)
<WHEN_T> condition() <ELSE_T> waveform() )*
[ <WHEN_T> condition() ]
}
// ( waveform() < WHEN_T> condition() <ELSE_T> )*
// waveform() [ <WHEN_T> condition() ]
//waveform()
// ( LOOKAHEAD( <WHEN> condition() <ELSE>)
// <WHEN> condition() <ELSE> waveform() )*
//[ <WHEN> condition() ]
void configuration_declaration() : {QCString s,s1;}
{
<CONFIGURATION_T> s=identifier() <OF_T> s1=name() <IS_T>
{
confName=s+"::"+s1;
addVhdlType(s.data(),getLine(CONFIGURATION_T),Entry::VARIABLE_SEC,VhdlDocGen::CONFIG,"configuration",s1.data(),Public);
}
configuration_declarative_part()
block_configuration()
<END_T> [ <CONFIGURATION_T> ] [ name() ] <SEMI_T>
{ genLabels.resize(0); confName="";}
}
void configuration_declarative_item() : {}
{
use_clause()
| attribute_specification()
| group_declaration()
}
void configuration_declarative_part() : {}
{
(configuration_declarative_item())*
}
void configuration_item (): {}
{
LOOKAHEAD(component_configuration())
component_configuration()
| block_configuration()
}
void configuration_specification() : {}
{
<FOR_T> component_specification() binding_indication() <SEMI_T>
}
QCString constant_declaration() : {QCString s,s1,s2;Token *t=0;}
{
<CONSTANT_T> s=identifier_list() <COLON_T> s1= subtype_indication() [ t=<VARASSIGN_T> s2=expression() ] <SEMI_T>
{
if(t)
s2.prepend(":=");
QCString it=s1+s2;
addVhdlType(s.data(),getLine(CONSTANT_T),Entry::VARIABLE_SEC,VhdlDocGen::CONSTANT,0,it.data(),Public);
it.prepend("constant ");
return it;
}
}
QCString constraint_array_definition (): {QCString s,s1;}
{
<ARRAY_T> s=index_constraint() <OF_T> s1=subtype_indication(){ return s+" "+s1;}
}
void context_clause (): {}
{
(context_item())*
}
QCString constraint () :{QCString s;}
{
LOOKAHEAD(range_constraint())
s=range_constraint(){ return s;}
|
LOOKAHEAD(index_constraint())
s=index_constraint(){ return s;}
}
void context_item() : {}
{
library_clause()
| use_clause()
}
QCString decimal_literal() : {Token *tok;}
{
tok=<DECIMAL_LITERAL> { return tok->image.c_str(); }
}
QCString delay_mechanism (): {QCString s;}
{
<TRANSPORT_T> { return " transport ";}
| [ <REJECT_T> s=expression() {s.prepend(" reject ");}] <INERTIAL_T> { return s+" inertial "; }
}
void design_file() : {}
{
(design_unit() )+ {}
| <EOF>
}
void design_unit() : {}
{
context_clause()library_unit()
}
QCString designator() : {QCString s;}
{
s=identifier() {return s;}
| s=operator_symbol(){return s;}
}
QCString direction (): {Token *tok;}
{
tok=<TO_T> { return tok->image.c_str();}
| tok=<DOWNTO_T> { return tok->image.c_str();}
}
void disconnection_specification() : {}
{
<DISCONNECT_T> guarded_signal_specificatio() <AFTER_T> expression() <SEMI_T>
}
void guarded_signal_specificatio() : {}
{
signal_list() <COLON_T> name()
}
QCString discrete_range() : {QCString s;}
{
LOOKAHEAD(range())
s=range() { return s;}
|
LOOKAHEAD(subtype_indication())
s=subtype_indication() { return s;}
}
QCString element_association() : {QCString s,s1;}
{
[LOOKAHEAD(choices() <ARROW_T>) choices() <ARROW_T> ] s1=expression() { return s1;}
}
QCString element_declaration() : {QCString s,s1;}
{
s=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T> {return s+":"+s1;}
}
QCString entity_aspect() : {Token *tok;QCString s,s1;}
{
tok=<ENTITY_T> s=name() [ LOOKAHEAD(1)<LPAREN_T> s1=identifier() <RPAREN_T> {s+="("+s1+")";} ] { return s;}
| tok=<CONFIGURATION_T> s=name() { return tok->image.c_str()+s;}
| tok=<OPEN_T> { return tok->image.c_str(); }
}
QCString entity_class() : {}
{
<ENTITY_T> { return "entity";}
| <ARCHITECTURE_T> {return "architecture";}
| <CONFIGURATION_T> {return "configuration";}
| <PROCEDURE_T> {return "procedure";}
| <FUNCTION_T> {return "function";}
| <PACKAGE_T> {return "package";}
| <TYPE_T> {return "type";}
| <SUBTYPE_T> {return "subtype";}
| <CONSTANT_T> {return "constant";}
| <SIGNAL_T> {return "signal";}
| <VARIABLE_T> {return "variable";}
| <COMPONENT_T> {return "component";}
| <LABEL_T> {return "label";}
| <LITERAL_T> {return "literal";}
| <UNITS_T> {return "units";}
| <GROUP_T> {return "group";}
| <FILE_T> {return "file";}
}
QCString entity_class_entry() : {QCString s;}
{
s=entity_class() [ <BOX_T> {s+="<>";} ] { return s;}
}
QCString entity_class_entry_list() : {QCString s,s1,s2;}
{
( s1=entity_class_entry() {s+=s1;} )(<COMMA_T> s=entity_class_entry(){s2+=",";s2+=s;} )* { return s1+s2;}
}
void entity_declaration() : {QCString s;}
{
try{
<ENTITY_T> s=identifier() <IS_T>
{
lastEntity=current;
lastCompound=0;
addVhdlType(s.data(),getLine(ENTITY_T),Entry::CLASS_SEC,VhdlDocGen::ENTITY,0,0,Public);
}
entity_header()
entity_declarative_part ()
[ <BEGIN_T> entity_statement_part() ]
<END_T> [ <ENTITY_T> ] [ name() ]
}catch(...){error_skipto(SEMI_T);}
<SEMI_T>
{ lastEntity=0;lastCompound=0; genLabels.resize(0); }
}
void entity_declarative_item() : {}
{
subprogram_declaration()
//| subprogram_body()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| signal_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
|
LOOKAHEAD(attribute_declaration())
attribute_declaration()
| attribute_specification()
| disconnection_specification()
| use_clause()
|
LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
|
LOOKAHEAD(5)
package_instantiation_declaration()
|package_declaration()
}
void entity_declarative_part() : {}
{
(entity_declarative_item() )*
}
QCString entity_designator() : {QCString s,s1;}
{
s=entity_tag() [ s1=signature() ] { return s+s1;}
}
void entity_header() : {}
{
[ { currP=VhdlDocGen::GENERIC;parse_sec=GEN_SEC; } generic_clause()]
[ { currP=VhdlDocGen::PORT; } port_clause()]
}
QCString entity_name_list() : {QCString s,s1;}
{
(s1=entity_designator() {s+=s1;})+ { return s;}
| <OTHER_T> { return "other";}
| <ALL_T> {return "all";}
}
QCString entity_specification() : {QCString s,s1;}
{
s=entity_name_list() <COLON_T> s1=entity_class(){ return s+":"+s1;}
}
void entity_statement() : {}
{
LOOKAHEAD(concurrent_assertion_statement())
concurrent_assertion_statement()
|
LOOKAHEAD(process_statement())
process_statement()
| concurrent_procedure_call_statement()
}
void entity_statement_part() : {}
{
(entity_statement())*
}
QCString entity_tag (): {QCString s;}
{
s=name() { return s;}
| s=character_literal() { return s;}
}
QCString enumeration_literal() : {QCString s;}
{
s=identifier() { return s;}
| s=character_literal() { return s;}
}
QCString enumeration_type_definition() : {QCString s,s1;}
{
<LPAREN_T>s=enumeration_literal() (LOOKAHEAD(1)<COMMA_T> s1=enumeration_literal() {s+=",";s+=s1;} )* <RPAREN_T>
{ return "("+s+")";}
}
QCString exit_statement() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
{
[ s=identifier() t=<COLON_T> ] <EXIT_T> [ s1=identifier() ]
[ t1=<WHEN_T> s2=condition() ] <SEMI_T>
{
if(t) s+=":";
if(t1) s2.prepend(" when ");
return s+s1+s2+";";
}
}
QCString expression (): {QCString s,s1,s2;}
{
s=relation() ( s1=logop() s2=relation() {s+=s1;s+=s2;} )*
{ return s; }
}
QCString logop() : {}
{
<AND_T> { return "and" ;}
|<NAND_T> { return "nand" ;}
|<NOR_T> { return "nor" ;}
|<XNOR_T> { return "xnor" ;}
|<XOR_T> { return "xor" ;}
|<OR_T> { return "or" ;}
}
QCString extended_identifier (): {Token *t;}
{
t=<EXTENDED_CHARACTER> { return t->image.c_str(); }
}
QCString factor(): {QCString s,s1;}
{
s=primary() [LOOKAHEAD(1) <DOUBLEMULT_T> s1=primary(){ s+="**";s+=s1;} ] { return s;}
| <ABS_T> s=primary(){ s1 = "abs "; return s1+s; }
| <NOT_T> s=primary(){s1="not ";return s1+s;}
}
QCString file_declaration() : {QCString s,s1,s2,s3;}
{
<FILE_T> s=identifier_list() <COLON_T> s2=subtype_indication() [ s3=file_open_information() ] <SEMI_T>
{
QCString t1=s2+" "+s3;
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,t1.data(),Public);
return " file "+s+":"+s2+" "+s3+";";
}
}
QCString file_logical_name(): {QCString s;}
{
s=expression() { return s; }
}
QCString file_open_information() : {QCString s,s1,s2;}
{
[ <OPEN_T> s=expression() ] <IS_T> s1=file_logical_name() {s2="open "+s+" is "+s1; return s2; }
}
QCString file_type_definition() : {QCString s,s1;}
{
<FILE_T> <OF_T> s=type_mark() { s1=" file of "+s; return s1;}
}
QCString floating_type_definition() : {QCString s;}
{
s=range_constraint(){ return s;}
}
QCString formal_designator() : {QCString s;Token *tok;}
{
s=name() { return s; }
|tok=<INTEGER> { return tok->image.c_str();}
}
QCString formal_parameter_list() : {QCString s;}
{
s=interface_list(){ return s; }
}
QCString formal_part() : {QCString s,s1;}
{
s=name() [<LPAREN_T> formal_designator() <RPAREN_T> {s+"("+s1+")";}] {return s;}
}
QCString full_type_declaration() : {QCString s,s1,s2;}
{
<TYPE_T> s=identifier() <IS_T>
try{
s2=type_definition()
}catch(...){error_skipto(SEMI_T);}
<SEMI_T>
{
addVhdlType(s.data(),getLine(TYPE_T),Entry::VARIABLE_SEC,VhdlDocGen::TYPE,0,s2.data(),Public);
return "type "+s+" is "+s2+";";
}
}
QCString function_call() : {QCString s,s1;}
{
s=name() <LPAREN_T> s1=actual_parameter_part() <RPAREN_T> { return s+"("+s1+")";}
}
void generate_statement() : {QCString s;}
{
s=identifier() <COLON_T>
try{
generate_scheme() <GENERATE_T>
{ pushLabel(genLabels,s); }
[ (block_declarative_item() )* <BEGIN_T> ] (concurrent_statement())*
<END_T>
}catch(...){error_skipto(GENERATE_T);}
<GENERATE_T> [ identifier() ] <SEMI_T> {genLabels=popLabel(genLabels); }
}
void generate_scheme() : {}
{
<FOR_T> parameter_specification()
| <IF_T> condition()
}
void generic_clause() : {QCString s;}
{
<GENERIC_T> <LPAREN_T> { parse_sec=GEN_SEC; } s=generic_list() <RPAREN_T> <SEMI_T> { parse_sec=0; }
}
QCString generic_list() : {QCString s;}
{
s=interface_list() { return s; }
}
void generic_map_aspect() : {}
{
<GENERIC_T> <MAP_T> <LPAREN_T> association_list() <RPAREN_T>
}
QCString group_constituent() : {QCString s;}
{
s=name() { return s; }
| s=character_literal() { return s;}
}
QCString group_constituent_list() : {QCString s,s1,s2;}
{
(s1=group_constituent())(<COMMA_T> s=group_constituent(){s2+=",";s2+=s1;})* { return s+s2;}
}
QCString group_declaration() : {QCString s,s1,s2;}
{
<GROUP_T> s=identifier() <COLON_T> s1=identifier() <LPAREN_T> s2=group_constituent_list() <RPAREN_T> <SEMI_T>
{
return "group "+s+":"+s1+"("+s2+");";
}
}
QCString group_template_declaration() : {QCString s,s1;}
{
<GROUP_T> s=identifier() <IS_T> <LPAREN_T> s1=entity_class_entry_list() <RPAREN_T> <SEMI_T>
{
return "group "+s+ "is ("+s1+");";
}
}
void guarded_signal_specification() : {}
{
signal_list() <COLON_T> type_mark()
}
QCString identifier() : {Token *tok;}
{
tok=<EXTENDED_CHARACTER>{ return tok->image.c_str(); }
|tok=<BASIC_IDENTIFIER> { return tok->image.c_str(); }
}
QCString identifier_list() : {QCString str,str1;}
{
str=identifier() (<COMMA_T> str1=identifier() {str+=",";str+=str1;})* { return str; }
}
void if_statement() : {QCString s,s1;}
{
[LOOKAHEAD(1) identifier() <COLON_T> ]
<IF_T> s=condition() <THEN_T>
{
s.prepend("if ");
FlowChart::addFlowChart(FlowChart::IF_NO,0,s);
}
sequence_of_statement()
(
<ELSIF_T> s1=condition() <THEN_T>
{
s1.prepend("elsif ");
FlowChart::addFlowChart(FlowChart::ELSIF_NO,0,s1.data());
}
sequence_of_statement()
)*
[LOOKAHEAD(1) <ELSE_T>
{
FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
}
sequence_of_statement() ] <END_T> <IF_T> [ identifier() ] <SEMI_T>
{
FlowChart::moveToPrevLevel();
FlowChart::addFlowChart(FlowChart::ENDIF_NO,0,0);
}
}
QCString incomplete_type_declaration() : {QCString s;}
{
<TYPE_T> s=identifier() <SEMI_T>
{
return "type "+s+";";
}
}
QCString index_constraint() : {QCString s="("; QCString s1,s2;}
{
//try{
<LPAREN_T> s2=discrete_range(){s+=s2;}(LOOKAHEAD(1)<COMMA_T> s1=discrete_range(){s+=",";s+=s1;})* <RPAREN_T> {return s+")";}
//}catch(...){ error_skipto(SEMI_T);hasError=false;return "";}
}
QCString index_specification() : {QCString s;}
{
LOOKAHEAD( discrete_range())
s=discrete_range() { return s;}
| s=expression(){ return s;}
}
QCString index_subtype_definition() : {QCString s;}
{
s=type_mark() <RANGE_T> <BOX_T> { return s+" range <> ";}
}
QCString instantiation_unit() : {QCString s,s1,s2;Token *tok;}
{
[ tok=<COMPONENT_T> ] s=identifier() {s1="component"; return s; }
| tok=<ENTITY_T> s2=name() {s=tok->image.c_str()+s2;} [ <LPAREN_T> s1=identifier() <RPAREN_T> {s+="(";s+=s1;s+=")" ;}] { return s;}
| <CONFIGURATION_T> s=name() {s1="configuration ";return s;}
}
QCString instantiation_list() : {QCString s;Token *tok;}
{
s=identifier_list() { return s;}
| tok=<OTHER_T> {return tok->image.c_str();}
| tok=<ALL_T> {return tok->image.c_str();}
}
QCString integer() : {Token *t;}
{
t=<INTEGER> {return t->image.c_str();}
}
QCString integer_type_definition() : {QCString s;}
{
s=range_constraint(){ return s;}
}
QCString interface_declaration() : {QCString s,s1;}
{
LOOKAHEAD(5)
s=interface_subprogram_declaration() { return s;}
|interface_package_declaration() { return s;}
|
LOOKAHEAD(5)
s=interface_variable_declaration() { return s;}
|
LOOKAHEAD(5)
interface_file_declaration() { return s;}
|
LOOKAHEAD(subprogram_declaration())
subprogram_declaration() { return s;}
|
s=object_class() s1=identifier()
{
if (parse_sec==GEN_SEC)
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,currP,s1.data(),0,Public);
return s;
}
}
QCString interface_element() : {QCString s;}
{
s=interface_declaration(){ return s;}
}
QCString interface_file_declaration() : {QCString s,s1;}
{
<FILE_T> s=identifier_list() <COLON_T> s1=subtype_indication()
{
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
return " file "+s+":"+s1;
}
}
QCString interface_list() : {QCString s,s1,s2;}
{
s=interface_element() (LOOKAHEAD(1) <SEMI_T> s1=interface_element(){s2+=";";s2+=s1;})* { return s+s2;}
}
QCString interface_variable_declaration() : {Token *tok=0;Token *tok1=0;Token *tok2=0;QCString s,s1,s2,s3,s4,s5;}
{
[( tok=<VARIABLE_T> | tok=<SIGNAL_T> | tok=<CONSTANT_T>|tok=<SHARED_T>) ]
s=identifier_list() <COLON_T> [ s1=mode() ]
s2=subtype_indication() [ tok1=<BUS_T> ] [ tok2=<VARASSIGN_T> s4=expression() ]
{
if(tok)
s5=tok->image.c_str();
if(tok1)
s3=tok->image.data();
if(tok2)
s3+=":=";
QCString it=s+":"+s1+" "+s2+" "+s3+" "+s4;
if (currP!=VhdlDocGen::COMPONENT)
{
if (currP==VhdlDocGen::FUNCTION || currP==VhdlDocGen::PROCEDURE)
{
addProto(s5.data(),s.data(),s2.data(),s3.data(),0,s4.data());
}
else
{
QCString i=s2+s3+s4;
if (currP==VhdlDocGen::GENERIC && param_sec==0)
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,currP,i.data(),s1.data(),Public);
else if(parse_sec != GEN_SEC)
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,currP,i.data(),s1.data(),Public);
}
// fprintf(stderr,"\n\n <<port %s >>\n",$$.data());
} // if component
return it;
}
}
void iteration_scheme() : {}
{
<WHILE_T> condition()
| <FOR_T> parameter_specification()
}
QCString label() : {QCString s;}
{
s=identifier() { return s;}
}
QCString library_clause() : {QCString s;}
{
(<LIBRARY_T> s=identifier_list() <SEMI_T>
)
{
if ( parse_sec==0 && Config_getBool("SHOW_INCLUDE_FILES") )
{
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::LIBRARY,s.data(),"_library_",Public);
}
QCString s1="library "+s;
return s1;
}
}
QCString library_unit() : {QCString s;}
{
LOOKAHEAD(2)
primary_unit() { return s; }
| secondary_unit() { return s; }
| context_declaration()
}
QCString literal() : {QCString s;}
{
LOOKAHEAD(bit_string_literal())
s=bit_string_literal() { return s;}
|
LOOKAHEAD(numeric_literal())
s=numeric_literal() { return s;}
|
LOOKAHEAD(enumeration_literal())
s=enumeration_literal() { return s;}
| s=string_literal() { return s;}
| <NULL_T> {return "null";}
}
QCString logical_operator() : {QCString s;}
{
s=logop() { return s;}
}
void loop_statement() : {}
{
[ identifier() <COLON_T> ]
[ iteration_scheme() ] <LOOP_T>
sequence_of_statement()
<END_T> <LOOP_T> [ identifier() ] <SEMI_T>
}
QCString miscellaneous_operator():{Token *t=0;}
{
<DOUBLEMULT_T> {return "**";}
| <ABS_T> {return "abs";}
| <NOT_T> {return "not";}
}
QCString mode() : {Token *tok;}
{
tok=<IN_T> { return "in"; }
| tok=<OUT_T> { return "out"; }
| tok=<INOUT_T> { return "inout"; }
| tok=<BUFFER_T> { return "buffer"; }
| tok=<LINKAGE_T> { return "linkage"; }
}
QCString multiplying_operation() : {Token *tok;}
{
tok=<MULT_T> { return tok->image.c_str(); }
| tok=<SLASH_T> { return tok->image.c_str(); }
| tok=<MOD_T> { return tok->image.c_str(); }
| tok=<REM_T> { return tok->image.c_str(); }
}
QCString name() : {QCString s,s1;}
{
(
s=operator_symbol()
| s=identifier()| s=external_name()
)
[LOOKAHEAD(name_ext1()) s1=name_ext1(){ s+=s1;}] { return s; }
}
QCString name_ext1() : {QCString s,s1,s2;}
{
s=name_ext() (LOOKAHEAD(name_ext()) s1=name_ext(){s+=s1;})* { return s;}
}
QCString name_ext() : {QCString s,s1,s2;}
{
(
LOOKAHEAD(<DOT_T> suffix())
<DOT_T> s1=suffix(){s+=".";s+=s1;}
|
LOOKAHEAD(test_att_name())
s1=test_att_name() { s+=s1;}
|
LOOKAHEAD( <LPAREN_T> discrete_range() <RPAREN_T>)
<LPAREN_T> s1=discrete_range() <RPAREN_T> {s+="(";s+=s1;s+=")";}
|
LOOKAHEAD( "(" expression() ("," expression() )* ")" )
<LPAREN_T> s1=expression() {s+="(";s+=s1;} (LOOKAHEAD(1) <COMMA_T> s1=expression(){s+=",";s+=s1;})* <RPAREN_T> { s+=")";}
)
{return s;}
}
QCString test_att_name() : {QCString s,s1;}
{
[ LOOKAHEAD(<LBRACKET_T>) s1=signature() {s=s1;}]
<APOSTROPHE_T> s1=attribute_designator() {s+="'";s+=s1;}
[LOOKAHEAD(1) <LPAREN_T> s1=expression() <RPAREN_T> {s+="(";s+=s1;s+=")";}]
{ return s;}
}
QCString indexed_name() : {QCString s,s1,s2;}
{
s2=identifier() <LPAREN_T> s1=expression(){s=s2+"("+s1;} (<COMMA_T> s1=expression(){s+=",";s+=s1;})* <RPAREN_T> {return s+")";}
}
QCString next_statement() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
{
[LOOKAHEAD(1) s=identifier() t=<COLON_T> ] <NEXT_T> [ s1=identifier() ]
[LOOKAHEAD(1) t1=<WHEN_T> s2=condition() ] <SEMI_T>
{
if(t) s+=":";
if(t1) s2.prepend("when ");
return s+s1+s2+";";
}
}
QCString null_statement() : {QCString s;}
{
[ s=identifier() <COLON_T> {s+=":";}] <NULL_T> <SEMI_T>{return s+="null";}
}
QCString numeric_literal() : {QCString s;}
{
LOOKAHEAD(physical_literal())
s=physical_literal(){ return s;}
| s=abstract_literal() { return s;}
}
QCString object_class() : {}
{
<CONSTANT_T> { return "constant"; }
|<SIGNAL_T> { return "signal"; }
|<VARIABLE_T> { return "variable"; }
|<SHARED_T> <VARIABLE_T> { return "shared variable"; }
|<FILE_T> { return "file"; }
|<TYPE_T> { return "type"; }
}
QCString operator_symbol() : {Token *tok;}
{
tok=<STRINGLITERAL> {return tok->image.c_str();}
}
void options() : {}
{
[ <GUARDED_T> ] [ delay_mechanism() ]
}
void package_body() : {QCString s;}
{
<PACKAGE_T> <BODY_T> s=name() <IS_T>
{
lastCompound=current;
s.prepend("_");
addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
}
package_body_declarative_part()
<END_T> [<PACKAGE_T> <BODY_T> ] [ name() ] <SEMI_T> { lastCompound=0; genLabels.resize(0); }
}
void package_body_declarative_item() : {}
{
subprogram_declaration()
//| subprogram_body()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
| use_clause()
|
LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
}
void package_body_declarative_part() : {}
{
(package_body_declarative_item() )*
}
void package_declaration(): {QCString s;}
{
<PACKAGE_T> s=identifier() <IS_T>
{
lastCompound=current;
Entry *clone=new Entry(*current);
clone->section=Entry::NAMESPACE_SEC;
clone->spec=VhdlDocGen::PACKAGE;
clone->name=s;
clone->startLine=getLine();
clone->bodyLine=getLine();
clone->protection=Package;
current_root->addSubEntry(clone);
addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
}
package_declarative_part()
<END_T> [ <PACKAGE_T>] [ name() ] <SEMI_T>
{ lastEntity=0;lastCompound=0; genLabels.resize(0); }
}
void geninter():{}
{
[gen_interface_list() <SEMI_T> [gen_assoc_list() <SEMI_T>]]
}
void package_declarative_item() : {}
{
//LOOKAHEAD(3)
//interface_subprogram_declaration()
subprogram_declaration()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| signal_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
| component_declaration()
|
LOOKAHEAD(attribute_declaration())
attribute_declaration()
| attribute_specification()
| disconnection_specification()
| use_clause()
|
LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
|
LOOKAHEAD(5)
package_instantiation_declaration()
|package_declaration()
}
void package_declarative_part() : {}
{
(package_declarative_item())*
}
QCString parameter_specification() : {QCString s,s1;}
{
s=identifier() <IN_T> s1=discrete_range(){ return s+" in "+s1;}
}
QCString physical_literal() : {QCString s,s1;}
{
[LOOKAHEAD(abstract_literal()) s=abstract_literal()] s1=name(){s+=" ";s+=s1;s.prepend(" "); return s;}
}
QCString physical_type_definition() : {QCString s,s1,s2;}
{
<UNITS_T>
s=identifier()<SEMI_T>
(s1=secondary_unit_declaration(){s2+=s1;s2+="#";})*
<END_T> <UNITS_T> [name()]
{
current->args=s2;
current->args.prepend("units");
current->spec=VhdlDocGen::UNITS;
return s2;
}
}
void port_clause() : {}
{
<PORT_T> <LPAREN_T> port_list()<RPAREN_T> <SEMI_T>{ currP=0; }
}
QCString port_list() : {QCString s;}
{
s=interface_list(){return s;}
}
void port_map_aspect() : {}
{
<PORT_T> <MAP_T> <LPAREN_T> association_list() <RPAREN_T>
}
QCString primary() : {QCString s,s1;}
{
LOOKAHEAD(function_call())
s=function_call() { return s;}
|
LOOKAHEAD(<LPAREN_T> expression() <RPAREN_T>)
<LPAREN_T> s1=expression() <RPAREN_T>{ s="("+s1+")"; return s;}
|
LOOKAHEAD(qualified_expression())
s=qualified_expression() { return s;}
|
LOOKAHEAD(type_conversion())
s=type_conversion() { return s;}
|
LOOKAHEAD(literal())
s=literal() { s.prepend(" ");return s;}
|
LOOKAHEAD(name())
s=name() { return s;}
|
allocator() { return "";}
|
s=aggregate() { return s; }
}
void primary_unit() : {}
{
entity_declaration()
| configuration_declaration()
|
LOOKAHEAD(package_instantiation_declaration())
package_instantiation_declaration()
|
LOOKAHEAD(4)
interface_package_declaration()
| package_declaration()
}
QCString procedure_call() : {QCString s,s1;}
{
s=name() [ <LPAREN_T> s1=actual_parameter_part() <RPAREN_T>{ s1.prepend("("); s1.append(")");}]
{ return s+s1;}
}
QCString procedure_call_statement() : {QCString s,s1;}
{
[LOOKAHEAD(2) s=identifier() <COLON_T> { s+=":"; }] s1=procedure_call() <SEMI_T>
{
return s+s1+";";
}
}
QCString process_declarative_item() : {QCString s;}
{
subprogram_declaration() { return "";}
//| subprogram_body()
| s=type_declaration() { return s;}
| s=subtype_declaration() { return s;}
| s=constant_declaration() { return s;}
| s=variable_declaration() { return s;}
| s=file_declaration() { return s;}
| s=alias_declaration() { return s;}
|
LOOKAHEAD(3)
s=attribute_declaration() { return s;}
| s=attribute_specification() { return s;}
| s=use_clause() { return s;}
|
LOOKAHEAD(3)
s=group_template_declaration() { return s;}
| s=group_declaration() { return s;}
}
QCString process_declarative_part() :{QCString s,s1;}
{
( s1=process_declarative_item(){s+=s1;} )* { return s;}
}
void process_statement() : {QCString s,s1,s2;Token *tok=0;}
{
[ s=identifier() <COLON_T> ]
[ <POSTPONED_T> ]
{
currP=VhdlDocGen::PROCESS;
current->startLine=getLine();
current->bodyLine=getLine();
}
<PROCESS_T>
try{
[ <LPAREN_T> (tok=<ALL_T> | s1=sensitivity_list()) <RPAREN_T> ] [ <IS_T> ]
s2=process_declarative_part()
{
if (s2.data())
FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2.data(),0);
FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
}
<BEGIN_T>
process_statement_part()
<END_T> [ <POSTPONED_T> ]
}catch(...){error_skipto(PROCESS_T);}
<PROCESS_T> [ identifier() ] <SEMI_T>
{
if(s.isEmpty())
currName=VhdlDocGen::getProcessNumber();
else
currName=s;
current->name=currName;
tempEntry=current;
current->endBodyLine=getLine();
currP=0;
if(tok)
s1=tok->image.data();
createFunction(currName,VhdlDocGen::PROCESS,s1.data());
createFlow();
currName="";
newEntry();
}
}
void process_statement_part() : {}
{
(sequential_statement())*
}
QCString qualified_expression() : {QCString s,s1;}
{
s1=identifier() <APOSTROPHE_T> {s=s1+"'";}
(
LOOKAHEAD(aggregate())
s1=aggregate(){s+=s1;}
| <LPAREN_T> s1=expression() <RPAREN_T>{s+="(";s+=s1;s+=")";}
)
{return s;}
}
QCString range() : {QCString s,s1,s2;}
{
LOOKAHEAD( simple_expression() direction() simple_expression())
s=simple_expression() s1=direction() s2=simple_expression(){return s+" "+s1+" "+s2;}
|
LOOKAHEAD(attribute_name())
s=attribute_name(){ return s;}
}
QCString range_constraint() : {QCString s,s1;}
{
<RANGE_T> s=range(){return " range "+s;}
}
void record_type_definition() : {}
{
<RECORD_T>
try{
(element_declaration())+
}catch(...){error_skipto(END_T);}
<END_T>
<RECORD_T> [ name()]
}
QCString relation() : {QCString s,s1,s2;}
{
s=shift_expression() [LOOKAHEAD(1) s1=relation_operator() s2=shift_expression() ] {return s+s1+s2;}
}
QCString relation_operator() : {}
{
<LT_T> {return "<";}
|<GT_T> {return ">";}
|<EQU_T> {return "=";}
|<GREATERTHAN_T> {return ">=";}
|<LESSTHAN_T> {return "<=";}
|<NOTEQU_T> {return "/=";}
}
QCString report_statement() : {Token *t=0;Token *t1=0;QCString s,s1,s2;}
{
[ s=identifier() t=<COLON_T> ]
<REPORT_T> s1=expression()
[ t1=<SEVERITY_T> s2=expression() ] <SEMI_T>
{
if(t) s.append(":");
s1.prepend(" report ");
if(t1) s2.prepend(" severity ");
return s+s1+s2+";";
}
}
QCString return_statement() : {QCString s,s1;}
{
[ s=identifier() <COLON_T> { s+=":";}] <RETURN_T> [ s1=expression() ] <SEMI_T>
{ return s+" return "+s1+";";}
}
QCString scalar_type_definition() : {QCString s,s1;}
{
s=enumeration_type_definition(){ return s;}
| s=range_constraint() [LOOKAHEAD( physical_type_definition()) s1=physical_type_definition()] { s+=" ";s+=s1;return s;}
}
void secondary_unit() : {}
{
architecture_body()
| package_body()
}
QCString secondary_unit_declaration() : {QCString s,s1;}
{
s=identifier() <EQU_T> s1=physical_literal() <SEMI_T> { return s+"="+s1; }
}
QCString selected_name() : {QCString s,s1;}
{
s=identifier() <DOT_T> s1=suffix(){ return s+"."+s1;}
}
void selected_signal_assignment() : {}
{
<WITH_T> expression() <SELECT_T>
target() < LESSTHAN_T> options() selected_waveforms() <SEMI_T>
}
void selected_waveforms() : {}
{
waveform() <WHEN_T> choices()(<COMMA_T> waveform() <WHEN_T> choices())*
}
QCString sensitivity_clause() : {QCString s;}
{
<ON_T> s=sensitivity_list()
{
s.prepend(" on ");
return s;
}
}
QCString sensitivity_list() : {QCString s,s1;}
{
s=name() (<COMMA_T> s1=name(){s+=",";s+=s1;} )* { return s;}
}
void sequence_of_statement() : {}
{
( LOOKAHEAD(3)sequential_statement())*
}
void sequential_statement() :{QCString s;}
{
LOOKAHEAD( [ identifier() ":" ] target() "<=")
s=signal_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
|
LOOKAHEAD(3)
s=assertion_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
|
LOOKAHEAD(3)
s=report_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
|
LOOKAHEAD(3)
s=wait_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
|
LOOKAHEAD( [ identifier() ":" ] target() ":=" )
s=variable_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
|
LOOKAHEAD(3)
s=procedure_call_statement(){ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0); }
|
LOOKAHEAD(3)
if_statement()
|
LOOKAHEAD(3)
case_statement()
|
LOOKAHEAD(3)
loop_statement()
|
LOOKAHEAD(3)
s=next_statement()
|
LOOKAHEAD(3)
s=exit_statement()
|
LOOKAHEAD(3)
s=return_statement(){FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);}
|
s=null_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);}
}
QCString shift_expression() : {QCString s,s1,s2;}
{
s=simple_expression() [ s1=shift_operator() s2=simple_expression() ] { return s+s1+s2;}
}
QCString shift_operator() : {}
{
<SLL_T> { return "sll";}
| <SRL_T> { return "srl";}
| <SLA_T> { return "sla";}
| <SRA_T> { return "sra";}
| <ROL_T> { return "rol";}
| <ROR_T> { return "ror";}
}
QCString sign() : {}
{
<PLUS_T> { return "+";}
| <MINUS_T> { return "-";}
}
QCString signal_assignment_statement() : {QCString s,s1,s2,s3;}
{
LOOKAHEAD(conditional_signal_assignment_wave())
conditional_signal_assignment_wave(){ return ""; }
|
LOOKAHEAD(selected_signal_assignment_wave())
selected_signal_assignment_wave() { return ""; }
|
[LOOKAHEAD(2) s=identifier() <COLON_T> {s+=":";} ]
s1=target() <LESSTHAN_T>
[ s2=delay_mechanism() ]
s3=waveform() <SEMI_T>
{
return s+s1+"<="+s2+s3+";";
}
}
void semi() : {}
{
<SEMI_T>
}
void signal_declaration() : {QCString s,s1,s2,s3,s4;}
{
<SIGNAL_T> s=identifier_list() <COLON_T> s1=subtype_indication() [ s2=signal_kind() ] [ <VARASSIGN_T> s3=expression() ] <SEMI_T>
{
s4=s1+s2+s3;
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SIGNAL,0,s4.data(),Public);
}
}
QCString signal_kind() : {}
{
<REGISTER_T> { return "register";}
| <BUS_T> { return "bus";}
}
QCString signal_list() : {QCString s,s1;}
{
s=name() (<COMMA_T> s1=name() { s+=",";s+=s1;})*
| <OTHER_T> { return "other";}
| <ALL_T> { return "all";}
}
QCString signature() : {QCString s,s1,s2;}
{
<LBRACKET_T>
[ s=name() (<COMMA_T> s1=name() {s+=",";s+=s1; })* ]
[ <RETURN_T> s1=name() {s+="return ";s+=s1;}]
<RBRACKET_T>
{ s1="["+s+"]";return s1;}
}
QCString simple_expression(): {QCString s,s1,s2;}
{
[ s=sign() ] s1=term() {s+=s1;} ( LOOKAHEAD(adding_operator()) s1=adding_operator() s2=term() {s+=s1;s+=s2;})* { return s;}
}
void simple_name() : {}
{
name()
}
QCString slice_name() : {QCString s,s1;}
{
s=identifier() <LPAREN_T> s1=discrete_range() <RPAREN_T> {return s+"("+s1+")";}
}
QCString string_literal() : {Token *tok;}
{
tok=<STRINGLITERAL> {return tok->image.c_str();}
}
void subprogram_body() : {QCString s;}
{
//subprogram_specification()
<IS_T>
try{
s=subprogram_declarative_part()
{
if (s.data())
{
FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,0);
}
FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
}
}catch(...){error_skipto(BEGIN_T);}
<BEGIN_T>
subprogram_statement_part()
<END_T> [ subprogram_kind() ] [ designator() ] <SEMI_T>
{
tempEntry->endBodyLine=getLine(END_T);
createFlow();
currP=0;
}
}
void subprogram_declaration() : {}
{
LOOKAHEAD(subprogram_instantiation_declaration())
subprogram_instantiation_declaration()
|
subprogram_specification()subprogram_1(){currP=0;}
}
void subprogram_1() : {}
{
subprogram_body()
| <SEMI_T>
}
QCString subprogram_declarative_item() : {QCString s;}
{
subprogram_declaration(){ return "";}
|s=type_declaration(){ return s;}
| subprogram_body(){ return "";}
| s=subtype_declaration(){ return s;}
| s=constant_declaration(){ return s;}
| s=variable_declaration(){ return s;}
| s=file_declaration(){ return s;}
| s=alias_declaration(){ return s;}
|
LOOKAHEAD(attribute_declaration())
s=attribute_declaration(){ return s;}
| s=attribute_specification(){ return s;}
| s=use_clause(){ return s;}
|
LOOKAHEAD(3)
s=group_template_declaration(){ return s;}
| s=group_declaration() { return s;}
}
QCString subprogram_declarative_part() : {QCString s,s1;}
{
(s1=subprogram_declarative_item(){s+=s1;})* { return s;}
}
void subprogram_kind() : {}
{
<FUNCTION_T>
|<PROCEDURE_T>
}
void subprogram_specification() : {QCString s;Token *tok=0;Token *t;}
{
<PROCEDURE_T> s=designator()
{
currP=VhdlDocGen::PROCEDURE;
createFunction(s.data(),currP,0);
tempEntry=current;
current->startLine=getLine(PROCEDURE_T);
current->bodyLine=getLine(PROCEDURE_T);
} [LOOKAHEAD(1) <LPAREN_T> { param_sec=PARAM_SEC; } interface_list() { param_sec=0; }<RPAREN_T> ]
[LOOKAHEAD(2) gen_interface_list()]
[ LOOKAHEAD(2) gen_assoc_list()]
param()
{ newEntry(); }
|
[ (tok=<PURE_T> | tok=<IMPURE_T>) ] t=<FUNCTION_T> s=designator()
{
currP=VhdlDocGen::FUNCTION;
if(tok)
createFunction(tok->image.c_str(),currP,s.data());
else
createFunction(0,currP,s.data());
tempEntry=current;
current->startLine=getLine(FUNCTION_T);
current->bodyLine=getLine(FUNCTION_T);
}
[{ param_sec=PARAM_SEC; } <LPAREN_T> formal_parameter_list() <RPAREN_T> { param_sec=0; }]
<RETURN_T> s=type_mark()
{
tempEntry=current;
current->type=s;
newEntry();
}
}
void subprogram_statement_part() : {}
{
(sequential_statement())*
}
QCString subtype_declaration() : {QCString s,s1;}
{
<SUBTYPE_T> s=identifier() <IS_T> s1=subtype_indication() <SEMI_T>
{
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SUBTYPE,0,s1.data(),Public);
return " subtype "+s+" is "+s1+";";
}
}
QCString subtype_indication() : {QCString s,s1,s2;}
{
s=name()
[LOOKAHEAD (name()) s1=name()] [LOOKAHEAD(constraint() ) s2=constraint()]
{return s+" "+s1+" "+s2;}
}
QCString suffix() : {QCString s;}
{
LOOKAHEAD(name())
s=name() { return s;}
| s=character_literal() { return s;}
| s=operator_symbol(){ return s;}
| <ALL_T> {return " all ";}
}
QCString target() : {QCString s;}
{
s=name(){ return s;}
| s=aggregate() { return s;}
}
QCString term() : {QCString s,s1,s2;}
{
s=factor() ( LOOKAHEAD(2) s1=multiplying_operation() s2=factor(){s+=s1;s+=s2;} )* { return s;}
}
QCString timeout_clause() : {QCString s;}
{
<FOR_T> s=expression()
{
return " for "+s;
}
}
QCString type_conversion() : {QCString s,s1;}
{
s=name() <LPAREN_T> s1=expression() <RPAREN_T> { return s+"("+s1+")";}
}
QCString type_declaration() : {QCString s;}
{
LOOKAHEAD(3)
s=full_type_declaration(){ return s;}
| s=incomplete_type_declaration(){ return s;}
}
QCString type_definition() : {QCString s;}
{
//try{
s=scalar_type_definition(){ return s;}
| s=composite_type_definition(){ return s;}
| s=access_type_definition(){ return s;}
| s=file_type_definition(){ return s;}
|
LOOKAHEAD(2)
protected_type_body() { return ""; }
| protected_type_declaration() { return ""; }
//}catch(...){error_skipto(SEMI_T); return "";}
}
QCString type_mark() : {QCString s; }
{
s=name() { return s;}
}
QCString unconstraint_array_definition() : {QCString s,s1,s2,s3;}
{
<ARRAY_T> <LPAREN_T> s=index_subtype_definition() ( <COMMA_T> s1=index_subtype_definition(){s3+=",";s3+=s1;})* <RPAREN_T>
<OF_T> s2=subtype_indication() {return "array("+s+s3+") of "+s2;}
}
QCString use_clause() : {QCString s,s1;}
{
<USE_T> s=selected_name()(<COMMA_T> s1=selected_name(){s+=",";s+=s1;})* <SEMI_T>
{
QStringList ql1=QStringList::split(",",s,FALSE);
for (uint j=0;j<ql1.count();j++)
{
QCString it=ql1[j].utf8();
if ( parse_sec==0 && Config_getBool("SHOW_INCLUDE_FILES") )
{
::vhdl::parser::VhdlParser::addVhdlType(it.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);
}
}
s1="use "+s;
return s1;
}
}
QCString variable_assignment_statement() : {QCString s,s1,s2;}
{
[LOOKAHEAD(2) s=identifier() <COLON_T> {s+=":";}]
s1=target() <VARASSIGN_T> s2=expression() <SEMI_T>
{return s+s1+":="+s2+";";}
|
selected_variable_assignment() { return ""; }
}
QCString variable_declaration() : {Token *tok=0;QCString s,s1,s2;}
{
[ tok=<SHARED_T> ] <VARIABLE_T> s=identifier_list() <COLON_T> s1=subtype_indication()
[ <VARASSIGN_T> s2=expression() ] <SEMI_T>
{
int spec;
QCString val=" variable "+s+":"+s1+":="+s2+";";
QCString it=s1+" "+s2;
if(tok != 0)
{
it.prepend(" shared ");
val.prepend(" shared");
spec=VhdlDocGen::SHAREDVARIABLE;
}
else
spec=VhdlDocGen::SHAREDVARIABLE;
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,spec,0,it.data(),Public);
return val;
}
}
QCString wait_statement() : {QCString s,s1,s2,s3;Token *t=0;}
{
[ s=identifier() <COLON_T> ] <WAIT_T> [ s1=sensitivity_clause() ] [ s2=condition_clause() ] [ s3=timeout_clause() ] <SEMI_T>
{
if(t) s.append(":");
return s+" wait "+s1+s2+s3+";";
}
}
QCString waveform() : {QCString s,s1;}
{
s=waveform_element() (<COMMA_T> s1=waveform_element(){s+=","; s+=s1;})* { return s;}
|
<UNAFFECTED_T> { return " unaffected ";}
}
QCString waveform_element() : {QCString s,s1;}
{
s=expression() [ <AFTER_T> s1=expression(){ s1.prepend(" after ");} ]
{ return s+s1;}
//<NULL_T> [ <AFTER_T> expression() ]
}
// -----------------------------------------------------------------
// VHDL 2002
// -----------------------------------------------------------------
QCString protected_type_body() :{ }
{
try{
<PROTECTED_T> <BODY_T>
protected_type_body_declarative_part()
}catch(...){error_skipto(END_T);}
<END_T><PROTECTED_T> <BODY_T> [identifier()] {return "";}
}
void protected_type_body_declarative_item() : { }
{
subprogram_declaration()
| subprogram_body()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
|
LOOKAHEAD( attribute_declaration())
attribute_declaration()
| attribute_specification()
| use_clause()
| LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
}
void protected_type_body_declarative_part() :{ }
{
( protected_type_body_declarative_item ())*
}
QCString protected_type_declaration() : { }
{
<PROTECTED_T>
try{
protected_type_declarative_part()
}catch(...){error_skipto(END_T);}
<END_T><PROTECTED_T> [ identifier() ] { return "";}
}
void protected_type_declarative_item(): { }
{
subprogram_specification()
| attribute_specification()
| use_clause()
}
void protected_type_declarative_part() : {}
{
(protected_type_declarative_item ()<SEMI_T>)*
}
// -----------------------------------------------------------------
// VHDL 2008
// -----------------------------------------------------------------
QCString context_ref() : {QCString s;}
{
<CONTEXT_T> s=identifier_list() <SEMI_T>
{
return "context "+s ;
}
}
void context_declaration(): {QCString s,s1;}
{
<CONTEXT_T> s=identifier() <IS_T> { parse_sec=CONTEXT_SEC; } (s1=libustcont_stats())* <END_T> [ <CONTEXT_T> ][identifier()] <SEMI_T>
{
parse_sec=0;
addVhdlType(s.data(),getLine(LIBRARY_T),Entry::VARIABLE_SEC,VhdlDocGen::LIBRARY,"context",s1.data(),Public);
}
}
QCString libustcont_stats(): {QCString s;}
{
s=use_clause() { return s;}
| s=library_clause() { return s;}
| s=context_ref() { return s;}
}
void package_instantiation_declaration() : {QCString s,s1,s2;}
{
<PACKAGE_T> s=identifier() <IS_T> <NEW_T> s1=name() s2=signature() [gen_assoc_list()] <SEMI_T>
{
QCString q=" is new "+s1+s2;
addVhdlType(s.data(),getLine(PACKAGE_T),Entry::VARIABLE_SEC,VhdlDocGen::INSTANTIATION,"package",q.data(),Public);
}
}
QCString interface_package_declaration(): {QCString s,s1;}
{
<PACKAGE_T> s=identifier() <IS_T> <NEW_T> s1=name() [gen_assoc_list()]
{
current->name=s;
return "package "+s+" is new "+s1;
}
}
QCString subprogram_instantiation_declaration():{QCString s,s1,s2;}
{
<FUNCTION_T> s=identifier() <IS_T> <NEW_T> s1=name() s2=signature() [gen_assoc_list()] <SEMI_T>
{
QCString q= " is new "+s1+s2;
addVhdlType(s.data(),getLine(FUNCTION_T),Entry::VARIABLE_SEC,VhdlDocGen::INSTANTIATION,"function ",q.data(),Public);
return q;
}
}
void gen_assoc_list():{}
{
<GENERIC_T> <MAP_T> <LPAREN_T> association_list()<RPAREN_T>
}
void gen_interface_list() : {}
{
<GENERIC_T><LPAREN_T>
{
//int u=s_str.iLine;
parse_sec=GEN_SEC;
}
interface_list()
{
// QCString vo=$3;
parse_sec=0;
}
<RPAREN_T>
}
void case_scheme (): {}
{
<CASE_T> expression() <GENERATE_T> when_stats() [LOOKAHEAD(3) ttend()] <END_T>
<GENERATE_T> generate_statement_body() <SEMI_T>
}
void when_stats() : {}
{
(
<WHEN_T> [LOOKAHEAD(2) label() <COLON_T>] choices() <ARROW_T> generate_statement_body()
)+
}
void ttend(): {}
{
<END_T> [identifier()] <SEMI_T>
}
void generate_statement_body() : {}
{
<BEGIN_T> [block_declarative_part() <BEGIN_T>] (concurrent_statement())*
}
QCString external_name(): {QCString s,s1,s2;}
{
<SLSL_T> s=sig_stat() s1=external_pathname() <COLON_T> s2=subtype_indication() <RSRS_T>
{
QCString t="<<"+s;
QCString t1=s1+":"+s2+">>";
return s+s1;
}
}
QCString sig_stat(): {Token *t;}
{
t=<CONSTANT_T> { return t->image.data(); }
| t=<SIGNAL_T> { return t->image.data(); }
| t=<VARIABLE_T> { return t->image.data(); }
}
QCString external_pathname(): {QCString s;}
{
s=absolute_pathname() { return s;}
| s=relative_pathname() { return s;}
| s=package_path_name() { return s;}
}
QCString absolute_pathname(): {QCString s,s1;}
{
LOOKAHEAD(<DOT_T> pathname_element_list())
<DOT_T> s=pathname_element_list() s1=identifier() { return "."+s+s1;}
| <DOT_T> s=identifier (){ return "."+s;}
}
QCString relative_pathname():{QCString s,s1,s2;}
{
s=neg_list() [LOOKAHEAD( pathname_element_list()) s1=pathname_element_list() ] s2=identifier() { return s+s1+s2;}
}
QCString neg_list(): {QCString s;}
{
(<NEG_T> <DOT_T>{s+="^.";})+ {return s; }
}
QCString pathname_element ():{QCString s,s1;}
{
s=identifier() [<LPAREN_T> s1=expression() <RPAREN_T>]
{
if(!s1.isEmpty())
return s+"("+s1+")";
return s;
}
}
QCString pathname_element_list():{QCString s,s1,s2;}
{
( s=pathname_element() <DOT_T> ) {s+=".";} (LOOKAHEAD(pathname_element() <DOT_T>) s1=pathname_element() <DOT_T> {s2+=s1;s2+="."; })*
{ return s+s2; }
}
QCString package_path_name():{QCString s;}
{
<AT_T> s=name() { return "@"+s; }
}
void conditional_signal_assignment_wave(): {}
{
LOOKAHEAD(conditional_force_assignment())
conditional_force_assignment()
|conditional_waveform_assignment()
}
void conditional_waveform_assignment():{}
{
target() <LESSTHAN_T> [LOOKAHEAD(1) delay_mechanism() ] waveform_element() <WHEN_T> expression() [else_wave_list()] <SEMI_T>
}
void else_wave_list(): {}
{
<ELSE_T> expression() [ <WHEN_T> expression()]
}
void conditional_force_assignment(): {}
{
target() <LESSTHAN_T> <FORCE_T> [inout_stat()] expression() <WHEN_T> [expression() else_stat()] <SEMI_T>
}
void selected_signal_assignment_wave() : {}
{
LOOKAHEAD(selected_force_assignment() )
selected_force_assignment()
| selected_waveform_assignment()
}
void selected_variable_assignment():{}
{
<WITH_T> expression() <SELECT_T> [<Q_T>] select_name() <VARASSIGN_T> sel_var_list() // { $$=""; }
}
void select_name(): {}
{
LOOKAHEAD(aggregate())
aggregate()
| name()
}
void selected_waveform_assignment():{}
{
<WITH_T> expression() <SELECT_T> [<Q_T>]
target() <LESSTHAN_T> [delay_mechanism()] sel_wave_list()
}
void selected_force_assignment():{}
{
<WITH_T> expression() <SELECT_T> [<Q_T>] target() <LESSTHAN_T> <FORCE_T>
[inout_stat()] sel_var_list()
}
void sel_var_list(): {}
{
(expression() <WHEN_T> choices() (<COMMA_T>|<SEMI_T>))(LOOKAHEAD(expression() <WHEN_T>) expression() <WHEN_T> choices() (<COMMA_T>|<SEMI_T>))*
}
void sel_wave_list() : {}
{
waveform_element() <WHEN_T> choices() (LOOKAHEAD(1) <COMMA_T> sel_wave_list())* <SEMI_T>
// | sel_wave_list_1()
}
void inout_stat(): {}
{
<IN_T>
| <OUT_T>
}
void else_stat(): {}
{
(<ELSE_T> expression() [LOOKAHEAD(1) <WHEN_T> expression()])+
}
QCString interface_subprogram_declaration(): {QCString s;}
{
s=iproc() { return s;}
| s=ifunc() { return s; }
}
QCString iproc(): {QCString s,s1;}
{
<PROCEDURE_T> s=identifier() s1=param()
{
current->name=s;
return "procedure "+s+s1;
}
}
QCString ifunc():{QCString s,s1,s2,s3;Token *t=0;Token *t1=0;Token *t2=0;}
{
[t=<PURE_T> | t=<IMPURE_T> ] <FUNCTION_T> s=name() s1=param() <RETURN_T> s2=name() [t1=<IS_T> (s3=identifier() | t2=<BOX_T>)]
{
QCString q;
if(t) q=t->image.data();
if(t2) s3="<>";
if (!s3.isEmpty())
{
s3.prepend(" is ");
}
current->name=s;
if (parse_sec==GEN_SEC)
{
QCString ss=q+" function "+s1+" return "+s2+s3;
int a=getLine(FUNCTION_T);
int b=getLine(PROCEDURE_T);
if (a>b) b=a;
addVhdlType(current->name.data(),b,Entry::VARIABLE_SEC,VhdlDocGen::GENERIC,ss.data(),0,Public);
}
currP=0;return "";
}
}
QCString param(): {QCString s,s1;Token *tok=0;}
{
[ tok=<PARAMETER_T> ] { param_sec=PARAM_SEC; }
[ <LPAREN_T> s1=interface_list() <RPAREN_T>]
{
if(tok)
{
s = tok->image.data();
param_sec=0;
}
return s+"("+s1+")";
}
}
// -----------------------------------------------------------------
// needed for inline (function/process/procedure) parsing
void parseInline() : {}
{
process_statement()
| subprogram_declaration()
}
--- VhdlParser.h 2014-07-27 14:26:18.000000000 +0200
+++ VhdlParser.h.new 2014-07-27 14:23:22.000000000 +0200
@@ -6,6 +6,7 @@
#include "TokenManager.h"
#include "VhdlParserTokenManager.h"
#include "VhdlParser.h"
+#include "vhdljjparser.h"
#include "VhdlParserConstants.h"
#include "ErrorHandler.h"
TEMPLATE = lib
CONFIG = warn_on staticlib $extraopts
HEADERS = CharStream.h \
ErrorHandler.h \
JavaCC.h \
ParseException.h \
TokenManager.h \
Token.h \
vhdlstring.h \
VhdlParser.h \
VhdlParserConstants.h \
VhdlParserTokenManager.h \
TokenMgrError.h \
VhdlParserIF.h \
VhdlParserErrorHandler.hpp
SOURCES = CharStream.cc \
ParseException.cc \
Token.cc \
TokenMgrError.cc \
VhdlParser.cc \
VhdlParserTokenManager.cc \
VhdlParserIF.cpp
INCLUDEPATH = . ../src ../qtools generated_src/doxygen
#TMAKE_CXXFLAGS += -DQT_NO_CODECS -DQ T_LITE_UNICODE
#must enable -fexceptions because we have try catch blocks in VhdlParser.cc
TMAKE_CXXFLAGS +=-w -fexceptions -DQT_LITE_UNICODE
win32:TMAKE_CXXFLAGS += -fexceptions -DQT_NODLL
win32-g++:TMAKE_CXXFLAGS += -fexceptions -D__CYGWIN__ -DALL_STATIC
OBJECTS_DIR = ../objects/vhdlparser
DESTDIR = ../lib
#ifndef VHDLSTRING_H
#define VHDLSTRING_H
#include <stdio.h>
#include <string.h>
/** @brief Minimal string class with std::string like behaviour that fulfills the JavaCC
* string requirements.
*/
class VhdlString
{
public:
VhdlString()
{
init();
}
VhdlString(const VhdlString &other)
{
m_str = (char*)malloc(other.m_len+1);
memcpy(m_str,other.m_str,other.m_len);
m_len = other.m_len;
m_str[m_len]=0;
}
VhdlString &operator=(const VhdlString &other)
{
if (this!=&other)
{
free(m_str);
m_str = (char*)malloc(other.m_len+1);
memcpy(m_str,other.m_str,other.m_len);
m_len = other.m_len;
m_str[m_len]=0;
}
return *this;
}
VhdlString(const char *s)
{
m_len = strlen(s);
m_str=(char*)malloc(m_len+1);
memcpy(m_str,s,m_len+1);
}
VhdlString(const char *s,int size)
{
m_str = (char*)malloc(size+1);
memcpy(m_str,s,size);
m_str[size]=0;
m_len=size;
}
~VhdlString()
{
delete[] m_str;
}
VhdlString& append(const char *s,int size)
{
int oldlen = m_len;
m_len+=size+1;
if (m_len)
{
m_str = (char*)realloc(m_str,m_len);
memcpy(m_str+oldlen,s,m_len-oldlen-1);
m_str[m_len-1]=0;
}
return *this;
}
VhdlString& append(const char *s)
{
return append(s,strlen(s));
}
VhdlString& append(const VhdlString &other)
{
return append(other.m_str,other.m_len);
}
VhdlString substr(int pos=0,int len=-1)
{
return VhdlString(m_str?m_str+pos:0,len==-1?m_len-pos:m_len);
}
int copy(char *s,int len,int pos=0) const
{
if (len==0) return 0;
if (pos>=m_len) { s[0]=0; return 0; }
int r=m_len<pos+len ? m_len-pos : len;
memcpy(s,m_str+pos,r);
return r;
}
const char *c_str() const { return m_str; }
const char *data() const { return m_str; }
int size() const { return m_len; }
int length() const { return m_len; }
char & operator[](int i) { return m_str[i]; }
const char &operator[](int i) const { return m_str[i]; }
void clear() { free(m_str); init(); }
VhdlString operator+=(char c) { char s[2]; s[0]=c; s[1]=0; return append(s); }
private:
void init() { m_str=(char*)calloc(1,1); m_len=0; }
char *m_str;
int m_len;
};
#endif
......@@ -95,7 +95,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 "
Optimization="0"
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,$(IntDir),."
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,..\vhdlparser,$(IntDir),."
PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG; _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;LIBICONV_STATIC;CHARSET_STATIC"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -217,7 +217,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 /bigobj"
Optimization="0"
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,$(IntDir),."
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,..\vhdlparser,$(IntDir),."
PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG; _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;LIBICONV_STATIC;CHARSET_STATIC"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -340,7 +340,7 @@
InlineFunctionExpansion="2"
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,$(IntDir),."
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,..\vhdlparser,$(IntDir),."
PreprocessorDefinitions="WIN32;_CINDEX_LIB_;_CINDEX_LIB_;NDEBUG;_CONSOLE; _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;LIBICONV_STATIC;CHARSET_STATIC"
StringPooling="true"
RuntimeLibrary="0"
......@@ -463,7 +463,7 @@
InlineFunctionExpansion="2"
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,$(IntDir),."
AdditionalIncludeDirectories="..\src,..\qtools,..\libpng,..\libmd5,..\vhdlparser,$(IntDir),."
PreprocessorDefinitions="WIN32;_CINDEX_LIB_;_CINDEX_LIB_;NDEBUG;_CONSOLE; _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;LIBICONV_STATIC;CHARSET_STATIC"
StringPooling="true"
RuntimeLibrary="0"
......@@ -542,6 +542,10 @@
RelativePath="$(IntDir)\ce_parse.cpp"
>
</File>
<File
RelativePath="..\vhdlparser\CharStream.cc"
>
</File>
<File
RelativePath="..\src\cite.cpp"
>
......@@ -826,6 +830,10 @@
RelativePath="..\src\pagedef.cpp"
>
</File>
<File
RelativePath="..\vhdlparser\ParseException.cc"
>
</File>
<File
RelativePath="..\src\perlmodgen.cpp"
>
......@@ -910,6 +918,14 @@
RelativePath="..\src\textdocvisitor.h"
>
</File>
<File
RelativePath="..\vhdlparser\Token.cc"
>
</File>
<File
RelativePath="..\vhdlparser\TokenMgrError.cc"
>
</File>
<File
RelativePath="..\src\tooltip.cpp"
>
......@@ -926,6 +942,22 @@
RelativePath="..\src\vhdldocgen.cpp"
>
</File>
<File
RelativePath="..\src\vhdljjparser.cpp"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParser.cc"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserIF.cpp"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserTokenManager.cc"
>
</File>
<File
RelativePath="..\src\xmldocvisitor.cpp"
>
......@@ -1180,42 +1212,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\vhdlscanner.l"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="Lex"
Case="true"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="Lex"
Case="true"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="Lex"
Case="true"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="Lex"
Case="true"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Python Files"
......@@ -2210,6 +2206,10 @@
RelativePath="..\src\ce_parse.h"
>
</File>
<File
RelativePath="..\vhdlparser\CharStream.h"
>
</File>
<File
RelativePath="..\src\cite.h"
>
......@@ -2362,6 +2362,10 @@
RelativePath="..\src\entry.h"
>
</File>
<File
RelativePath="..\vhdlparser\ErrorHandler.h"
>
</File>
<File
RelativePath="..\src\example.h"
>
......@@ -2454,6 +2458,10 @@
RelativePath="..\src\instdox.h"
>
</File>
<File
RelativePath="..\vhdlparser\JavaCC.h"
>
</File>
<File
RelativePath="$(IntDir)\jquery_fx_js.h"
>
......@@ -2586,6 +2594,10 @@
RelativePath="..\src\pagedef.h"
>
</File>
<File
RelativePath="..\vhdlparser\ParseException.h"
>
</File>
<File
RelativePath="..\src\parserintf.h"
>
......@@ -2702,6 +2714,18 @@
RelativePath="..\src\template.h"
>
</File>
<File
RelativePath="..\vhdlparser\Token.h"
>
</File>
<File
RelativePath="..\vhdlparser\TokenManager.h"
>
</File>
<File
RelativePath="..\vhdlparser\TokenMgrError.h"
>
</File>
<File
RelativePath="..\src\tooltip.h"
>
......@@ -2907,11 +2931,31 @@
>
</File>
<File
RelativePath="$(IntDir)\vhdlscanner.cpp"
RelativePath="..\src\vhdljjparser.h"
>
</File>
<File
RelativePath="..\vhdlparser\vhdlparser.h"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserConstants.h"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserErrorHandler.hpp"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserIF.h"
>
</File>
<File
RelativePath="..\vhdlparser\VhdlParserTokenManager.h"
>
</File>
<File
RelativePath="..\src\vhdlscanner.h"
RelativePath="..\vhdlparser\vhdlstring.h"
>
</File>
<File
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment