home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
genada95.tcl
< prev
next >
Wrap
Text File
|
1997-10-20
|
3KB
|
105 lines
###########################################################################
##
## Copyright (c) 1996 by Cadre Technologies Inc.
## and Scientific Toolworks Inc.
##
## This software is furnished under a license and may be used only in
## accordance with the terms of such license and with the inclusion of
## the above copyright notice. This software or any other copies thereof
## may not be provided or otherwise made available to any other person.
## No title to and ownership of the software is hereby transferred.
##
## The information in this software is subject to change without notice
## and should not be construed as a commitment by Cadre Technologies Inc.
## or Scientific Toolworks Inc.
##
###########################################################################
require wmt_util.tcl
require ada95_util.tcl
require ada95_const.tcl
global comment_string; set comment_string(ada95) "--"
require ada95_config.tcl
require ada95_class.tcl
require ada95_funcs.tcl
require ada95_disp.tcl
require ada95_regen.tcl
proc generate_ada95 {} {
puts stdout ""
if {$g_generate_separates} {
puts stdout "Subunit file generation is enabled."
}
find_ada95_file_types
set system [cap [m4_var get M4_system]]
set tgt_objs [get_tgt_objs]
if [lempty $tgt_objs] {
# import new
generate [get_oopl_model $oomodel]
} else {
# import selected
global gen_file
set do_ada95 0
# set gen_file(${system}_Types.$ada95_spec_type) 1
foreach file $tgt_objs {
set gen_file($file) 1
set type [nt_get_type $file]
if {"$type" == "$ada95_body_type" ||
"$type" == "$ada95_spec_type" ||
"$type" == "$ada95_sep_type" } {
set do_ada95 1
}
}
if $do_ada95 {
generate [get_oopl_model $oomodel]
}
}
}
# Search for user defined Tcl files and "source" them. Tcl files are sourced
# in the following order:
# - u_genada95.tcl; EITHER in m4_home/tcl OR in <project_dir>/tcl
# - all tcl files in the system named "Tcl"
# - all tcl files in the current system
# "Source" a tcl file
#
proc source_tcl_file {file} {
if [catch {source $file}] {
m4_error $E_USER_TCL $file
puts stderr $errorInfo
}
}
# "Source" all tcl files in the current system
#
proc source_all_tcl_files {} {
foreach file [fstorage::dir tcl] {
source_tcl_file [fstorage::get_uenv_path $file absolute]
}
}
# "Source" all tcl files in the system named "Tcl"
#
proc source_files_in_tcl_sys {} {
set current_system [m4_var get M4_system]
if [catch {fstorage::goto_system Tcl}] {
return
}
source_all_tcl_files
fstorage::goto_system $current_system
}
if {![catch { set user_file [m4_path_name tcl u_genada95.tcl]}]} {
source_tcl_file $user_file
}
source_files_in_tcl_sys
source_all_tcl_files
generate_ada95