[antlr-interest] Literals, Predicates and Actions

Julian Mensch jmensch at shaw.ca
Fri Mar 6 13:13:07 PST 2009


> Just for curiosity: why are you migration away from Accent? 
> Didn't the 
> disambiguation features work out as expected? Are there bugs 
> that are 
> not resolved for years? Or do you just need a special ANTLR feature?

  There's a number of issues I had with ACCENT. It was a really
nice piece of software, but it's slow, isn't maintained and I had to
hack it in order to get it to generate code that would compile in
C++. The deal-breaker was that I wanted reasonable error
reporting and recovery, and ACCENT blankly just doesn't do that
as far as I can tell. ACCENT also generates slower parsers, does
not have an active mailing list and hasn't changed much in the
last 8+ years -- and I can't use changes since I had to hack it to
get C++-compatible code.

  I have a script language welded on to a very old, public domain
hacked C preprocessor (DECUS CPP), and it was impossible to
maintain. There's a depth of examples for ANTLR and very few
for ACCENT, and there's that Youngki Ku preprocessor code that,
while it doesn't work in ANTLR 3, still shows me that it might not
be hard to recode the preprocessor subset that I need. Then I have
everything under one tool in active widespread use, which is an
obvious maintenance benefit. Between the Youngki Ku code and 
the C++ target, whether to use ANTLR 3.1.1 or 2.7.2 was by no 
means a trivial choice for me. Finally I chose to go with what seems
to be the most supported.

  I was really taken in with the elegance of ANTLR code when
looking at the Java examples. The C stuff tends to be a little
uglier in practice, with all the macros and structs-as-classes
and lack of exceptions, but it's still more readable than ACCENT 
was getting. I also thought the literals thing might be a big time-
saver, but I guess it turns out it's not since I can't apply it to my 
project.

-- Julian Mensch


More information about the antlr-interest mailing list