Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
475b0c51
Commit
475b0c51
authored
Nov 06, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various VHDL fixes
parent
e5076edf
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1248 additions
and
1217 deletions
+1248
-1217
classdef.cpp
src/classdef.cpp
+7
-1
libdoxygen.pro.in
src/libdoxygen.pro.in
+1
-1
vhdldocgen.cpp
src/vhdldocgen.cpp
+0
-15
vhdljjparser.cpp
src/vhdljjparser.cpp
+51
-40
CharStream.cc
vhdlparser/CharStream.cc
+2
-2
CharStream.h
vhdlparser/CharStream.h
+94
-100
ErrorHandler.h
vhdlparser/ErrorHandler.h
+12
-11
JavaCC.h
vhdlparser/JavaCC.h
+8
-17
JavaCC.h.in
vhdlparser/JavaCC.h.in
+8
-17
Makefile.in
vhdlparser/Makefile.in
+1
-2
ParseException.cc
vhdlparser/ParseException.cc
+2
-4
ParseException.h
vhdlparser/ParseException.h
+2
-2
Token.cc
vhdlparser/Token.cc
+2
-2
Token.h
vhdlparser/Token.h
+4
-3
TokenManager.h
vhdlparser/TokenManager.h
+6
-6
TokenMgrError.cc
vhdlparser/TokenMgrError.cc
+2
-5
TokenMgrError.h
vhdlparser/TokenMgrError.h
+12
-11
VhdlParser.cc
vhdlparser/VhdlParser.cc
+118
-112
VhdlParser.h
vhdlparser/VhdlParser.h
+286
-271
VhdlParserTokenManager.cc
vhdlparser/VhdlParserTokenManager.cc
+41
-15
VhdlParserTokenManager.h
vhdlparser/VhdlParserTokenManager.h
+16
-11
vhdlparser.jj
vhdlparser/vhdlparser.jj
+571
-558
vhdlparser.patch
vhdlparser/vhdlparser.patch
+0
-10
vhdlstring.h
vhdlparser/vhdlstring.h
+2
-1
No files found.
src/classdef.cpp
View file @
475b0c51
...
...
@@ -4234,7 +4234,13 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QC
MemberList
*
ml
=
getMemberList
(
lt
);
MemberList
*
ml2
=
getMemberList
((
MemberListType
)
lt2
);
if
(
getLanguage
()
==
SrcLangExt_VHDL
)
// use specific declarations function
{
{
static
ClassDef
*
cdef
;
if
(
cdef
!=
this
)
{
// only one inline link
VhdlDocGen
::
writeInlineClassLink
(
this
,
ol
);
cdef
=
this
;
}
if
(
ml
)
{
VhdlDocGen
::
writeVhdlDeclarations
(
ml
,
ol
,
0
,
this
,
0
,
0
);
...
...
src/libdoxygen.pro.in
View file @
475b0c51
...
...
@@ -231,7 +231,7 @@ linux-g++:TMAKE_CXXFLAGS += -fno-exceptions
INCLUDEPATH += ../generated_src/doxygen ../src ../qtools ../libmd5 ../vhdlparser
INCLUDEPATH += %%SQLITE3_INC%%
INCLUDEPATH += %%LIBCLANG_INC%%
DEPENDPATH += ../generated_src/doxygen
DEPENDPATH += ../generated_src/doxygen
../qtools ../libmd5 ../vhdlparser
win32:INCLUDEPATH += .
DESTDIR = ../lib
TARGET = doxygen
...
...
src/vhdldocgen.cpp
View file @
475b0c51
...
...
@@ -1785,21 +1785,6 @@ QCString VhdlDocGen::convertArgumentListToString(const ArgumentList* al,bool fun
void
VhdlDocGen
::
writeVhdlDeclarations
(
MemberList
*
ml
,
OutputList
&
ol
,
GroupDef
*
gd
,
ClassDef
*
cd
,
FileDef
*
fd
,
NamespaceDef
*
nd
)
{
static
ClassDef
*
cdef
;
//static GroupDef* gdef;
if
(
cd
&&
cdef
!=
cd
)
{
// only one inline link
VhdlDocGen
::
writeInlineClassLink
(
cd
,
ol
);
cdef
=
cd
;
}
/*
if (gd && gdef==gd) return;
if (gd && gdef!=gd)
{
gdef=gd;
}
*/
VhdlDocGen
::
writeVHDLDeclarations
(
ml
,
ol
,
cd
,
nd
,
fd
,
gd
,
theTranslator_vhdlType
(
VhdlDocGen
::
LIBRARY
,
FALSE
),
0
,
FALSE
,
VhdlDocGen
::
LIBRARY
);
VhdlDocGen
::
writeVHDLDeclarations
(
ml
,
ol
,
cd
,
nd
,
fd
,
gd
,
theTranslator_vhdlType
(
VhdlDocGen
::
USE
,
FALSE
),
0
,
FALSE
,
VhdlDocGen
::
USE
);
VhdlDocGen
::
writeVHDLDeclarations
(
ml
,
ol
,
cd
,
nd
,
fd
,
gd
,
theTranslator_vhdlType
(
VhdlDocGen
::
FUNCTION
,
FALSE
),
0
,
FALSE
,
VhdlDocGen
::
FUNCTION
);
...
...
src/vhdljjparser.cpp
View file @
475b0c51
...
...
@@ -42,26 +42,6 @@ static int iDocLine = -1;
static
QCString
inputString
;
static
Entry
gBlock
;
static
Entry
*
previous
=
0
;
#if 0
int iLine;
QStringList qrl;
ParserInterface *g_thisParser;
int inputPosition;
int inputLen;
int startComment = 0;
QFile inputFile;
QCString inbuf;
QCString yyFileName;
bool g_lexInit = FALSE;
int yyLineNr = 1;
int g_lastCommentContext = 0;
bool docBlockAutoBrief;
char docBlockTerm;
int iDocLine = -1;
int num_chars;
int* lineParse;
#endif
//-------------------------------------------------------
static
Entry
*
oldEntry
;
...
...
@@ -124,7 +104,6 @@ void startCodeBlock(int index)
int
ll
=
strComment
.
length
();
iCodeLen
=
inputString
.
findRev
(
strComment
.
data
())
+
ll
;
// fprintf(stderr,"\n startin code..%d %d %d\n",iCodeLen,num_chars,ll);
//assert(false);
gBlock
.
reset
();
int
len
=
strComment
.
length
();
QCString
name
=
strComment
.
right
(
len
-
index
);
//
...
...
@@ -134,8 +113,6 @@ void startCodeBlock(int index)
else
gBlock
.
name
=
name
;
//int li=strComment.contains('\n');
gBlock
.
startLine
=
yyLineNr
;
gBlock
.
bodyLine
=
yyLineNr
;
...
...
@@ -232,7 +209,10 @@ void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,En
VhdlDocGen
::
resetCodeVhdlParserState
();
}
void
VhdlParser
::
lineCount
(){
yyLineNr
++
;
}
void
VhdlParser
::
lineCount
()
{
yyLineNr
++
;
}
void
VhdlParser
::
lineCount
(
const
char
*
text
)
{
...
...
@@ -309,7 +289,6 @@ bool checkInlineCode(QCString & doc)
void
VhdlParser
::
handleFlowComment
(
const
char
*
doc
)
{
lineCount
(
doc
);
if
(
VhdlDocGen
::
getFlowMember
())
{
QCString
qcs
(
doc
);
...
...
@@ -319,6 +298,7 @@ void VhdlParser::handleFlowComment(const char* doc)
}
}
void
VhdlParser
::
handleCommentBlock
(
const
char
*
doc1
,
bool
brief
)
{
int
position
=
0
;
...
...
@@ -328,7 +308,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
if
(
checkMultiComment
(
doc
,
yyLineNr
))
{
lineCount
(
doc1
);
strComment
.
resize
(
0
);
return
;
}
...
...
@@ -345,7 +325,6 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
if
(
isIn
)
{
isIn
=
false
;
lineCount
(
doc1
);
return
;
}
...
...
@@ -353,7 +332,9 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
bool
needsEntry
=
FALSE
;
Protection
protection
=
Public
;
int
lineNr
=
iDocLine
;
int
lineNr
;
if
(
iDocLine
==-
1
)
lineNr
=
yyLineNr
;
if
(
oldEntry
==
current
)
{
...
...
@@ -375,13 +356,13 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
{
current
->
docLine
=
yyLineNr
;
}
// printf("parseCommentBlock file<%s>\n [%s]\n
",yyFileName.data(),doc.data()
);
// printf("parseCommentBlock file<%s>\n [%s]\n
at line [%d] \n ",yyFileName.data(),doc.data(),iDocLine
);
while
(
parseCommentBlock
(
g_thisParser
,
current
,
doc
,
// text
yyFileName
,
// file
lineNr
,
// line of block start
iDocLine
,
// line of block start
brief
,
0
,
FALSE
,
...
...
@@ -405,7 +386,8 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
}
newEntry
();
}
lineCount
(
doc1
);
iDocLine
=-
1
;
strComment
.
resize
(
0
);
}
void
VHDLLanguageScanner
::
parsePrototype
(
const
char
*
text
)
...
...
@@ -571,12 +553,10 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
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
;
...
...
@@ -619,8 +599,7 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
}
configL
.
append
(
co
);
}
// addConfigure
}
void
VhdlParser
::
addProto
(
const
char
*
s1
,
const
char
*
s2
,
const
char
*
s3
,
...
...
@@ -788,23 +767,55 @@ void VhdlParser::createFlow()
currP
=
0
;
}
void
VhdlParser
::
setMultCommentLine
()
{
iDocLine
=
yyLineNr
;
}
void
VhdlParser
::
oneLineComment
(
QCString
qcs
)
{
bool
isEndCode
=
qcs
.
contains
(
"
\\
endcode"
);
int
index
=
qcs
.
find
(
"
\\
code"
);
if
(
isEndCode
)
{
int
end
=
inputString
.
find
(
qcs
.
data
(),
iCodeLen
);
makeInlineDoc
(
end
);
}
else
if
(
index
>
0
)
{
// assert(false);
strComment
=
qcs
;
startCodeBlock
(
index
);
strComment
.
resize
(
0
);
}
if
(
!
isEndCode
&&
index
==-
1
)
{
int
j
=
qcs
.
find
(
"--!"
);
qcs
=
qcs
.
right
(
qcs
.
length
()
-
3
-
j
);
if
(
!
checkMultiComment
(
qcs
,
iDocLine
))
{
handleCommentBlock
(
qcs
,
TRUE
);
}
}
}
bool
checkMultiComment
(
QCString
&
qcs
,
int
line
)
{
QList
<
Entry
>
*
pTemp
=
getEntryAtLine
(
VhdlParser
::
current_root
,
line
);
if
(
pTemp
->
isEmpty
())
return
false
;
//int ii=pTemp->count();
// qcs.stripPrefix("--!");
VhdlDocGen
::
prepareComment
(
qcs
);
while
(
!
pTemp
->
isEmpty
())
{
Entry
*
e
=
(
Entry
*
)
pTemp
->
getFirst
();
e
->
briefLine
=
line
;
e
->
brief
+=
qcs
;
iDocLine
=-
1
;
pTemp
->
removeFirst
();
//ii=pTemp->count();
}
return
true
;
}
...
...
@@ -819,7 +830,7 @@ QList<Entry>* getEntryAtLine(const Entry* ce,int line)
if
(
rt
->
bodyLine
==
line
)
{
lineEntry
.
insert
(
0
,
rt
);
}
// if
}
getEntryAtLine
(
rt
,
line
);
}
...
...
vhdlparser/CharStream.cc
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "CharStream.h"
...
...
@@ -209,4 +209,4 @@ void CharStream::UpdateLineColumn(JAVACC_CHAR_TYPE c) {
}
}
/* JavaCC - OriginalChecksum=
e709b9ee1adf0fcb6b1c5e1641f10348
(do not edit this line) */
/* JavaCC - OriginalChecksum=
ade3c1b57a731a003629de593814ffa6
(do not edit this line) */
vhdlparser/CharStream.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef CHARSTREAM_H
#define CHARSTREAM_H
...
...
@@ -28,17 +28,17 @@ namespace parser {
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
;
}
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
;
}
/**
...
...
@@ -47,25 +47,25 @@ class CharStream {
* (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
;
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
;
}
virtual
inline
JAVACC_CHAR_TYPE
BeginToken
()
{
tokenBegin
=
-
1
;
JAVACC_CHAR_TYPE
c
=
readChar
();
tokenBegin
=
bufpos
;
return
c
;
}
/**
...
...
@@ -73,31 +73,30 @@ virtual inline JAVACC_CHAR_TYPE BeginToken() {
* 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
;
virtual
inline
JAVACC_CHAR_TYPE
readChar
()
{
if
(
inBuf
>
0
)
{
--
inBuf
;
++
bufpos
;
if
(
bufpos
==
bufsize
)
{
bufpos
=
0
;
}
return
buffer
[
bufpos
];
}
return
buffer
[
bufpos
];
}
++
bufpos
;
if
(
bufpos
>=
maxNextCharInd
)
{
FillBuff
();
}
++
bufpos
;
if
(
bufpos
>=
maxNextCharInd
)
{
FillBuff
();
}
JAVACC_CHAR_TYPE
c
=
buffer
[
bufpos
];
JAVACC_CHAR_TYPE
c
=
buffer
[
bufpos
];
if
(
trackLineColumn
)
{
UpdateLineColumn
(
c
);
}
if
(
trackLineColumn
)
{
UpdateLineColumn
(
c
);
return
c
;
}
return
c
;
}
virtual
void
ExpandBuff
(
bool
wrapAround
);
virtual
void
FillBuff
();
...
...
@@ -112,8 +111,7 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
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
);
return
JAVACC_STRING_TYPE
(
buffer
+
tokenBegin
,
bufsize
-
tokenBegin
).
append
(
buffer
,
bufpos
+
1
);
}
/**
...
...
@@ -126,8 +124,7 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
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
);
return
JAVACC_STRING_TYPE
(
buffer
+
bufsize
-
(
len
-
bufpos
-
1
),
len
-
bufpos
-
1
).
append
(
buffer
,
bufpos
+
1
);
}
/**
...
...
@@ -144,74 +141,71 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
}
bool
endOfInput
()
{
return
inBuf
==
0
&&
bufpos
+
1
>=
maxNextCharInd
&&
inputStream
->
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
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
),
in
Buf
(
0
)
,
tabSize
(
8
),
trackLineColumn
(
true
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
false
)
{
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
ReInit
(
input_stream
,
startline
,
startcolumn
,
INITIAL_BUFFER_SIZE
);
int
startcolumn
,
int
buffersize
)
:
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
ReInit
(
input_stream
,
startline
,
startcolumn
,
buffersize
);
}
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
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
),
in
Buf
(
0
),
tabSize
(
8
),
trackLineColumn
(
tru
e
)
{
bufline
(
NULL
),
bufcolumn
(
NULL
),
buffer
(
NULL
),
bufpos
(
0
),
bufsize
(
0
),
tokenBegin
(
0
),
column
(
0
),
line
(
0
),
prevCharIsCR
(
false
),
prevCharIsLF
(
false
),
available
(
0
),
maxNextCharInd
(
0
),
inBuf
(
0
),
tabSize
(
1
),
trackLineColumn
(
true
),
in
putStream
(
NULL
),
deleteStream
(
fals
e
)
{
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
,
int
buffersize
);
virtual
void
ReInit
(
ReaderStream
*
input_stream
,
int
startline
,
int
startcolumn
)
{
virtual
void
ReInit
(
ReaderStream
*
input_stream
,
int
startline
,
int
startcolumn
)
{
ReInit
(
input_stream
,
startline
,
startcolumn
,
INITIAL_BUFFER_SIZE
);
}
...
...
@@ -232,26 +226,26 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
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
;
int
*
bufline
;
int
*
bufcolumn
;
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
;
ReaderStream
*
inputStream
;
bool
deleteStream
;
};
}
}
#endif
/* JavaCC - OriginalChecksum=
5eaf75ef6a2c7859369c80cf6fd037e0
(do not edit this line) */
/* JavaCC - OriginalChecksum=
89f4cb30f0d3487ee809cca18a2924f2
(do not edit this line) */
vhdlparser/ErrorHandler.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,BUILD_PARSER=true,BUILD_TOKEN_MANAGER=true */
#ifndef ERRORHANDLER_H
#define ERRORHANDLER_H
//#include <string>
#include <stdio.h>
#include <string>
#include "JavaCC.h"
#include "Token.h"
namespace
vhdl
{
namespace
parser
{
//
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str);
JAVACC_SIMPLE_STRING
addUnicodeEscapes
(
JAVACC_STRING_TYPE
str
);
class
VhdlParser
;
class
ErrorHandler
{
...
...
@@ -23,22 +24,22 @@ namespace parser {
// 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
,
Token
*
,
VhdlParser
*
)
{
virtual
void
handleUnexpectedToken
(
int
/*expectedKind*/
,
JAVACC_STRING_TYPE
expectedToken
,
Token
*
actual
,
VhdlParser
*
/*parser*/
)
{
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());
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
*
,
JAVACC_SIMPLE_STRING
,
VhdlParser
*
)
{
virtual
void
handleParseError
(
Token
*
/*last*/
,
Token
*
unexpected
,
JAVACC_SIMPLE_STRING
production
,
VhdlParser
*
/*parser*/
)
{
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());
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
void
handleOtherError
(
JAVACC_STRING_TYPE
message
,
VhdlParser
*
)
{
virtual
void
handleOtherError
(
JAVACC_STRING_TYPE
message
,
VhdlParser
*
/*parser*/
)
{
fprintf
(
stderr
,
"Error: %s
\n
"
,
(
char
*
)
message
.
c_str
());
}
virtual
~
ErrorHandler
()
{}
...
...
@@ -61,11 +62,11 @@ namespace parser {
// errorAfter : prefix that was seen before this error occurred
// curchar : the offending character
//
virtual
void
lexicalError
(
bool
EOFSeen
,
int
/*lexState*/
,
int
errorLine
,
int
errorColumn
,
JAVACC_STRING_TYPE
errorAfter
,
JAVACC_CHAR_TYPE
curChar
,
VhdlParserTokenManager
*
)
{
virtual
void
lexicalError
(
bool
EOFSeen
,
int
/*lexState*/
,
int
errorLine
,
int
errorColumn
,
JAVACC_STRING_TYPE
errorAfter
,
JAVACC_CHAR_TYPE
curChar
,
VhdlParserTokenManager
*
/*token_manager*/
)
{
// by default, we just print an error message and return.
fprintf
(
stderr
,
"Lexical error at: %d:%d. Encountered: %c after: %s.
\n
"
,
errorLine
,
errorColumn
,
curChar
,
(
EOFSeen
?
"EOF"
:
(
const
char
*
)
errorAfter
.
c_str
()));
}
virtual
void
lexicalError
(
JAVACC_STRING_TYPE
errorMessage
,
VhdlParserTokenManager
*
)
{
virtual
void
lexicalError
(
JAVACC_STRING_TYPE
errorMessage
,
VhdlParserTokenManager
*
/*token_manager*/
)
{
fprintf
(
stderr
,
"%s
\n
"
,
(
char
*
)
errorMessage
.
c_str
());
}
virtual
~
TokenManagerErrorHandler
()
{}
...
...
@@ -75,4 +76,4 @@ namespace parser {
}
#endif
/* JavaCC - OriginalChecksum=
685d19cb4cd943b60089f599e45f23ad
(do not edit this line) */
/* JavaCC - OriginalChecksum=
c18f1105ba178be8e21cc9f279f94496
(do not edit this line) */
vhdlparser/JavaCC.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef
__JAVACC_H
#define
__JAVACC_H
#ifndef
JAVACC_H_
#define
JAVACC_H_
#include <stdio.h>
#include <string
.h
>
#include <string>
#include <memory.h>
#include <assert.h>
#include <cstring>
#include "vhdlstring.h"
#ifndef JAVACC_CHAR_TYPE
...
...
@@ -18,24 +16,17 @@
#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
:
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
size_t
read
(
JAVACC_CHAR_TYPE
*
/*bufptr*/
,
int
/*offset*/
,
size_t
/*len*/
)
{
return
0
;
}
virtual
bool
endOfInput
()
{
return
true
;
}
virtual
~
ReaderStream
()
{}
};
...
...
@@ -49,4 +40,4 @@ const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
#endif
#endif
/* JavaCC - OriginalChecksum=
775c677272b259e2a33aac80851ba9f1
(do not edit this line) */
/* JavaCC - OriginalChecksum=
eb066370c81bb58bb68713327da9719f
(do not edit this line) */
vhdlparser/JavaCC.h.in
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef
__JAVACC_H
#define
__JAVACC_H
#ifndef
JAVACC_H_
#define
JAVACC_H_
#include <stdio.h>
#include <string
.h
>
#include <string>
#include <memory.h>
#include <assert.h>
#include <cstring>
#include "vhdlstring.h"
#ifndef JAVACC_CHAR_TYPE
...
...
@@ -18,24 +16,17 @@
#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:
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 size_t read(JAVACC_CHAR_TYPE * /*bufptr*/, int /*offset*/, size_t /*len*/) { return 0; }
virtual bool endOfInput() { return true; }
virtual ~ReaderStream() {}
};
...
...
@@ -49,4 +40,4 @@ const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
#endif
#endif
/* JavaCC - OriginalChecksum=
775c677272b259e2a33aac80851ba9f1
(do not edit this line) */
/* JavaCC - OriginalChecksum=
eb066370c81bb58bb68713327da9719f
(do not edit this line) */
vhdlparser/Makefile.in
View file @
475b0c51
...
...
@@ -31,8 +31,7 @@ regenerate:
VhdlParserConstants.h VhdlParserTokenManager.cc VhdlParserTokenManager.h
\
JavaCC.h
javacc vhdlparser.jj
patch <vhdlparser.patch
$(CP)
JavaCC.h.in JavaCC.h
$(CP)
JavaCC.h.in JavaCC.h
distclean
:
clean
$(RM)
Makefile vhdlparser.pro
...
...
vhdlparser/ParseException.cc
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "ParseException.h"
...
...
@@ -141,8 +141,6 @@ namespace parser {
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
case 0 :
continue;
case '\b':
retval.append("\\b");
continue;
...
...
@@ -183,4 +181,4 @@ namespace parser {
}
}
/* JavaCC - OriginalChecksum=9
9d488e13335cf377284c90700f070ed
(do not edit this line) */
/* JavaCC - OriginalChecksum=9
f6af8fd72f5fe3e4210cf02acbd8387
(do not edit this line) */
vhdlparser/ParseException.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef _PARSE_EXCEPTION_H
#define _PARSE_EXCEPTION_H
...
...
@@ -96,4 +96,4 @@ class ParseException {
}
}
#endif
/* JavaCC - OriginalChecksum=
8c47c56fc2030f05b43e20cae6ca5d66
(do not edit this line) */
/* JavaCC - OriginalChecksum=
bd87c2fc11a4306bd2c2482fd1025b7c
(do not edit this line) */
vhdlparser/Token.cc
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
#include "Token.h"
...
...
@@ -89,4 +89,4 @@ namespace parser {
}
}
/* JavaCC - OriginalChecksum=
9db9ca693072c4c37bb7cc933c0c5e35
(do not edit this line) */
/* JavaCC - OriginalChecksum=
dcb0f64486aa6455ae5af05d6bb539ec
(do not edit this line) */
vhdlparser/Token.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
#ifndef TOKEN_H
#define TOKEN_H
...
...
@@ -86,12 +86,13 @@ class Token
*/
Token
(
int
kind
,
JAVACC_STRING_TYPE
image
);
virtual
~
Token
();
/**
* Returns the image.
*/
JAVACC_STRING_TYPE
toString
();
public
:
virtual
~
Token
();
/**
* Returns a new Token void *, by default. However, if you want, you
...
...
@@ -113,4 +114,4 @@ class Token
}
}
#endif
/* JavaCC - OriginalChecksum=
2f5eb1c937adc983dfa2008c4fe383a7
(do not edit this line) */
/* JavaCC - OriginalChecksum=
4748c3d6443aa3445d3c95ab54f14c2a
(do not edit this line) */
vhdlparser/TokenManager.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef TOKENMANAGER_H
#define TOKENMANAGER_H
#include "JavaCC.h"
#include "Token.h"
using
namespace
std
;
namespace
vhdl
{
namespace
parser
{
...
...
@@ -19,10 +20,9 @@ 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
"
);
virtual
~
TokenManager
()
{
}
virtual
Token
*
getNextToken
()
=
0
;
virtual
void
lexicalError
()
{
}
};
...
...
@@ -30,4 +30,4 @@ public:
}
}
#endif
/* JavaCC - OriginalChecksum=
d4725ee75465725057819b3b07fadaa7
(do not edit this line) */
/* JavaCC - OriginalChecksum=
918e2eba53e028d6c4142283ce3f498f
(do not edit this line) */
vhdlparser/TokenMgrError.cc
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#include "TokenMgrError.h"
...
...
@@ -79,9 +79,6 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) {
JAVACC_CHAR_TYPE
ch
=
str
[
i
];
switch
(
ch
)
{
case
0
:
retval
+=
EMPTY
[
0
];
continue
;
case
'\b'
:
retval
.
append
(
"
\\
b"
);
continue
;
...
...
@@ -118,4 +115,4 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) {
}
}
/* JavaCC - OriginalChecksum=2
bf63f131c8e60fd30c70d0b4f66001
6 (do not edit this line) */
/* JavaCC - OriginalChecksum=2
fe11435e6701b2fca885354b08bfdf
6 (do not edit this line) */
vhdlparser/TokenMgrError.h
View file @
475b0c51
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.
0
*/
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.
2
*/
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
#ifndef _TOKENMGRERROR_H
#define _TOKENMGRERROR_H
...
...
@@ -8,7 +8,7 @@
namespace
vhdl
{
namespace
parser
{
enum
LexerErrors
{
enum
LexerErrors
{
/**
* Lexical error occurred.
*/
...
...
@@ -28,11 +28,10 @@ namespace parser {
* Detected (and bailed out of) an infinite loop in the token manager.
*/
LOOP_DETECTED
=
3
,
};
};
class
TokenMgrError
{
public
:
class
TokenMgrError
{
public
:
/*
* Ordinals for various reasons why an Error of this type can be thrown.
*/
...
...
@@ -57,7 +56,8 @@ class TokenMgrError
*/
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
;
private
:
JAVACC_STRING_TYPE
message
;
/**
* You can also modify the body of this method to customize your error messages.
...
...
@@ -68,6 +68,7 @@ class TokenMgrError
*
* from this method for such cases in the release version of your parser.
*/
public
:
JAVACC_STRING_TYPE
getMessage
()
;
/*
...
...
@@ -75,16 +76,16 @@ class TokenMgrError
*/
/** No arg constructor. */
public
:
TokenMgrError
()
;
TokenMgrError
()
;
/** Constructor with message and reason. */
public
:
TokenMgrError
(
JAVACC_STRING_TYPE
message
,
int
reason
)
;
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
)
;
TokenMgrError
(
bool
EOFSeen
,
int
lexState
,
int
errorLine
,
int
errorColumn
,
JAVACC_STRING_TYPE
errorAfter
,
JAVACC_CHAR_TYPE
curChar
,
int
reason
)
;
};
}
}
#endif
/* JavaCC - OriginalChecksum=c
7d825cb4d037b031ae43569d383f738
(do not edit this line) */
/* JavaCC - OriginalChecksum=c
22a1b25630ec91deb47dcba22b6b39d
(do not edit this line) */
vhdlparser/VhdlParser.cc
View file @
475b0c51
/* VhdlParser.cc */
#include "./VhdlParser.h"
#include "VhdlParser.h"
#include "TokenMgrError.h"
namespace
vhdl
{
namespace
parser
{
unsigned
int
jj_la1_0
[]
=
{
...
...
@@ -64,7 +65,7 @@ assert(false);
}
QCString
VhdlParser
::
access_type_definition
()
{
Token
*
tok
;
QCString
str
,
str1
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
access_type_definition
()
{
Token
*
tok
=
0
;
QCString
str
,
str1
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
ACCESS_T
);
}
...
...
@@ -78,7 +79,7 @@ assert(false);
}
QCString
VhdlParser
::
actual_designator
()
{
QCString
str
;
Token
*
t
;
QCString
VhdlParser
::
actual_designator
()
{
QCString
str
;
Token
*
t
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
OPEN_T
:{
if
(
!
hasError
)
{
...
...
@@ -722,7 +723,7 @@ QCString VhdlParser::assertion_statement() {QCString s,s1,s2;Token *t=0;if (!has
}
if
(
t
)
s
+=
":"
;
return
s
+
s1
+
";"
;
return
s
+
s1
+
";"
;
assert
(
false
);
}
...
...
@@ -816,7 +817,7 @@ assert(false);
}
QCString
VhdlParser
::
attribute_designator
()
{
QCString
s
;
Token
*
tok
;
QCString
VhdlParser
::
attribute_designator
()
{
QCString
s
;
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
BASIC_IDENTIFIER
:
case
EXTENDED_CHARACTER
:{
if
(
!
hasError
)
{
...
...
@@ -935,7 +936,7 @@ assert(false);
}
QCString
VhdlParser
::
base
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
base
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
INTEGER
);
}
...
...
@@ -945,7 +946,7 @@ assert(false);
}
QCString
VhdlParser
::
base_specifier
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
base_specifier
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BASIC_IDENTIFIER
);
}
...
...
@@ -965,7 +966,7 @@ assert(false);
}
QCString
VhdlParser
::
based_integer
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
based_integer
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BASIC_IDENTIFIER
);
}
...
...
@@ -975,7 +976,7 @@ assert(false);
}
QCString
VhdlParser
::
based_literal
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
based_literal
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BASED_LITERAL
);
}
...
...
@@ -985,7 +986,7 @@ assert(false);
}
QCString
VhdlParser
::
basic_identifier
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
basic_identifier
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BASIC_IDENTIFIER
);
}
...
...
@@ -1048,7 +1049,7 @@ void VhdlParser::binding_indication() {if (!hasError) {
}
QCString
VhdlParser
::
bit_string_literal
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
bit_string_literal
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BIT_STRING_LITERAL
);
}
...
...
@@ -1058,7 +1059,7 @@ assert(false);
}
QCString
VhdlParser
::
bit_value
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
bit_value
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
BASIC_IDENTIFIER
);
}
...
...
@@ -1668,7 +1669,7 @@ FlowChart::moveToPrevLevel();
}
QCString
VhdlParser
::
character_literal
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
character_literal
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
CHARACTER_LITERAL
);
}
...
...
@@ -2550,11 +2551,11 @@ QCString VhdlParser::constant_declaration() {QCString s,s1,s2;Token *t=0;if (!ha
}
if
(
t
)
s2
.
prepend
(
":="
);
QCString
it
=
s1
+
s2
;
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
;
return
it
;
assert
(
false
);
}
...
...
@@ -2656,7 +2657,7 @@ void VhdlParser::context_item() {
}
QCString
VhdlParser
::
decimal_literal
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
decimal_literal
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
DECIMAL_LITERAL
);
}
...
...
@@ -2824,7 +2825,7 @@ assert(false);
}
QCString
VhdlParser
::
direction
()
{
Token
*
tok
;
QCString
VhdlParser
::
direction
()
{
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
TO_T
:{
if
(
!
hasError
)
{
...
...
@@ -2973,7 +2974,7 @@ assert(false);
}
QCString
VhdlParser
::
entity_aspect
()
{
Token
*
tok
;
QCString
s
,
s1
;
QCString
VhdlParser
::
entity_aspect
()
{
Token
*
tok
=
0
;
QCString
s
,
s1
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
ENTITY_T
:{
if
(
!
hasError
)
{
...
...
@@ -4336,7 +4337,7 @@ assert(false);
}
QCString
VhdlParser
::
formal_designator
()
{
QCString
s
;
Token
*
tok
;
QCString
VhdlParser
::
formal_designator
()
{
QCString
s
;
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
SLSL_T
:
case
STRINGLITERAL
:
...
...
@@ -4448,7 +4449,7 @@ error_skipto(SEMI_T);
}
addVhdlType
(
s
.
data
(),
getLine
(
TYPE_T
),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
TYPE
,
0
,
s2
.
data
(),
Public
);
return
"type "
+
s
+
" is "
+
s2
+
";"
;
return
"type "
+
s
+
" is "
+
s2
+
";"
;
assert
(
false
);
}
...
...
@@ -4798,7 +4799,7 @@ void VhdlParser::guarded_signal_specification() {if (!hasError) {
}
QCString
VhdlParser
::
identifier
()
{
Token
*
tok
;
QCString
VhdlParser
::
identifier
()
{
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
EXTENDED_CHARACTER
:{
if
(
!
hasError
)
{
...
...
@@ -5135,7 +5136,7 @@ assert(false);
}
QCString
VhdlParser
::
instantiation_unit
()
{
QCString
s
,
s1
,
s2
;
Token
*
tok
;
QCString
VhdlParser
::
instantiation_unit
()
{
QCString
s
,
s1
,
s2
;
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
COMPONENT_T
:
case
BASIC_IDENTIFIER
:
...
...
@@ -5235,7 +5236,7 @@ assert(false);
}
QCString
VhdlParser
::
instantiation_list
()
{
QCString
s
;
Token
*
tok
;
QCString
VhdlParser
::
instantiation_list
()
{
QCString
s
;
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
BASIC_IDENTIFIER
:
case
EXTENDED_CHARACTER
:{
if
(
!
hasError
)
{
...
...
@@ -5576,15 +5577,15 @@ QCString VhdlParser::interface_variable_declaration() {Token *tok=0;Token *tok1=
}
if
(
tok
)
s5
=
tok
->
image
.
c_str
();
s5
=
tok
->
image
.
c_str
();
if
(
tok1
)
s3
=
tok1
->
image
.
data
();
if
(
tok1
)
s3
=
tok1
->
image
.
data
();
if
(
tok2
)
s3
+=
":="
;
if
(
tok2
)
s3
+=
":="
;
QCString
it
=
s
+
":"
+
s1
+
" "
+
s2
+
" "
+
s3
+
" "
+
s4
;
QCString
it
=
s
+
":"
+
s1
+
" "
+
s2
+
" "
+
s3
+
" "
+
s4
;
if
(
currP
!=
VhdlDocGen
::
COMPONENT
)
{
if
(
currP
==
VhdlDocGen
::
FUNCTION
||
currP
==
VhdlDocGen
::
PROCEDURE
)
...
...
@@ -5601,7 +5602,7 @@ if(tok)
}
// fprintf(stderr,"\n\n <<port %s >>\n",$$.data());
}
// if component
return
it
;
return
it
;
assert
(
false
);
}
...
...
@@ -5639,7 +5640,7 @@ s.prepend("while ");
QCString
q
=
lab
+
" for "
+
s
;
FlowChart
::
addFlowChart
(
FlowChart
::
FOR_NO
,
0
,
q
.
data
(),
lab
.
data
());
lab
=
""
;
return
q
;
return
q
;
}
break
;
...
...
@@ -5681,10 +5682,10 @@ QCString VhdlParser::library_clause() {QCString s;if (!hasError) {
if
(
parse_sec
==
0
&&
Config_getBool
(
"SHOW_INCLUDE_FILES"
)
)
{
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
LIBRARY
,
s
.
data
(),
"_library_"
,
Public
);
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
LIBRARY
,
s
.
data
(),
"_library_"
,
Public
);
}
QCString
s1
=
"library "
+
s
;
return
s1
;
return
s1
;
assert
(
false
);
}
...
...
@@ -5845,7 +5846,7 @@ s+=":";
if
(
!
hasError
)
{
if
(
s1
.
isEmpty
())
FlowChart
::
addFlowChart
(
FlowChart
::
LOOP_NO
,
0
,
"infinite"
);
FlowChart
::
addFlowChart
(
FlowChart
::
LOOP_NO
,
0
,
"infinite"
);
}
if
(
!
hasError
)
{
...
...
@@ -5888,7 +5889,7 @@ QCString q = s+" loop "+s2+" end loop" +s3;
QCString
endLoop
=
"end loop"
+
s3
;
FlowChart
::
moveToPrevLevel
();
FlowChart
::
addFlowChart
(
FlowChart
::
END_LOOP
,
endLoop
.
data
(),
0
);
return
q
;
return
q
;
assert
(
false
);
}
...
...
@@ -5937,7 +5938,7 @@ assert(false);
}
QCString
VhdlParser
::
mode
()
{
Token
*
tok
;
QCString
VhdlParser
::
mode
()
{
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
IN_T
:{
if
(
!
hasError
)
{
...
...
@@ -6003,7 +6004,7 @@ assert(false);
}
QCString
VhdlParser
::
multiplying_operation
()
{
Token
*
tok
;
QCString
VhdlParser
::
multiplying_operation
()
{
Token
*
tok
=
0
;
switch
((
jj_ntk
==-
1
)
?
jj_ntk_f
()
:
jj_ntk
)
{
case
MULT_T
:{
if
(
!
hasError
)
{
...
...
@@ -6579,7 +6580,7 @@ assert(false);
}
QCString
VhdlParser
::
operator_symbol
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
operator_symbol
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
STRINGLITERAL
);
}
...
...
@@ -6843,11 +6844,11 @@ lastCompound=current;
clone
->
section
=
Entry
::
NAMESPACE_SEC
;
clone
->
spec
=
VhdlDocGen
::
PACKAGE
;
clone
->
name
=
s
;
clone
->
startLine
=
getLine
();
clone
->
bodyLine
=
getLine
();
clone
->
startLine
=
getLine
(
PACKAGE_T
);
clone
->
bodyLine
=
getLine
(
PACKAGE_T
);
clone
->
protection
=
Package
;
current_root
->
addSubEntry
(
clone
);
addVhdlType
(
s
,
getLine
(),
Entry
::
CLASS_SEC
,
VhdlDocGen
::
PACKAGE
,
0
,
0
,
Package
);
addVhdlType
(
s
,
getLine
(
PACKAGE_T
),
Entry
::
CLASS_SEC
,
VhdlDocGen
::
PACKAGE
,
0
,
0
,
Package
);
}
if
(
!
hasError
)
{
...
...
@@ -7229,9 +7230,9 @@ s2+=s1;s2+="#";
}
current
->
args
=
s2
;
current
->
args
.
prepend
(
"units"
);
current
->
args
.
prepend
(
"units"
);
current
->
spec
=
VhdlDocGen
::
UNITS
;
return
s2
;
return
s2
;
assert
(
false
);
}
...
...
@@ -8255,9 +8256,9 @@ QCString VhdlParser::report_statement() {Token *t=0;Token *t1=0;QCString s,s1,s2
}
if
(
t
)
s
.
append
(
":"
);
s1
.
prepend
(
" report "
);
if
(
t1
)
s2
.
prepend
(
" severity "
);
return
s
+
s1
+
s2
+
";"
;
s1
.
prepend
(
" report "
);
if
(
t1
)
s2
.
prepend
(
" severity "
);
return
s
+
s1
+
s2
+
";"
;
assert
(
false
);
}
...
...
@@ -9035,9 +9036,9 @@ void VhdlParser::signal_declaration() {Token* tok=0;QCString s,s1,s2,s3,s4;if (!
}
if
(
tok
)
s3
.
prepend
(
":="
);
s4
=
s1
+
s2
+
s3
;
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
SIGNAL
,
0
,
s4
.
data
(),
Public
);
s3
.
prepend
(
":="
);
s4
=
s1
+
s2
+
s3
;
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
SIGNAL
,
0
,
s4
.
data
(),
Public
);
}
...
...
@@ -9309,7 +9310,7 @@ assert(false);
}
QCString
VhdlParser
::
string_literal
()
{
Token
*
tok
;
if
(
!
hasError
)
{
QCString
VhdlParser
::
string_literal
()
{
Token
*
tok
=
0
;
if
(
!
hasError
)
{
tok
=
jj_consume_token
(
STRINGLITERAL
);
}
...
...
@@ -9699,8 +9700,8 @@ void VhdlParser::subprogram_specification() {QCString s;Token *tok=0;Token *t;
currP
=
VhdlDocGen
::
PROCEDURE
;
createFunction
(
s
.
data
(),
currP
,
0
);
tempEntry
=
current
;
current
->
startLine
=
getLine
(
PROCEDURE_T
);
current
->
bodyLine
=
getLine
(
PROCEDURE_T
);
current
->
startLine
=
getLine
(
PROCEDURE_T
);
current
->
bodyLine
=
getLine
(
PROCEDURE_T
);
}
if
(
!
hasError
)
{
...
...
@@ -9814,13 +9815,13 @@ newEntry();
if
(
!
hasError
)
{
currP
=
VhdlDocGen
::
FUNCTION
;
if
(
tok
)
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
);
else
createFunction
(
0
,
currP
,
s
.
data
());
tempEntry
=
current
;
current
->
startLine
=
getLine
(
FUNCTION_T
);
current
->
bodyLine
=
getLine
(
FUNCTION_T
);
}
if
(
!
hasError
)
{
...
...
@@ -10365,14 +10366,14 @@ QStringList ql1=QStringList::split(",",s,FALSE);
for
(
uint
j
=
0
;
j
<
ql1
.
count
();
j
++
)
{
QStringList
ql
=
QStringList
::
split
(
"."
,
ql1
[
j
],
FALSE
);
QCString
it
=
ql
[
1
].
utf8
();
QCString
it
=
ql
[
1
].
utf8
();
if
(
parse_sec
==
0
&&
Config_getBool
(
"SHOW_INCLUDE_FILES"
)
)
{
VhdlParser
::
addVhdlType
(
it
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
VhdlDocGen
::
USE
,
it
.
data
(),
"_use_"
,
Public
);
}
}
s1
=
"use "
+
s
;
return
s1
;
return
s1
;
assert
(
false
);
}
...
...
@@ -10501,24 +10502,24 @@ QCString VhdlParser::variable_declaration() {Token *tok=0;Token *t1=0;QCString s
}
int
spec
;
if
(
t1
)
s2
.
prepend
(
":="
);
QCString
val
=
" variable "
+
s
+
":"
+
s1
+
s2
+
";"
;
QCString
it
=
s1
;
if
(
tok
!=
0
)
{
it
.
prepend
(
" shared "
);
val
.
prepend
(
" shared"
);
spec
=
VhdlDocGen
::
SHAREDVARIABLE
;
}
else
spec
=
VhdlDocGen
::
SHAREDVARIABLE
;
if
(
t1
){
it
+=
":="
;
if
(
t1
)
s2
.
prepend
(
":="
);
QCString
val
=
" variable "
+
s
+
":"
+
s1
+
s2
+
";"
;
QCString
it
=
s1
;
if
(
tok
!=
0
)
{
it
.
prepend
(
" shared "
);
val
.
prepend
(
" shared"
);
spec
=
VhdlDocGen
::
SHAREDVARIABLE
;
}
else
spec
=
VhdlDocGen
::
SHAREDVARIABLE
;
if
(
t1
){
it
+=
":="
;
it
+=
s2
;
}
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
spec
,
0
,
it
.
data
(),
Public
);
}
addVhdlType
(
s
.
data
(),
getLine
(),
Entry
::
VARIABLE_SEC
,
spec
,
0
,
it
.
data
(),
Public
);
return
val
;
assert
(
false
);
}
...
...
@@ -11249,7 +11250,7 @@ QCString VhdlParser::interface_package_declaration() {QCString s,s1;if (!hasErro
}
current
->
name
=
s
;
return
"package "
+
s
+
" is new "
+
s1
;
return
"package "
+
s
+
" is new "
+
s1
;
assert
(
false
);
}
...
...
@@ -11854,7 +11855,7 @@ QCString VhdlParser::pathname_element() {QCString s,s1;if (!hasError) {
}
if
(
!
s1
.
isEmpty
())
return
s
+
"("
+
s1
+
")"
;
return
s
+
"("
+
s1
+
")"
;
return
s
;
assert
(
false
);
...
...
@@ -12681,17 +12682,17 @@ QCString VhdlParser::ifunc() {QCString s,s1,s2,s3;Token *t=0;Token *t1=0;Token *
}
QCString
q
;
if
(
t
)
q
=
t
->
image
.
data
();
if
(
t
)
q
=
t
->
image
.
data
();
if
(
t2
)
s3
=
"<>"
;
if
(
!
s3
.
isEmpty
())
if
(
!
s3
.
isEmpty
())
{
s3
.
prepend
(
" is "
);
}
current
->
name
=
s
;
if
(
parse_sec
==
GEN_SEC
)
if
(
parse_sec
==
GEN_SEC
)
{
QCString
ss
=
q
+
" function "
+
s1
+
" return "
+
s2
+
s3
;
int
a
=
getLine
(
FUNCTION_T
);
int
a
=
getLine
(
FUNCTION_T
);
int
b
=
getLine
(
PROCEDURE_T
);
if
(
a
>
b
)
b
=
a
;
...
...
@@ -12746,11 +12747,11 @@ param_sec=PARAM_SEC;
}
if
(
tok
)
{
s
=
tok
->
image
.
data
();
param_sec
=
0
;
}
return
s
+
"("
+
s1
+
")"
;
{
s
=
tok
->
image
.
data
();
param_sec
=
0
;
}
return
s
+
"("
+
s1
+
")"
;
assert
(
false
);
}
...
...
@@ -12787,26 +12788,16 @@ void VhdlParser::parseInline() {
VhdlParser
::
VhdlParser
(
TokenManager
*
tm
){
head
=
NULL
;
errorHandlerCreated
=
false
;
ReInit
(
tm
);
}
VhdlParser
::~
VhdlParser
()
VhdlParser
::~
VhdlParser
()
{
if
(
token_source
)
delete
token_source
;
if
(
head
)
{
Token
*
next
,
*
t
=
head
;
while
(
t
)
{
next
=
t
->
next
;
delete
t
;
t
=
next
;
}
}
if
(
errorHandlerCreated
)
{
delete
errorHandler
;
}
clear
();
}
void
VhdlParser
::
ReInit
(
TokenManager
*
tm
){
if
(
head
)
delete
head
;
clear
()
;
errorHandler
=
new
ErrorHandler
();
errorHandlerCreated
=
true
;
hasError
=
false
;
...
...
@@ -12828,6 +12819,24 @@ void VhdlParser::ReInit(TokenManager *tm){
}
void
VhdlParser
::
clear
(){
//Since token manager was generate from outside,
//parser should not take care of deleting
//if (token_source) delete token_source;
if
(
head
)
{
Token
*
next
,
*
t
=
head
;
while
(
t
)
{
next
=
t
->
next
;
delete
t
;
t
=
next
;
}
}
if
(
errorHandlerCreated
)
{
delete
errorHandler
;
}
}
Token
*
VhdlParser
::
jj_consume_token
(
int
kind
)
{
Token
*
oldToken
;
if
((
oldToken
=
token
)
->
next
!=
NULL
)
token
=
token
->
next
;
...
...
@@ -12907,26 +12916,23 @@ int VhdlParser::jj_ntk_f(){
}
void
VhdlParser
::
jj_add_error_token
(
int
kind
,
int
pos
)
{
void
VhdlParser
::
jj_add_error_token
(
int
kind
,
int
pos
)
{
}
/** Generate ParseException. */
void
VhdlParser
::
parseError
()
{
//
fprintf(stderr, "Parse error at: %d:%d, after token: %s encountered: %s\n", token->beginLine, token->beginColumn, addUnicodeEscapes(token->image).c_str(), addUnicodeEscapes(getToken(1)->image).c_str());
fprintf
(
stderr
,
"Parse error at: %d:%d, after token: %s encountered: %s
\n
"
,
token
->
beginLine
,
token
->
beginColumn
,
addUnicodeEscapes
(
token
->
image
).
c_str
(),
addUnicodeEscapes
(
getToken
(
1
)
->
image
).
c_str
());
}
void
VhdlParser
::
enable_tracing
()
{
void
VhdlParser
::
enable_tracing
()
{
}
/** Disable tracing. */
void
VhdlParser
::
disable_tracing
()
{
void
VhdlParser
::
disable_tracing
()
{
}
void
VhdlParser
::
jj_rescan_token
(){
void
VhdlParser
::
jj_rescan_token
(){
jj_rescan
=
true
;
for
(
int
i
=
0
;
i
<
114
;
i
++
)
{
JJCalls
*
p
=
&
jj_2_rtns
[
i
];
...
...
@@ -13057,7 +13063,7 @@ void VhdlParser::jj_rescan_token(){
}
void
VhdlParser
::
jj_save
(
int
index
,
int
xla
){
void
VhdlParser
::
jj_save
(
int
index
,
int
xla
){
JJCalls
*
p
=
&
jj_2_rtns
[
index
];
while
(
p
->
gen
>
jj_gen
)
{
if
(
p
->
next
==
NULL
)
{
p
=
p
->
next
=
new
JJCalls
();
break
;
}
...
...
vhdlparser/VhdlParser.h
View file @
475b0c51
...
...
@@ -12,12 +12,12 @@
namespace
vhdl
{
namespace
parser
{
struct
JJCalls
{
int
gen
;
Token
*
first
;
int
arg
;
JJCalls
*
nex
t
;
int
gen
;
int
arg
;
JJCalls
*
next
;
Token
*
firs
t
;
~
JJCalls
()
{
if
(
next
)
delete
next
;
}
JJCalls
()
{
next
=
NULL
;
arg
=
0
;
gen
=
-
1
;
first
=
NULL
;
}
JJCalls
()
{
next
=
NULL
;
arg
=
0
;
gen
=
-
1
;
first
=
NULL
;
}
};
class
VhdlParser
{
...
...
@@ -1490,48 +1490,6 @@ void parseInline();
{
jj_save
(
113
,
xla
);
}
}
inline
bool
jj_3R_430
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
INOUT_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_429
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
OUT_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_346
()
{
if
(
jj_done
)
return
true
;
Token
*
xsp
;
xsp
=
jj_scanpos
;
if
(
jj_3R_428
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_429
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_430
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_431
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_432
())
return
true
;
}
}
}
}
return
false
;
}
inline
bool
jj_3R_428
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
IN_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_258
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -1855,18 +1813,18 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_
62
1
()
inline
bool
jj_3R_
18
1
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
if
(
jj_scan_token
(
COMMA_T
))
return
true
;
if
(
jj_3R_69
())
return
true
;
return
false
;
}
inline
bool
jj_3R_
18
1
()
inline
bool
jj_3R_
62
1
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
COMMA_T
))
return
true
;
if
(
jj_3R_69
())
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
...
...
@@ -2026,20 +1984,20 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_
620
()
inline
bool
jj_3R_
526
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
ELSE_T
))
return
true
;
if
(
jj_3R_259
())
return
true
;
if
(
jj_scan_token
(
TYPE_T
))
return
true
;
if
(
jj_3R_70
())
return
true
;
if
(
jj_scan_token
(
SEMI_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_
526
()
inline
bool
jj_3R_
620
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
TYPE_T
))
return
true
;
if
(
jj_3R_70
())
return
true
;
if
(
jj_scan_token
(
SEMI_T
))
return
true
;
if
(
jj_scan_token
(
ELSE_T
))
return
true
;
if
(
jj_3R_259
())
return
true
;
return
false
;
}
...
...
@@ -2279,13 +2237,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_171
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_608
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -2331,6 +2282,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_171
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_343
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -2651,13 +2609,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_398
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
INTEGER
))
return
true
;
return
false
;
}
inline
bool
jj_3_112
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -2694,6 +2645,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_398
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
INTEGER
))
return
true
;
return
false
;
}
inline
bool
jj_3R_312
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -3881,24 +3839,24 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_
680
()
inline
bool
jj_3R_
588
()
{
if
(
jj_done
)
return
true
;
if
(
jj_
3R_70
(
))
return
true
;
if
(
jj_
scan_token
(
CONFIGURATION_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_58
8
()
inline
bool
jj_3R_58
7
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
CONFIGURATION
_T
))
return
true
;
if
(
jj_scan_token
(
ARCHITECTURE
_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_
587
()
inline
bool
jj_3R_
680
()
{
if
(
jj_done
)
return
true
;
if
(
jj_
scan_token
(
ARCHITECTURE_T
))
return
true
;
if
(
jj_
3R_70
(
))
return
true
;
return
false
;
}
...
...
@@ -3986,13 +3944,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_103
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_65
())
return
true
;
return
false
;
}
inline
bool
jj_3R_564
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4015,6 +3966,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_103
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_65
())
return
true
;
return
false
;
}
inline
bool
jj_3R_679
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4067,13 +4025,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_716
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_65
())
return
true
;
return
false
;
}
inline
bool
jj_3R_707
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4105,6 +4056,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_716
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_65
())
return
true
;
return
false
;
}
inline
bool
jj_3_30
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4179,6 +4137,20 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_709
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_519
())
return
true
;
return
false
;
}
inline
bool
jj_3R_163
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_85
())
return
true
;
return
false
;
}
inline
bool
jj_3R_708
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4231,20 +4203,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_709
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_519
())
return
true
;
return
false
;
}
inline
bool
jj_3R_163
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_85
())
return
true
;
return
false
;
}
inline
bool
jj_3R_252
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4466,13 +4424,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_28
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_83
())
return
true
;
return
false
;
}
inline
bool
jj_3R_405
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -4492,17 +4443,17 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_2
7
()
inline
bool
jj_3_2
8
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_8
2
())
return
true
;
if
(
jj_3R_8
3
())
return
true
;
return
false
;
}
inline
bool
jj_3
R_27
7
()
inline
bool
jj_3
_2
7
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_8
3
())
return
true
;
if
(
jj_3R_8
2
())
return
true
;
return
false
;
}
...
...
@@ -4514,6 +4465,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_277
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_83
())
return
true
;
return
false
;
}
inline
bool
jj_3R_134
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -5177,22 +5135,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_95
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_133
())
return
true
;
return
false
;
}
inline
bool
jj_3R_516
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
LPAREN_T
))
return
true
;
if
(
jj_3R_313
())
return
true
;
if
(
jj_scan_token
(
RPAREN_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_557
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -5200,13 +5142,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_94
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_132
())
return
true
;
return
false
;
}
inline
bool
jj_3R_556
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -5277,6 +5212,29 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_95
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_133
())
return
true
;
return
false
;
}
inline
bool
jj_3R_516
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
LPAREN_T
))
return
true
;
if
(
jj_3R_313
())
return
true
;
if
(
jj_scan_token
(
RPAREN_T
))
return
true
;
return
false
;
}
inline
bool
jj_3_94
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_132
())
return
true
;
return
false
;
}
inline
bool
jj_3R_173
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -5859,13 +5817,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_624
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_336
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -5905,25 +5856,25 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_
461
()
inline
bool
jj_3R_
624
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_
527
())
return
true
;
if
(
jj_3R_
70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_
1
61
()
inline
bool
jj_3R_
4
61
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_129
())
return
true
;
if
(
jj_3R_130
())
return
true
;
if
(
jj_3R_527
())
return
true
;
return
false
;
}
inline
bool
jj_3R_
648
()
inline
bool
jj_3R_
161
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
if
(
jj_3R_129
())
return
true
;
if
(
jj_3R_130
())
return
true
;
return
false
;
}
...
...
@@ -5970,6 +5921,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_648
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_623
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6682,13 +6640,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_245
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_363
())
return
true
;
return
false
;
}
inline
bool
jj_3R_307
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6699,6 +6650,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_245
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_363
())
return
true
;
return
false
;
}
inline
bool
jj_3R_95
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6715,13 +6673,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_85
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_125
())
return
true
;
return
false
;
}
inline
bool
jj_3_86
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6729,17 +6680,17 @@ void parseInline();
return
false
;
}
inline
bool
jj_3
_84
()
inline
bool
jj_3
R_419
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_
124
())
return
true
;
if
(
jj_3R_
329
())
return
true
;
return
false
;
}
inline
bool
jj_3
R_419
()
inline
bool
jj_3
_85
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_
329
())
return
true
;
if
(
jj_3R_
125
())
return
true
;
return
false
;
}
...
...
@@ -6758,10 +6709,10 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_8
3
()
inline
bool
jj_3_8
4
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_12
3
())
return
true
;
if
(
jj_3R_12
4
())
return
true
;
return
false
;
}
...
...
@@ -6786,13 +6737,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_82
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_122
())
return
true
;
return
false
;
}
inline
bool
jj_3_79
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6804,6 +6748,20 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_83
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_123
())
return
true
;
return
false
;
}
inline
bool
jj_3_82
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_122
())
return
true
;
return
false
;
}
inline
bool
jj_3_81
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6826,13 +6784,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_78
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_118
())
return
true
;
return
false
;
}
inline
bool
jj_3R_244
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -6851,6 +6802,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3_78
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_118
())
return
true
;
return
false
;
}
inline
bool
jj_3_77
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7277,13 +7235,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_703
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_60
())
return
true
;
return
false
;
}
inline
bool
jj_3R_700
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7325,6 +7276,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_703
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_60
())
return
true
;
return
false
;
}
inline
bool
jj_3R_484
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7391,13 +7349,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_702
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_707
())
return
true
;
return
false
;
}
inline
bool
jj_3R_467
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7415,6 +7366,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_702
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_707
())
return
true
;
return
false
;
}
inline
bool
jj_3R_693
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7486,15 +7444,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_228
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
LPAREN_T
))
return
true
;
if
(
jj_3R_59
())
return
true
;
if
(
jj_scan_token
(
RPAREN_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_182
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7543,6 +7492,15 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_228
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
LPAREN_T
))
return
true
;
if
(
jj_3R_59
())
return
true
;
if
(
jj_scan_token
(
RPAREN_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_530
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7579,13 +7537,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_193
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_62
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7626,6 +7577,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_193
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_377
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -7868,18 +7826,18 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_
51
3
()
inline
bool
jj_3R_
65
3
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_383
())
return
true
;
if
(
jj_scan_token
(
ACCESS_T
))
return
true
;
if
(
jj_3R_85
())
return
true
;
return
false
;
}
inline
bool
jj_3R_
65
3
()
inline
bool
jj_3R_
51
3
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
ACCESS_T
))
return
true
;
if
(
jj_3R_85
())
return
true
;
if
(
jj_3R_383
())
return
true
;
return
false
;
}
...
...
@@ -8167,13 +8125,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_242
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_60
())
return
true
;
return
false
;
}
inline
bool
jj_3R_457
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -8225,6 +8176,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_242
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_60
())
return
true
;
return
false
;
}
inline
bool
jj_3R_453
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -8807,13 +8765,6 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_625
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_281
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -8860,6 +8811,13 @@ void parseInline();
return
false
;
}
inline
bool
jj_3R_625
()
{
if
(
jj_done
)
return
true
;
if
(
jj_3R_70
())
return
true
;
return
false
;
}
inline
bool
jj_3R_432
()
{
if
(
jj_done
)
return
true
;
...
...
@@ -8874,39 +8832,88 @@ void parseInline();
return
false
;
}
public
:
TokenManager
*
token_source
;
public
:
CharStream
*
jj_input_stream
;
inline
bool
jj_3R_430
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
INOUT_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_429
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
OUT_T
))
return
true
;
return
false
;
}
inline
bool
jj_3R_346
()
{
if
(
jj_done
)
return
true
;
Token
*
xsp
;
xsp
=
jj_scanpos
;
if
(
jj_3R_428
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_429
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_430
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_431
())
{
jj_scanpos
=
xsp
;
if
(
jj_3R_432
())
return
true
;
}
}
}
}
return
false
;
}
inline
bool
jj_3R_428
()
{
if
(
jj_done
)
return
true
;
if
(
jj_scan_token
(
IN_T
))
return
true
;
return
false
;
}
public
:
TokenManager
*
token_source
;
CharStream
*
jj_input_stream
;
/** Current token. */
public
:
Token
*
token
;
Token
*
token
;
/** Next token. */
public
:
Token
*
jj_nt
;
private
:
int
jj_ntk
;
private
:
JJCalls
jj_2_rtns
[
115
];
private
:
bool
jj_rescan
;
private
:
int
jj_gc
;
private
:
Token
*
jj_scanpos
,
*
jj_lastpos
;
private
:
int
jj_la
;
Token
*
jj_nt
;
private
:
int
jj_ntk
;
JJCalls
jj_2_rtns
[
115
];
bool
jj_rescan
;
int
jj_gc
;
Token
*
jj_scanpos
,
*
jj_lastpos
;
int
jj_la
;
/** Whether we are looking ahead. */
private
:
bool
jj_lookingAhead
;
private
:
bool
jj_semLA
;
private
:
int
jj_gen
;
private
:
int
jj_la1
[
295
];
private
:
ErrorHandler
*
errorHandler
;
private
:
bool
errorHandlerCreated
;
protected
:
bool
hasError
;
public
:
void
setErrorHandler
(
ErrorHandler
*
eh
)
{
bool
jj_lookingAhead
;
bool
jj_semLA
;
int
jj_gen
;
int
jj_la1
[
295
];
ErrorHandler
*
errorHandler
;
bool
errorHandlerCreated
;
protected
:
bool
hasError
;
public
:
void
setErrorHandler
(
ErrorHandler
*
eh
)
{
if
(
errorHandlerCreated
)
delete
errorHandler
;
errorHandler
=
eh
;
errorHandlerCreated
=
false
;
}
Token
*
head
;
public
:
Token
*
head
;
public
:
VhdlParser
(
TokenManager
*
tm
);
public
:
virtual
~
VhdlParser
();
virtual
~
VhdlParser
();
void
ReInit
(
TokenManager
*
tm
);
void
clear
();
Token
*
jj_consume_token
(
int
kind
);
bool
jj_scan_token
(
int
kind
);
...
...
@@ -8916,26 +8923,30 @@ Token * getNextToken();
Token
*
getToken
(
int
index
);
int
jj_ntk_f
();
private
:
int
jj_kind
;
private
:
int
jj_kind
;
int
**
jj_expentries
;
int
*
jj_expentry
;
void
jj_add_error_token
(
int
kind
,
int
pos
);
void
jj_add_error_token
(
int
kind
,
int
pos
);
protected
:
/** Generate ParseException. */
protected
:
virtual
void
parseError
();
private
:
int
trace_indent
;
private
:
bool
trace_enabled
;
/** Enable tracing. */
virtual
void
parseError
();
private
:
int
trace_indent
;
bool
trace_enabled
;
public
:
void
enable_tracing
();
public
:
public
:
void
dis
able_tracing
();
void
en
able_tracing
();
void
jj_rescan_token
();
void
disable_tracing
();
void
jj_save
(
int
index
,
int
xla
);
typedef
unsigned
long
long
uint64
;
void
jj_rescan_token
();
void
jj_save
(
int
index
,
int
xla
);
typedef
unsigned
long
long
uint64
;
static
Entry
*
current_root
;
static
Entry
*
tempEntry
;
...
...
@@ -8976,8 +8987,12 @@ 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
);
private
:
bool
jj_done
;
static
void
error_skipto
(
int
kind
);
static
void
oneLineComment
(
QCString
qcs
);
static
void
setMultCommentLine
();
private
:
bool
jj_done
;
};
}
}
...
...
vhdlparser/VhdlParserTokenManager.cc
View file @
475b0c51
/* VhdlParserTokenManager.cc */
#include "./VhdlParserTokenManager.h"
#include "VhdlParserTokenManager.h"
#include "TokenMgrError.h"
namespace
vhdl
{
namespace
parser
{
static
const
unsigned
long
long
jjbitVec0
[]
=
{
...
...
@@ -3307,10 +3308,10 @@ bool VhdlParserTokenManager::jjCanMove_1(int hiByte, int i1, int i2, unsigned lo
Token
*
VhdlParserTokenManager
::
jjFillToken
(){
Token
*
t
;
JAVACC_STRING_TYPE
curTokenImage
;
int
beginLine
;
int
endLine
;
int
beginColumn
;
int
endColumn
;
int
beginLine
=
-
1
;
int
endLine
=
-
1
;
int
beginColumn
=
-
1
;
int
endColumn
=
-
1
;
JAVACC_STRING_TYPE
im
=
jjstrLiteralImages
[
jjmatchedKind
];
curTokenImage
=
(
im
.
length
()
==
0
)
?
input_stream
->
GetImage
()
:
im
;
if
(
input_stream
->
getTrackLineColumn
())
{
...
...
@@ -3319,7 +3320,9 @@ Token * VhdlParserTokenManager::jjFillToken(){
endLine
=
input_stream
->
getEndLine
();
endColumn
=
input_stream
->
getEndColumn
();
}
t
=
Token
::
newToken
(
jjmatchedKind
,
curTokenImage
);
t
=
Token
::
newToken
(
jjmatchedKind
);
t
->
kind
=
jjmatchedKind
;
t
->
image
=
curTokenImage
;
t
->
specialToken
=
NULL
;
t
->
next
=
NULL
;
...
...
@@ -3405,7 +3408,14 @@ void VhdlParserTokenManager::SkipLexicalActions(Token *matchedToken){
}
case
6
:
{
image
.
append
(
input_stream
->
GetSuffix
(
jjimageLen
+
(
lengthOfMatch
=
jjmatchedPos
+
1
)));
::
vhdl
::
parser
::
VhdlParser
::
handleCommentBlock
(
image
.
data
(),
TRUE
);
QCString
doc
(
image
.
data
());
int
count
=
doc
.
contains
(
"--!"
);
::
vhdl
::
parser
::
VhdlParser
::
setMultCommentLine
();
::
vhdl
::
parser
::
VhdlParser
::
lineCount
(
image
.
data
());
if
(
count
==
1
)
::
vhdl
::
parser
::
VhdlParser
::
oneLineComment
(
doc
);
else
::
vhdl
::
parser
::
VhdlParser
::
handleCommentBlock
(
image
.
data
(),
FALSE
);
;
break
;
}
case
7
:
{
...
...
@@ -3415,7 +3425,7 @@ void VhdlParserTokenManager::SkipLexicalActions(Token *matchedToken){
}
case
8
:
{
image
.
append
(
input_stream
->
GetSuffix
(
jjimageLen
+
(
lengthOfMatch
=
jjmatchedPos
+
1
)));
::
vhdl
::
parser
::
VhdlParser
::
lineCount
(
image
.
data
());
::
vhdl
::
parser
::
VhdlParser
::
lineCount
(
image
.
data
());
break
;
}
case
9
:
{
...
...
@@ -3560,7 +3570,7 @@ void VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
}
/** Reinitialise parser. */
void
VhdlParserTokenManager
::
ReInit
(
JAVACC_CHARSTREAM
*
stream
,
int
lexState
,
VhdlParser
*
parserArg
)
{
if
(
input_stream
)
delete
input_stream
;
clear
()
;
jjmatchedPos
=
jjnewStateCnt
=
0
;
curLexState
=
lexState
;
input_stream
=
stream
;
...
...
@@ -3581,10 +3591,17 @@ void VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
/** Switch to specified lex state. */
void
VhdlParserTokenManager
::
SwitchTo
(
int
lexState
)
{
if
(
lexState
>=
1
||
lexState
<
0
)
assert
(
false
);
//throw 1;//new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
if
(
lexState
>=
1
||
lexState
<
0
)
{
JAVACC_STRING_TYPE
message
;
#ifdef WIDE_CHAR
message
+=
L"Error: Ignoring invalid lexical state : "
;
message
+=
lexState
;
message
+=
L". State unchanged."
;
#else
message
+=
"Error: Ignoring invalid lexical state : "
;
message
+=
lexState
;
message
+=
". State unchanged."
;
#endif
throw
new
TokenMgrError
(
message
,
INVALID_LEXICAL_STATE
);
}
else
curLexState
=
lexState
;
}
...
...
@@ -3592,14 +3609,23 @@ void VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
VhdlParserTokenManager
::
VhdlParserTokenManager
(
JAVACC_CHARSTREAM
*
stream
,
int
lexState
,
VhdlParser
*
parserArg
)
{
input_stream
=
NULL
;
errorHandlerCreated
=
false
;
ReInit
(
stream
,
lexState
,
parserArg
);
}
// Destructor
VhdlParserTokenManager
::~
VhdlParserTokenManager
()
{
if
(
input_stream
)
delete
input_stream
;
if
(
errorHandlerCreated
)
delete
errorHandler
;
clear
();
}
// clear
void
VhdlParserTokenManager
::
clear
()
{
//Since input_stream was generated outside of TokenManager
//TokenManager should not take care of deleting it
//if (input_stream) delete input_stream;
if
(
errorHandlerCreated
)
delete
errorHandler
;
}
}
}
vhdlparser/VhdlParserTokenManager.h
View file @
475b0c51
#ifndef VHDLPARSERTOKENMANAGER_H
#define VHDLPARSERTOKENMANAGER_H
#include "stdio.h"
#include "JavaCC.h"
#include "CharStream.h"
#include "Token.h"
...
...
@@ -116,23 +117,27 @@ void TokenLexicalActions(Token *matchedToken);
public
:
virtual
~
VhdlParserTokenManager
();
void
ReInit
(
JAVACC_CHARSTREAM
*
stream
,
int
lexState
=
0
,
VhdlParser
*
parserArg
=
NULL
);
void
SwitchTo
(
int
lexState
);
void
clear
();
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
[
75
];
int
jjstateSet
[
2
*
75
];
JAVACC_STRING_TYPE
jjimage
;
JAVACC_STRING_TYPE
image
;
int
jjimageLen
;
int
lengthOfMatch
;
JAVACC_CHAR_TYPE
curChar
;
TokenManagerErrorHandler
*
errorHandler
;
bool
errorHandlerCreated
;
public
:
void
setErrorHandler
(
TokenManagerErrorHandler
*
eh
)
{
JAVACC_CHARSTREAM
*
input_stream
;
int
jjrounds
[
75
];
int
jjstateSet
[
2
*
75
];
JAVACC_STRING_TYPE
jjimage
;
JAVACC_STRING_TYPE
image
;
int
jjimageLen
;
int
lengthOfMatch
;
JAVACC_CHAR_TYPE
curChar
;
TokenManagerErrorHandler
*
errorHandler
;
bool
errorHandlerCreated
;
public
:
void
setErrorHandler
(
TokenManagerErrorHandler
*
eh
)
{
if
(
errorHandlerCreated
&&
errorHandler
!=
NULL
)
delete
errorHandler
;
errorHandler
=
eh
;
errorHandlerCreated
=
false
;
}
};
}
}
...
...
vhdlparser/vhdlparser.jj
View file @
475b0c51
...
...
@@ -3,8 +3,8 @@
* 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
* 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.
*
...
...
@@ -20,14 +20,13 @@ options {
//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 ;
...
...
@@ -68,7 +67,8 @@ static bool addLibUseClause(const QCString &type);
static void mapLibPackage( Entry* root);
static void createFlow();
static void error_skipto(int kind);
static void oneLineComment(QCString qcs);
static void setMultCommentLine();
PARSER_END(VhdlParser)
SKIP :
...
...
@@ -82,24 +82,37 @@ SKIP :
SKIP:
{
// VHDL comment -- ......
// VHDL doxygen line comment --! ....
<#DOXYGEN_VHDL_COMMENT: (" "|"\t")*"--!"(~["\n", "\r"])* ("\n" | "\r" | "\r\n")?>
| <MULT_DOXYGEN_COMMENT: (<DOXYGEN_VHDL_COMMENT>)+ > { ::vhdl::parser::VhdlParser::handleCommentBlock(image.data(),TRUE); }
// VHDL doxygen line comment --! ....
<#DOXYGEN_VHDL_COMMENT: (" "|"\t")*"--!"(~["\n", "\r"])* ("\n" | "\r" | "\r\n")?>
| <MULT_DOXYGEN_COMMENT: (<DOXYGEN_VHDL_COMMENT>)+ >
{
QCString doc(image.data());
int count=doc.contains("--!");
::vhdl::parser::VhdlParser::setMultCommentLine();
::vhdl::parser::VhdlParser::lineCount(image.data());
if (count == 1)
::vhdl::parser::VhdlParser::oneLineComment(doc);
else
::vhdl::parser::VhdlParser::handleCommentBlock(image.data(),FALSE); ;
}
|<VHDL_FLOWCHART_COMMENT: "--#" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?> { ::vhdl::parser::VhdlParser::handleFlowComment(image.data());}
|<VHDL_COMMENT: "--" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?> { ::vhdl::parser::VhdlParser::lineCount(image.data());}
}
|<VHDL_COMMENT: "--" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?>
{
::vhdl::parser::VhdlParser::lineCount(image.data());}
}
// VHDL 2008 comment /* .... */
// VHDL 2008 doxygen comment /*! .... */
SKIP :
{
<MULT_DOXYGEN_VHDL_COMMENT_2008 : "/*!" (~[])* "*/" >
<MULT_DOXYGEN_VHDL_COMMENT_2008 : "/*!" (~[])* "*/" >
{
QCString q(image.data());
q.stripPrefix("/*!");
q.resize(q.length()-2);
q.stripPrefix("/*!");
q.resize(q.length()-2);
::vhdl::parser::VhdlParser::handleCommentBlock(q.data(),TRUE);image.clear();
}
}
| <MULT_VHDL_2008_COMMENT : "/*" (~[])* "*/" > {::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();}
}
...
...
@@ -107,7 +120,7 @@ SKIP :
TOKEN [IGNORE_CASE] :
{
<ABS_T: "abs">
<ABS_T: "abs">
| <ACCESS_T: "access">
| <AFTER_T: "after">
| <ALIAS_T: "alias">
...
...
@@ -115,86 +128,86 @@ TOKEN [IGNORE_CASE] :
| <AND_T: "and">
| <ARCHITECTURE_T: "architecture"> {::vhdl::parser::VhdlParser::setLineParsed(ARCHITECTURE_T);}
| <ARRAY_T: "array"> {VhdlParser::setLineParsed(ARRAY_T);}
| <ASSERT_T: "assert">
| <ASSUME_T: "assume">
| <ASSUME_GUARANTEE_T: "assume_guarentee">
| <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">
| <BEGIN_T: "begin">
| <BLOCK_T: "block">
| <BODY_T: "body"> {::vhdl::parser::VhdlParser::setLineParsed(BODY_T);}
| <BUFFER_T: "buffer">
| <BUS_T: "bus">
| <BUS_T: "bus">
| <COMPONENT_T: "component"> {VhdlParser::setLineParsed(COMPONENT_T);}
| <CASE_T: "case">
| <CASE_T: "case">
| <CONFIGURATION_T: "configuration"> {VhdlParser::setLineParsed(CONFIGURATION_T);}
| <CONSTANT_T: "constant"> {VhdlParser::setLineParsed(CONSTANT_T);}
| <CONTEXT_T: "context"> {VhdlParser::setLineParsed(CONTEXT_T);}
| <COVER_T: "cover">
| <DEFAULT_T: "default">
| <DISCONNECT_T: "disconnect">
| <DOWNTO_T: "downto">
| <ELSE_T: "else">
| <ELSIF_T: "elsif">
| <COVER_T: "cover">
| <DEFAULT_T: "default">
| <DISCONNECT_T: "disconnect">
| <DOWNTO_T: "downto">
| <ELSE_T: "else">
| <ELSIF_T: "elsif">
| <END_T: "end"> {VhdlParser::setLineParsed(END_T);}
| <ENTITY_T: "entity"> {VhdlParser::setLineParsed(ENTITY_T);}
| <EXIT_T: "exit">
| <FAIRNESS_T: "fairness">
| <EXIT_T: "exit">
| <FAIRNESS_T: "fairness">
| <FILE_T: "file"> {VhdlParser::setLineParsed(FILE_T);}
| <FOR_T: "for">
| <FOR_T: "for">
| <FORCE_T: "force">
| <FUNCTION_T: "function"> {VhdlParser::setLineParsed(FUNCTION_T);}
| <GENERATE_T: "generate">
| <GENERIC_T: "generic">
| <GENERATE_T: "generate">
| <GENERIC_T: "generic">
| <GROUP_T: "group"> {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">
| <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"> {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">
| <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">
| <NULL_T: "null">
| <OF_T: "of">
| <ON_T: "on">
| <OPEN_T: "open">
| <OR_T: "or">
| <OTHER_T: "others">
| <OUT_T: "out">
| <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">
| <PARAMETER_T: "parameter">
| <PORT_T: "port"> {::vhdl::parser::VhdlParser::setLineParsed(PORT_T);}
| <POSTPONED_T: "postponed">
| <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">
| <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">
| <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">
...
...
@@ -213,11 +226,11 @@ TOKEN [IGNORE_CASE] :
| <UNTIL_T: "until">
| <USE_T: "use">
| <VARIABLE_T: "variable">
| <VMODE_T: "vmode">
| <VPROP_T: "vprop">
| <VMODE_T: "vmode">
| <VPROP_T: "vprop">
| <VUNIT_T: "vunit">
| <WAIT_T: "wait">
| <WHEN_T: "when">
| <WHEN_T: "when">
| <WHILE_T: "while">
| <WITH_T: "with">
| <XOR_T: "xor">
...
...
@@ -270,16 +283,16 @@ TOKEN :
}
TOKEN:
TOKEN:
{
<INTEGER: <DIGIT> ((["_"])? (<DIGIT>))* >
<INTEGER: <DIGIT> ((["_"])? (<DIGIT>))* >
| <STRINGLITERAL: (( ["\""](<GRAPHIC_CHARACTER>)*) "\"")+ >
| <BASIC_IDENTIFIER: (<LETTER> ( (["_"])* <LETTER_OR_DIGIT> )*) >
| <EXTENDED_CHARACTER: ( ["\\"](<GRAPHIC_CHARACTER>)*["\\"] ) >
| <CHARACTER_LITERAL: (["'"]<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>)? >
| <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> ) >
...
...
@@ -294,54 +307,54 @@ TOKEN:
| < #SPACE_CHARACTER: [" ","\t"] >
| < #LOWER_CASE_LETTER: ["a"-"z"] >
| <VHDL2008TOOLDIR : ["`"](<GRAPHIC_CHARACTER>|<STRINGLITERAL>)+ >
}
QCString abstract_literal() :
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(); }
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;}
{Token *tok
=0
;QCString str,str1;}
{
tok=<ACCESS_T> str1=subtype_indication() {str=tok->image.c_str(); return str+str1;
}
tok=<ACCESS_T> str1=subtype_indication() { str=tok->image.c_str(); return str+str1;
}
}
QCString actual_designator() :
{QCString str;Token *t;}
QCString actual_designator() :
{QCString str;Token *t
=0
;}
{
t=<OPEN_T> { return t->image.c_str(); }
|
LOOKAHEAD(expression())
str=expression() { return str; }
|
LOOKAHEAD(name())
LOOKAHEAD(name())
str=name() { return str; }
}
QCString actual_parameter_part() :
QCString actual_parameter_part() :
{QCString s;}
{
s=association_list() { return s;}
}
QCString actual_part() :
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 () :
QCString adding_operator () :
{}
{
<PLUS_T> { return "+";}
...
...
@@ -357,12 +370,12 @@ QCString aggregate() : {QCString s,s1,s2;}
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;}]
[ <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+";";
}
}
...
...
@@ -376,25 +389,25 @@ QCString alias_designator() : {Token *tok=0;QCString s;}
void allocator() :{}
{
LOOKAHEAD(3)
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>
{
<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);}
architecture_declarative_part()
}catch(...){error_skipto(BEGIN_T);}
<BEGIN_T>
architecture_statement_part()
<END_T> [<ARCHITECTURE_T>] [name()] <SEMI_T>
...
...
@@ -417,10 +430,10 @@ 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;}
...
...
@@ -439,7 +452,7 @@ 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+";";
return s+s1+";";
}
}
QCString association_element() : {QCString s,s1;}
...
...
@@ -455,14 +468,14 @@ s=association_element() (<COMMA_T> s1=association_element() { s+=","+s1; })* { r
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);
<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;}
QCString attribute_designator (): {QCString s;Token *tok
=0
;}
{
s=identifier() { return s;}
| tok=<RANGE_T> { return tok->image.c_str(); }
...
...
@@ -477,40 +490,40 @@ QCString attribute_name (): {QCString s,s1;}
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;
{
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+";";
return " attribute "+s+" of "+s1+ " is "+s2+";";
}
}
QCString base() : {Token *tok;}
QCString base() : {Token *tok
=0
;}
{
tok=<INTEGER> { return tok->image.c_str();}
}
QCString base_specifier (): {Token *tok;}
QCString base_specifier (): {Token *tok
=0
;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
QCString base_unit_declaration() :
QCString base_unit_declaration() :
{QCString s;}
{
s=identifier() { return s; }
}
QCString based_integer() : {Token *tok;}
QCString based_integer() : {Token *tok
=0
;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
QCString based_literal(): {Token *tok;}
QCString based_literal(): {Token *tok
=0
;}
{
tok=<BASED_LITERAL> { return tok->image.c_str();}
}
QCString basic_identifier() : {Token *tok;}
QCString basic_identifier() : {Token *tok
=0
;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
...
...
@@ -522,13 +535,13 @@ void binding_indication() : {}
[ port_map_aspect() ]
}
QCString bit_string_literal (): {Token *tok;}
QCString bit_string_literal (): {Token *tok
=0
;}
{
tok=<BIT_STRING_LITERAL> { return tok->image.c_str();}
}
QCString bit_value() : {Token *tok;}
QCString bit_value() : {Token *tok
=0
;}
{
tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
}
...
...
@@ -537,7 +550,7 @@ void block_configuration() : {}
{
<FOR_T> block_specification()
( use_clause() )*
( configuration_item())*
( configuration_item())*
<END_T> <FOR_T> <SEMI_T>
}
...
...
@@ -577,7 +590,7 @@ 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>]
...
...
@@ -590,9 +603,9 @@ void block_statement() : {QCString s;}
block_header()
block_declarative_part()
<BEGIN_T>
block_statement_part()
<END_T> <BLOCK_T> [ identifier() ] <SEMI_T>
{
block_statement_part()
<END_T> <BLOCK_T> [ identifier() ] <SEMI_T>
{
genLabels=popLabel(genLabels);
}
}
...
...
@@ -605,33 +618,33 @@ void block_statement_part() : {}
void case_statement() : {QCString s;}
{
[ identifier() <COLON_T> ]
<CASE_T> s=expression()
<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>
{
<END_T> <CASE_T> [ identifier() ] <SEMI_T>
{
FlowChart::moveToPrevLevel();
FlowChart::addFlowChart(FlowChart::END_CASE,"end case",0);
}
}
}
void case_statement_alternative() : {QCString s;}
{
<WHEN_T> s=choices() <ARROW_T>
{
<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;}
QCString character_literal() : {Token *tok
=0
;}
{
tok=<CHARACTER_LITERAL>{ return tok->image.c_str();}
}
...
...
@@ -640,7 +653,7 @@ QCString choice() : {QCString s;}
{
LOOKAHEAD(simple_expression())
s=simple_expression(){ return s; }
|
|
LOOKAHEAD(discrete_range())
s=discrete_range(){ return s; }
|
...
...
@@ -648,10 +661,10 @@ QCString choice() : {QCString s;}
s=identifier(){ return s; }
| <OTHER_T> { return " others "; }
}
QCString choices() : {QCString s,s1;}
{
s=choice() (<BAR_T> s1=choice(){s+="|";s+=s1;})* { return s; }
s=choice() (<BAR_T> s1=choice(){s+="|";s+=s1;})* { return s; }
}
void component_configuration () :{}
...
...
@@ -664,7 +677,7 @@ void component_configuration () :{}
void component_declaration() : {QCString s;}
{
<COMPONENT_T> s=identifier() [ <IS_T> ]
{ currP=VhdlDocGen::COMPONENT; }
{ currP=VhdlDocGen::COMPONENT; }
[ generic_clause() ]
[ port_clause() ]
{
...
...
@@ -678,10 +691,10 @@ void component_declaration() : {QCString s;}
void component_instantiation_statement() : {QCString s,s1;}
{
s=identifier() <COLON_T>
s=identifier() <COLON_T>
s1=instantiation_unit()
{
addCompInst(s.lower().data(),s1.lower().data(),0,getLine());
addCompInst(s.lower().data(),s1.lower().data(),0,getLine());
}
[ LOOKAHEAD(generic_map_aspect()) generic_map_aspect() ]
[ port_map_aspect() ] <SEMI_T>
...
...
@@ -710,7 +723,7 @@ void concurrent_procedure_call_statement() : {}
void concurrent_signal_assignment_statement() : {}
{
[ LOOKAHEAD(2) identifier() <COLON_T> ] [<POSTPONED_T> ]
[ LOOKAHEAD(2) identifier() <COLON_T> ] [<POSTPONED_T> ]
(
LOOKAHEAD(conditional_signal_assignment() )
conditional_signal_assignment()
...
...
@@ -725,21 +738,21 @@ 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()
|
...
...
@@ -762,14 +775,14 @@ QCString condition() : {QCString s;}
QCString condition_clause() : {QCString s;}
{
<UNTIL_T> s=condition()
{
{
return " until "+s;
}
}
void conditional_signal_assignment() : {}
{
// LOOKAHEAD( target() "<=" options_() conditional_waveforms() ";")
// LOOKAHEAD( target() "<=" options_() conditional_waveforms() ";")
target() <LESSTHAN_T> options() conditional_waveforms() <SEMI_T>
}
...
...
@@ -782,7 +795,7 @@ waveform()
}
// ( waveform() < WHEN_T> condition() <ELSE_T> )*
// waveform() [ <WHEN_T> condition() ]
// waveform() [ <WHEN_T> condition() ]
//waveform()
// ( LOOKAHEAD( <WHEN> condition() <ELSE>)
...
...
@@ -793,12 +806,12 @@ 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()
block_configuration()
<END_T> [ <CONFIGURATION_T> ] [ name() ] <SEMI_T>
{ genLabels.resize(0); confName="";}
}
...
...
@@ -812,7 +825,7 @@ void configuration_declarative_item() : {}
void configuration_declarative_part() : {}
{
(configuration_declarative_item())*
(configuration_declarative_item())*
}
void configuration_item (): {}
...
...
@@ -820,25 +833,25 @@ void configuration_item (): {}
LOOKAHEAD(component_configuration())
component_configuration()
| block_configuration()
}
void configuration_specification() : {}
{
<FOR_T> component_specification() binding_indication() <SEMI_T>
<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>
<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;
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;
}
return it;
}
}
QCString constraint_array_definition (): {QCString s,s1;}
...
...
@@ -852,12 +865,12 @@ void context_clause (): {}
}
QCString constraint () :{QCString s;}
{
LOOKAHEAD(range_constraint())
s=range_constraint(){ return s;}
{
LOOKAHEAD(range_constraint())
s=range_constraint(){ return s;}
|
LOOKAHEAD(index_constraint())
s=index_constraint(){ return s;}
LOOKAHEAD(index_constraint())
s=index_constraint(){ return s;}
}
void context_item() : {}
...
...
@@ -866,7 +879,7 @@ void context_item() : {}
| use_clause()
}
QCString decimal_literal() : {Token *tok;}
QCString decimal_literal() : {Token *tok
=0
;}
{
tok=<DECIMAL_LITERAL> { return tok->image.c_str(); }
}
...
...
@@ -887,7 +900,7 @@ void design_file() : {}
void design_unit() : {}
{
context_clause()library_unit()
}
QCString designator() : {QCString s;}
...
...
@@ -896,7 +909,7 @@ QCString designator() : {QCString s;}
| s=operator_symbol(){return s;}
}
QCString direction (): {Token *tok;}
QCString direction (): {Token *tok
=0
;}
{
tok=<TO_T> { return tok->image.c_str();}
| tok=<DOWNTO_T> { return tok->image.c_str();}
...
...
@@ -916,18 +929,18 @@ 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>) s=choices() <ARROW_T> ] s1=expression()
{
if(!s.isEmpty())
[LOOKAHEAD(choices() <ARROW_T>) s=choices() <ARROW_T> ] s1=expression()
{
if(!s.isEmpty())
return s+"=>"+s1;
return s1;
return s1;
}
}
...
...
@@ -937,7 +950,7 @@ s=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T> {return s+":"+s1;
}
QCString entity_aspect() : {Token *tok;QCString s,s1;}
QCString entity_aspect() : {Token *tok
=0
;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;}
...
...
@@ -967,7 +980,7 @@ QCString entity_class() : {}
QCString entity_class_entry() : {QCString s;}
{
s=entity_class() [ <BOX_T> {s+="<>";} ] { return s;}
s=entity_class() [ <BOX_T> {s+="<>";} ] { return s;}
}
QCString entity_class_entry_list() : {QCString s,s1,s2;}
...
...
@@ -978,19 +991,19 @@ QCString entity_class_entry_list() : {QCString s,s1,s2;}
void entity_declaration() : {QCString s;}
{
// try{
<ENTITY_T> s=identifier() <IS_T>
{
<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() ]
[ <BEGIN_T> entity_statement_part() ]
<END_T> [ <ENTITY_T> ] [ name() ]
//
}catch(...){error_skipto(SEMI_T);}
<SEMI_T>
{ lastEntity=0;lastCompound=0; genLabels.resize(0); }
//
}catch(...){error_skipto(SEMI_T);}
<SEMI_T>
{ lastEntity=0;lastCompound=0; genLabels.resize(0); }
}
void entity_declarative_item() : {}
...
...
@@ -1004,13 +1017,13 @@ subprogram_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()
...
...
@@ -1034,7 +1047,7 @@ 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()]
[ { currP=VhdlDocGen::PORT; } port_clause()]
}
QCString entity_name_list() : {QCString s,s1;}
...
...
@@ -1062,7 +1075,7 @@ LOOKAHEAD(process_statement())
void entity_statement_part() : {}
{
(entity_statement())*
(entity_statement())*
}
...
...
@@ -1086,14 +1099,14 @@ QCString enumeration_type_definition() : {QCString s,s1;}
QCString exit_statement() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
{
[ s=identifier() t=<COLON_T> ] <EXIT_T> [ s1=identifier() ]
[ s=identifier() t=<COLON_T> ] <EXIT_T> [ s1=identifier() ]
[ t1=<WHEN_T> s2=condition() ] <SEMI_T>
{
lab.resize(0);
lab.resize(0);
if(t) s+=":";
if(t1) s2.prepend(" when ");
FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2.data(),s1.data());
FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2.data(),s1.data());
return s+s1+s2+";";
}
}
...
...
@@ -1128,10 +1141,10 @@ s=primary() [LOOKAHEAD(1) <DOUBLEMULT_T> s1=primary(){ s+="**";s+=s1;} ] { retur
QCString file_declaration() : {QCString s,s1,s2,s3;}
{
<FILE_T> s=identifier_list() <COLON_T> s2=subtype_indication() [ s3=file_open_information() ] <SEMI_T>
<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);
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,t1.data(),Public);
return " file "+s+":"+s2+" "+s3+";";
}
}
...
...
@@ -1156,10 +1169,10 @@ QCString floating_type_definition() : {QCString s;}
s=range_constraint(){ return s;}
}
QCString formal_designator() : {QCString s;Token *tok
;}
QCString formal_designator() : {QCString s;Token *tok
=0;}
{
s=name() { return s; }
|tok=<INTEGER> { return tok->image.c_str();}
|tok=<INTEGER> { return tok->image.c_str();}
}
...
...
@@ -1177,13 +1190,13 @@ 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+";";
}
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;}
...
...
@@ -1195,12 +1208,12 @@ void generate_statement() : {QCString s;}
{
s=identifier() <COLON_T>
try{
generate_scheme() <GENERATE_T>
generate_scheme() <GENERATE_T>
{ pushLabel(genLabels,s); }
generate_statement_body1()
<END_T>
}catch(...){error_skipto(GENERATE_T);}
<GENERATE_T> [ identifier() ] <SEMI_T> {genLabels=popLabel(genLabels); }
<END_T>
}catch(...){error_skipto(GENERATE_T);}
<GENERATE_T> [ identifier() ] <SEMI_T> {genLabels=popLabel(genLabels); }
}
void generate_scheme() : {}
...
...
@@ -1226,18 +1239,18 @@ void generic_map_aspect() : {}
QCString group_constituent() : {QCString s;}
{
s=name() { return 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;}
(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>
<GROUP_T> s=identifier() <COLON_T> s1=identifier() <LPAREN_T> s2=group_constituent_list() <RPAREN_T> <SEMI_T>
{
return "group "+s+":"+s1+"("+s2+");";
}
...
...
@@ -1245,7 +1258,7 @@ QCString group_declaration() : {QCString 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>
<GROUP_T> s=identifier() <IS_T> <LPAREN_T> s1=entity_class_entry_list() <RPAREN_T> <SEMI_T>
{
return "group "+s+ "is ("+s1+");";
}
...
...
@@ -1256,7 +1269,7 @@ void guarded_signal_specification() : {}
signal_list() <COLON_T> type_mark()
}
QCString identifier() : {Token *tok;}
QCString identifier() : {Token *tok
=0
;}
{
tok=<EXTENDED_CHARACTER>{ return tok->image.c_str(); }
|tok=<BASIC_IDENTIFIER> { return tok->image.c_str(); }
...
...
@@ -1271,33 +1284,33 @@ 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>
{
}
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>
{
sequence_of_statement()
)*
[LOOKAHEAD(1) <ELSE_T>
{
FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
}
sequence_of_statement() ] <END_T> <IF_T> [ identifier() ] <SEMI_T>
{
}
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>
<TYPE_T> s=identifier() <SEMI_T>
{
return "type "+s+";";
}
...
...
@@ -1319,17 +1332,17 @@ QCString index_specification() : {QCString s;}
QCString index_subtype_definition() : {QCString s;}
{
s=type_mark() <RANGE_T> <BOX_T> { return s+" range <> ";}
s=type_mark() <RANGE_T> <BOX_T> { return s+" range <> ";}
}
QCString instantiation_unit() : {QCString s,s1,s2;Token *tok;}
QCString instantiation_unit() : {QCString s,s1,s2;Token *tok
=0
;}
{
[ 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;}
QCString instantiation_list() : {QCString s;Token *tok
=0
;}
{
s=identifier_list() { return s;}
| tok=<OTHER_T> {return tok->image.c_str();}
...
...
@@ -1353,13 +1366,13 @@ 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;}
|
...
...
@@ -1367,8 +1380,8 @@ subprogram_declaration() { return s;}
{
if (parse_sec==GEN_SEC)
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,currP,s1.data(),0,Public);
return s;
}
return s;
}
}
QCString interface_element() : {QCString s;}
...
...
@@ -1379,7 +1392,7 @@ 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;
}
...
...
@@ -1394,20 +1407,20 @@ s=interface_element() (LOOKAHEAD(1) <SEMI_T> s1=interface_element(){s2+=";";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() ]
[( 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=tok1->image.data();
if(tok2)
s3+=":=";
QCString it=s+":"+s1+" "+s2+" "+s3+" "+s4;
s5=tok->image.c_str();
if(tok1)
s3=tok1->image.data();
if(tok2)
s3+=":=";
QCString it=s+":"+s1+" "+s2+" "+s3+" "+s4;
if (currP!=VhdlDocGen::COMPONENT)
{
if (currP==VhdlDocGen::FUNCTION || currP==VhdlDocGen::PROCEDURE)
...
...
@@ -1424,8 +1437,8 @@ QCString interface_variable_declaration() : {Token *tok=0;Token *tok1=0;Token *
}
// fprintf(stderr,"\n\n <<port %s >>\n",$$.data());
} // if component
return it;
}
return it;
}
}
QCString iteration_scheme() : {QCString s;}
...
...
@@ -1434,15 +1447,15 @@ QCString iteration_scheme() : {QCString s;}
{
s.prepend("while ");
FlowChart::addFlowChart(FlowChart::WHILE_NO,0,s.data(),lab.data());
lab="";
return s;
lab="";
return s;
}
| <FOR_T> s=parameter_specification()
{
QCString q=lab+" for "+s;
FlowChart::addFlowChart(FlowChart::FOR_NO,0,q.data(),lab.data());
lab="";
return q;
return q;
}
}
...
...
@@ -1454,14 +1467,14 @@ QCString label() : {QCString 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);
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::LIBRARY,s.data(),"_library_",Public);
}
QCString s1="library "+s;
return s1;
return s1;
}
}
...
...
@@ -1471,19 +1484,19 @@ 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;}
...
...
@@ -1499,21 +1512,21 @@ QCString loop_statement() : {QCString s,s1,s2,s3;}
{
[ s=identifier() <COLON_T> {s+=":";} ]
[ s1=iteration_scheme() ]
{
if(s1.isEmpty())
FlowChart::addFlowChart(FlowChart::LOOP_NO,0,"infinite");
}
<LOOP_T>
s2=sequence_of_statement()
<END_T> <LOOP_T> [ s3=identifier() ] <SEMI_T>
{
QCString q = s+" loop "+s2+" end loop" +s3;
{
if(s1.isEmpty())
FlowChart::addFlowChart(FlowChart::LOOP_NO,0,"infinite");
}
<LOOP_T>
s2=sequence_of_statement()
<END_T> <LOOP_T> [ s3=identifier() ] <SEMI_T>
{
QCString q = s+" loop "+s2+" end loop" +s3;
QCString endLoop="end loop" + s3;
FlowChart::moveToPrevLevel();
FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop.data(),0);
return q;
}
return q;
}
}
...
...
@@ -1524,7 +1537,7 @@ QCString miscellaneous_operator():{Token *t=0;}
| <NOT_T> {return "not";}
}
QCString mode() : {Token *tok;}
QCString mode() : {Token *tok
=0
;}
{
tok=<IN_T> { return "in"; }
| tok=<OUT_T> { return "out"; }
...
...
@@ -1533,7 +1546,7 @@ tok=<IN_T> { return "in"; }
| tok=<LINKAGE_T> { return "linkage"; }
}
QCString multiplying_operation() : {Token *tok;}
QCString multiplying_operation() : {Token *tok
=0
;}
{
tok=<MULT_T> { return tok->image.c_str(); }
| tok=<SLASH_T> { return tok->image.c_str(); }
...
...
@@ -1558,46 +1571,46 @@ QCString name_ext1() : {QCString s,s1,s2;}
QCString name_ext() : {QCString s,s1,s2;}
{
(
LOOKAHEAD(<DOT_T> suffix())
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+=")";}
<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+=")";}]
[ 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) s=identifier() t=<COLON_T> ] <NEXT_T> [ s1=identifier() ]
[LOOKAHEAD(1) t1=<WHEN_T> s2=condition() ] <SEMI_T>
{
if(t) s+=":";
FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2.data(),s1.data());
FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2.data(),s1.data());
lab.resize(0);
if(t1) s2.prepend("when ");
if(t1) s2.prepend("when ");
return s+s1+s2+";";
}
}
...
...
@@ -1609,7 +1622,7 @@ QCString null_statement() : {QCString s;}
QCString numeric_literal() : {QCString s;}
{
LOOKAHEAD(physical_literal())
s=physical_literal(){ return s;}
| s=abstract_literal() { return s;}
...
...
@@ -1625,14 +1638,14 @@ QCString object_class() : {}
|<TYPE_T> { return "type"; }
}
QCString operator_symbol() : {Token *tok;}
QCString operator_symbol() : {Token *tok
=0
;}
{
tok=<STRINGLITERAL> {return tok->image.c_str();}
}
void options() : {}
{
[ <GUARDED_T> ] [ delay_mechanism() ]
[ <GUARDED_T> ] [ delay_mechanism() ]
}
void package_body() : {QCString s;}
...
...
@@ -1643,7 +1656,7 @@ void package_body() : {QCString s;}
s.prepend("_");
addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
}
package_body_declarative_part()
package_body_declarative_part()
<END_T> [<PACKAGE_T> <BODY_T> ] [ name() ] <SEMI_T> { lastCompound=0; genLabels.resize(0); }
}
...
...
@@ -1659,7 +1672,7 @@ subprogram_declaration()
| file_declaration()
| alias_declaration()
| use_clause()
|
|
LOOKAHEAD(3)
group_template_declaration()
| group_declaration()
...
...
@@ -1672,7 +1685,7 @@ void package_body_declarative_part() : {}
void package_declaration(): {QCString s;}
{
<PACKAGE_T> s=identifier() <IS_T>
{
lastCompound=current;
...
...
@@ -1680,14 +1693,14 @@ void package_declaration(): {QCString s;}
clone->section=Entry::NAMESPACE_SEC;
clone->spec=VhdlDocGen::PACKAGE;
clone->name=s;
clone->startLine=getLine();
clone->bodyLine=getLine();
clone->startLine=getLine(
PACKAGE_T
);
clone->bodyLine=getLine(
PACKAGE_T
);
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>
addVhdlType(s,getLine(
PACKAGE_T),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); }
}
...
...
@@ -1746,13 +1759,13 @@ 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");
<END_T> <UNITS_T> [name()]
{
current->args=s2;
current->args.prepend("units");
current->spec=VhdlDocGen::UNITS;
return s2;
}
return s2;
}
}
void port_clause() : {}
...
...
@@ -1777,21 +1790,21 @@ 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; }
}
...
...
@@ -1800,7 +1813,7 @@ void primary_unit() : {}
{
entity_declaration()
| configuration_declaration()
|
|
LOOKAHEAD(package_instantiation_declaration())
package_instantiation_declaration()
|
...
...
@@ -1812,13 +1825,13 @@ LOOKAHEAD(4)
QCString procedure_call() : {QCString s,s1;}
{
s=name() [ <LPAREN_T> s1=actual_parameter_part() <RPAREN_T>{ s1.prepend("("); s1.append(")");}]
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>
[LOOKAHEAD(2) s=identifier() <COLON_T> { s+=":"; }] s1=procedure_call() <SEMI_T>
{
return s+s1+";";
}
...
...
@@ -1834,12 +1847,12 @@ subprogram_declaration() { return "";}
| 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;}
...
...
@@ -1853,38 +1866,38 @@ QCString process_declarative_part() :{QCString s,s1;}
void process_statement() : {QCString s,s1,s2;Token *tok=0;}
{
[ s=identifier() <COLON_T> ]
[ <POSTPONED_T> ]
{
currP=VhdlDocGen::PROCESS;
[ <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()
{
s2=process_declarative_part()
{
if (s2.data())
FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2.data(),0);
FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
}
<BEGIN_T>
<BEGIN_T>
process_statement_part()
<END_T> [ <POSTPONED_T> ]
// }catch(...){error_skipto(PROCESS_T);}
<PROCESS_T> [ identifier() ] <SEMI_T>
{
<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();
s1=tok->image.data();
createFunction(currName,VhdlDocGen::PROCESS,s1.data());
createFlow();
currName="";
...
...
@@ -1894,16 +1907,16 @@ void process_statement() : {QCString s,s1,s2;Token *tok=0;}
void process_statement_part() : {}
{
(sequential_statement())*
(sequential_statement())*
}
QCString qualified_expression() : {QCString s,s1;}
{
s1=identifier() <APOSTROPHE_T> {s=s1+"'";}
(
s1=identifier() <APOSTROPHE_T> {s=s1+"'";}
(
LOOKAHEAD(aggregate())
s1=aggregate(){s+=s1;}
| <LPAREN_T> s1=expression() <RPAREN_T>{s+="(";s+=s1;s+=")";}
s1=aggregate(){s+=s1;}
| <LPAREN_T> s1=expression() <RPAREN_T>{s+="(";s+=s1;s+=")";}
)
{return s;}
}
...
...
@@ -1912,7 +1925,7 @@ 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;}
}
...
...
@@ -1921,15 +1934,15 @@ 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()]
(element_declaration())+
// }catch(...){error_skipto(END_T);}
<END_T>
<RECORD_T> [ name()]
}
QCString relation() : {QCString s,s1,s2;}
...
...
@@ -1945,25 +1958,25 @@ QCString relation_operator() : {}
|<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+";";
}
[ 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>
[ s=identifier() <COLON_T> { s+=":";}] <RETURN_T> [ s1=expression() ] <SEMI_T>
{ return s+" return "+s1+";";}
}
...
...
@@ -1982,7 +1995,7 @@ architecture_body()
QCString secondary_unit_declaration() : {QCString s,s1;}
{
s=identifier() <EQU_T> s1=physical_literal() <SEMI_T> { return s+"="+s1; }
s=identifier() <EQU_T> s1=physical_literal() <SEMI_T> { return s+"="+s1; }
}
QCString selected_name() : {QCString s,s1;}
...
...
@@ -2024,47 +2037,47 @@ QCString sequence_of_statement() : {QCString s,s1;}
QCString sequential_statement() :{QCString s;}
{
LOOKAHEAD( [ identifier() ":" ] target() "<=")
s=signal_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=assertion_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=report_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=wait_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
s=signal_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=assertion_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=report_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=wait_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD( [ identifier() ":" ] target() ":=" )
s=variable_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
s=variable_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
|
LOOKAHEAD(3)
s=procedure_call_statement(){ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s; }
|
LOOKAHEAD(3)
if_statement(){return s;}
|
LOOKAHEAD(3)
case_statement(){return s;}
|
LOOKAHEAD(3)
loop_statement(){return s;}
|
LOOKAHEAD(3)
s=next_statement() {return s;}
|
LOOKAHEAD(3)
s=exit_statement(){return s;}
|
s=procedure_call_statement(){ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s; }
|
LOOKAHEAD(3)
if_statement(){return s;}
|
LOOKAHEAD(3)
case_statement(){return s;}
|
LOOKAHEAD(3)
loop_statement(){return s;}
|
LOOKAHEAD(3)
s=next_statement() {return s;}
|
LOOKAHEAD(3)
s=return_statement(){FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);return s;}
|
s=null_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
s=exit_statement(){return s;}
|
LOOKAHEAD(3)
s=return_statement(){FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);return s;}
|
s=null_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
}
QCString shift_expression() : {QCString s,s1,s2;}
{
s=simple_expression() [ s1=shift_operator() s2=simple_expression() ] { return s+s1+s2;}
s=simple_expression() [ s1=shift_operator() s2=simple_expression() ] { return s+s1+s2;}
}
QCString shift_operator() : {}
{
...
...
@@ -2087,14 +2100,14 @@ 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>
[LOOKAHEAD(2) s=identifier() <COLON_T> {s+=":";} ]
s1=target() <LESSTHAN_T>
[ s2=delay_mechanism() ]
s3=waveform() <SEMI_T>
{
return s+s1+"<="+s2+s3+";";
}
...
...
@@ -2103,38 +2116,38 @@ s3=waveform() <SEMI_T>
void semi() : {}
{
<SEMI_T>
<SEMI_T>
}
void signal_declaration() : { Token* tok=0;QCString s,s1,s2,s3,s4;}
{
<SIGNAL_T> s=identifier_list() <COLON_T> s1=subtype_indication() [ s2=signal_kind() ] [ tok=<VARASSIGN_T> s3=expression() ] <SEMI_T>
<SIGNAL_T> s=identifier_list() <COLON_T> s1=subtype_indication() [ s2=signal_kind() ] [ tok=<VARASSIGN_T> s3=expression() ] <SEMI_T>
{
if(tok)
s3.prepend(":=");
s4=s1+s2+s3;
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SIGNAL,0,s4.data(),Public);
if(tok)
s3.prepend(":=");
s4=s1+s2+s3;
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SIGNAL,0,s4.data(),Public);
}
}
QCString signal_kind() : {}
{
<REGISTER_T> { return "register";}
<REGISTER_T> { return "register";}
| <BUS_T> { return "bus";}
}
QCString signal_list() : {QCString s,s1;}
{
s=name() (<COMMA_T> s1=name() { s+=",";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; })* ]
<LBRACKET_T>
[ s=name() (<COMMA_T> s1=name() {s+=",";s+=s1; })* ]
[ <RETURN_T> s1=name() {s+="return ";s+=s1;}]
<RBRACKET_T>
<RBRACKET_T>
{ s1="["+s+"]";return s1;}
}
...
...
@@ -2153,14 +2166,14 @@ QCString slice_name() : {QCString s,s1;}
s=identifier() <LPAREN_T> s1=discrete_range() <RPAREN_T> {return s+"("+s1+")";}
}
QCString string_literal() : {Token *tok;}
QCString string_literal() : {Token *tok
=0
;}
{
tok=<STRINGLITERAL> {return tok->image.c_str();}
}
void subprogram_body() : {QCString s;}
{
//subprogram_specification()
//subprogram_specification()
<IS_T>
//try{
s=subprogram_declarative_part()
...
...
@@ -2170,14 +2183,14 @@ tok=<STRINGLITERAL> {return tok->image.c_str();}
FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,0);
}
FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
}
// }catch(...){error_skipto(BEGIN_T);}
}
// }catch(...){error_skipto(BEGIN_T);}
<BEGIN_T>
subprogram_statement_part()
<END_T> [ subprogram_kind() ] [ designator() ] <SEMI_T>
<END_T> [ subprogram_kind() ] [ designator() ] <SEMI_T>
{
tempEntry->endBodyLine=getLine(END_T);
createFlow();
createFlow();
currP=0;
}
}
...
...
@@ -2192,7 +2205,7 @@ subprogram_specification()subprogram_1(){currP=0;}
void subprogram_1() : {}
{
subprogram_body()
| <SEMI_T>
}
...
...
@@ -2207,12 +2220,12 @@ subprogram_declaration(){ return "";}
| 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;}
...
...
@@ -2231,33 +2244,33 @@ void subprogram_kind() : {}
void subprogram_specification() : {QCString s;Token *tok=0;Token *t;}
{
<PROCEDURE_T> s=designator()
<PROCEDURE_T> s=designator()
{
currP=VhdlDocGen::PROCEDURE;
createFunction(s.data(),currP,0);
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(); }
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()
[ (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);
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()
<RETURN_T> s=type_mark()
{
tempEntry=current;
current->type=s;
...
...
@@ -2303,7 +2316,7 @@ QCString target() : {QCString s;}
QCString term() : {QCString s,s1,s2;}
{
s=factor() ( LOOKAHEAD(2) s1=multiplying_operation() s2=factor(){s+=s1;s+=s2;} )* { return s;}
s=factor() ( LOOKAHEAD(2) s1=multiplying_operation() s2=factor(){s+=s1;s+=s2;} )* { return s;}
}
QCString timeout_clause() : {QCString s;}
...
...
@@ -2334,7 +2347,7 @@ s=scalar_type_definition(){ return s;}
| s=access_type_definition(){ return s;}
| s=file_type_definition(){ return s;}
|
LOOKAHEAD(2)
LOOKAHEAD(2)
protected_type_body() { return ""; }
| protected_type_declaration() { return ""; }
//}catch(...){error_skipto(SEMI_T); return "";}
...
...
@@ -2358,15 +2371,15 @@ QCString unconstraint_array_definition() : {QCString s,s1,s2,s3;}
QStringList ql1=QStringList::split(",",s,FALSE);
for (uint j=0;j<ql1.count();j++)
{
QStringList ql=QStringList::split(".",ql1[j],FALSE);
QCString it=ql[1].utf8();
QStringList ql=QStringList::split(".",ql1[j],FALSE);
QCString it=ql[1].utf8();
if ( parse_sec==0 && Config_getBool("SHOW_INCLUDE_FILES") )
{
VhdlParser::addVhdlType(it.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);
}
}
s1="use "+s;
return s1;
return s1;
}
}
...
...
@@ -2375,35 +2388,35 @@ 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 ""; }
|
selected_variable_assignment() { return ""; }
}
QCString variable_declaration() : {Token *tok=0;Token *t1=0;QCString s,s1,s2;}
{
[ tok=<SHARED_T> ] <VARIABLE_T> s=identifier_list() <COLON_T> s1=subtype_indication()
[ t1=<VARASSIGN_T> s2=expression() ] <SEMI_T>
[ tok=<SHARED_T> ] <VARIABLE_T> s=identifier_list() <COLON_T> s1=subtype_indication()
[ t1=<VARASSIGN_T> s2=expression() ] <SEMI_T>
{
int spec;
if(t1)
s2.prepend(":=");
QCString val=" variable "+s+":"+s1+s2+";";
QCString it=s1;
if(tok != 0)
{
it.prepend(" shared ");
val.prepend(" shared");
spec=VhdlDocGen::SHAREDVARIABLE;
}
else
spec=VhdlDocGen::SHAREDVARIABLE;
if(t1){
it+=":=";
if(t1)
s2.prepend(":=");
QCString val=" variable "+s+":"+s1+s2+";";
QCString it=s1;
if(tok != 0)
{
it.prepend(" shared ");
val.prepend(" shared");
spec=VhdlDocGen::SHAREDVARIABLE;
}
else
spec=VhdlDocGen::SHAREDVARIABLE;
if(t1){
it+=":=";
it+=s2;
}
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,spec,0,it.data(),Public);
}
addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,spec,0,it.data(),Public);
return val;
}
...
...
@@ -2411,7 +2424,7 @@ QCString variable_declaration() : {Token *tok=0;Token *t1=0;QCString s,s1,s2;}
QCString wait_statement() : {QCString s,s1,s2,s3;Token *t=0;}
{
[ s=identifier() t=<COLON_T> ] <WAIT_T> [ s1=sensitivity_clause() ] [ s2=condition_clause() ] [ s3=timeout_clause() ] <SEMI_T>
[ s=identifier() t=<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+";";
...
...
@@ -2421,16 +2434,16 @@ QCString wait_statement() : {QCString s,s1,s2,s3;Token *t=0;}
QCString waveform() : {QCString s,s1;}
{
s=waveform_element() (LOOKAHEAD(1) <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 ");} ]
s=expression() [ <AFTER_T> s1=expression(){ s1.prepend(" after ");} ]
{ return s+s1;}
//<NULL_T> [ <AFTER_T> expression() ]
//<NULL_T> [ <AFTER_T> expression() ]
}
// -----------------------------------------------------------------
...
...
@@ -2440,60 +2453,60 @@ QCString waveform_element() : {QCString s,s1;}
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 "";}
<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()
{
subprogram_declaration()
| subprogram_body()
| type_declaration()
| subtype_declaration()
| constant_declaration()
| variable_declaration()
| file_declaration()
| alias_declaration()
|
LOOKAHEAD( attribute_declaration())
attribute_declaration()
|
LOOKAHEAD( attribute_declaration())
attribute_declaration()
| attribute_specification()
| use_clause()
| LOOKAHEAD(3)
group_template_declaration()
group_template_declaration()
| group_declaration()
}
void protected_type_body_declarative_part() :{ }
{
( protected_type_body_declarative_item ())*
( protected_type_body_declarative_item ())*
}
QCString protected_type_declaration() : { }
{
<PROTECTED_T>
try{
protected_type_declarative_part()
}catch(...){error_skipto(END_T);}
{
<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()
subprogram_specification()
| attribute_specification()
| use_clause()
}
void protected_type_declarative_part() : {}
{
(protected_type_declarative_item ()<SEMI_T>)*
(protected_type_declarative_item ()<SEMI_T>)*
}
// -----------------------------------------------------------------
...
...
@@ -2501,10 +2514,10 @@ void protected_type_declarative_part() : {}
// -----------------------------------------------------------------
QCString context_ref() : {QCString s;}
{
<CONTEXT_T> s=identifier_list() <SEMI_T>
{
return "context "+s ;
{
<CONTEXT_T> s=identifier_list() <SEMI_T>
{
return "context "+s ;
}
}
...
...
@@ -2518,7 +2531,7 @@ void context_declaration(): {QCString s,s1;}
}
QCString libustcont_stats(): {QCString s;}
{
{
s=use_clause() { return s;}
| s=library_clause() { return s;}
| s=context_ref() { return s;}
...
...
@@ -2528,20 +2541,20 @@ QCString libustcont_stats(): {QCString s;}
{
<PACKAGE_T> s=identifier() <IS_T> <NEW_T> s1=name() s2=signature() [gen_assoc_list()] <SEMI_T>
{
QCString q=" is new "+s1+s2;
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()]
<PACKAGE_T> s=identifier() <IS_T> <NEW_T> s1=name() [gen_assoc_list()]
{
current->name=s;
return "package "+s+" is new "+s1;
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>
...
...
@@ -2549,10 +2562,10 @@ QCString subprogram_instantiation_declaration():{QCString s,s1,s2;}
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>
...
...
@@ -2570,8 +2583,8 @@ void gen_interface_list() : {}
// QCString vo=$3;
parse_sec=0;
}
<RPAREN_T>
}
<RPAREN_T>
}
void case_scheme (): {}
{
...
...
@@ -2589,14 +2602,14 @@ void when_stats() : {}
void ttend(): {}
{
<END_T> [identifier()] <SEMI_T>
}
}
void generate_statement_body() : {}
{
<BEGIN_T> generate_statement_body()
}
void generate_statement_body1() : {}
{
LOOKAHEAD(block_declarative_item()<BEGIN_T> )
...
...
@@ -2610,7 +2623,7 @@ QCString external_name(): {QCString s,s1,s2;}
{
QCString t="<<"+s;
QCString t1=s1+":"+s2+">>";
return s+s1;
return s+s1;
}
}
...
...
@@ -2619,7 +2632,7 @@ 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;}
...
...
@@ -2632,7 +2645,7 @@ QCString external_pathname(): {QCString 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=pathname_element_list() s1=identifier() { return "."+s+s1;}
| <DOT_T> s=identifier (){ return "."+s;}
}
...
...
@@ -2643,24 +2656,24 @@ QCString relative_pathname():{QCString s,s1,s2;}
QCString neg_list(): {QCString s;}
{
(<NEG_T> <DOT_T>{s+="^.";})+ {return s; }
(<NEG_T> <DOT_T>{s+="^.";})+ {return s; }
}
QCString pathname_element ():{QCString s,s1;}
{
s=identifier() [<LPAREN_T> s1=expression() <RPAREN_T>]
s=identifier() [<LPAREN_T> s1=expression() <RPAREN_T>]
{
if(!s1.isEmpty())
return s+"("+s1+")";
return s;
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; }
( 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;}
...
...
@@ -2669,10 +2682,10 @@ QCString package_path_name():{QCString s;}
}
void conditional_signal_assignment_wave(): {}
{
{
LOOKAHEAD(conditional_force_assignment())
conditional_force_assignment()
|conditional_waveform_assignment()
conditional_force_assignment()
|conditional_waveform_assignment()
}
void conditional_waveform_assignment():{}
...
...
@@ -2680,7 +2693,7 @@ 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(): {}
void else_wave_list(): {}
{
<ELSE_T> expression() [ <WHEN_T> expression()]
}
...
...
@@ -2690,15 +2703,15 @@ void conditional_force_assignment(): {}
target() <LESSTHAN_T> <FORCE_T> [inout_stat()] expression() <WHEN_T> [expression() else_stat()] <SEMI_T>
}
void selected_signal_assignment_wave() : {}
void selected_signal_assignment_wave() : {}
{
LOOKAHEAD(selected_force_assignment() )
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() // { $$=""; }
}
...
...
@@ -2707,7 +2720,7 @@ void select_name(): {}
LOOKAHEAD(aggregate())
aggregate()
| name()
}
void selected_waveform_assignment():{}
...
...
@@ -2717,7 +2730,7 @@ void selected_waveform_assignment():{}
}
void selected_force_assignment():{}
{
{
<WITH_T> expression() <SELECT_T> [<Q_T>] target() <LESSTHAN_T> <FORCE_T>
[inout_stat()] sel_var_list()
}
...
...
@@ -2730,23 +2743,23 @@ void sel_var_list(): {}
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>
{
<IN_T>
| <OUT_T>
}
void else_stat(): {}
{
{
(<ELSE_T> expression() [LOOKAHEAD(1) <WHEN_T> expression()])+
}
QCString interface_subprogram_declaration(): {QCString s;}
{
...
...
@@ -2754,32 +2767,32 @@ QCString interface_subprogram_declaration(): {QCString s;}
| s=ifunc() { return s; }
}
QCString iproc(): {QCString s,s1;}
QCString iproc(): {QCString s,s1;}
{
<PROCEDURE_T> s=identifier() s1=param()
{
current->name=s;
return "procedure "+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();
{
QCString q;
if(t) q=t->image.data();
if(t2) s3="<>";
if (!s3.isEmpty())
if (!s3.isEmpty())
{
s3.prepend(" is ");
}
current->name=s;
if (parse_sec==GEN_SEC)
if (parse_sec==GEN_SEC)
{
QCString ss=q+" function "+s1+" return "+s2+s3;
int a=getLine(FUNCTION_T);
QCString ss=q+" function "+s1+" return "+s2+s3;
int a=getLine(FUNCTION_T);
int b=getLine(PROCEDURE_T);
if (a>b) b=a;
...
...
@@ -2787,25 +2800,25 @@ QCString ifunc():{QCString s,s1,s2,s3;Token *t=0;Token *t1=0;Token *t2=0;}
}
currP=0;return "";
}
}
QCString param(): {QCString s,s1;Token *tok=0;}
{
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+")";
}
{
if(tok)
{
s = tok->image.data();
param_sec=0;
}
return s+"("+s1+")";
}
}
// -----------------------------------------------------------------
// needed for inline (function/process/procedure) parsing
...
...
vhdlparser/vhdlparser.patch
deleted
100644 → 0
View file @
e5076edf
--- 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"
vhdlparser/vhdlstring.h
View file @
475b0c51
...
...
@@ -90,7 +90,8 @@ class VhdlString
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
);
}
VhdlString
&
operator
+=
(
char
c
)
{
char
s
[
2
];
s
[
0
]
=
c
;
s
[
1
]
=
0
;
return
append
(
s
);
}
VhdlString
&
operator
+=
(
const
char
*
s
)
{
return
append
(
s
);
}
private
:
void
init
()
{
m_str
=
(
char
*
)
calloc
(
1
,
1
);
m_len
=
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment