home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / illistcong.tcl < prev    next >
Text File  |  1997-04-10  |  3KB  |  111 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)illistcong.tcl    /main/hindenburg/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)illistcong.tcl    /main/hindenburg/2   10 Apr 1997 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "ilcongen.tcl"
  15.  
  16. Class IlListConGen : {IlConGen} {
  17.     constructor
  18.     method destructor
  19.     method generate
  20.     method makeReport
  21.     attribute section
  22.     attribute ascFid
  23. }
  24.  
  25. constructor IlListConGen {class this name section_1} {
  26.     set this [IlConGen::constructor $class $this $name $section_1]
  27.     # Start constructor user section
  28.  
  29.     # this is not a type-tied generator, so adjust the type
  30.     # part of the tempate name
  31.     set version [[[[$this section] document] editor] version]
  32.     $this templatePath [m4_path_name etc il${version}doc.asc]
  33.  
  34.     # End constructor user section
  35.     return $this
  36. }
  37.  
  38. method IlListConGen::destructor {this} {
  39.     # Start destructor user section
  40.     # End destructor user section
  41.     $this IlConGen::destructor
  42. }
  43.  
  44. method IlListConGen::generate {this} {
  45.  
  46.     $this ascFid [$this openAsc]
  47.  
  48.     # check first if output file can be opened
  49.     if {[$this ascFid] == ""} {
  50.         return
  51.     }
  52.  
  53.     # when the fold-level is lower than 2 the file name will be a chapter
  54.     # else the file will be a section
  55.  
  56.     set header [TextSection new]
  57.     set version [[[[$this section] document] editor] version]
  58.     expand_file $header [m4_path_name etc il${version}doc.asc]
  59.  
  60.     set classes [TextSection new]
  61.     expand_file $classes [m4_path_name etc il${version}class.asc]
  62.  
  63.     puts [$this ascFid] "[$header contents]"
  64.     puts [$this ascFid] "\n[$classes contents]"
  65.     puts [$this ascFid] "\n<!End Declarations>"
  66.     case [[$this section] indentation] {
  67.         {0 1}    {puts [$this ascFid] "\n<\"Chapter\">"}
  68.         {2}    {puts [$this ascFid] "\n<\"Section\">"}
  69.         {3}    {puts [$this ascFid] "\n<\"Subsection\">"}
  70.         {4}    {puts [$this ascFid] "\n<\"Sub2section\">"}
  71.     }
  72.     puts [$this ascFid] "\n[[$this section] docTitle]"
  73.  
  74.     $this makeReport
  75.  
  76.     close [$this ascFid]
  77. }
  78.  
  79. method IlListConGen::makeReport {this} {
  80.  
  81.     puts [$this ascFid] "\n<\"para\","
  82.     puts [$this ascFid] "\tFont =\t\tF31@Z7@Lnl>\n"
  83.  
  84.     # get all the cad_classes and cad_containers from the 
  85.     # documented system
  86.     foreach file [[[[$this section] document] documentedSystem] localFileVersions] {
  87.         if {[[$file file] type] != "cad"} {
  88.             continue
  89.         }
  90.         set fileName [[$file file] name]
  91.         puts [$this ascFid] "$fileName<HR>"
  92.         foreach comp [$file components] {
  93.             if { [$comp type] == "cad_class" || \
  94.                  [$comp type] == "cad_container"} {
  95.                 set name ""
  96.                 foreach label [$comp labels] {
  97.                     if {[$label type] == "name"} {
  98.                         set name [$label value]
  99.                     }
  100.                 }
  101.                 if {$name != ""} {
  102.                     puts [$this ascFid] "   -$name<HR>"
  103.                 }
  104.             }
  105.         }
  106.     }
  107. }
  108.  
  109. # Do not delete this line -- regeneration end marker
  110.  
  111.