jalilweb.com

You are here: Home
  • Decrease font size
  • Default font size
  • Increase font size
Parsing VHDL Print E-mail
Written by Jalil   
Wednesday, 28 November 2007

Two months into my PhD now, and I already have an idea of what needs to be done to achieve the ultimate goal! (Not the real goal though)

As part of the system I am creating, I need to create a VHDL parser! This is no trivial task. Simply because everything I read in the internet and in a couple of papers agrees that the VHDL standard BNF specification is an ambigious grammar.

This means that using a parser generator tool like Bison(YACC) is not the safest option. Since Bison resolves reduce/reduce conflicts by choosing to use the rule that appears first in the grammar, it is very risky to rely on this. "According to the Bison manual"

The only way such a parser generator can be usefull is by changing the standard BNF specification in order to eliminate those conflicts. I found a VHDL BNF grammar for YACC that was modified and only produces 3 shift/reduce and 3 reduce/reduce conflicts. This is nice, but I really need to go through the changes one by one trying to spot any unwanted mistakes.

The other way, is to create a parser from scratch. Maybe reuse some parts of the bison generated source code to reduce the time it will take to create a fresh parser.

For the time being.. I have no conclusion to write in this post ! 

Comments (2)Add comments
Djihed Afifi wrote on April 04, 2008
Title: Avoiding conflicts
Salam Jalila,


This may be late and you may have definitely gone past this now.

But, to eliminate these conflicts you either have to resolve left recursion (if you have that), or use lookaheads where your grammar is not recursive.

Inevitably, you will end up with a problem that you just have to resolve using semantic checks, i.e past your lexer.
report abuse
vote down
vote up
website
Votes: +0
Hamza A Rouabah wrote on March 28, 2008
Title: Mr
Salam Jalil,
Your PhD project seems very intresting to me, but I'm no longer using VHDL smilies/sad.gif . wish if I can help. I like your website, cool videos in particular the Talking Parrot's one. Anyway Keep up the good work and wish you good luck with the rest of your PHD .
report abuse
vote down
vote up

Votes: +0

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

busy
Last Updated ( Thursday, 03 April 2008 )
 
< Prev   Next >