home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vbgrammar.tcl
< prev
next >
Wrap
Text File
|
1997-11-10
|
55KB
|
1,985 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 : vbgrammar.tcl
# Author :
# Original date : November 1997
# Description : Classes for code generation
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# File: @(#)vbcookie.tcl /main/titanic/5
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBCookie : {Object} {
constructor
method destructor
}
global VBCookie::inherAttribs
set VBCookie::inherAttribs "' Inheritance attributes"
global VBCookie::events
set VBCookie::events "' Events"
global VBCookie::implement0
set VBCookie::implement0 "' Implement this function!"
global VBCookie::implement1
set VBCookie::implement1 "'"
global VBCookie::startUserSection
set VBCookie::startUserSection "' Start user section"
global VBCookie::endUserSection
set VBCookie::endUserSection "' End user section"
global VBCookie::assocAttribs
set VBCookie::assocAttribs "' Association attributes"
global VBCookie::userDefControl
set VBCookie::userDefControl "' User defined control"
global VBCookie::userDefAttribs
set VBCookie::userDefAttribs "' User defined attributes"
global VBCookie::userDefMethods
set VBCookie::userDefMethods "' User defined methods"
global VBCookie::userDefEnums
set VBCookie::userDefEnums "' User defined Enums"
global VBCookie::accessMethods
set VBCookie::accessMethods "' Access methods"
global VBCookie::assocMethods
set VBCookie::assocMethods "' Association methods"
global VBCookie::classFeatureAttribs
set VBCookie::classFeatureAttribs "' Class feature attributes"
global VBCookie::classFeatureMethods
set VBCookie::classFeatureMethods "' Class feature methods"
global VBCookie::userAttribDefault
set VBCookie::userAttribDefault "' Has default value "
constructor VBCookie {class this} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBCookie::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbargument.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBArgument : {GCObject} {
constructor
method destructor
method generate
attribute optional
attribute passedBy
attribute name
attribute defaultValue
attribute type
}
constructor VBArgument {class this type} {
set this [GCObject::constructor $class $this]
$this optional 0
$this type $type
# Start constructor user section
$this passedBy ""
# End constructor user section
return $this
}
method VBArgument::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBArgument::generate {this whole} {
if {[$this optional]} {$whole append "Optional "}
if {[$this passedBy] != ""} {
$whole append [$this passedBy]
$whole append " "
}
$whole append [$this name]
$whole append " "
[$this type] generate $whole
if {[$this defaultValue] != ""} {
$whole append " = "
$whole append [$this defaultValue]
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbcomment.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBComment : {GCObject} {
constructor
method destructor
method generate
attribute comment
}
constructor VBComment {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method VBComment::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBComment::generate {this section} {
if { [string length [$this comment]] > 0 } {
set restComment [$this comment]
set newlinePos [string first "\n" $restComment ]
while {$newlinePos != -1} {
set thisline [string range $restComment 0 [expr $newlinePos - 1]]
set restComment \
[string range $restComment [expr $newlinePos + 1] end]
set newlinePos [string first "\n" $restComment ]
$section append "' $thisline\n"
}
$section append "' $restComment\n"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbenumcons.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBEnumConstant : {GCObject} {
constructor
method destructor
method generate
method module
attribute refName
attribute name
attribute hasValue
attribute value
attribute comment
attribute _module
}
constructor VBEnumConstant {class this module} {
set this [GCObject::constructor $class $this]
$this hasValue 0
$this _module $module
[$module _constSet] append $this
# Start constructor user section
$this comment ""
# End constructor user section
return $this
}
method VBEnumConstant::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBEnumConstant::generate {this section} {
if {![$this hasValue]} {
$this value [[$this module] unique]
$this hasValue 1
}
if {[$this comment] != ""} {
[$this comment] generate $section
}
if {[$this refName] != ""} {
$section append [$this refName]
$section append "_"
}
$section append [$this name]
$section append " = "
$section append [$this value]
$section append "\n"
}
# Do not delete this line -- regeneration end marker
method VBEnumConstant::module {this args} {
if {$args == ""} {
return [$this _module]
}
set ref [$this _module]
if {$ref != ""} {
[$ref _constSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _constSet] append $this
}
$this _module $obj
}
#---------------------------------------------------------------------------
# File: @(#)vbfeature.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBFeature : {GCObject} {
constructor
method destructor
attribute name
attribute refName
attribute access
attribute comment
}
constructor VBFeature {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
$this comment ""
$this refName ""
# End constructor user section
return $this
}
method VBFeature::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbproject.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBProject : {GCObject} {
constructor
method destructor
method generate
method getClassmodule
method setClassmodule
method removeClassmodule
method getForm
method setForm
method removeForm
method getModule
method setModule
method removeModule
attribute name
attribute mdiform
attribute classmodule
attribute form
attribute module
}
constructor VBProject {class this} {
set this [GCObject::constructor $class $this]
$this classmodule [Dictionary new]
$this form [Dictionary new]
$this module [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method VBProject::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBProject::generate {this typeToClassDict} {
$typeToClassDict foreach ooplclass fileDict {
switch [$ooplclass baseClass] {
"Form" {
if {[[$this form] exists [$ooplclass getName]]} {
set formfile [TextSection new]
[[$this form] set [$ooplclass getName]] generate $formfile
$fileDict set "frm" $formfile
if {[[[$this form] set [$ooplclass getName]] hasExtraModule]} {
set modulefile [TextSection new]
[[$this form] set [$ooplclass getName]] generateExtraModule $modulefile
$fileDict set "bas" $modulefile
}
}
}
"Class" {
if {[[$this classmodule] exists [$ooplclass getName]]} {
set classfile [TextSection new]
[[$this classmodule] set [$ooplclass getName]] generate $classfile
$fileDict set "cls" $classfile
if {[[[$this classmodule] set [$ooplclass getName]] hasExtraModule]} {
set modulefile [TextSection new]
[[$this classmodule] set [$ooplclass getName]] generateExtraModule $modulefile
$fileDict set "bas" $modulefile
}
}
}
"MDIForm" {
if {[$this mdiform] != ""} {
set mdiformfile [TextSection new]
[$this mdiform] generate $mdiformfile
$fileDict set "frm" $mdiformfile
if {[[$this mdiform] hasExtraModule]} {
set modulefile [TextSection new]
[$this mdiform] generateExtraModule $modulefile
$fileDict set "bas" $modulefile
}
}
}
"Enum" {
if {[[$this module] exists [$ooplclass getName]]} {
set modulefile [TextSection new]
[[$this module] set [$ooplclass getName]] generate $modulefile
$fileDict set "bas" $modulefile
}
}
}
}
}
# Do not delete this line -- regeneration end marker
method VBProject::getClassmodule {this name} {
return [[$this classmodule] set $name]
}
method VBProject::setClassmodule {this name newClassmodule} {
[$this classmodule] set $name $newClassmodule
}
method VBProject::removeClassmodule {this name} {
[$this classmodule] unset $name
}
method VBProject::getForm {this name} {
return [[$this form] set $name]
}
method VBProject::setForm {this name newForm} {
[$this form] set $name $newForm
}
method VBProject::removeForm {this name} {
[$this form] unset $name
}
method VBProject::getModule {this name} {
return [[$this module] set $name]
}
method VBProject::setModule {this name newModule} {
[$this module] set $name $newModule
}
method VBProject::removeModule {this name} {
[$this module] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)vbtype.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBType : {GCObject} {
constructor
method destructor
method generate
attribute name
}
constructor VBType {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method VBType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBType::generate {this whole} {
$whole append "As "
$whole append [$this name]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbobject.tcl /main/titanic/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBObject : {GCObject} {
constructor
method destructor
method addHeader
attribute name
}
constructor VBObject {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method VBObject::destructor {this} {
# Start destructor user section
# End destructor user section
}
method VBObject::addHeader {this fileT section} {
if {$fileT == "bas"} {
set filename "[$this name]Extras.$fileT"
} else {
set filename "[$this name].$fileT"
}
expandHeaderIntoSection $filename $fileT $section
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbprocedur.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBProcedure : {VBFeature} {
constructor
method destructor
method generateGenCode
method generateUserCode
method generateBegin
method generateBeginArguments
method generateBeginSub
method generateMiddle
method generateEnd
method generate
method addArg
method removeArg
attribute procType
attribute hasUserSection
attribute userCodeFirst
attribute usercode
attribute gencode
attribute argSet
}
constructor VBProcedure {class this} {
set this [VBFeature::constructor $class $this]
$this procType "None"
$this hasUserSection 1
$this userCodeFirst 0
$this argSet [List new]
# Start constructor user section
$this usercode ""
$this gencode ""
# End constructor user section
return $this
}
method VBProcedure::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBFeature::destructor
}
method VBProcedure::generateGenCode {this whole} {
$whole indent +
if {[$this gencode] != ""} {
$whole appendSect [$this gencode]
} elseif {![$this hasUserSection] && [$this usercode] == ""} {
$whole append "${VBCookie::implement0}\n"
$whole append "${VBCookie::implement1}\n"
}
$whole indent -
}
method VBProcedure::generateUserCode {this whole} {
if {[$this hasUserSection]} {
$whole indent +
$whole append "${VBCookie::startUserSection}\n"
$whole indent -
}
if {[$this usercode] != ""} {
$whole appendSect [$this usercode]
}
if {[$this hasUserSection]} {
$whole indent +
$whole append "${VBCookie::endUserSection}\n"
$whole indent -
}
}
method VBProcedure::generateBegin {this whole} {
if {[$this comment] != ""} {
[$this comment] generate $whole
}
$whole append [$this access]
$whole append " "
$whole append [$this procType]
$whole append " "
if {[$this refName] != ""} {
$whole append [$this refName]
$whole append "_"
}
$whole append [$this name]
$this generateBeginArguments $whole
}
method VBProcedure::generateBeginArguments {this whole} {
$whole append "("
set first 1
[$this argSet] foreach arg {
if {$first} {
set first 0
} else {
$whole append ", "
}
$arg generate $whole
}
$whole append ")"
}
method VBProcedure::generateBeginSub {this whole} {
$whole append "\n"
}
method VBProcedure::generateMiddle {this whole} {
if {[$this userCodeFirst]} {
$this generateUserCode $whole
$this generateGenCode $whole
} else {
$this generateGenCode $whole
$this generateUserCode $whole
}
}
method VBProcedure::generateEnd {this whole} {
$whole append "End "
$whole append [$this procType]
$whole append "\n\n"
}
method VBProcedure::generate {this whole} {
if {[$this access] != "None"} {
$this generateBegin $whole
$this generateBeginSub $whole
$this generateMiddle $whole
$this generateEnd $whole
}
}
# Do not delete this line -- regeneration end marker
method VBProcedure::addArg {this newArg} {
[$this argSet] append $newArg
}
method VBProcedure::removeArg {this oldArg} {
[$this argSet] removeValue $oldArg
}
#---------------------------------------------------------------------------
# File: @(#)vbproperty.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBProperty : {VBProcedure} {
constructor
method destructor
method generateEnd
attribute procType
attribute hasUserSection
}
constructor VBProperty {class this} {
set this [VBProcedure::constructor $class $this]
$this procType "Property None"
$this hasUserSection 0
# Start constructor user section
# End constructor user section
return $this
}
method VBProperty::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProcedure::destructor
}
method VBProperty::generateEnd {this whole} {
$whole append "End Property"
$whole append "\n\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbsetprope.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBSetProperty : {VBProperty} {
constructor
method destructor
attribute procType
}
constructor VBSetProperty {class this} {
set this [VBProperty::constructor $class $this]
$this procType "Property Set"
# Start constructor user section
# End constructor user section
return $this
}
method VBSetProperty::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProperty::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbgetprope.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBGetProperty : {VBProperty} {
constructor
method destructor
method generateBeginSub
attribute procType
attribute returnvalue
}
constructor VBGetProperty {class this returnvalue} {
set this [VBProperty::constructor $class $this]
$this procType "Property Get"
$this returnvalue $returnvalue
# Start constructor user section
# End constructor user section
return $this
}
method VBGetProperty::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProperty::destructor
}
method VBGetProperty::generateBeginSub {this whole} {
$whole append " "
[$this returnvalue] generate $whole
$whole append "\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbvariable.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBVariable : {VBFeature} {
constructor
method destructor
method generate
method generateProcs
method addProc
method removeProc
attribute defaultValue
attribute procSet
attribute type
}
constructor VBVariable {class this type} {
set this [VBFeature::constructor $class $this]
$this type $type
$this procSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method VBVariable::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBFeature::destructor
}
method VBVariable::generate {this whole} {
if {[$this comment] != ""} {
[$this comment] generate $whole
}
$whole append [$this access]
$whole append " "
if {[$this refName] != ""} {
$whole append [$this refName]
$whole append "_"
}
$whole append [$this name]
$whole append " "
[$this type] generate $whole
if {[$this defaultValue] != ""} {
$whole append "\n${VBCookie::userAttribDefault}"
$whole append [$this defaultValue]
}
$whole append "\n\n"
}
method VBVariable::generateProcs {this whole} {
[$this procSet] foreach proc {
$proc refName [$this refName]
$proc generate $whole
}
}
# Do not delete this line -- regeneration end marker
method VBVariable::addProc {this newProc} {
[$this procSet] append $newProc
}
method VBVariable::removeProc {this oldProc} {
[$this procSet] removeValue $oldProc
}
#---------------------------------------------------------------------------
# File: @(#)vbfunction.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBFunction : {VBProcedure} {
constructor
method destructor
method generateBeginSub
attribute procType
attribute returnvalue
}
constructor VBFunction {class this returnvalue} {
set this [VBProcedure::constructor $class $this]
$this procType "Function"
$this returnvalue $returnvalue
# Start constructor user section
# End constructor user section
return $this
}
method VBFunction::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProcedure::destructor
}
method VBFunction::generateBeginSub {this whole} {
$whole append " "
[$this returnvalue] generate $whole
$whole append "\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbsub.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBSub : {VBProcedure} {
constructor
method destructor
attribute procType
}
constructor VBSub {class this} {
set this [VBProcedure::constructor $class $this]
$this procType "Sub"
# Start constructor user section
# End constructor user section
return $this
}
method VBSub::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProcedure::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbevent.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBEvent : {VBSub} {
constructor
method destructor
method generateBeginArguments
attribute access
attribute hasIndex
}
constructor VBEvent {class this} {
set this [VBSub::constructor $class $this]
$this access "Private"
$this hasIndex 0
# Start constructor user section
# End constructor user section
return $this
}
method VBEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBSub::destructor
}
method VBEvent::generateBeginArguments {this whole} {
$whole append "("
if {[$this hasIndex]} {
$whole append "Index As Integer"
set first 0
} else {
set first 1
}
[$this argSet] foreach arg {
if {$first} {
set first 0
} else {
$whole append ", "
}
$arg generate $whole
}
$whole append ")"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbunit.tcl /main/titanic/10
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBUnit : {VBObject} {
constructor
method destructor
method generateAssocAttribs
method generateUserDefAttribs
method generateInherAttribs
method generateUserDefMethods
method generateAccessMethods
method generateAssocMethods
method generateEvents
method generateBegin
method generateEnd
method generate
method hasExtraModule
method generateExtraModule
method addGlobvar
method removeGlobvar
method addAssocvar
method removeAssocvar
method addUservar
method removeUservar
method addInhervar
method removeInhervar
method addUserSproc
method removeUserSproc
method addGlobSproc
method removeGlobSproc
method getUserproc
method setUserproc
method removeUserproc
method getGlobproc
method setGlobproc
method removeGlobproc
attribute type
attribute globvarSet
attribute attribs
attribute comment
attribute assocvarSet
attribute uservarSet
attribute inhervarSet
attribute userSprocSet
attribute globSprocSet
attribute constructor
attribute terminate
attribute userproc
attribute globproc
}
constructor VBUnit {class this} {
set this [VBObject::constructor $class $this]
$this type "None"
$this globvarSet [List new]
$this assocvarSet [List new]
$this uservarSet [List new]
$this inhervarSet [List new]
$this userSprocSet [List new]
$this globSprocSet [List new]
$this userproc [Dictionary new]
$this globproc [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method VBUnit::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBObject::destructor
}
method VBUnit::generateAssocAttribs {this section} {
$section append "\n${VBCookie::assocAttribs}\n\n"
[$this assocvarSet] foreach assocvar {
$assocvar generate $section
}
}
method VBUnit::generateUserDefAttribs {this section} {
$section append "\n${VBCookie::userDefAttribs}\n\n"
[$this uservarSet] foreach uservar {
$uservar generate $section
}
}
method VBUnit::generateInherAttribs {this section} {
}
method VBUnit::generateUserDefMethods {this section} {
$section append "\n${VBCookie::userDefMethods}\n\n"
if {[$this constructor] != ""} {
[$this constructor] refName [$this name]
[$this constructor] generate $section
}
if {[$this terminate] != ""} {
[$this terminate] refName [$this type]
[$this terminate] generate $section
}
[$this userSprocSet] foreach userproc {
$userproc generate $section
}
}
method VBUnit::generateAccessMethods {this section} {
$section append "\n${VBCookie::accessMethods}\n\n"
[$this uservarSet] foreach uservar {
$uservar generateProcs $section
}
[$this globvarSet] foreach globvar {
$globvar generateProcs $section
}
}
method VBUnit::generateAssocMethods {this section} {
$section append "\n${VBCookie::assocMethods}\n\n"
[$this assocvarSet] foreach assocvar {
$assocvar generateProcs $section
}
}
method VBUnit::generateEvents {this section} {
}
method VBUnit::generateBegin {this section} {
$section append "NONE\n"
}
method VBUnit::generateEnd {this section} {
$this generateInherAttribs $section
$this generateAssocAttribs $section
$this generateUserDefAttribs $section
$this generateUserDefMethods $section
$this generateEvents $section
$this generateAccessMethods $section
$this generateAssocMethods $section
}
method VBUnit::generate {this section} {
$this generateBegin $section
$this generateEnd $section
}
method VBUnit::hasExtraModule {this} {
if {[[$this globvarSet] empty]} {
if {[[$this globproc] size] == 0} {
return 0
}
}
return 1
}
method VBUnit::generateExtraModule {this section} {
$section append "Attribute VB_Name = \""
$section append [$this name]
$section append "Extras\"\n"
$this addHeader bas $section
$section append "Option Explicit\n"
$section append "\n${VBCookie::classFeatureAttribs}\n\n"
[$this globvarSet] foreach globalvar {
$globalvar refName [$this name]
$globalvar access "Public"
$globalvar generate $section
}
$section append "\n\n${VBCookie::classFeatureMethods}\n\n"
[$this globSprocSet] foreach globalproc {
$globalproc refName [$this name]
$globalproc access "Public"
$globalproc generate $section
}
}
# Do not delete this line -- regeneration end marker
method VBUnit::addGlobvar {this newGlobvar} {
[$this globvarSet] append $newGlobvar
}
method VBUnit::removeGlobvar {this oldGlobvar} {
[$this globvarSet] removeValue $oldGlobvar
}
method VBUnit::addAssocvar {this newAssocvar} {
[$this assocvarSet] append $newAssocvar
}
method VBUnit::removeAssocvar {this oldAssocvar} {
[$this assocvarSet] removeValue $oldAssocvar
}
method VBUnit::addUservar {this newUservar} {
[$this uservarSet] append $newUservar
}
method VBUnit::removeUservar {this oldUservar} {
[$this uservarSet] removeValue $oldUservar
}
method VBUnit::addInhervar {this newInhervar} {
[$this inhervarSet] append $newInhervar
}
method VBUnit::removeInhervar {this oldInhervar} {
[$this inhervarSet] removeValue $oldInhervar
}
method VBUnit::addUserSproc {this newUserSproc} {
[$this userSprocSet] append $newUserSproc
}
method VBUnit::removeUserSproc {this oldUserSproc} {
[$this userSprocSet] removeValue $oldUserSproc
}
method VBUnit::addGlobSproc {this newGlobSproc} {
[$this globSprocSet] append $newGlobSproc
}
method VBUnit::removeGlobSproc {this oldGlobSproc} {
[$this globSprocSet] removeValue $oldGlobSproc
}
method VBUnit::getUserproc {this name} {
return [[$this userproc] set $name]
}
method VBUnit::setUserproc {this name newUserproc} {
[$this userproc] set $name $newUserproc
}
method VBUnit::removeUserproc {this name} {
[$this userproc] unset $name
}
method VBUnit::getGlobproc {this name} {
return [[$this globproc] set $name]
}
method VBUnit::setGlobproc {this name newGlobproc} {
[$this globproc] set $name $newGlobproc
}
method VBUnit::removeGlobproc {this name} {
[$this globproc] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)vbclassmod.tcl /main/titanic/7
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBClassModule : {VBUnit} {
constructor
method destructor
method generateInherAttribs
method generateBegin
attribute type
}
constructor VBClassModule {class this} {
set this [VBUnit::constructor $class $this]
$this type "Class"
# Start constructor user section
# End constructor user section
return $this
}
method VBClassModule::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBUnit::destructor
}
method VBClassModule::generateInherAttribs {this section} {
$section append "\n${VBCookie::inherAttribs}\n\n"
[$this inhervarSet] foreach inhervar {
$inhervar generate $section
}
}
method VBClassModule::generateBegin {this section} {
$section append "VERSION 1.0 CLASS\n"
$section append "BEGIN\n"
$section append " MultiUse = -1 'True\n"
$section append "END\n"
if {[$this attribs] == ""} {
$section append "Attribute VB_Name = \""
$section append [$this name]
$section append "\"\n"
} else {
$section appendSect [$this attribs]
}
$this addHeader cls $section
if {[$this comment] != ""} {
[$this comment] generate $section
}
$section append "Option Explicit\n\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbcontaine.tcl /main/titanic/5
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBContainer : {VBObject} {
constructor
method destructor
method generateIndex
method generateMiddle
method generate
method generateRemarks
method generateEvents
method addSevent
method removeSevent
method getEvent
method setEvent
method removeEvent
attribute ofClass
attribute guiType
attribute guiLib
attribute hasIndex
attribute indexInSpecs
attribute index
attribute specs
attribute SeventSet
attribute event
}
constructor VBContainer {class this} {
set this [VBObject::constructor $class $this]
$this guiLib "VB"
$this hasIndex 0
$this indexInSpecs 0
$this SeventSet [List new]
$this event [Dictionary new]
# Start constructor user section
$this specs ""
# End constructor user section
return $this
}
method VBContainer::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBObject::destructor
}
method VBContainer::generateIndex {this section} {
if {[$this hasIndex] && ![$this indexInSpecs]} {
$section append "Index = "
$section append [$this index]
$section append "\n"
}
}
method VBContainer::generateMiddle {this section} {
$section append "NONE\n"
}
method VBContainer::generate {this section} {
$section append "Begin "
$section append [$this guiLib]
$section append "."
$section append [$this guiType]
$section append " "
$section append [$this name]
$section append "\n"
if {[$this specs] != ""} {
$section pushIndent 1
$section appendSect [$this specs]
$section popIndent
}
$section indent +
$this generateIndex $section
$section indent -
$section indent +
$this generateMiddle $section
$section indent -
$section append "End\n"
}
method VBContainer::generateRemarks {this section} {
$section append "${VBCookie::userDefControl} [$this name] of [$this ofClass]\n"
}
method VBContainer::generateEvents {this section} {
[$this SeventSet] foreach eventval {
$eventval refName [$this name]
$eventval hasIndex [$this hasIndex]
$eventval generate $section
}
}
# Do not delete this line -- regeneration end marker
method VBContainer::addSevent {this newSevent} {
[$this SeventSet] append $newSevent
}
method VBContainer::removeSevent {this oldSevent} {
[$this SeventSet] removeValue $oldSevent
}
method VBContainer::getEvent {this name} {
return [[$this event] set $name]
}
method VBContainer::setEvent {this name newEvent} {
[$this event] set $name $newEvent
}
method VBContainer::removeEvent {this name} {
[$this event] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)vbcontrol.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBControl : {VBContainer} {
constructor
method destructor
method getContainers
method addContain
method generateMiddle
method addSubcontrol
method removeSubcontrol
attribute subcontrolSet
}
constructor VBControl {class this} {
set this [VBContainer::constructor $class $this]
$this subcontrolSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method VBControl::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBContainer::destructor
}
method VBControl::getContainers {this frm} {
$frm addContainer $this
[$this subcontrolSet] foreach subcontrol {
$subcontrol getContainers $frm
}
}
method VBControl::addContain {this cl} {
$this addSubcontrol $cl
}
method VBControl::generateMiddle {this section} {
[$this subcontrolSet] foreach subcontrol {
$subcontrol generate $section
}
}
# Do not delete this line -- regeneration end marker
method VBControl::addSubcontrol {this newSubcontrol} {
[$this subcontrolSet] append $newSubcontrol
}
method VBControl::removeSubcontrol {this oldSubcontrol} {
[$this subcontrolSet] removeValue $oldSubcontrol
}
#---------------------------------------------------------------------------
# File: @(#)vbform.tcl /main/titanic/14
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBForm : {VBUnit} {
constructor
method destructor
method addContain
method checkSynonyms
method removeDuplicates
method setIndices
method configur
method generateControls
method generateControlRemarks
method generateMenus
method generateBegin
method generateEvents
method addContainer
method removeContainer
method addControl
method removeControl
method addMenu
method removeMenu
method addSortedmenu
method removeSortedmenu
method addSevent
method removeSevent
method getEvent
method setEvent
method removeEvent
attribute type
attribute objects
attribute specs
attribute containerSet
attribute controlSet
attribute menuSet
attribute sortedmenuSet
attribute SeventSet
attribute event
}
constructor VBForm {class this} {
set this [VBUnit::constructor $class $this]
$this type "Form"
$this containerSet [List new]
$this controlSet [List new]
$this menuSet [List new]
$this sortedmenuSet [List new]
$this SeventSet [List new]
$this event [Dictionary new]
# Start constructor user section
$this specs ""
# End constructor user section
return $this
}
method VBForm::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBUnit::destructor
}
method VBForm::addContain {this cl} {
if {[$cl guiType] == "Menu"} {
$this addMenu $cl
} else {
$this addControl $cl
}
}
method VBForm::checkSynonyms {this} {
set SynonymsDict [Dictionary new]
[$this containerSet] foreach container {
if {[$SynonymsDict exists [$container name]]} {
set group [$SynonymsDict set [$container name]]
$group foreach other {
$this removeDuplicates $container $other
}
} else {
set group [List new]
$SynonymsDict set [$container name] $group
}
$group append $container
}
[$this containerSet] foreach container {
if {[[$SynonymsDict set [$container name]] length] > 1} {
$container hasIndex 1
}
}
}
method VBForm::removeDuplicates {this first second} {
[$first event] foreach evntname evnt {
if {[[$second event] exists $evntname]} {
$second removeSevent [$second getEvent $evntname]
$second removeEvent $evntname
}
}
}
method VBForm::setIndices {this} {
set indexContainerDict [Dictionary new]
[$this containerSet] foreach container {
if {![$indexContainerDict exists [$container name]]} {
$indexContainerDict set [$container name] [Dictionary new]
}
if {[$container hasIndex] && [$container index] != ""} {
[$indexContainerDict set [$container name]] set [$container index] [$container index]
}
}
[$this containerSet] foreach container {
if {[$container hasIndex] && [$container index] == ""} {
set indx 0
set found 0
while {!$found} {
if {![[$indexContainerDict set [$container name]] exists $indx]} {
set found 1
} else {
incr indx
}
}
[$indexContainerDict set [$container name]] set $indx $indx
$container index $indx
}
}
}
method VBForm::configur {this} {
if {[[$this containerSet] empty]} {
[$this sortedmenuSet] foreach sortedmenu {
$sortedmenu getContainers $this
}
[$this menuSet] foreach menu {
$menu getContainers $this
}
[$this controlSet] foreach control {
$control getContainers $this
}
}
$this checkSynonyms
}
method VBForm::generateControls {this section} {
[$this controlSet] foreach control {
$control generate $section
}
}
method VBForm::generateControlRemarks {this section} {
[$this containerSet] foreach control {
$control generateRemarks $section
}
}
method VBForm::generateMenus {this section} {
[$this sortedmenuSet] foreach sortedmenu {
$sortedmenu generate $section
}
[$this menuSet] foreach menu {
$menu generate $section
}
}
method VBForm::generateBegin {this section} {
$section append "VERSION 5.00\n"
if {[$this objects] != ""} {
$section appendSect [$this objects]
}
$section append "Begin VB."
$section append [$this type]
$section append " "
$section append [$this name]
$section append " \n"
if {[$this specs] != ""} {
$section appendSect [$this specs]
}
$this configur
$this setIndices
set temp [$section indentString]
$section indentString " "
$section indent +
$this generateControls $section
$this generateMenus $section
$section indent -
$section indentString $temp
$section append "End\n"
if {[$this attribs] != ""} {
$section appendSect [$this attribs]
} else {
$section append "Attribute VB_Name = \""
$section append [$this name]
$section append "\"\n"
}
$this addHeader frm $section
$this generateControlRemarks $section
if {[$this comment] != ""} {
[$this comment] generate $section
}
$section append "Option Explicit\n\n"
}
method VBForm::generateEvents {this section} {
$section append "\n${VBCookie::events}\n\n"
[$this SeventSet] foreach eventval {
$eventval refName [$this type]
$eventval generate $section
}
[$this containerSet] foreach container {
$container generateEvents $section
}
}
# Do not delete this line -- regeneration end marker
method VBForm::addContainer {this newContainer} {
[$this containerSet] append $newContainer
}
method VBForm::removeContainer {this oldContainer} {
[$this containerSet] removeValue $oldContainer
}
method VBForm::addControl {this newControl} {
[$this controlSet] append $newControl
}
method VBForm::removeControl {this oldControl} {
[$this controlSet] removeValue $oldControl
}
method VBForm::addMenu {this newMenu} {
[$this menuSet] append $newMenu
}
method VBForm::removeMenu {this oldMenu} {
[$this menuSet] removeValue $oldMenu
}
method VBForm::addSortedmenu {this newSortedmenu} {
[$this sortedmenuSet] append $newSortedmenu
}
method VBForm::removeSortedmenu {this oldSortedmenu} {
[$this sortedmenuSet] removeValue $oldSortedmenu
}
method VBForm::addSevent {this newSevent} {
[$this SeventSet] append $newSevent
}
method VBForm::removeSevent {this oldSevent} {
[$this SeventSet] removeValue $oldSevent
}
method VBForm::getEvent {this name} {
return [[$this event] set $name]
}
method VBForm::setEvent {this name newEvent} {
[$this event] set $name $newEvent
}
method VBForm::removeEvent {this name} {
[$this event] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)vbmdiform.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBMDIForm : {VBForm} {
constructor
method destructor
attribute type
}
constructor VBMDIForm {class this} {
set this [VBForm::constructor $class $this]
$this type "MDIForm"
# Start constructor user section
# End constructor user section
return $this
}
method VBMDIForm::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBForm::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbenummodu.tcl /main/titanic/6
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBEnumModule : {VBObject} {
constructor
method destructor
method generate
method unique
method constSet
method addConst
method removeConst
attribute comment
attribute _constSet
}
constructor VBEnumModule {class this} {
set this [VBObject::constructor $class $this]
$this _constSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method VBEnumModule::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBObject::destructor
}
method VBEnumModule::generate {this section} {
if {[$this comment] != ""} {
[$this comment] generate $section
}
$section append "Attribute VB_Name = \""
$section append "[$this name]Extras"
$section append "\"\n"
$this addHeader bas $section
$section append "Option Explicit\n\n"
$section append "${VBCookie::userDefEnums}\n\n"
$section append "Enum [$this name]\n"
$section indent +
[$this constSet] foreach const {
$const generate $section
}
$section indent -
$section append "End Enum\n"
}
method VBEnumModule::unique {this} {
set value 0
set found 0
while {!$found} {
incr value
set found 1
[$this constSet] foreach const {
if {[$const hasValue]} {
if {[$const value] == $value} {
set found 0
break
}
}
}
}
return $value
}
# Do not delete this line -- regeneration end marker
method VBEnumModule::constSet {this} {
return [$this _constSet]
}
method VBEnumModule::addConst {this newConst} {
[$this _constSet] append $newConst
$newConst _module $this
}
method VBEnumModule::removeConst {this oldConst} {
$oldConst _module ""
[$this _constSet] removeValue $oldConst
}
#---------------------------------------------------------------------------
# File: @(#)vbletprope.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBLetProperty : {VBProperty} {
constructor
method destructor
attribute procType
}
constructor VBLetProperty {class this} {
set this [VBProperty::constructor $class $this]
$this procType "Property Let"
# Start constructor user section
# End constructor user section
return $this
}
method VBLetProperty::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBProperty::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)vbmenu.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class VBMenu : {VBContainer} {
constructor
method destructor
method getContainers
method addContain
method generateMiddle
method addSubmenu
method removeSubmenu
method addSortedsubmenu
method removeSortedsubmenu
attribute guiType
attribute submenuSet
attribute sortedsubmenuSet
}
constructor VBMenu {class this} {
set this [VBContainer::constructor $class $this]
$this guiType "Menu"
$this submenuSet [List new]
$this sortedsubmenuSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method VBMenu::destructor {this} {
# Start destructor user section
# End destructor user section
$this VBContainer::destructor
}
method VBMenu::getContainers {this frm} {
$frm addContainer $this
[$this sortedsubmenuSet] foreach sortedsubmenu {
$sortedsubmenu getContainers $frm
}
[$this submenuSet] foreach submenu {
$submenu getContainers $frm
}
}
method VBMenu::addContain {this cl} {
$this addSubmenu $cl
}
method VBMenu::generateMiddle {this section} {
[$this sortedsubmenuSet] foreach sortedsubmenu {
$sortedsubmenu generate $section
}
[$this submenuSet] foreach submenu {
$submenu generate $section
}
}
# Do not delete this line -- regeneration end marker
method VBMenu::addSubmenu {this newSubmenu} {
[$this submenuSet] append $newSubmenu
}
method VBMenu::removeSubmenu {this oldSubmenu} {
[$this submenuSet] removeValue $oldSubmenu
}
method VBMenu::addSortedsubmenu {this newSortedsubmenu} {
[$this sortedsubmenuSet] append $newSortedsubmenu
}
method VBMenu::removeSortedsubmenu {this oldSortedsubmenu} {
[$this sortedsubmenuSet] removeValue $oldSortedsubmenu
}