Article View: comp.lang.vhdl
Article #482Re: ctags for VHDL??
From: Todd Carpenter
Date: Mon, 17 Oct 1994 12:44
Date: Mon, 17 Oct 1994 12:44
108 lines
4953 bytes
4953 bytes
<from gnu.emacs.help>
PH> I wonder if there is anyone who has adapdet ctags/etags for VHDL.
No, but I wrote a trivial PERL script. RMS, I *really* hope posting
this here isn't against all etiquette, since I'm unable at this point to
put a full GNU copyleft on it. Sorry if this is a problem.
From my original internal release announcement:
Lack of VHDL tags support was driving me insane (ok, so it was more like
a short walk for me...). So, this morning I wrote a perl script to
generate a TAGS table. To make the table, type something like:
% vtags *.vhdl
To use the tables within GNU Emacs, heh, it's cool. Type M-. when
you're on the function, entity, type, etc., that you want to find.
EMACS will prompt you for an item for which to search, the default being
that to which you're pointing. Hit return, and *whoof*, the appropriate
file is opened, and you're pointing at that item. Of course, there's
some problems with overloading, scoping, etc, so it still needs some
work. But it's a start.
-Todd P. Carpenter
Honeywell Technology Center 3660 Technology Drive, Minneapolis, MN 55418-1006
US-612-951-7229(w) 951-7438(f) 698-1934(h) carpenter_todd@htc.honeywell.com
User Manual, p34, line 5: This carbon unit not authorized to possess opinions
#!/usr/local/bin/perl
#------------------------------------------------------------------------------
#-- copyright 1994
#-- Honeywell Technology Center
#-- All Rights Reserved, except as noted:
#--
#-- This code is freely distributable, as long as the copyright notice
#-- remains intact, and code changes are marked.
#--
#-- File name : vtags
#-- Title : VHDL Tags generator.
#--
#-- Purpose : Generate TAGS file for GNU Emacs.
#--
#-- Usage : vtags [-h] [-o <TAGSFILE>] files
#--
#-- Example : % vtags *.vhdl
#--
#-- Maint : vhdl-mode@src.honeywell.com
#--
#------------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# parse the input switches if any
$OutFile = ">TAGS";
while ($_ = $ARGV[0], /^-/) {
shift;
last if /^--$/;
/^-o/ && do {
$OutFile = ">" .$ARGV[0];
shift;
};
# print out header for help
/^-h.*/ && do { $MyName = $0;
open MyName;
while (<MyName>)
{ print if s/^#-- //; };
exit;
};
};
@VHDLTags =
(
"ARCHITECTURE",
"ATTRIBUTE",
"CONFIGURATION",
# "CONSTANT", # might want these back
"ENTITY",
"FUNCTION",
# "GENERIC", # Whoa, these are ugly with the maps.
"PACKAGE",
"PROCEDURE",
"PROCESS",
# "SIGNAL", # just too many
"SUBTYPE",
"TYPE",
# "VARIABLE",# too many
);
# -----------------------------------------------------------------------------
# reset the output to the final file, and print the file to it.
open OutFile || die "Can't open tagsfile $OutFile: $!\n";
select(OutFile);
# -----------------------------------------------------------------------------
# build tags table.
while (<>) {
if ($. == 1) {print "\n" .$ARGV .",0\n"; $charpos = 0};
if (eof) {close (ARGV);};
foreach $VHDLTag (@VHDLTags) {
if (/^( *$VHDLTag +[^ (:]*)/)
{print $1 ."" .$. .",$charpos\n";}
}
$charpos += length;
}
# -----------------------------------------------------------------------------
Technical Details
Message-ID:
<9410171244.AA22624@marduk.src.honeywell.com>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!usc!howland.reston.ans.net!spool.mu.edu!uwm.edu!src.honeywell.com!recnews-2.3References:
<37lthr$12j@luxor.mch.sni.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089ad,59ac54ad2707d9ef,start X-Google-Attributes: gid1089ad,public X-Google-Thread: 107729,59ac54ad2707d9ef,start X-Google-Attributes: gid107729,public X-Google-ArrivalTime: 1994-10-19 02:34:07 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!usc!howland.reston.ans.net!spool.mu.edu!uwm.edu!src.honeywell.com!recnews-2.3 From: carpent@src.honeywell.com (Todd Carpenter) Newsgroups: comp.lang.vhdl,gnu.emacs.sources Subject: Re: ctags for VHDL?? Date: 17 Oct 1994 07:44:28 -0500 Organization: mailEnteringNews @ Honeywell Technology Center Lines: 109 Sender: daemon@src.honeywell.com Message-ID: <9410171244.AA22624@marduk.src.honeywell.com> References: <37lthr$12j@luxor.mch.sni.de> NNTP-Posting-Host: moon.src.honeywell.com X-Received: from marduk.src.honeywell.com by src.honeywell.com (4.1/smail2.6.3/SRCv0.25); Mon, 17 Oct 94 07:44:22 CDT id AA24726 for gnu.emacs.sources at Posted-Date: Mon, 17 Oct 94 07:44:20 CDT Received-Date: Mon, 17 Oct 94 07:44:22 CDT X-Received: by marduk.src.honeywell.com (4.1/SMI-3.2) id AA22624; Mon, 17 Oct 94 07:44:20 CDT In-Reply-To: hober@lipp.mch.sni.de's message of 14 Oct 1994 12:28:43 GMT X-To: gnu.emacs.sources, comp.lang.vhdl, carpent@src.honeywell.com