#!/bin/sh # -*- tcl -*- \ exec tclsh "$0" ${1+"$@"} # Check instrumentation for possible problems foreach {in} $argv break set if [open $in r] #set of [open $out w] set no 0 set chkreturn 0 set chkctrl 0 while {![eof $if]} { gets $if line if {[eof $if]} { break } incr no if {$chkreturn} { if { ![regexp "^\[ \t\]*return" $line] && [regexp "\[ \t\]*return" $line] } { puts "${in}: $no : Illegal insertion of TCL_STACK_POP" } } set chkreturn 0 if {[regexp {TCL_STACK_POP} $line]} { set chkreturn 1 if {$chkctrl} { puts "${in}: $no : TCL_STACK_POP in unbraced control structure" } } set chkctrl 0 if { ([regexp "if\[ \t\]*\\(.*\\)" $line] || [regexp "while\[ \t\]*\\(.*\\)" $line] || [regexp "for\[ \t\]*\\(.*\\)" $line]) && ![regexp "\\).*\{" $line] } { set chkctrl 1 } } close $if exit