home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
pbimporter.tcl
< prev
next >
Wrap
Text File
|
1997-07-18
|
3KB
|
116 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)pbimporter.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)pbimporter.tcl /main/titanic/5 18 Jul 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require pb_msg.tcl
require pboopl.tcl
require pbtarget.tcl
require pbgentor.tcl
# End user added include file section
require "importer.tcl"
Class PbImporter : {Importer} {
constructor
method destructor
method generateOopl
method getOoplFileTypesToGenerateFor
method import
}
constructor PbImporter {class this} {
set this [Importer::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method PbImporter::destructor {this} {
# Start destructor user section
# End destructor user section
$this Importer::destructor
}
method PbImporter::generateOopl {this classes} {
set fileHandler [PBFileHandler new]
$fileHandler sourceTclFiles
set selectedClasses [List new]
foreach class $classes {
if [$class isExternal] {
continue
}
if {[$class getName] == ""} {
m4_warning $W_CLASS_WITHOUT_NAME
} else {
$selectedClasses append $class
}
}
set pbGenerator [PBGenerator new]
# export and import will check themselves for autolibrary feature
# and returns whether there's an old library
if {[$pbGenerator checkOldSrc $selectedClasses]} {
m4_error $EPB_HASOLDSRC
# there is old source, so stop
return
}
set errornr [$pbGenerator exportSrc $selectedClasses]
if { $errornr != 0 } {
# something is/was wrong, so don't generate
return
}
# generate source
set generatedSections [$pbGenerator generate $selectedClasses]
# write source to files
$generatedSections foreach class classToSection {
$classToSection foreach type section {
$fileHandler writeSectionToFile $section $class $type
}
}
# import src
if {[M4CheckManager::getErrorCount] == 0} {
set errornr [$pbGenerator importSrc $selectedClasses]
} else {
if {[$pbGenerator isAutoLibrary]} {
m4_error $EPB_NOIMPORT
}
}
}
method PbImporter::getOoplFileTypesToGenerateFor {this} {
set fileHandler [PBFileHandler new]
return [[$fileHandler getFileTypes] contents]
}
method PbImporter::import {this} {
set cc [ClientContext::global]
set prevPhaseV [[$cc currentPhase] previous [$cc currentConfig]]
if [$prevPhaseV isNil] {
m4_error $E_NO_PREV_PHASE [$cc levelNameAt Phase]
return
}
set sysName "PBBuiltins"
set sysV [$prevPhaseV findSystemVersion $sysName "system"]
if [$sysV isNil] {
m4_error $E_NOBUILTINSYS $sysName
return
}
$this Importer::import
}
# Do not delete this line -- regeneration end marker