[antlr-interest] Problem compiling VHDL-AMS grammar file

Robert E Farrell bfarrell at raytheon.com
Tue Apr 10 10:07:44 PDT 2007


I am a newbie to ANTLR having installed 2.7.7 yesterday. I was trying to
run the VHDL-AMS example grammar posted on the ANTLR web site and get the
following: (command line and result with paths shorted for readability.)

[72]%  /home/farrell/ANTLR/antlr-2.7.7_build/scripts/antlr.sh
/home/farrell/ANTLR/VHDL_AMS/vams.g

/apps/local/as/bin/java -classpath /home/farrell/ANTLR/antlr-2.7.7
_build/antlr/antlr.jar antlr.Tool /home/farrell/ANTLR/VHDL_AMS/vams.g
ANTLR Parser Generator   Version 2.7.7 (20070409)   1989-2005
error: Token stream error reading grammar(s):
/home/farrell/ANTLR/VHDL_AMS/vams.g:26:14: expecting '*', found 'a'
TokenStreamException: expecting '*', found 'a'


This is was compiled on a Solaris machine. The vams.g file at line 26 is in
the middle of a big comment so I didn't know what it might be looking at.

Background: Trying to update a program that reads VHDL files and pulls out
some information about each one. The current program uses flex/bison with
an elaborate scheme to skip over things that it thinks are "uninteresting"
for the task at hand. Since it has a number of problems not the least of
which is that it can only read a severe subset of VHDL I thought to update
to a more complete VHDL reader even though much of the information is
thrown away. Since the language is inherently ambiguous, LALR(1) parsers,
although I understand them, would take a lot of work to be useable.

I started investigating using a LL(1) or recursive descent parser and
thought that this is going to be easier to work. I tried Coco but was left
with a huge pile of conflicts which I was willing to momentarily ignore
except the generated C++ code would not compile. (It had case statements
where each statement was labeled with the same huge list of cases.)

I then switched to trying Antlr. I got really excited over the fact there
was a VHDL-AMS grammar posted. But now this problem.

Thanks for any help.

Bob Farrell



More information about the antlr-interest mailing list