[antlr-interest] Re: Syntatic predicates...

Tom Verbeure hombre at gmail.com
Wed May 19 13:34:05 PDT 2004


Hi Rick,

in the past, I have actually used the Twente grammar to convert VHDL
files into a generated Perl-program that builds a limited AST. (I
hadn't seen the Python light by then.) My AST didn't cover the full
language though.

My reasons to do it with Antlr this time are:
- automatich AST building. This should be a huge time saver.
- much better recovery from syntax errors. The yacc way of doing this
is too painful...
- tree transformation.
- direct support of C++. 
- readability of the generated parser source code. At least it's a bit
easier to debug your stuff...
- it's a nice exercise. :-)

There were previous efforts for this and I'm mainly just cleaning them
into how I like it to be. I'm using the following projects as
baseline:
- savant has a version, but I think it's based on PCCTS. In addition,
it uses FLEX as lexer.
- There is a French project that created a grammer for ANTLR. It's
called bhdl... However, it also adds analog VHDL extensions and there
are quite a lot of syntactic ambiguity warnings in there.

Like I said before, I don't really mind those warnings as long as I
understand that they are harmless...

My current status is that I have a grammar without ANTLR warnings. To
get there, however, I simply removed a number of features from the
language. Yes, you can call this cheating. :-)

However, in real life, there are a number of features that are never
every practically used. In addition, my goal is mainly to process
synthesizable VHDL code (for the non-initiated: this is code that can
be compiled straight into electronic gates). Here the subset is even
smaller. I may look later at how to add the removed features back into
the grammar, but this isn't a high priority to be honest.

Tom


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list