home *** CD-ROM | disk | FTP | other *** search
- ###########################################################################
- ##
- ## 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 ada_util.tcl
- require ada_const.tcl
-
- global comment_srtring; set comment_string(ada83) "--"
-
- require ada_config.tcl
- require ada_class.tcl
- require ada_funcs.tcl
- require ada_disp.tcl
- require ada_regen.tcl
-
- proc generate_ada {} {
- puts stdout ""
- if {$g_generate_separates} {
- puts stdout "Subunit file generation is enabled."
- }
- if {$g_poly} {
- puts stdout "Polymorphic file generation is enabled.\n"
- }
- find_ada_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_ada 0
- # set gen_file(${system}_Types.$ada_spec_type) 1
- foreach file $tgt_objs {
- set gen_file($file) 1
- set type [nt_get_type $file]
-
- if {"$type" == "$ada_body_type" ||
- "$type" == "$ada_spec_type" ||
- "$type" == "$ada_sep_type" } {
- set do_ada 1
- }
- }
- if $do_ada {
- generate [get_oopl_model $oomodel]
- }
- }
- }
-
- # Search for user defined Tcl files and "source" them. Tcl files are sourced
- # in the following order:
- # - u_genada.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_genada.tcl]}]} {
- source_tcl_file $user_file
- }
-
- source_files_in_tcl_sys
- source_all_tcl_files
-
- generate_ada
-