home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vbgclasses.tcl
< prev
next >
Wrap
Text File
|
1997-11-10
|
118KB
|
3,860 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1997 by Cayenne Software, 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 Cayenne Software, Inc.
#
#---------------------------------------------------------------------------
#
# File : vbgclasses.tcl
# Author :
# Original date : November 1997
# Description : Classes for code generation
#
#---------------------------------------------------------------------------
# File: @(#)vbgclass.tcl /main/titanic/21
Class VBGClass : {Object} {
constructor
method destructor
method guiLib
method hasMain
method hasExtras
method baseClass
method baseType
method check
method checkLocal
method checkLoop
method checkLoopContainer
method checkContainer
method checkLocalContainer
method generate
method generateContainer
attribute bseClass
attribute bseType
attribute guiLb
attribute done
attribute loop
attribute hsExtras
attribute containerErrors
attribute localContainerErrors
}
constructor VBGClass {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGClass::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGClass::guiLib {this} {
if {[$this guiLb] == ""} {
if {[$this baseType] != "Class"} {
$this guiLb [[[lindex [$this genNodeSet] 0] superClass] getPropertyValue "gui_lib"]
}
}
return [$this guiLb]
}
method VBGClass::hasMain {this} {
switch [$this baseType] {
"NodeControl" {
return 0
}
"LeafControl" {
return 0
}
default {
return 1
}
}
}
method VBGClass::hasExtras {this} {
if {[$this hsExtras] == ""} {
switch [$this baseType] {
"NodeControl" {
$this hsExtras 0
}
"LeafControl" {
$this hsExtras 0
}
default {
$this hsExtras 0
foreach feature [$this dataAttrSet] {
if {[$feature isClassFeature]} {
$this hsExtras 1
break
}
}
foreach feature [$this operationSet] {
if {[$feature isClassFeature] && [$feature getName] != "create"} {
$this hsExtras 1
break
}
}
}
}
}
return [$this hsExtras]
}
method VBGClass::baseClass {this} {
if {[$this bseClass] == ""} {
if {[$this baseType] == "Class" || [llength [$this genNodeSet]] <= 0} {
$this bseClass "Class"
} else {
$this bseClass [[lindex [$this genNodeSet] 0] getSuperClassName]
}
}
return [$this bseClass]
}
method VBGClass::baseType {this} {
if {[$this bseType] == ""} {
if {[$this loop] != 1} {
$this loop 1
if {[llength [$this genNodeSet]] > 0} {
set name [[[lindex [$this genNodeSet] 0] superClass] baseType]
} else {
set name [$this getName]
}
$this loop 0
switch $name {
"Window" {
$this bseType $name
}
"NodeControl" {
$this bseType $name
}
"LeafControl" {
$this bseType $name
}
default {
$this bseType "Class"
}
}
} else {
$this bseType "Class"
}
}
return [$this bseType]
}
method VBGClass::check {this} {
set errornr [$this checkLocal]
if {[$this baseClass] == "Class"} {
foreach genNode [$this genNodeSet] {
incr errornr [$genNode check]
}
}
foreach feature [$this dataAttrSet] {
incr errornr [$feature check]
}
foreach feature [$this operationSet] {
incr errornr [$feature check]
}
if {[$this constructor] != ""} {
incr errornr [[$this constructor] check]
}
foreach feature [$this genAssocAttrSet] {
incr errornr [$feature check]
}
return $errornr
}
method VBGClass::checkLocal {this} {
set errornr [$this checkLoop]
if {[$this getName] == "Form" || [$this getName] == "MDIForm" ||
[$this getName] == "LeafControl" || [$this getName] == "NodeControl" ||
[$this getName] == "Menu" || [$this getName] == "Window"} {
m4_error $E_RESERVEDWORD [$this getName]
incr errornr
}
return $errornr
}
method VBGClass::checkLoop {this} {
set errornr 0
if {[$this loop] != 1} {
$this loop 1
if {[llength [$this genNodeSet]] > 0} {
set errornr [[[lindex [$this genNodeSet] 0] superClass] checkLoop]
}
$this loop 0
} else {
set errornr 1
}
return $errornr
}
method VBGClass::checkLoopContainer {this} {
set errornr 0
if {[$this done] != 1} {
if {[$this baseType] == "NodeControl"} {
$this done 1
foreach assoc [$this genAssocAttrSet] {
if {![[$assoc ooplType] isA OPBaseType]} {
if {[[$assoc ooplType] ooplClass] != ""} {
incr errornr [[[$assoc ooplType] ooplClass] checkLoopContainer]
}
}
}
$this done 0
}
} else {
incr errornr 1
}
return $errornr
}
method VBGClass::checkContainer {this} {
if {[$this containerErrors] == ""} {
set errornr [$this checkLocalContainer]
if {[$this baseType] == "NodeControl" || [$this baseType] == "LeafControl"} {
if {[$this checkLoopContainer] == 0} {
foreach assoc [$this genAssocAttrSet] {
incr errornr [$assoc check]
}
}
foreach event [$this operationSet] {
set temperr [$event check]
incr errornr $temperr
incr temperr [$this localContainerErrors]
$this localContainerErrors $temperr
}
}
$this containerErrors $errornr
}
return [$this containerErrors]
}
method VBGClass::checkLocalContainer {this} {
if {[$this localContainerErrors] == ""} {
set errornr [$this checkLoop]
if {[$this checkLoopContainer] > 0} {
m4_fatal $F_CONTLOOP [$this getName]
incr errornr 1
}
if {[$this baseType] != "NodeControl" && [$this baseType] != "LeafControl"} {
m4_error $E_NOTACONT [$this getName]
incr errornr 1
}
foreach feature [$this dataAttrSet] {
incr errornr [$feature check]
}
if {[$this getName] == "Form" || [$this getName] == "MDIForm" ||
[$this getName] == "LeafControl" || [$this getName] == "NodeControl" ||
[$this getName] == "Menu" || [$this getName] == "Window"} {
m4_error $E_RESERVEDWORD [$this getName]
incr errornr
}
$this localContainerErrors $errornr
}
return [$this localContainerErrors]
}
method VBGClass::generate {this tgt} {
if {[$this checkLocal] != 0} {
return
}
switch [$this baseClass] {
"Form" {
set unit [VBForm new]
$tgt setForm [$this getName] $unit
}
"Class" {
set unit [VBClassModule new]
$tgt setClassmodule [$this getName] $unit
foreach genNode [$this genNodeSet] {
$genNode generate $unit
}
}
"MDIForm" {
set unit [VBForm new]
$tgt mdiform $unit
}
}
set terminate [VBSub new]
$terminate name "Terminate"
$terminate access "Private"
$terminate userCodeFirst 1
set gcode [TextSection new]
$terminate gencode $gcode
$unit terminate $terminate
$unit name [$this getName]
set comment [VBComment new]
$unit comment $comment
$comment comment [$this getPropertyValue "freeText"]
foreach feature [$this dataAttrSet] {
$feature generate $unit
}
foreach feature [$this operationSet] {
$feature generate $unit
}
if {[$this constructor] != ""} {
[$this constructor] generate $unit
}
foreach feature [$this genAssocAttrSet] {
$feature generate $unit
}
}
method VBGClass::generateContainer {this roleName number tgt} {
if {[$this checkLocalContainer] != 0} {
return
}
if {$number != ""} {
set temp $number
} else {
set temp 1
}
for {set i $temp} {$i > 0} {incr i -1} {
switch [$this baseType] {
"NodeControl" {
if {[$this baseClass] == "Menu"} {
set control [VBMenu new]
} else {
set control [VBControl new]
}
foreach assoc [$this genAssocAttrSet] {
$assoc generate $control
}
}
"LeafControl" {
set control [VBControl new]
foreach assoc [$this genAssocAttrSet] {
$assoc generate $control
}
}
}
$control name $roleName
$control ofClass [$this getName]
$control guiType [$this baseClass]
if {[$this guiLib] != ""} {
$control guiLib [$this guiLib]
}
if {$number != ""} {
$control hasIndex 1
}
$tgt addContain $control
}
foreach event [$this operationSet] {
$event generate $control
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMClass] {
Class VBGClassD : {VBGClass CMClass} {
}
} else {
Class VBGClassD : {VBGClass OPClass} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPClass) VBGClassD
selfPromoter OPClass {this} {
VBGClassD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgfeature.tcl /main/titanic/4
Class VBGFeature : {Object} {
constructor
method destructor
method check
method checkLocal
}
constructor VBGFeature {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGFeature::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGFeature::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGFeature::checkLocal {this} {
set errornr 0
return $errornr
}
# Do not delete this line -- regeneration end marker
if [isCommand CMFeature] {
Class VBGFeatureD : {VBGFeature CMFeature} {
}
} else {
Class VBGFeatureD : {VBGFeature OPFeature} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPFeature) VBGFeatureD
selfPromoter OPFeature {this} {
VBGFeatureD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbginhgrou.tcl /main/titanic/5
Class VBGInhGroup : {Object} {
constructor
method destructor
method generate
method check
method checkLocal
}
constructor VBGInhGroup {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGInhGroup::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGInhGroup::generate {this cl} {
set type [VBType new]
$type name "New [[$this superClass] getName]"
set variable [VBVariable new $type]
$variable name "[[$this superClass] getName]"
set access [$this inherAccess]
if {$access == ""} {
set access "Public"
}
$variable access $access
$cl addInhervar $variable
}
method VBGInhGroup::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGInhGroup::checkLocal {this} {
set errornr 0
return $errornr
}
# Do not delete this line -- regeneration end marker
if [isCommand CMInhGroup] {
Class VBGInhGroupD : {VBGInhGroup CMInhGroup} {
}
} else {
Class VBGInhGroupD : {VBGInhGroup OPInhGroup} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPInhGroup) VBGInhGroupD
selfPromoter OPInhGroup {this} {
VBGInhGroupD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgparamet.tcl /main/titanic/5
Class VBGParameter : {Object} {
constructor
method destructor
method check
method checkLocal
}
constructor VBGParameter {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGParameter::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGParameter::check {this} {
set errornr [$this checkLocal]
incr errornr [[$this ooplType] check]
return $errornr
}
method VBGParameter::checkLocal {this} {
set errornr 0
if {[$this getPropertyValue "default_value"] != ""} {
if {[$this getPropertyValue "optional"] != "1"} {
m4_error $E_HASTOBEOPT [$this getName]
incr errornr
}
}
return $errornr
}
# Do not delete this line -- regeneration end marker
if [isCommand CMParameter] {
Class VBGParameterD : {VBGParameter CMParameter} {
}
} else {
Class VBGParameterD : {VBGParameter OPParameter} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPParameter) VBGParameterD
selfPromoter OPParameter {this} {
VBGParameterD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbginitial.tcl /main/titanic/3
Class VBGInitializer : {Object} {
constructor
method destructor
method check
method checkLocal
}
constructor VBGInitializer {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGInitializer::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGInitializer::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGInitializer::checkLocal {this} {
set errornr 0
return $errornr
}
# Do not delete this line -- regeneration end marker
if [isCommand CMInitializer] {
Class VBGInitializerD : {VBGInitializer CMInitializer} {
}
} else {
Class VBGInitializerD : {VBGInitializer OPInitializer} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPInitializer) VBGInitializerD
selfPromoter OPInitializer {this} {
VBGInitializerD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgtype.tcl /main/titanic/4
Class VBGType : {Object} {
constructor
method destructor
method check
method checkLocal
}
constructor VBGType {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGType::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGType::checkLocal {this} {
set errornr 0
return $errornr
}
# Do not delete this line -- regeneration end marker
if [isCommand CMType] {
Class VBGTypeD : {VBGType CMType} {
}
} else {
Class VBGTypeD : {VBGType OPType} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPType) VBGTypeD
selfPromoter OPType {this} {
VBGTypeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgassocge.tcl /main/titanic/4
Class VBGAssocGen : {GCObject} {
constructor
method destructor
method hasRead
method hasWrite
method hasGet
method check
method checkLocal
method assocattr
attribute _assocattr
}
constructor VBGAssocGen {class this assocattr} {
set this [GCObject::constructor $class $this]
$this _assocattr $assocattr
$assocattr _generator $this
# Start constructor user section
# End constructor user section
return $this
}
method VBGAssocGen::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGAssocGen::hasRead {this} {
set accessList [split [[$this assocattr] getPropertyValue assoc_access] -]
set accessStr [lindex $accessList 0]
if {$accessStr == ""} {
set accessStr "Public"
}
return $accessStr
}
method VBGAssocGen::hasWrite {this} {
set accessList [split [[$this assocattr] getPropertyValue assoc_access] -]
set accessStr [lindex $accessList 1]
if {$accessStr == ""} {
set accessStr "Public"
}
return $accessStr
}
method VBGAssocGen::hasGet {this self} {
set rd [$this hasRead]
if {$self} {
if {$rd == "None"} {
return 0
}
} else {
if {$rd == "None" || $rd == "Private"} {
return 0
}
}
return 1
}
method VBGAssocGen::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGAssocGen::checkLocal {this} {
set errornr 0
return $errornr
}
# Do not delete this line -- regeneration end marker
method VBGAssocGen::assocattr {this args} {
if {$args == ""} {
return [$this _assocattr]
}
set ref [$this _assocattr]
if {$ref != ""} {
$ref _generator ""
}
set obj [lindex $args 0]
if {$obj != ""} {
$obj _generator $this
}
$this _assocattr $obj
}
#---------------------------------------------------------------------------
# File: @(#)vbgclassen.tcl /main/titanic/4
Class VBGClassEnum : {VBGClass} {
constructor
method destructor
method baseClass
method baseType
method check
method checkLocal
method hasMain
method hasExtras
method generate
}
constructor VBGClassEnum {class this name} {
set this [VBGClass::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGClassEnum::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGClassEnum::baseClass {this} {
if {[$this bseClass] == ""} {
$this bseClass "Enum"
}
return [$this bseClass]
}
method VBGClassEnum::baseType {this} {
if {[$this bseType] == ""} {
$this bseType "Class"
}
return [$this bseType]
}
method VBGClassEnum::check {this} {
set errornr [$this checkLocal]
foreach feature [$this dataAttrSet] {
incr errornr [$feature check]
}
return $errornr
}
method VBGClassEnum::checkLocal {this} {
set errornr 0
return $errornr
}
method VBGClassEnum::hasMain {this} {
return 0
}
method VBGClassEnum::hasExtras {this} {
return 1
}
method VBGClassEnum::generate {this tgt} {
set enummodule [VBEnumModule new]
$enummodule name [$this getName]
foreach enum [$this dataAttrSet] {
$enum generate $enummodule
}
$tgt setModule [$this getName] $enummodule
}
# Do not delete this line -- regeneration end marker
if [isCommand CMClassEnum] {
Class VBGClassEnumD : {VBGClassEnum CMClassEnum} {
}
} else {
Class VBGClassEnumD : {VBGClassEnum OPClassEnum} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPClassEnum) VBGClassEnumD
selfPromoter OPClassEnum {this} {
VBGClassEnumD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgclassge.tcl /main/titanic/3
Class VBGClassGenericTypeDef : {VBGClass} {
constructor
method destructor
}
constructor VBGClassGenericTypeDef {class this name} {
set this [VBGClass::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGClassGenericTypeDef::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
if [isCommand CMClassGenericTypeDef] {
Class VBGClassGenericTypeDefD : {VBGClassGenericTypeDef CMClassGenericTypeDef} {
}
} else {
Class VBGClassGenericTypeDefD : {VBGClassGenericTypeDef OPClassGenericTypeDef} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPClassGenericTypeDef) VBGClassGenericTypeDefD
selfPromoter OPClassGenericTypeDef {this} {
VBGClassGenericTypeDefD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgclasstd.tcl /main/titanic/3
Class VBGClassTDef : {VBGClass} {
constructor
method destructor
}
constructor VBGClassTDef {class this name} {
set this [VBGClass::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGClassTDef::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
if [isCommand CMClassTDef] {
Class VBGClassTDefD : {VBGClassTDef CMClassTDef} {
}
} else {
Class VBGClassTDefD : {VBGClassTDef OPClassTDef} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPClassTDef) VBGClassTDefD
selfPromoter OPClassTDef {this} {
VBGClassTDefD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbglinkcla.tcl /main/titanic/3
Class VBGLinkClass : {VBGClass} {
constructor
method destructor
}
constructor VBGLinkClass {class this name} {
set this [VBGClass::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGLinkClass::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
if [isCommand CMLinkClass] {
Class VBGLinkClassD : {VBGLinkClass CMLinkClass} {
}
} else {
Class VBGLinkClassD : {VBGLinkClass OPLinkClass} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPLinkClass) VBGLinkClassD
selfPromoter OPLinkClass {this} {
VBGLinkClassD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgattribu.tcl /main/titanic/3
Class VBGAttribute : {VBGFeature} {
constructor
method destructor
}
constructor VBGAttribute {class this name} {
set this [VBGFeature::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAttribute::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
if [isCommand CMAttribute] {
Class VBGAttributeD : {VBGAttribute CMAttribute} {
}
} else {
Class VBGAttributeD : {VBGAttribute OPAttribute} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPAttribute) VBGAttributeD
selfPromoter OPAttribute {this} {
VBGAttributeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgconstru.tcl /main/titanic/6
Class VBGConstructor : {VBGFeature} {
constructor
method destructor
method check
method checkLocal
method generate
}
constructor VBGConstructor {class this name} {
set this [VBGFeature::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGConstructor::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGConstructor::check {this} {
set errornr [$this checkLocal]
foreach param [[$this ooplClass] creationParamSet] {
incr errornr [$param check]
}
foreach initializer [$this initializerSet] {
incr errornr [$initializer check]
}
return $errornr
}
method VBGConstructor::checkLocal {this} {
set errornr 0
if {[$this getPropertyValue "method_access"] == "Protected"} {
m4_warning $W_METVISCHANGE "\$[$this getName]"
incr errornr 1
}
return $errornr
}
method VBGConstructor::generate {this cl} {
$this checkLocal
set ctor [VBSub new]
set comment [VBComment new]
$ctor comment $comment
$comment comment [$this getPropertyValue "freeText"]
$ctor name "Constructor"
$ctor access [$this getPropertyValue "method_access"]
if {[$ctor access] == ""} {
$ctor access "Public"
}
if {[$ctor access] == "Protected"} {
$ctor access "Public"
}
set gencode [TextSection new]
$ctor gencode $gencode
foreach attrib [[$this ooplClass] dataAttrSet] {
$attrib generateSetDefault $ctor
}
foreach param [[$this ooplClass] creationParamSet] {
$param generate $ctor
}
foreach initializer [$this initializerSet] {
$initializer generate $ctor
}
$cl constructor $ctor
}
# Do not delete this line -- regeneration end marker
if [isCommand CMConstructor] {
Class VBGConstructorD : {VBGConstructor CMConstructor} {
}
} else {
Class VBGConstructorD : {VBGConstructor OPConstructor} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPConstructor) VBGConstructorD
selfPromoter OPConstructor {this} {
VBGConstructorD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgoperati.tcl /main/titanic/15
Class VBGOperation : {VBGFeature} {
constructor
method destructor
method getParamSet
method getReturnType
method isEvent
method check
method checkLocal
method dblEvent
method dblGlobproc
method dblUserproc
method generate
attribute isEv
attribute PSet
attribute RType
}
constructor VBGOperation {class this name} {
set this [VBGFeature::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGOperation::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGOperation::getParamSet {this} {
if {[$this PSet] == ""} {
$this PSet [$this parameterSet]
if {[$this getPropertyValue "is_event"] == ""} {
if {[llength [[$this ooplClass] genNodeSet]] > 0} {
foreach sup [[$this ooplClass] genNodeSet] {
foreach feature [[$sup superClass] operationSet] {
if {[$feature getName] == [$this getName]} {
$this PSet [$feature getParamSet]
m4_message $M_USEPARAM [$this getName] [[$this ooplClass] baseClass] [[$this ooplClass] getName]
break
}
}
}
}
}
}
return [$this PSet]
}
method VBGOperation::getReturnType {this} {
if {[$this RType] == ""} {
$this RType [$this ooplType]
if {[$this getPropertyValue "is_event"] == ""} {
if {[llength [[$this ooplClass] genNodeSet]] > 0} {
foreach sup [[$this ooplClass] genNodeSet] {
foreach feature [[$sup superClass] operationSet] {
if {[$feature getName] == [$this getName]} {
$this RType [$feature getReturnType]
break
}
}
}
}
}
}
return [$this RType]
}
method VBGOperation::isEvent {this} {
if {[$this isEv] == ""} {
switch [$this getPropertyValue "is_event"] {
"Yes" {
$this isEv 1
}
"No" {
$this isEv 0
}
default {
$this isEv 0
if {[llength [[$this ooplClass] genNodeSet]] > 0} {
foreach sup [[$this ooplClass] genNodeSet] {
foreach feature [[$sup superClass] operationSet] {
if {[$feature getName] == [$this getName]} {
$this isEv [$feature isEvent]
break
}
}
}
}
}
}
}
return [$this isEv]
}
method VBGOperation::check {this} {
set errornr [$this checkLocal]
incr errornr [[$this getReturnType] check]
foreach param [$this getParamSet] {
incr errornr [$param check]
}
return $errornr
}
method VBGOperation::checkLocal {this} {
set errornr 0
if {[[$this ooplClass] baseType] == "NodeControl" || [[$this ooplClass] baseType] == "LeafControl"} {
if {[$this isEvent] != 1} {
m4_error $E_CANTCONTMETH [[$this ooplClass] getName]
incr errornr 1
} else {
if {[$this dblEvent [$this getName]]} {
m4_error $E_EVENTDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
}
}
if {[[$this ooplClass] baseType] == "Class"} {
if {[$this isEvent] == 1} {
m4_error $E_CANTCONTEVENT [[$this ooplClass] getName]
incr errornr 1
} else {
if {[$this isClassFeature]} {
if {[$this dblGlobproc [$this getName]]} {
m4_error $E_METHODDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
} else {
if {[$this dblUserproc [$this getName]]} {
m4_error $E_METHODDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
}
}
}
if {[[$this ooplClass] baseType] == "Window"} {
if {[$this isEvent] == 1} {
if {[$this dblEvent [$this getName]]} {
m4_error $E_EVENTDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
} else {
if {[$this isClassFeature]} {
if {[$this dblGlobproc [$this getName]]} {
m4_error $E_METHODDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
} else {
if {[$this dblUserproc [$this getName]]} {
m4_error $E_METHODDBDEF [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
}
}
}
if {[$this getPropertyValue "method_access"] == "Protected"} {
m4_warning $W_METVISCHANGE [$this getName]
}
return $errornr
}
method VBGOperation::dblEvent {this name} {
set nr 0
foreach feature [[$this ooplClass] operationSet] {
if {[$feature getName] == $name && [$feature isEvent] == 1} {
incr nr 1
}
}
if {$nr > 1} {
return 1
}
return 0
}
method VBGOperation::dblGlobproc {this name} {
set nr 0
foreach feature [[$this ooplClass] operationSet] {
if {[$feature getName] == $name && [$feature isClassFeature] && [$feature isEvent] != 1} {
incr nr 1
}
}
if {$nr > 1} {
return 1
}
return 0
}
method VBGOperation::dblUserproc {this name} {
set nr 0
foreach feature [[$this ooplClass] operationSet] {
if {[$feature getName] == $name && ![$feature isClassFeature] && [$feature isEvent] != 1} {
incr nr 1
}
}
if {$nr > 1} {
return 1
}
return 0
}
method VBGOperation::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
switch [[$this ooplClass] baseType] {
"NodeControl" {
set oper [VBEvent new]
$oper name [$this getName]
$cl setEvent [$oper name] $oper
$cl addSevent $oper
}
"LeafControl" {
set oper [VBEvent new]
$oper name [$this getName]
$cl setEvent [$oper name] $oper
$cl addSevent $oper
}
"Class" {
set returntype [[$this getReturnType] generate]
if {[$returntype name] != ""} {
set oper [VBFunction new $returntype]
$oper name [$this getName]
if {[$this isClassFeature]} {
$cl setGlobproc [$oper name] $oper
$cl addGlobSproc $oper
} else {
$cl addUserSproc $oper
$cl setUserproc [$oper name] $oper
}
} else {
set oper [VBSub new]
$oper name [$this getName]
if {[$this getName] == "create" && [$this isClassFeature]} {
$oper name "Constructor"
$cl constructor $oper
} else {
if {[$this isClassFeature]} {
$cl setGlobproc [$oper name] $oper
$cl addGlobSproc $oper
} else {
$cl addUserSproc $oper
$cl setUserproc [$oper name] $oper
}
}
}
}
"Window" {
if {[$this isEvent] == 1} {
set oper [VBEvent new]
$oper name [$this getName]
$cl setEvent [$oper name] $oper
$cl addSevent $oper
} else {
set returntype [[$this getReturnType] generate]
if {[$returntype name] != ""} {
set oper [VBFunction new $returntype]
$oper name [$this getName]
if {[$this isClassFeature]} {
$cl setGlobproc [$oper name] $oper
$cl addGlobSproc $oper
} else {
$cl addUserSproc $oper
$cl setUserproc [$oper name] $oper
}
} else {
set oper [VBSub new]
$oper name [$this getName]
if {[$this getName] == "create" && [$this isClassFeature]} {
$oper name "Constructor"
$cl constructor $oper
} else {
if {[$this isClassFeature]} {
if {[$cl getGlobproc [$oper name]] == ""} {
$cl setGlobproc [$oper name] $oper
$cl addGlobSproc $oper
}
} else {
if {[$cl getUserproc [$oper name]] == ""} {
$cl addUserSproc $oper
$cl setUserproc [$oper name] $oper
}
}
}
}
}
}
}
$oper access [$this getPropertyValue "method_access"]
$oper hasUserSection 0
if {[$oper access] == ""} {
$oper access "Public"
}
if {[$oper access] == "Protected"} {
$oper access "Public"
}
set comment [VBComment new]
$oper comment $comment
$comment comment [$this getPropertyValue "freeText"]
foreach param [$this getParamSet] {
$param generate $oper
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMOperation] {
Class VBGOperationD : {VBGOperation CMOperation} {
}
} else {
Class VBGOperationD : {VBGOperation OPOperation} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPOperation) VBGOperationD
selfPromoter OPOperation {this} {
VBGOperationD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgctorpar.tcl /main/titanic/11
Class VBGCtorParameter : {VBGParameter} {
constructor
method destructor
method generate
}
constructor VBGCtorParameter {class this name} {
set this [VBGParameter::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGCtorParameter::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGCtorParameter::generate {this method} {
if {[$this checkLocal] != 0} {
return
}
if {[$this attrib] != ""} {
if {[[$this attrib] isClassFeature]} {
return
}
}
set param [VBArgument new [[$this ooplType] generate]]
if {[$this initializer] != ""} {
if {[[$this initializer] isA OPQualInitializer]} {
return
}
if {[[$this initializer] isA OPAssocInitializer]} {
if {[[[[$this initializer] assoc] ooplType] isA OPBaseType]} {
return
}
if {[[[[$this initializer] assoc] ooplType] ooplClass] != ""} {
if {[[[[[$this initializer] assoc] ooplType] ooplClass] baseType] == "NodeControl" ||
[[[[[$this initializer] assoc] ooplType] ooplClass] baseType] == "LeafControl"} {
return
}
}
$param name "a_[$this getName]"
} else {
$param name [$this getName]
}
} else {
$param name [$this getName]
}
if {[$this getPropertyValue "pass_by"] != "ByRef"} {
$param passedBy [$this getPropertyValue "pass_by"]
}
if {[$this getPropertyValue "optional"] != ""} {
$param optional [$this getPropertyValue "optional"]
}
if {[$this getPropertyValue "default_value"] != ""} {
$param defaultValue [$this getPropertyValue "default_value"]
}
$method addArg $param
}
# Do not delete this line -- regeneration end marker
if [isCommand CMCtorParameter] {
Class VBGCtorParameterD : {VBGCtorParameter CMCtorParameter} {
}
} else {
Class VBGCtorParameterD : {VBGCtorParameter OPCtorParameter} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPCtorParameter) VBGCtorParameterD
selfPromoter OPCtorParameter {this} {
VBGCtorParameterD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgoperpar.tcl /main/titanic/5
Class VBGOperParameter : {VBGParameter} {
constructor
method destructor
method generate
}
constructor VBGOperParameter {class this name} {
set this [VBGParameter::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGOperParameter::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGOperParameter::generate {this method} {
if {[$this checkLocal] != 0} {
return
}
set param [VBArgument new [[$this ooplType] generate]]
$param name [$this getName]
if {[$this getPropertyValue "pass_by"] != "ByRef"} {
$param passedBy [$this getPropertyValue "pass_by"]
}
if {[$this getPropertyValue "optional"] != ""} {
$param optional [$this getPropertyValue "optional"]
}
if {[$this getPropertyValue "default_value"] != ""} {
$param defaultValue [$this getPropertyValue "default_value"]
}
$method addArg $param
}
# Do not delete this line -- regeneration end marker
if [isCommand CMOperParameter] {
Class VBGOperParameterD : {VBGOperParameter CMOperParameter} {
}
} else {
Class VBGOperParameterD : {VBGOperParameter OPOperParameter} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPOperParameter) VBGOperParameterD
selfPromoter OPOperParameter {this} {
VBGOperParameterD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgassocin.tcl /main/titanic/8
Class VBGAssocInitializer : {VBGInitializer} {
constructor
method destructor
method generate
}
constructor VBGAssocInitializer {class this name} {
set this [VBGInitializer::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAssocInitializer::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGAssocInitializer::generate {this ctor} {
if {[[[$this assoc] ooplType] isA OPBaseType]} {
return
}
if {[[[$this assoc] ooplType] ooplClass] != ""} {
if {[[[[$this assoc] ooplType] ooplClass] baseType] == "NodeControl" ||
[[[[$this assoc] ooplType] ooplClass] baseType] == "LeafControl"} {
return
}
}
if {[[$this assoc] getMultiplicity] == "one"} {
if {[[$this assoc] isMandatory] &&
[[$this assoc] opposite] != ""} {
if {[[[$this assoc] opposite] isQualified]} {
# [$ctor gencode] append "a_[$this getName].Add[cap [[[$this assoc] opposite] getName]] Me, CStr([$this getName]_[[[[$this assoc] opposite] qualifier] getName])\n"
m4_warning $W_NOCTOR [$this getName]
} else {
[$ctor gencode] append "Set [[$this assoc] getName] = a_[$this getName]\n"
}
} else {
[$ctor gencode] append "Set [[$this assoc] getName] = a_[$this getName]\n"
}
} else {
[$ctor gencode] append "Add[cap [[$this assoc] getName]] a_[$this getName]\n"
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMAssocInitializer] {
Class VBGAssocInitializerD : {VBGAssocInitializer CMAssocInitializer} {
}
} else {
Class VBGAssocInitializerD : {VBGAssocInitializer OPAssocInitializer} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPAssocInitializer) VBGAssocInitializerD
selfPromoter OPAssocInitializer {this} {
VBGAssocInitializerD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgattribi.tcl /main/titanic/6
Class VBGAttribInitializer : {VBGInitializer} {
constructor
method destructor
method check
method checkLocal
method generate
}
constructor VBGAttribInitializer {class this name} {
set this [VBGInitializer::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAttribInitializer::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGAttribInitializer::check {this} {
set errornr [$this checkLocal]
return $errornr
}
method VBGAttribInitializer::checkLocal {this} {
set errornr 0
if {[[$this attrib] isClassFeature]} {
m4_error $W_NOKEYFEAT [[$this attrib] getName] [[[$this attrib] ooplClass] getName]
incr errornr 1
}
return $errornr
}
method VBGAttribInitializer::generate {this ctor} {
if {[$this checkLocal] > 0} {
return
}
if {[[[$this attrib] ooplType] get_obj_type] == "class_type" ||
[[[$this attrib] ooplType] getType3GL] == "Object"} {
[$ctor gencode] append "Set "
}
[$ctor gencode] append [[$this attrib] getName]
[$ctor gencode] append " = "
[$ctor gencode] append [$this getName]
[$ctor gencode] append "\n"
}
# Do not delete this line -- regeneration end marker
if [isCommand CMAttribInitializer] {
Class VBGAttribInitializerD : {VBGAttribInitializer CMAttribInitializer} {
}
} else {
Class VBGAttribInitializerD : {VBGAttribInitializer OPAttribInitializer} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPAttribInitializer) VBGAttribInitializerD
selfPromoter OPAttribInitializer {this} {
VBGAttribInitializerD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgqualini.tcl /main/titanic/6
Class VBGQualInitializer : {VBGInitializer} {
constructor
method destructor
method generate
}
constructor VBGQualInitializer {class this name} {
set this [VBGInitializer::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGQualInitializer::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGQualInitializer::generate {this ctor} {
}
# Do not delete this line -- regeneration end marker
if [isCommand CMQualInitializer] {
Class VBGQualInitializerD : {VBGQualInitializer CMQualInitializer} {
}
} else {
Class VBGQualInitializerD : {VBGQualInitializer OPQualInitializer} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPQualInitializer) VBGQualInitializerD
selfPromoter OPQualInitializer {this} {
VBGQualInitializerD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgsupercl.tcl /main/titanic/6
Class VBGSuperClassInitializer : {VBGInitializer} {
constructor
method destructor
method generate
}
constructor VBGSuperClassInitializer {class this name} {
set this [VBGInitializer::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGSuperClassInitializer::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGSuperClassInitializer::generate {this ctor} {
if {[[[$this constructor] ooplClass] baseClass] == "Class"} {
[$ctor gencode] append "[[$this ooplClass] getName].[[$this ooplClass] getName]_Constructor"
set first 1
foreach param [$this parameterSet] {
if {!$first} {
[$ctor gencode] append ", "
} else {
[$ctor gencode] append " "
set first 0
}
[$ctor gencode] append "[$param getName]"
}
[$ctor gencode] append "\n"
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMSuperClassInitializer] {
Class VBGSuperClassInitializerD : {VBGSuperClassInitializer CMSuperClassInitializer} {
}
} else {
Class VBGSuperClassInitializerD : {VBGSuperClassInitializer OPSuperClassInitializer} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPSuperClassInitializer) VBGSuperClassInitializerD
selfPromoter OPSuperClassInitializer {this} {
VBGSuperClassInitializerD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgbasetyp.tcl /main/titanic/3
Class VBGBaseType : {VBGType} {
constructor
method destructor
method generate
}
constructor VBGBaseType {class this name} {
set this [VBGType::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGBaseType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGBaseType::generate {this} {
set type [VBType new]
$type name [$this getType3GL]
return $type
}
# Do not delete this line -- regeneration end marker
if [isCommand CMBaseType] {
Class VBGBaseTypeD : {VBGBaseType CMBaseType} {
}
} else {
Class VBGBaseTypeD : {VBGBaseType OPBaseType} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPBaseType) VBGBaseTypeD
selfPromoter OPBaseType {this} {
VBGBaseTypeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgclassty.tcl /main/titanic/4
Class VBGClassType : {VBGType} {
constructor
method destructor
method generate
}
constructor VBGClassType {class this name} {
set this [VBGType::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGClassType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGClassType::generate {this} {
set type [VBType new]
if {[$this ooplClass] != ""} {
set name [[$this ooplClass] getName]
} else {
set name ""
}
$type name $name
return $type
}
# Do not delete this line -- regeneration end marker
if [isCommand CMClassType] {
Class VBGClassTypeD : {VBGClassType CMClassType} {
}
} else {
Class VBGClassTypeD : {VBGClassType OPClassType} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPClassType) VBGClassTypeD
selfPromoter OPClassType {this} {
VBGClassTypeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgenumtyp.tcl /main/titanic/5
Class VBGEnumType : {VBGType} {
constructor
method destructor
method generate
}
constructor VBGEnumType {class this name} {
set this [VBGType::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGEnumType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGEnumType::generate {this} {
set type [VBType new]
if {[$this ooplClass] != ""} {
set name [[$this ooplClass] getName]
} else {
set name ""
}
$type name $name
return $type
}
# Do not delete this line -- regeneration end marker
if [isCommand CMEnumType] {
Class VBGEnumTypeD : {VBGEnumType CMEnumType} {
}
} else {
Class VBGEnumTypeD : {VBGEnumType OPEnumType} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPEnumType) VBGEnumTypeD
selfPromoter OPEnumType {this} {
VBGEnumTypeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgassocma.tcl /main/titanic/8
Class VBGAssocMany : {VBGAssocGen} {
constructor
method destructor
method hasAdd
method hasDtor
method hasRemove
method generate
method generateGet
method generateAdd
method generateRemove
method generateDtor
}
constructor VBGAssocMany {class this assocattr} {
set this [VBGAssocGen::constructor $class $this $assocattr]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAssocMany::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBGAssocGen::destructor
}
method VBGAssocMany::hasAdd {this self} {
set wr [$this hasWrite]
if {$self} {
if {$wr == "None"} {
return 0
}
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NOSET [[$this assocattr] getName]}
return 0
}
}
return 1
}
method VBGAssocMany::hasDtor {this self} {
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NODTOR [[$this assocattr] getName]}
return 0
}
}
return 1
}
method VBGAssocMany::hasRemove {this self} {
set wr [$this hasWrite]
if {$self} {
if {$wr == "None"} {
return 0
}
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NOREMOVE [[$this assocattr] getName]}
return 0
}
}
return 1
}
method VBGAssocMany::generate {this cl} {
set type [VBType new]
$type name "New ClassSet"
set vari [VBVariable new $type]
$vari name "[[$this assocattr] getName]_"
$cl addAssocvar $vari
$vari access "Private"
if {[[$this assocattr] opposite] != ""} {
[[$this assocattr] opposite] setGenerator
}
$this generateGet $vari
$this generateAdd $vari
$this generateRemove $vari
$this generateDtor $cl
}
method VBGAssocMany::generateGet {this vari} {
if {![$this hasGet 0]} {
$vari access "Public"
}
if {![$this hasGet 1]} {
return
}
set type [VBType new]
$type name "ClassSet"
set getproc [VBGetProperty new $type]
set getcode [TextSection new]
$getproc gencode $getcode
$getproc hasUserSection 0
$getproc access [$this hasRead]
$getproc name [[$this assocattr] getName]
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = "
$getcode append "[[$this assocattr] getName]_\n"
$vari addProc $getproc
}
method VBGAssocMany::generateAdd {this vari} {
if {![$this hasAdd 0]} {
$vari access "Public"
}
if {![$this hasAdd 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
set addsub [VBSub new]
$addsub addArg $arg
set addcode [TextSection new]
$addsub gencode $addcode
$addsub hasUserSection 0
$addsub access [$this hasWrite]
$addsub name "Add[cap [[$this assocattr] getName]]"
$addcode append "If Not([$vari name].Contains(x)) Then\n"
$addcode indent +
$addcode append "[$vari name].Add x\n"
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
if {[[[[$this assocattr] opposite] generator] hasAdd 0]} {
$addcode append "x.Add[cap [[[$this assocattr] opposite] getName]] Me\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Add Me\n"
}
} else {
if {[[[[$this assocattr] opposite] generator] hasSet 0]} {
$addcode append "Set x.[[[$this assocattr] opposite] getName] = Me\n"
} else {
$addcode append "If Not(x.[[[$this assocattr] opposite] getName]_ Is Nothing) Then\n"
$addcode indent +
if {[$this hasRemove 1]} {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Remove[cap [[$this assocattr] getName]] x\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.[[$this assocattr] getName]_.Remove x\n"
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
$addcode append "x.Remove[cap [[[$this assocattr] opposite] getName]]\n"
} else {
$addcode append "Set x.[[[$this assocattr] opposite] getName]_ = Nothing\n"
}
}
$addcode indent -
$addcode append "End If\n"
$addcode append "Set x.[[[$this assocattr] opposite] getName]_ = Me\n"
}
}
}
$addcode indent -
$addcode append "End If\n"
$vari addProc $addsub
}
method VBGAssocMany::generateRemove {this vari} {
if {![$this hasRemove 0]} {
$vari access "Public"
}
if {![$this hasRemove 1]} {
return
}
set removesub [VBSub new]
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
$removesub addArg $arg
set removecode [TextSection new]
$removesub gencode $removecode
$removesub hasUserSection 0
$removesub access [$this hasWrite]
$removesub name "Remove[cap [[$this assocattr] getName]]"
if {[[$this assocattr] opposite] != ""} {
$removecode append "If [$vari name].Contains(x) Then\n"
$removecode indent +
$removecode append "[$vari name].Remove x\n"
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
$removecode append "x.Remove[cap [[[$this assocattr] opposite] getName]]"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append " Me"
}
} else {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append "x.[[[$this assocattr] opposite] getName]_.Remove Me"
} else {
$removecode append "Set x.[[[$this assocattr] opposite] getName]_ = Nothing"
}
}
$removecode append "\n"
$removecode indent -
$removecode append "End If\n"
} else {
$removecode append "[$vari name].Remove x\n"
}
$vari addProc $removesub
}
method VBGAssocMany::generateDtor {this cl} {
if {![$this hasDtor 1]} {
return
}
if {[[$this assocattr] opposite] != ""} {
[[$cl terminate] gencode] append "While [[$this assocattr] getName]_.Count > 0\n"
[[$cl terminate] gencode] indent +
if {[$this hasRemove 1]} {
[[$cl terminate] gencode] append "Remove[cap [[$this assocattr] getName]] [[$this assocattr] getName]_.item(1)\n"
} else {
[[$cl terminate] gencode] append "Dim temp As [[[[$this assocattr] ooplType] ooplClass] getName]\n"
[[$cl terminate] gencode] append "Set temp = [[$this assocattr] getName]_.item(1)\n"
[[$cl terminate] gencode] append "[[$this assocattr] getName]_.Remove temp\n"
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
[[$cl terminate] gencode] append "temp.Remove[cap [[[$this assocattr] opposite] getName]]"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
[[$cl terminate] gencode] append " Me"
}
} else {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
[[$cl terminate] gencode] append "temp.[[[$this assocattr] opposite] getName]_.Remove Me"
} else {
[[$cl terminate] gencode] append "Set temp.[[[$this assocattr] opposite] getName]_ = Nothing"
}
}
[[$cl terminate] gencode] append "\n"
}
[[$cl terminate] gencode] indent -
[[$cl terminate] gencode] append "Wend\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgassocon.tcl /main/titanic/9
Class VBGAssocOne : {VBGAssocGen} {
constructor
method destructor
method hasSet
method hasDtor
method hasRemove
method generate
method generateSet
method generateGet
method generateRemove
method generateDtor
}
constructor VBGAssocOne {class this assocattr} {
set this [VBGAssocGen::constructor $class $this $assocattr]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAssocOne::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBGAssocGen::destructor
}
method VBGAssocOne::hasSet {this self} {
set wr [$this hasWrite]
if {$self} {
if {$wr == "None"} {
return 0
}
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NOADD [[$this assocattr] getName]}
return 0
}
}
return 1
}
method VBGAssocOne::hasDtor {this self} {
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NODTOR [[$this assocattr] getName]}
return 0
}
}
return 1
}
method VBGAssocOne::hasRemove {this self} {
set wr [$this hasWrite]
if {$self} {
if {$wr == "None"} {
return 0
}
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
if {[[[$this assocattr] opposite] isQualified]} {
if {$self} {m4_warning $W_NOREMOVE [[$this assocattr] getName]}
return 0
}
}
if {[[$this assocattr] isMandatory]} {
return 0
}
return 1
}
method VBGAssocOne::generate {this cl} {
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set vari [VBVariable new $type]
$vari name "[[$this assocattr] getName]_"
$cl addAssocvar $vari
$vari access "Private"
if {[[$this assocattr] opposite] != ""} {
[[$this assocattr] opposite] setGenerator
}
$this generateGet $vari
$this generateSet $vari
$this generateRemove $vari
$this generateDtor $cl
}
method VBGAssocOne::generateSet {this vari} {
if {![$this hasSet 0]} {
$vari access "Public"
}
if {![$this hasSet 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
set setproc [VBSetProperty new]
$setproc addArg $arg
set setcode [TextSection new]
$setproc gencode $setcode
$setproc hasUserSection 0
$setproc access [$this hasWrite]
$setproc name [[$this assocattr] getName]
if {[[$this assocattr] opposite] != ""} {
$setcode append "If Not (x Is Nothing) Then\n"
$setcode indent +
if {[[$this assocattr] isMandatory]} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
if {[[[[$this assocattr] opposite] generator] hasGet 0]} {
$setcode append "If x.[[[$this assocattr] opposite] getName] Is Nothing Then\n"
} else {
$setcode append "If x.[[[$this assocattr] opposite] getName]_ Is Nothing Then\n"
}
$setcode indent +
$setcode append "If Not ([$vari name] Is Nothing) Then\n"
$setcode indent +
$setcode append "Set [$vari name].[[[$this assocattr] opposite] getName]_ = Nothing\n"
$setcode indent -
$setcode append "End If\n"
} else {
$setcode append "If Not (x Is [$vari name]) Then\n"
$setcode indent +
$setcode append "If Not ([$vari name] Is Nothing) Then\n"
$setcode indent +
$setcode append "[$vari name].[[[$this assocattr] opposite] getName]_.Remove Me\n"
$setcode indent -
$setcode append "End If\n"
}
} else {
$setcode append "If Not (x Is [$vari name]) Then\n"
$setcode indent +
$setcode append "If Not ([$vari name] Is Nothing) Then\n"
$setcode indent +
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
$setcode append "[$vari name].Remove[cap [[[$this assocattr] opposite] getName]]"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$setcode append " Me"
}
} else {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$setcode append "[$vari name].[[[$this assocattr] opposite] getName]_.Remove Me"
} else {
$setcode append "Set [$vari name].[[[$this assocattr] opposite] getName]_ = Nothing"
}
}
$setcode append "\n"
$setcode indent -
$setcode append "End If\n"
}
$setcode append "Set [$vari name] = x\n"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
if {[[[[$this assocattr] opposite] generator] hasAdd 0]} {
$setcode append "x.Add[cap [[[$this assocattr] opposite] getName]] Me\n"
} else {
$setcode append "x.[[[$this assocattr] opposite] getName]_.Add Me\n"
}
} else {
if {[[[[$this assocattr] opposite] generator] hasSet 0]} {
$setcode append "Set x.[[[$this assocattr] opposite] getName] = Me\n"
} else {
$setcode append "Set x.[[[$this assocattr] opposite] getName]_ = Me\n"
}
}
$setcode indent -
$setcode append "End If\n"
if {[$this hasRemove 1]} {
$setcode indent -
$setcode append "Else\n"
$setcode indent +
$setcode append "Remove[cap [[$this assocattr] getName]]\n"
}
$setcode indent -
$setcode append "End If\n"
} else {
if {[[$this assocattr] isMandatory]} {
$setcode append "If Not (x Is Nothing) Then\n"
$setcode indent +
$setcode append "Set [$vari name] = x\n"
$setcode indent -
$setcode append "End If\n"
} else {
$setcode append "Set [$vari name] = x\n"
}
}
$vari addProc $setproc
}
method VBGAssocOne::generateGet {this vari} {
if {![$this hasGet 0]} {
$vari access "Public"
}
if {![$this hasGet 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set getproc [VBGetProperty new $type]
set getcode [TextSection new]
$getproc gencode $getcode
$getproc hasUserSection 0
$getproc access [$this hasRead]
$getproc name [[$this assocattr] getName]
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = "
$getcode append "[[$this assocattr] getName]_\n"
$vari addProc $getproc
}
method VBGAssocOne::generateRemove {this vari} {
if {![$this hasRemove 0]} {
$vari access "Public"
}
if {![$this hasRemove 1]} {
return
}
set removesub [VBSub new]
set removecode [TextSection new]
$removesub gencode $removecode
$removesub hasUserSection 0
$removesub access [$this hasWrite]
$removesub name "Remove[cap [[$this assocattr] getName]]"
if {[[$this assocattr] opposite] != ""} {
$removecode append "If Not ([$vari name] Is Nothing) Then\n"
$removecode indent +
$removecode append "Dim temp As [[$vari type] name]\n"
$removecode append "Set temp = [$vari name]\n"
$removecode append "Set [$vari name] = Nothing\n"
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
$removecode append "temp.Remove[cap [[[$this assocattr] opposite] getName]]"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append " Me"
}
} else {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append "temp.[[[$this assocattr] opposite] getName]_.Remove Me"
} else {
$removecode append "Set temp.[[[$this assocattr] opposite] getName]_ = Nothing"
}
}
$removecode append "\n"
$removecode indent -
$removecode append "End If\n"
} else {
$removecode append "Set [$vari name] = Nothing\n"
}
$vari addProc $removesub
}
method VBGAssocOne::generateDtor {this cl} {
if {![$this hasDtor 1]} {
return
}
if {[[$this assocattr] opposite] != ""} {
if {[$this hasRemove 1]} {
[[$cl terminate] gencode] append "Remove[cap [[$this assocattr] getName]]\n"
} else {
[[$cl terminate] gencode] append "If Not ([[$this assocattr] getName]_ Is Nothing) Then\n"
[[$cl terminate] gencode] indent +
if {[[[[$this assocattr] opposite] generator] hasRemove 0]} {
[[$cl terminate] gencode] append "[[$this assocattr] getName]_.Remove[cap [[[$this assocattr] opposite] getName]]"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
[[$cl terminate] gencode] append " Me"
}
} else {
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
[[$cl terminate] gencode] append "[[$this assocattr] getName]_.[[[$this assocattr] opposite] getName]_.Remove Me"
} else {
[[$cl terminate] gencode] append "Set [[$this assocattr] getName]_.[[[$this assocattr] opposite] getName]_ = Nothing"
}
}
[[$cl terminate] gencode] append "\n"
[[$cl terminate] gencode] indent -
[[$cl terminate] gencode] append "End If\n"
}
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgqual.tcl /main/titanic/1
Class VBGQual : {VBGAssocGen} {
constructor
method destructor
method hasAdd
method hasDtor
method hasRemove
}
constructor VBGQual {class this assocattr} {
set this [VBGAssocGen::constructor $class $this $assocattr]
# Start constructor user section
# End constructor user section
return $this
}
method VBGQual::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBGAssocGen::destructor
}
method VBGQual::hasAdd {this self} {
set wr [$this hasWrite]
if {$self} {
if {$wr == "None"} {
return 0
}
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
return 1
}
method VBGQual::hasDtor {this self} {
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
}
return 1
}
method VBGQual::hasRemove {this self} {
set wr [$this hasWrite]
if {$self} {
} else {
if {$wr == "None" || $wr == "Private"} {
return 0
}
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] isMandatory] && [[[$this assocattr] opposite] getMultiplicity] == "one"} {
return 0
}
}
return 1
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgdataatt.tcl /main/titanic/11
Class VBGDataAttr : {VBGAttribute} {
constructor
method destructor
method check
method checkLocal
method checkLocalSub
method checkLocalSubSub
method generateSetDefault
method generateAccesProcs
method generate
}
constructor VBGDataAttr {class this name} {
set this [VBGAttribute::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGDataAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGDataAttr::check {this} {
set errornr [$this checkLocal]
incr errornr [[$this ooplType] check]
return $errornr
}
method VBGDataAttr::checkLocal {this} {
set errornr [$this checkLocalSub]
if {[[$this ooplClass] baseType] == "NodeControl" || [[$this ooplClass] baseType] == "LeafControl"} {
m4_error $E_CONTHASNOAT [[$this ooplClass] getName]
incr errornr 1
}
incr errornr [$this checkLocalSubSub]
return $errornr
}
method VBGDataAttr::checkLocalSub {this} {
set errornr 0
if {[[$this ooplType] getType3GL] == "enum" && ![[$this ooplClass] isEnumClass]} {
m4_error $E_NOENUM [[$this ooplClass] getName]
incr errornr 1
}
return $errornr
}
method VBGDataAttr::checkLocalSubSub {this} {
set errornr 0
if {[$this getInitialValue] != "" && [$this isClassFeature] && ![[$this ooplClass] isEnumClass]} {
m4_error $W_NODEFAULT [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
return $errornr
}
method VBGDataAttr::generateSetDefault {this proc} {
if {[$this checkLocalSubSub] > 0} {
return
}
if {[$this getInitialValue] != ""} {
if {[[$this ooplType] get_obj_type] == "class_type" ||
[[$this ooplType] getType3GL] == "Object"} {
[$proc gencode] append "Set "
}
[$proc gencode] append [$this getName]
[$proc gencode] append " = "
[$proc gencode] append [$this getInitialValue]
[$proc gencode] append "\n"
}
}
method VBGDataAttr::generateAccesProcs {this var} {
set accessTxt [$this getPropertyValue "attrib_access"]
set accessList [split $accessTxt -]
set readAccess [lindex $accessList 0]
if {$readAccess == ""} {
set readAccess "Public"
}
set writeAccess [lindex $accessList 1]
if {$writeAccess == ""} {
set writeAccess "Public"
}
set getproc [VBGetProperty new [[$this ooplType] generate]]
set getcode [TextSection new]
$getproc gencode $getcode
$getproc hasUserSection 0
$getproc access $readAccess
$getproc name [$this getName]
$getproc refName [$var refName]
set setcode [TextSection new]
if {[[$this ooplType] get_obj_type] == "class_type" ||
[[$this ooplType] getType3GL] == "Object"} {
$setcode append "Set "
$getcode append "Set "
set setproc [VBSetProperty new]
} else {
set setproc [VBLetProperty new]
}
set arg [VBArgument new [[$this ooplType] generate]]
$arg name "x"
$setproc addArg $arg
$setproc gencode $setcode
$setproc hasUserSection 0
$setproc access $writeAccess
$setproc name [$this getName]
$setproc refName [$var refName]
if {[$setproc refName] != ""} {
$setcode append "[$setproc refName]_"
}
$setcode append "[$var name] = x\n"
if {[$getproc refName] != ""} {
set addin "[$getproc refName]_[$this getName]"
} else {
set addin "[$this getName]"
}
$getcode append "$addin = "
$getcode append "${addin}_\n"
$var addProc $getproc
$var addProc $setproc
}
method VBGDataAttr::generate {this cl} {
if {[$this checkLocalSub] > 0} {
return
}
if {[[$this ooplType] getType3GL] == "enum"} {
set enum [VBEnumConstant new $cl]
$enum name [$this getName]
set comment [VBComment new]
$enum comment $comment
$comment comment [$this getPropertyValue "freeText"]
if {[$this getPropertyValue "initial_value"] != ""} {
$enum value [$this getPropertyValue "initial_value"]
$enum hasValue 1
}
} else {
set variable [VBVariable new [[$this ooplType] generate]]
$variable name "[$this getName]_"
if {![$this isClassFeature]} {
$variable defaultValue [$this getInitialValue]
}
set comment [VBComment new]
$variable comment $comment
$comment comment [$this getPropertyValue "freeText"]
$variable access "Private"
if {[$this isClassFeature]} {
$variable refName [$cl name]
$cl addGlobvar $variable
} else {
$cl addUservar $variable
}
$this generateAccesProcs $variable
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMDataAttr] {
Class VBGDataAttrD : {VBGDataAttr CMDataAttr} {
}
} else {
Class VBGDataAttrD : {VBGDataAttr OPDataAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPDataAttr) VBGDataAttrD
selfPromoter OPDataAttr {this} {
VBGDataAttrD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbggenasso.tcl /main/titanic/13
Class VBGGenAssocAttr : {VBGAttribute} {
constructor
method destructor
method check
method checkLocal
method checkLocalSub
method checkContainer
method checkLocalContainer
method getName
method hasContainer
method generateContainer
method generator
attribute _generator
}
constructor VBGGenAssocAttr {class this name} {
set this [VBGAttribute::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGGenAssocAttr::destructor {this} {
set ref [$this _generator]
if {$ref != ""} {
$ref _assocattr ""
}
# Start destructor user section
# End destructor user section
}
method VBGGenAssocAttr::check {this} {
set errornr [$this checkLocal]
if {$errornr == 0} {
if {[$this hasContainer]} {
incr errornr [$this checkContainer]
} else {
$this setGenerator
incr errornr [[$this generator] check]
}
}
return $errornr
}
method VBGGenAssocAttr::checkLocal {this} {
set errornr [$this checkLocalSub]
if {[[$this ooplType] isA OPBaseType]} {
m4_error $W_ASSOCTYPEERR [$this getName] [[$this ooplType] getName]
incr errornr 1
} else {
if {[[$this ooplType] ooplClass] == ""} {
incr errornr 1
} else {
if {[[$this ooplClass] baseClass] == "Menu"} {
if {[[[$this ooplType] ooplClass] baseClass] != "Menu"} {
m4_error $E_NOTMENU [[$this ooplClass] getName] [[[$this ooplType] ooplClass] getName]
incr errornr 1
set temper [[$this ooplClass] localContainerErrors]
incr temper 1
[$this ooplClass] localContainerErrors $temper
}
}
if {[[$this ooplClass] baseType] == "LeafControl"} {
m4_error $E_CANTCONT [[$this ooplClass] getName]
incr errornr 1
set temper [[$this ooplClass] localContainerErrors]
incr temper 1
[$this ooplClass] localContainerErrors $temper
}
if {[[$this ooplClass] baseType] == "Class"} {
if {[[[$this ooplType] ooplClass] baseType] == "LeafControl" ||
[[[$this ooplType] ooplClass] baseType] == "NodeControl"} {
m4_error $E_CANTCONTCONT [[$this ooplClass] getName]
incr errornr 1
}
}
if {[[$this ooplClass] baseType] == "NodeControl"} {
if {[[[$this ooplType] ooplClass] baseType] != "NodeControl" &&
[[[$this ooplType] ooplClass] baseType] != "LeafControl"} {
m4_error $E_ONLYCONT [[$this ooplClass] getName] [[[$this ooplType] ooplClass] getName]
incr errornr 1
set temper [[$this ooplClass] localContainerErrors]
incr temper 1
[$this ooplClass] localContainerErrors $temper
}
}
}
}
return $errornr
}
method VBGGenAssocAttr::checkLocalSub {this} {
return 0
}
method VBGGenAssocAttr::checkContainer {this} {
set errornr [$this checkLocalContainer]
if {$errornr == 0} {
incr errornr [[[$this ooplType] ooplClass] checkContainer]
}
return $errornr
}
method VBGGenAssocAttr::checkLocalContainer {this} {
set errornr 0
if {[[$this ooplClass] baseType] == "Window" || [[$this ooplClass] baseType] == "NodeControl"} {
set number [$this getConstraint]
if {$number != ""} {
if {![regexp {^[0-9]+$} $number]} {
m4_error $W_INCORCONTAR [$this getName] [[$this ooplClass] getName]
incr errornr 1
}
}
}
return $errornr
}
method VBGGenAssocAttr::getName {this} {
if {[$this isLinkAttr]} {
if {[$this opposite] != ""} {
return "[uncap [[[$this opposite] ooplClass] getName]]of[$this OPGenAssocAttr::getName]"
}
}
return [$this OPGenAssocAttr::getName]
}
method VBGGenAssocAttr::hasContainer {this} {
set baseType [[[$this ooplType] ooplClass] baseType]
if {$baseType == "NodeControl" || $baseType == "LeafControl"} {
return 1
} else {
return 0
}
}
method VBGGenAssocAttr::generateContainer {this cl} {
if {[$this checkLocalContainer] > 0} {
return
}
[[$this ooplType] ooplClass] generateContainer [$this getName] [$this getConstraint] $cl
}
# Do not delete this line -- regeneration end marker
if [isCommand CMGenAssocAttr] {
Class VBGGenAssocAttrD : {VBGGenAssocAttr CMGenAssocAttr} {
}
} else {
Class VBGGenAssocAttrD : {VBGGenAssocAttr OPGenAssocAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPGenAssocAttr) VBGGenAssocAttrD
selfPromoter OPGenAssocAttr {this} {
VBGGenAssocAttrD promote $this
}
method VBGGenAssocAttr::generator {this args} {
if {$args == ""} {
return [$this _generator]
}
set ref [$this _generator]
if {$ref != ""} {
$ref _assocattr ""
}
set obj [lindex $args 0]
if {$obj != ""} {
$obj _assocattr $this
}
$this _generator $obj
}
#---------------------------------------------------------------------------
# File: @(#)vbgtypedef.tcl /main/titanic/4
Class VBGTypeDefType : {VBGClassType} {
constructor
method destructor
}
constructor VBGTypeDefType {class this name} {
set this [VBGClassType::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGTypeDefType::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
if [isCommand CMTypeDefType] {
Class VBGTypeDefTypeD : {VBGTypeDefType CMTypeDefType} {
}
} else {
Class VBGTypeDefTypeD : {VBGTypeDefType OPTypeDefType} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPTypeDefType) VBGTypeDefTypeD
selfPromoter OPTypeDefType {this} {
VBGTypeDefTypeD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgmanyqua.tcl /main/titanic/11
Class VBGManyQual : {VBGQual} {
constructor
method destructor
method generate
method generateAdd
method generateGet
method generateRemove
method generateDtor
}
constructor VBGManyQual {class this assocattr} {
set this [VBGQual::constructor $class $this $assocattr]
# Start constructor user section
# End constructor user section
return $this
}
method VBGManyQual::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBGQual::destructor
}
method VBGManyQual::generate {this cl} {
set type [VBType new]
$type name "New ClassSet"
set vari [VBVariable new $type]
$vari name "[[$this assocattr] getName]_"
$cl addAssocvar $vari
$vari access "Private"
if {[[$this assocattr] opposite] != ""} {
[[$this assocattr] opposite] setGenerator
}
$this generateGet $vari
$this generateAdd $vari
$this generateRemove $vari
$this generateDtor $cl
}
method VBGManyQual::generateAdd {this vari} {
if {![$this hasAdd 0]} {
$vari access "Public"
}
if {![$this hasAdd 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
set addsub [VBSub new]
$addsub addArg $arg
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$addsub addArg $arg
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name "old_[[[$this assocattr] qualifier] getName]"
$arg optional 1
$addsub addArg $arg
}
}
set addcode [TextSection new]
$addsub gencode $addcode
$addsub hasUserSection 0
$addsub access [$this hasWrite]
$addsub name "Add[cap [[$this assocattr] getName]]"
$addcode append "Dim tempSet As ClassSet\n"
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$addcode append "If IsMissing(old_[[[$this assocattr] qualifier] getName]) Then\n"
$addcode indent +
$addcode append "If Not (x.[[[$this assocattr] opposite] getName]_ Is Nothing) Then\n"
$addcode indent +
if {[[[$this assocattr] opposite] isMandatory]} {
$addcode append "Set tempSet = x.[[[$this assocattr] opposite] getName]_.[[$this assocattr] getName]_.Item(CStr([[[$this assocattr] qualifier] getName]))\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Remove[cap [[$this assocattr] getName]] [[[$this assocattr] qualifier] getName], x\n"
}
$addcode indent -
$addcode append "End If\n"
$addcode indent -
$addcode append "Else\n"
$addcode indent +
$addcode append "If Not (x.[[[$this assocattr] opposite] getName]_ Is Nothing) Then\n"
$addcode indent +
if {[[[$this assocattr] opposite] isMandatory]} {
$addcode append "Set tempSet = x.[[[$this assocattr] opposite] getName]_.[[$this assocattr] getName]_.Item(CStr(old_[[[$this assocattr] qualifier] getName]))\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Remove[cap [[$this assocattr] getName]] old_[[[$this assocattr] qualifier] getName], x\n"
}
$addcode indent -
$addcode append "End If\n"
$addcode indent -
$addcode append "End If\n"
if {[[[$this assocattr] opposite] isMandatory]} {
$addcode append "tempSet.Remove x\n"
}
}
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Add Me\n"
} else {
$addcode append "Set x.[[[$this assocattr] opposite] getName]_ = Me\n"
}
}
$addcode append "If [$vari name].ContainsKey(CStr([[[$this assocattr] qualifier] getName])) Then\n"
$addcode indent +
$addcode append "Set tempSet = [$vari name].Item(CStr([[[$this assocattr] qualifier] getName]))\n"
$addcode indent -
$addcode append "Else\n"
$addcode indent +
$addcode append "Set tempSet = New ClassSet\n"
$addcode append "[$vari name].Add tempSet, CStr([[[$this assocattr] qualifier] getName])\n"
$addcode indent -
$addcode append "End If\n"
$addcode append "tempSet.Add x\n"
$vari addProc $addsub
}
method VBGManyQual::generateGet {this vari} {
if {![$this hasGet 0]} {
$vari access "Public"
}
if {![$this hasGet 1]} {
return
}
set type [VBType new]
$type name "ClassSet"
set getproc [VBGetProperty new $type]
set getcode [TextSection new]
$getproc gencode $getcode
$getproc hasUserSection 0
$getproc access [$this hasRead]
$getproc name [[$this assocattr] getName]
$getcode append "If [[$this assocattr] getName]_.ContainsKey(CStr([[[$this assocattr] qualifier] getName])) Then\n"
$getcode indent +
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = "
$getcode append "[[$this assocattr] getName]_.Item(CStr([[[$this assocattr] qualifier] getName]))\n"
$getcode indent -
$getcode append "Else\n"
$getcode indent +
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = Nothing\n"
$getcode indent -
$getcode append "End If\n"
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$getproc addArg $arg
$vari addProc $getproc
}
method VBGManyQual::generateRemove {this vari} {
if {![$this hasRemove 0]} {
$vari access "Public"
}
if {![$this hasRemove 1]} {
return
}
set removesub [VBSub new]
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$removesub addArg $arg
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
$arg optional 1
$removesub addArg $arg
set removecode [TextSection new]
$removesub gencode $removecode
$removesub hasUserSection 0
$removesub name "Remove[cap [[$this assocattr] getName]]"
if {[$this hasWrite] == "None"} {
$removesub access "Private"
m4_warning $W_CHANGEDREM [[$this assocattr] getName]
} else {
$removesub access [$this hasWrite]
}
$removecode append "Dim tempSet As ClassSet\n"
$removecode append "Set tempSet = [$vari name].Item(CStr([[[$this assocattr] qualifier] getName]))\n"
$removecode append "If IsMissing(x) Then\n"
$removecode indent +
$removecode append "Dim temp As [[[[$this assocattr] ooplType] ooplClass] getName]\n"
$removecode append "While tempSet.Count > 0\n"
$removecode indent +
$removecode append "Set temp = tempSet.Item(1)\n"
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$removecode append "Set "
}
$removecode append "temp.[[[$this assocattr] opposite] getName]_"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append ".Remove Me"
} else {
$removecode append " = Nothing"
}
$removecode append "\n"
}
$removecode append "tempSet.Remove temp\n"
$removecode indent -
$removecode append "Wend\n"
$removecode append "[$vari name].RemoveUsingKey(CStr([[[$this assocattr] qualifier] getName]))\n"
$removecode indent -
$removecode append "Else\n"
$removecode indent +
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$removecode append "Set "
}
$removecode append "temp.[[[$this assocattr] opposite] getName]_"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append ".Remove Me"
} else {
$removecode append " = Nothing"
}
$removecode append "\n"
}
$removecode append "tempSet.Remove x\n"
$removecode append "If tempSet.Count = 0 Then\n"
$removecode indent +
$removecode append "[$vari name].RemoveUsingKey(CStr([[[$this assocattr] qualifier] getName]))\n"
$removecode indent -
$removecode append "End If\n"
$removecode indent -
$removecode append "End If\n"
$vari addProc $removesub
}
method VBGManyQual::generateDtor {this cl} {
if {![$this hasDtor 1]} {
return
}
if {[[$this assocattr] opposite] != ""} {
[[$cl terminate] gencode] append "While [[$this assocattr] getName]_.Count > 0\n"
[[$cl terminate] gencode] indent +
[[$cl terminate] gencode] append "Remove[cap [[$this assocattr] getName]] [[$this assocattr] getName]_.key(1)\n"
[[$cl terminate] gencode] indent -
[[$cl terminate] gencode] append "Wend\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgonequal.tcl /main/titanic/10
Class VBGOneQual : {VBGQual} {
constructor
method destructor
method generate
method generateAdd
method generateGet
method generateRemove
method generateDtor
}
constructor VBGOneQual {class this assocattr} {
set this [VBGQual::constructor $class $this $assocattr]
# Start constructor user section
# End constructor user section
return $this
}
method VBGOneQual::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBGQual::destructor
}
method VBGOneQual::generate {this cl} {
set type [VBType new]
$type name "New ClassSet"
set vari [VBVariable new $type]
$vari name "[[$this assocattr] getName]_"
$cl addAssocvar $vari
$vari access "Private"
if {[[$this assocattr] opposite] != ""} {
[[$this assocattr] opposite] setGenerator
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$vari access "Public"
}
}
$this generateGet $vari
$this generateAdd $vari
$this generateRemove $vari
$this generateDtor $cl
}
method VBGOneQual::generateAdd {this vari} {
if {![$this hasAdd 0]} {
$vari access "Public"
}
if {![$this hasAdd 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set arg [VBArgument new $type]
$arg name "x"
set addsub [VBSub new]
$addsub addArg $arg
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$addsub addArg $arg
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name "old_[[[$this assocattr] qualifier] getName]"
$arg optional 1
$addsub addArg $arg
}
}
set addcode [TextSection new]
$addsub gencode $addcode
$addsub hasUserSection 0
$addsub access [$this hasWrite]
$addsub name "Add[cap [[$this assocattr] getName]]"
if {[[$this assocattr] isMandatory]} {
$addcode append "If Not (x Is Nothing) Then\n"
$addcode indent +
}
if {[[$this assocattr] opposite] != ""} {
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$addcode append "If IsMissing(old_[[[$this assocattr] qualifier] getName]) Then\n"
$addcode indent +
$addcode append "If Not (x.[[[$this assocattr] opposite] getName]_ Is Nothing) Then\n"
$addcode indent +
if {[[[$this assocattr] opposite] isMandatory]} {
$addcode append "x.[[[$this assocattr] opposite] getName]_.[[$this assocattr] getName]_.RemoveUsingKey(CStr([[[$this assocattr] qualifier] getName]))\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Remove[cap [[$this assocattr] getName]]([[[$this assocattr] qualifier] getName])\n"
}
$addcode indent -
$addcode append "End If\n"
$addcode indent -
$addcode append "Else\n"
$addcode indent +
$addcode append "If Not (x.[[[$this assocattr] opposite] getName]_ Is Nothing) Then\n"
$addcode indent +
if {[[[$this assocattr] opposite] isMandatory]} {
$addcode append "x.[[[$this assocattr] opposite] getName]_.[[$this assocattr] getName]_.RemoveUsingKey(CStr(old_[[[$this assocattr] qualifier] getName]))\n"
} else {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Remove[cap [[$this assocattr] getName]](old_[[[$this assocattr] qualifier] getName])\n"
}
$addcode indent -
$addcode append "End If\n"
$addcode indent -
$addcode append "End If\n"
}
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$addcode append "x.[[[$this assocattr] opposite] getName]_.Add Me\n"
} else {
$addcode append "Set x.[[[$this assocattr] opposite] getName]_ = Me\n"
}
}
$addcode append "[$vari name].Add x, CStr([[[$this assocattr] qualifier] getName])\n"
if {[[$this assocattr] isMandatory]} {
$addcode indent -
$addcode append "End If\n"
}
$vari addProc $addsub
}
method VBGOneQual::generateGet {this vari} {
if {![$this hasGet 0]} {
$vari access "Public"
}
if {![$this hasGet 1]} {
return
}
set type [VBType new]
$type name [[[[$this assocattr] ooplType] ooplClass] getName]
set getproc [VBGetProperty new $type]
set getcode [TextSection new]
$getproc gencode $getcode
$getproc hasUserSection 0
$getproc access [$this hasRead]
$getproc name [[$this assocattr] getName]
$getcode append "If [[$this assocattr] getName]_.ContainsKey(CStr([[[$this assocattr] qualifier] getName])) Then\n"
$getcode indent +
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = "
$getcode append "[[$this assocattr] getName]_.Item(CStr([[[$this assocattr] qualifier] getName]))\n"
$getcode indent -
$getcode append "Else\n"
$getcode indent +
$getcode append "Set "
$getcode append "[[$this assocattr] getName] = Nothing\n"
$getcode indent -
$getcode append "End If\n"
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$getproc addArg $arg
$vari addProc $getproc
}
method VBGOneQual::generateRemove {this vari} {
if {![$this hasRemove 0]} {
$vari access "Public"
}
if {![$this hasRemove 1]} {
return
}
set removesub [VBSub new]
set type [VBType new]
$type name [[[[$this assocattr] qualifier] ooplType] getType3GL]
set arg [VBArgument new $type]
$arg name [[[$this assocattr] qualifier] getName]
$removesub addArg $arg
set removecode [TextSection new]
$removesub gencode $removecode
$removesub hasUserSection 0
$removesub name "Remove[cap [[$this assocattr] getName]]"
if {[$this hasWrite] == "None"} {
$removesub access "Private"
m4_warning $W_CHANGEDREM [[$this assocattr] getName]
} else {
$removesub access [$this hasWrite]
}
$removecode append "Dim temp As [[[[$this assocattr] ooplType] ooplClass] getName]\n"
$removecode append "Set temp = [$vari name].Item(CStr([[[$this assocattr] qualifier] getName]))\n"
if {[[$this assocattr] opposite] != ""} {
$removecode append "[$vari name].RemoveUsingKey(CStr([[[$this assocattr] qualifier] getName]))\n"
if {[[[$this assocattr] opposite] getMultiplicity] == "one"} {
$removecode append "Set "
}
$removecode append "temp.[[[$this assocattr] opposite] getName]_"
if {[[[$this assocattr] opposite] getMultiplicity] != "one"} {
$removecode append ".Remove Me"
} else {
$removecode append " = Nothing"
}
$removecode append "\n"
} else {
$removecode append "[$vari name].RemoveUsingKey(CStr([[[$this assocattr] qualifier] getName]))\n"
}
$vari addProc $removesub
}
method VBGOneQual::generateDtor {this cl} {
if {![$this hasDtor 1]} {
return
}
if {[[$this assocattr] opposite] != ""} {
[[$cl terminate] gencode] append "While [[$this assocattr] getName]_.Count > 0\n"
[[$cl terminate] gencode] indent +
[[$cl terminate] gencode] append "Remove[cap [[$this assocattr] getName]] [[$this assocattr] getName]_.key(1)\n"
[[$cl terminate] gencode] indent -
[[$cl terminate] gencode] append "Wend\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgassocat.tcl /main/titanic/9
Class VBGAssocAttr : {VBGGenAssocAttr} {
constructor
method destructor
method setGenerator
method generate
}
constructor VBGAssocAttr {class this name} {
set this [VBGGenAssocAttr::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGAssocAttr::setGenerator {this} {
if {[$this generator] == ""} {
if {[$this getMultiplicity]=="one"} {
$this generator [VBGAssocOne new $this]
} else {
$this generator [VBGAssocMany new $this]
}
}
}
method VBGAssocAttr::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
if {[$this hasContainer]} {
$this generateContainer $cl
} else {
$this setGenerator
[$this generator] generate $cl
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMAssocAttr] {
Class VBGAssocAttrD : {VBGAssocAttr CMAssocAttr} {
}
} else {
Class VBGAssocAttrD : {VBGAssocAttr OPAssocAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPAssocAttr) VBGAssocAttrD
selfPromoter OPAssocAttr {this} {
VBGAssocAttrD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbglinkatt.tcl /main/titanic/8
Class VBGLinkAttr : {VBGGenAssocAttr} {
constructor
method destructor
method setGenerator
method generate
}
constructor VBGLinkAttr {class this name} {
set this [VBGGenAssocAttr::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGLinkAttr::setGenerator {this} {
if {[$this generator] == ""} {
if {[$this getMultiplicity]=="one"} {
$this generator [VBGAssocOne new $this]
} else {
$this generator [VBGAssocMany new $this]
}
}
}
method VBGLinkAttr::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
if {[$this hasContainer]} {
$this generateContainer $cl
} else {
$this setGenerator
[$this generator] generate $cl
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMLinkAttr] {
Class VBGLinkAttrD : {VBGLinkAttr CMLinkAttr} {
}
} else {
Class VBGLinkAttrD : {VBGLinkAttr OPLinkAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPLinkAttr) VBGLinkAttrD
selfPromoter OPLinkAttr {this} {
VBGLinkAttrD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgqualass.tcl /main/titanic/9
Class VBGQualAssocAttr : {VBGGenAssocAttr} {
constructor
method destructor
method checkLocalSub
method setGenerator
method generate
}
constructor VBGQualAssocAttr {class this name} {
set this [VBGGenAssocAttr::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGQualAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGQualAssocAttr::checkLocalSub {this} {
set errornr 0
if {![[[$this qualifier] ooplType] isA OPBaseType]} {
m4_error $E_QUALTYPEWRONG [[$this qualifier] getName] [$this getName]
incr errornr 1
}
return $errornr
}
method VBGQualAssocAttr::setGenerator {this} {
if {[$this generator] == ""} {
if {[$this getMultiplicity]=="one"} {
$this generator [VBGOneQual new $this]
} else {
$this generator [VBGManyQual new $this]
}
}
}
method VBGQualAssocAttr::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
if {[$this hasContainer]} {
$this generateContainer $cl
} else {
$this setGenerator
[$this generator] generate $cl
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMQualAssocAttr] {
Class VBGQualAssocAttrD : {VBGQualAssocAttr CMQualAssocAttr} {
}
} else {
Class VBGQualAssocAttrD : {VBGQualAssocAttr OPQualAssocAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPQualAssocAttr) VBGQualAssocAttrD
selfPromoter OPQualAssocAttr {this} {
VBGQualAssocAttrD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgquallin.tcl /main/titanic/9
Class VBGQualLinkAttr : {VBGGenAssocAttr} {
constructor
method destructor
method checkLocalSub
method setGenerator
method generate
}
constructor VBGQualLinkAttr {class this name} {
set this [VBGGenAssocAttr::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGQualLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGQualLinkAttr::checkLocalSub {this} {
set errornr 0
if {![[[$this qualifier] ooplType] isA OPBaseType]} {
m4_error $E_QUALTYPEWRONG [[$this qualifier] getName] [$this getName]
incr errornr 1
}
return $errornr
}
method VBGQualLinkAttr::setGenerator {this} {
if {[$this generator] == ""} {
if {[$this getMultiplicity]=="one"} {
$this generator [VBGOneQual new $this]
} else {
$this generator [VBGManyQual new $this]
}
}
}
method VBGQualLinkAttr::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
if {[$this hasContainer]} {
$this generateContainer $cl
} else {
$this setGenerator
[$this generator] generate $cl
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMQualLinkAttr] {
Class VBGQualLinkAttrD : {VBGQualLinkAttr CMQualLinkAttr} {
}
} else {
Class VBGQualLinkAttrD : {VBGQualLinkAttr OPQualLinkAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPQualLinkAttr) VBGQualLinkAttrD
selfPromoter OPQualLinkAttr {this} {
VBGQualLinkAttrD promote $this
}
#---------------------------------------------------------------------------
# File: @(#)vbgreverse.tcl /main/titanic/8
Class VBGReverseLinkAttr : {VBGGenAssocAttr} {
constructor
method destructor
method setGenerator
method generate
}
constructor VBGReverseLinkAttr {class this name} {
set this [VBGGenAssocAttr::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBGReverseLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBGReverseLinkAttr::setGenerator {this} {
if {[$this generator] == ""} {
if {[$this getMultiplicity]=="one"} {
$this generator [VBGAssocOne new $this]
} else {
$this generator [VBGAssocOne new $this]
}
}
}
method VBGReverseLinkAttr::generate {this cl} {
if {[$this checkLocal] > 0} {
return
}
if {[$this hasContainer]} {
$this generateContainer $cl
} else {
$this setGenerator
[$this generator] generate $cl
}
}
# Do not delete this line -- regeneration end marker
if [isCommand CMReverseLinkAttr] {
Class VBGReverseLinkAttrD : {VBGReverseLinkAttr CMReverseLinkAttr} {
}
} else {
Class VBGReverseLinkAttrD : {VBGReverseLinkAttr OPReverseLinkAttr} {
}
}
global mostDerivedOOPL ; set mostDerivedOOPL(OPReverseLinkAttr) VBGReverseLinkAttrD
selfPromoter OPReverseLinkAttr {this} {
VBGReverseLinkAttrD promote $this
}