home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
ada95_util.tcl
< prev
next >
Wrap
Text File
|
1997-03-24
|
3KB
|
115 lines
###########################################################################
##
## Copyright (c) 1996 by Cadre Technologies 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.
##
###########################################################################
proc find_ada95_file_types {} {
global ada95_spec_type
global ada95_body_type
global ada95_sep_type
set ada95_spec_type "ada_spec"
set ada95_body_type "ada_body"
set ada95_sep_type "ada_subunit"
}
proc ada95_echo {s} {
# puts stdout $s
}
proc echo {s} {
# puts stdout $s
}
proc add_incl_stmnt {type sect} {
global link_incl_list
if {[lsearch $link_incl_list $type] == -1} {
section append $sect "with ${type};\n"
lappend link_incl_list $type
}
}
proc add_incl_stmnt_force {type sect} {
#HM Added this procedure to force withs for association classes
section append $sect "with ${type};\n"
}
#
# Return a class name in child syntax
#
proc get_full_class_name {class} {
set res_class_name [get_name $class]
set syntax [get_child_syntax $class]
if {$syntax == "" || $syntax == "True"} {
set cur_class $class
set cur_parents [get_super_classes $cur_class]
while { ! [lempty $cur_parents]} {
set cur_parent [get_super_class [lindex $cur_parents 0]]
set new_name [get_name $cur_parent]
append new_name "."
append new_name $res_class_name
set res_class_name $new_name
set cur_class $cur_parent
set cur_parents [get_super_classes $cur_class]
}
# if {[get_controlled_type $cur_class] == "Controlled" ||
# [get_controlled_type $cur_class] == "Limited Controlled"} {
# set new_name "Ada.Finalization."
# append new_name $res_class_name
# set res_class_name $new_name
# }
}
return $res_class_name
}
proc get_ada95_super_classes {class} {
set supers [get_super_classes $class]
if { ! [lempty $supers]} {
return $supers
}
if {[get_controlled_type $class] == "Controlled" ||
[get_controlled_type $class] == "Limited Controlled"} {
return "Ada.Finalization"
}
return ""
}
proc get_g_handle_name {type_name} {
global cur_model
set p_class [ $cur_model classByName $type_name ]
if {$p_class == ""} {
set ind [string last "." $type_name]
if { $ind == 0 } {
return $g_handle_name
}
incr ind
set new_name [string range $type_name $ind end]
set p_class [ $cur_model classByName $new_name ]
if {$p_class == ""} {
return $g_handle_name
}
}
if {[get_sub_classes $p_class] != ""} {
return Class_$g_handle_name
}
return $g_handle_name
}
proc incr_component_count {} {
global g_component_count
incr g_component_count 1
}