home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vacppimpor.tcl
< prev
next >
Wrap
Text File
|
1997-11-04
|
4KB
|
129 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)vacppimpor.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)vacppimpor.tcl /main/titanic/2 4 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require "vacppgentor.tcl"
require "vacppoopl.tcl"
require "vatarget.tcl"
require "vacpptarget.tcl"
require "vacpp_msg.tcl"
# End user added include file section
require "cppimporte.tcl"
Class VACPPImporter : {CppImporter} {
constructor
method destructor
method generateOopl
method getOoplFileTypesToGenerateFor
method getFileNamesNotToGenerateFor
method promoter
attribute genSpecialFiles
}
constructor VACPPImporter {class this} {
set this [CppImporter::constructor $class $this]
$this genSpecialFiles 0
# Start constructor user section
# End constructor user section
return $this
}
method VACPPImporter::destructor {this} {
# Start destructor user section
# End destructor user section
$this CppImporter::destructor
}
method VACPPImporter::generateOopl {this classes} {
$this CppImporter::generateOopl $classes
if {[M4CheckManager::getErrorCount] > 0} {
m4_message $M_NOMAKE
return
}
set fileHandler [VACPPFileHandler new]
$fileHandler sourceTclFiles
set selectedClasses [List new]
foreach class $classes {
if [$class isExternal] {
continue
}
if {[$class getName] == ""} {
m4_warning $W_NONAMECLASS
} else {
$selectedClasses append $class
}
}
set vacppGenerator [VACPPGenerator new]
$vacppGenerator ooplModel [$this ooplModel]
$vacppGenerator importer $this
$vacppGenerator fileHandler $fileHandler
set generatedSections [$vacppGenerator generate $selectedClasses]
$generatedSections foreach class classToSection {
$classToSection foreach type section {
$fileHandler writeSectionToFile $section $class $type
}
}
# Special files
set import_new [lempty [$this targetObjects]]
if $import_new {
set specialFileList [$fileHandler getSpecialFiles]
} else {
set specialFileList [List new]
set selectedFiles [$this targetObjects]
[$fileHandler getSpecialFiles] foreach specialFile {
if { [lsearch $selectedFiles $specialFile] != -1 } {
$specialFileList append $specialFile
}
}
}
if { ![$specialFileList empty] || [$this genSpecialFiles] != 0 } {
if {[M4CheckManager::getErrorCount] > 0} {
m4_error $E_NOSPECFILES
} else {
$vacppGenerator generateSpecialFiles $specialFileList
}
}
}
method VACPPImporter::getOoplFileTypesToGenerateFor {this} {
return "[$this CppImporter::getOoplFileTypesToGenerateFor] {vbe}"
}
method VACPPImporter::getFileNamesNotToGenerateFor {this} {
return "[$this CppImporter::getFileNamesNotToGenerateFor] {[getCurrentSystemName]}"
}
selfPromoter CppImporter {this} {
VACPPImporter promote $this
}
method VACPPImporter::promoter {this} {
$this sourceObjects [CommandLineInterface::getSourceObjects]
$this targetObjects [CommandLineInterface::getTargetObjects]
$this ooplFileTypes [$this getOoplFileTypesToGenerateFor]
$this sqlFileTypes [$this getSqlFileTypesToGenerateFor]
}
# Do not delete this line -- regeneration end marker