Artifact [f7acdd7bce]
Not logged in

Artifact f7acdd7bce75011bb6502b638ca78d67d4c1500b:


#!/usr/local/bin/tclsh
# FILE: aux/tcltags
# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

set tags [open "tags" a+]
#set tags stdout
#_BoxHandle Z_Box.c /^int _BoxHandle (Box *boxPtr, Tcl_Interp *interp, int argc, char **argv)$/;"   f

foreach file "$argv" {

    if {[file exists $file]} {

        set source [open $file r]
        if {$source == 0} {
            continue
        }

        while {"[gets $source line]" != -1} {
            if [regexp \
                "^\(proc|class|body|configbody\)\[ \t\]*\(\[^ \t\]*\)\[ \t\]"\
                "$line" all junk proc] {

                set tail [namespace tail $proc]
                puts $tags "$proc\t$file\t/^$line$/;\"\tf"
                puts $tags "$tail\t$file\t/^$line$/;\"\tf"
            }
        }

        close $source

    }

}

close $tags