File: ts_tree.tcl

package info (click to toggle)
ts 9802-1
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 2,348 kB
  • ctags: 1,468
  • sloc: tcl: 4,567; ansic: 3,389; makefile: 88; sh: 1
file content (23 lines) | stat: -rw-r--r-- 483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ts_tree.tcl
# Analysis of document tree

set params(treelist) {"\\include" "\\input"}
proc tree_analyse {file} {
  global params

  set fd [open $file r]
  puts $fd
  while {![eof $fd]} {
    gets $fd s
    puts $s
    foreach key $params(treelist) {
      while {[set i [string first $key $s]] != -1} {
        set i [expr $i + [string length $key]]
        set s [string range $s $i end]
	regexp {^[\{ ]([^\}\\ ]*)} $s dummy file
	puts "|$file|"
      }
    }
  } 
  close $fd
}