Menu

[r3]: / cmp / Cct / CctIndex.tcl  Maximize  Restore  History

Download this file

138 lines (121 with data), 3.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
##
## Cct - ::CctIndex
##
## (C) IPN - Ingenieurbuero fuer Praezisionsnumerik
##
## Dipl.-Ing. Andreas Otto
## Ulmenstrasse 3
## D-34289 Zierenberg
## mailto:aotto@t-online.de
## http://tclcompiler.sourceforge.net
##
## Alle Rechte vorbehalten
##
namespace eval ::CctIndex {}
proc ::CctIndex::Cfg {} {
return [ list 0 {create all kinds of indexes} ]
}
if {[ info exists COMPILER_CCT_CFG ]} return
PkgProvide CctIndex
package require Cct
proc ::CctIndex::ErrorN { args } {
::StdLib::ErrorN {INDEX ERROR} $args
}
##
## -------------------------------------------------------
## Index
##
namespace eval ::CctIndex::Args {
variable ARGS_DEFAULT {-p 0 -t 0 -c 0 -i 0 --sys {NOT SET} --cmp 0 --dir .}
variable VALUE
variable ARGS
array set ARGS {
--dir {SetArg CctIndex --dir}
--cmp {SetFlag CctIndex --cmp}
--sys {SetArg CctIndex --sys}
-p {SetFlag CctIndex -p}
-t {SetFlag CctIndex -t}
-c {SetFlag CctIndex -c}
-i {SetFlag CctIndex -i}
-h ::CctIndex::Args::Help
--help ::CctIndex::Args::Help
}
namespace import ::Args::*
}
proc ::CctIndex::Args::Help {} {
variable VALUE
EnvRead CctIndex
::StdLib::StdErr "\nusage: cct index \[user-option ...\] \[--\] args"
::StdLib::StdErr ""
::StdLib::StdErr " user-options :\n"
Print-Flag CctIndex -p "create \"pkgIndex.tcl\""
Print-Flag CctIndex -t "create \"tclIndex\" and \"tags\""
Print-Flag CctIndex -c "create \"cct.cfg\" file"
Print-Flag CctIndex -i "create \"cgi.cfg\" file"
Print-Opt CctIndex --sys BOOL "create/delete \"SysIndex\" file"
Print-Opt CctIndex --dir DIR "directory to create index"
Print-Flag CctIndex --cmp "use COMPILER_ARCH/lib/pkg"
Print-Opt CctIndex --args LIST "index arguments"
Print-Cmd %MASTER% Default
::StdLib::StdErr ""
exit 1
}
proc ::CctIndex::Args::Main {} {
set FLAG 1
while {1} {
set Val [ GetArg ]
if {[ string equal $Val %%NO%% ]} break
if {[ string equal $Val -- ]} { set FLAG 0 ; continue }
if {$FLAG && [ IsOpt CctIndex $Val ]} {
Test-Opt CctIndex $Val
Invoke CctIndex $Val
} else {
AppendVal CctIndex --args $Val
}
}
EnvRead CctIndex
}
##
## -------------------------------------------------------
##
proc ::CctIndex::Main {} {
upvar 0 Args::VALUE VALUE
package require IIndex
if {$VALUE(-p)} {
if {[ info exists VALUE(--args) ]} {
set ARGS $VALUE(--args)
} else {
set ARGS [ list *[info sharedlibextension] *.tcl ]
}
if { $VALUE(--cmp) } {
::IIndex::Pkg [ ::Env::Arch lib pkg ] $ARGS
} else {
::IIndex::Pkg $VALUE(--dir) $ARGS
}
}
if {$VALUE(-t)} {
if {[ info exists VALUE(--args) ]} {
set ARGS $VALUE(--args)
} else {
set ARGS *.tcl
}
::IIndex::Tcl $VALUE(--dir) $ARGS
}
if {$VALUE(-c)} {
if { $VALUE(--cmp) } {
::IIndex::Cct [ ::Env::Arch lib pkg ]
} else {
::IIndex::Cct $VALUE(--dir)
}
}
if {$VALUE(-i)} {
if { $VALUE(--cmp) } {
::IIndex::Cgi [ ::Env::Arch lib pkg ]
} else {
::IIndex::Cgi $VALUE(--dir)
}
}
if {$VALUE(--sys) != {NOT SET}} {
::IIndex::Sys [ string is true $VALUE(--sys) ]
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.