Version 2 of Exuberant Ctags

Updated 2004-02-16 15:31:32

What: Exuberant Ctags Where: http://ctags.sf.net/

 Description: Multi-language reimplementation of the Unix ctags program.
        Generates an index of source code object definitions which is used
        by many editors and tools to look up definitions.  Currently supports
        Assembler, AWK, BETA, Bourne Shell, C, C++, COBOL, Eiffel, FORTRAN,
        Java, LISP, Perl, Python, Scheme, Tcl, Vim, YACC.
        Currently at version 5.5 .
 Updated: 11/2000
 Contact: See SF.net page for details.

AM A very simple-minded solution for just Tcl files in one directory is this:

 # Doodle to determine "tags" file
 #
 proc writeAllTags {tagfile sourcefile} {
    set infile [open $sourcefile]

    while { [gets $infile line] >= 0 } {
       if { [regexp {proc\s(\S+)} $line fullpatt fullname] } {
          regexp {[^:]+$} $fullname name
          puts $tagfile "$name\t$sourcefile\t/$fullpatt/"
       }
    }

    close $infile
 }

 set tagfile [open "tagstmp" "w"]
 foreach f [glob -nocomplain "*.tcl"] {
    puts $f
    writeAllTags $tagfile $f
 }

Then, on the command prompt, do:

   % sort tagstmp >tags

(For reasons I have not sorted out yet, "exec sort tagstmp > tags" does not work - at least on my system!) (PBO: missing a "close $tagfile" before the "exec sort ..." ?)


Category Application