[Lxr-dev] VHDL support and other stuff
Brought to you by:
ajlittoz
From: Robin T. <Rob...@te...> - 2001-11-01 11:20:07
|
Hi there, I'm hacking VHDL support into lxr and have come across a few things I'd like to comment on. I have it fully working now but based on the 0.8 release (I'm firewalled so CVS access in N/A). I'm relying on an external parser (lex&yecc based skeleton I ripped from the net) because VHDL is a pain to parse. The main changes are kept in LXR::Lang::VHDL. A few other changes are necessary though. 1) The %type_names in Common.pm are hashed from chars. With VHDL I have about 20 new types and letter allocation is getting ugly. Is there another way of doing this. I could think of using numbers and an array instead. The db overhead is minimal and the type is referenced few places. I could produce a patch but I'm not dealing with C or C++ files, so I cannot offer to fully test the (e)ctags implementation. I'm also thinking about making this language dependent. Something like major.minor numbers in UNIX devices. Major is the language and minor is the local specific set. 2) The find and search is using $config->sourceroot to remove leading path so it fits to source. However, glimpse has a nasty way of expanding symlinks so the glimpse path and the sourceroot is not the same. I have something like this in mind (hand edited diff against 0.8 ;-): --- ../../lxrsrc/lxr/find Tue Oct 16 22:38:37 2001 +++ find Wed Oct 31 17:17:21 2001 @@ -58,11 +58,11 @@ return; } print("<hr>\n"); + $glimpseroot = $config->glimpseroot; - $sourceroot = $config->sourceroot; while($file = <FILELLISTING>) { + $file =~ s/^$glimpseroot//; - $file =~ s/^$sourceroot//; if($file =~ /$searchtext/) { print(&fileref("$file", "find-file", "/$file"),"<br>\n"); The same applies for search... Is that acceptable to include? 3) Just wondering. How could we go about dealing with an external C based parser. Including it in the project would increase the noise (and portability). Rewriting it into perl would be nice but quite a pain because VHDL is context sensitive and generally stateful (and I like lex and yacc for doing this). Right now it might make sense to keep VHDL out from the releases and offer a language addon. BTW, thanks for all this great work in lxr. Regards. Robin. -- ASIC Design Engineer Tellabs Denmark A/S Direct: +45 4473 2942 rob...@te... |