home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / chk_funcs.tcl < prev    next >
Text File  |  1996-06-05  |  5KB  |  196 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. # Copyright (c) 1994-1995 by Cadre Technologies Inc.
  4. #
  5. # This software is furnished under a license and may be used only in
  6. # accordance with the terms of such license and with the inclusion of
  7. # the above copyright notice. This software or any other copies thereof
  8. # may not be provided or otherwise made available to any other person.
  9. # No title to and ownership of the software is hereby transferred.
  10. #
  11. # The information in this software is subject to change without notice
  12. # and should not be construed as a commitment by Cadre Technologies Inc.
  13. #
  14. #---------------------------------------------------------------------------
  15. #
  16. #       File            : @(#)chk_funcs.tcl    2.1
  17. #       Author          : edri
  18. #       Original date   : 11-10-94
  19. #       Description     : Functions for "check"
  20. #
  21. #---------------------------------------------------------------------------
  22. #
  23.  
  24. proc oopl_model::check {model {diagram ""}} {
  25.     foreach class [getSelectedOoplClasses $model] {
  26.         if {[$class isSynthetic] != "1"} {
  27.         if [$class isExternal] {
  28.         puts stdout "\nClass '[$class getName]'\
  29.                  is external, not checked."
  30.         continue
  31.         }
  32.         check $class $diagram
  33.         }
  34.     }
  35.  
  36.     foreach subject [getSelectedOoplSubjects $model $diagram] {
  37.         m4_message $M_CHECKING_SUBJECT [$subject getName]
  38.         check $subject $diagram
  39.     }
  40. }
  41.  
  42. proc class::check {class diagram} {
  43.     m4_message $M_CHECKING_CLASS [$class getName]
  44.  
  45.     check_direct_supers $class
  46.     check_class_attributes $class
  47.     check_class_associations $class
  48.  
  49.     foreach f [$class featureSet] {
  50.         if {[$f isSynthetic] != "1"} {
  51.             check $f $class
  52.         }
  53.     }
  54.  
  55.     foreach e [$class receivedEventSet] {
  56.         if {$diagram != "" && ![in_diagram $e $diagram]} {
  57.             continue
  58.         }
  59.         check $e $class $diagram
  60.     }
  61. }
  62.  
  63. proc class_enum::check {class diagram} {
  64.     m4_message $M_CHECKING_CLASS [$class getName]
  65.     check_special_class $class $diagram
  66. }
  67.  
  68. proc class_typedef::check {class diagram} {
  69.     m4_message $M_CHECKING_CLASS [$class getName]
  70.     check_special_class $class $diagram
  71. }
  72.  
  73. proc class_generic_typedef::check {class diagram} {
  74.     m4_message $M_CHECKING_CLASS [$class getName]
  75.     check_special_class $class $diagram
  76. }
  77.  
  78. proc link_class::check {class diagram} {
  79.     class::check $class $diagram
  80. }
  81.  
  82. proc data_attrib::check {attrib class} {
  83.     # nop
  84. }
  85.  
  86. proc assoc_attrib::check {attrib class} {
  87.     # nop
  88. }
  89.  
  90. proc qual_assoc_attrib::check {attrib class} {
  91.     assoc_attrib::check $attrib $class
  92. }
  93.  
  94. proc rv_link_attrib::check {attrib class} {
  95.     assoc_attrib::check $attrib $class
  96. }
  97.  
  98. proc link_attrib::check {attrib class} {
  99.     assoc_attrib::check $attrib $class
  100. }
  101.  
  102. proc qual_link_attrib::check {attrib class} {
  103.     qual_assoc_attrib::check $attrib $class
  104. }
  105.  
  106. proc operation::check {oper class} {
  107.     set name [$class getName]
  108.     if {[$oper getName] == $name} {
  109.         m4_error $E_ILLEGAL_CONSTRUCTOR $name
  110.     }
  111.  
  112.     foreach p [get_parameters $oper] {
  113.         check $p $oper $class
  114.     }
  115. }
  116.  
  117. proc constructor::check {ctor class} {
  118.     operation::check $ctor $class
  119. }
  120.  
  121. proc parameter::check {param oper class} {
  122.     # nop
  123. }
  124.  
  125. proc ctor_param::check {param oper class} {
  126.     parameter::check $param $oper $class
  127. }
  128.  
  129. #
  130. # Dispatcher for received_events.
  131. #
  132. proc received_event::check {e class diagram} {
  133.     if {$diagram != "" && ![in_diagram $e $diagram]} {
  134.     return
  135.     }
  136.     [$e getEventType]::check $e $class $diagram
  137. }
  138.  
  139. proc trace_event::check {e class diagram} {
  140.     check_event_attributes $e $class
  141.     check_corr_ccd_message $e $class $diagram
  142.     check_etd_times $e $class $diagram
  143.     check_method_for_event $e $class $diagram
  144. }
  145.  
  146. proc internal_event::check {e class diagram} {
  147.     check_method_for_event $e $class $diagram
  148. }
  149.  
  150. proc internal_action::check {e class diagram} {
  151.     check_method_for_event $e $class $diagram
  152. }
  153.  
  154. proc internal_activity::check {e class diagram} {
  155.     check_method_for_event $e $class $diagram
  156. }
  157.  
  158. proc external_event::check {e class diagram} {
  159.     check_event_attributes $e $class
  160.     check_method_for_event $e $class $diagram
  161. }
  162.  
  163. proc external_action::check {e class diagram} {
  164.     check_method_for_event $e $class $diagram
  165. }
  166.  
  167. proc event_message::check {e class diagram} {
  168.     check_event_attributes $e $class
  169.     check_method_for_event $e $class $diagram
  170. }
  171.  
  172. proc comm_message::check {e class diagram} {
  173.     check_method_for_event $e $class $diagram
  174. }
  175.  
  176. proc subject::check {subject diagram} {
  177.     m4_error $E_INVALID_SUBJECT [$subject getName] $diagram
  178. }
  179.  
  180. proc cad_subject::check {subject diagram} {
  181.     check_cad_subject $subject
  182. }
  183.  
  184. proc ccd_subject::check {subject diagram} {
  185.     check_ccd_subject $subject
  186. }
  187.  
  188. proc cad_ccd_subject::check {subject diagram} {
  189.     cad_subject::check $subject $diagram
  190.     ccd_subject::check $subject $diagram
  191. }
  192.  
  193. proc system_subject::check {subject diagram} {
  194.     check_system_subject $subject
  195. }
  196.