home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
fortetgt.tcl
< prev
next >
Wrap
Text File
|
1997-06-06
|
59KB
|
2,236 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 : fortetgt.tcl
# Author :
# Original date : May 1997
# Description : Classes for code generation
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# File: @(#)ftcompitem.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCompItem : {GCObject} {
constructor
method destructor
method generate
method composite
attribute item
attribute type
attribute _composite
}
constructor FTCompItem {class this i_item type composite} {
set this [GCObject::constructor $class $this]
$this item $i_item
$this type $type
$this _composite $composite
[$composite _itemSet] append $this
# Start constructor user section
# End constructor user section
return $this
}
method FTCompItem::destructor {this} {
# Start destructor user section
# End destructor user section
}
method FTCompItem::generate {this sect} {
set idx [[[$this composite] itemSet] search -exact $this]
if {$idx != 0} {
$sect append ";\n"
}
[$this type] generate "[$this item]" $sect [$this composite]
}
# Do not delete this line -- regeneration end marker
method FTCompItem::composite {this args} {
if {$args == ""} {
return [$this _composite]
}
set ref [$this _composite]
if {$ref != ""} {
[$ref _itemSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _itemSet] append $this
}
$this _composite $obj
}
#---------------------------------------------------------------------------
# File: @(#)ftenumitem.tcl /main/hindenburg/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTEnumItem : {GCObject} {
constructor
method destructor
method generate
method enum
attribute item
attribute value
attribute _enum
}
constructor FTEnumItem {class this i_item enum} {
set this [GCObject::constructor $class $this]
$this item $i_item
$this _enum $enum
[$enum _itemSet] append $this
# Start constructor user section
# End constructor user section
return $this
}
method FTEnumItem::destructor {this} {
# Start destructor user section
# End destructor user section
}
method FTEnumItem::generate {this sect} {
set idx [[[$this enum] itemSet] search -exact $this]
if {$idx != 0} {
$sect append ",\n"
}
$sect append "[$this item]"
if {[$this value] != ""} {
$sect append " = [$this value]"
}
}
# Do not delete this line -- regeneration end marker
method FTEnumItem::enum {this args} {
if {$args == ""} {
return [$this _enum]
}
set ref [$this _enum]
if {$ref != ""} {
[$ref _itemSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _itemSet] append $this
}
$this _enum $obj
}
#---------------------------------------------------------------------------
# File: @(#)ftmodel.tcl /main/hindenburg/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTModel : {GCObject} {
constructor
method destructor
method findDefinition
method generate
method definitionSet
method addDefinition
method removeDefinition
attribute _definitionSet
}
constructor FTModel {class this} {
set this [GCObject::constructor $class $this]
$this _definitionSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method FTModel::destructor {this} {
# Start destructor user section
# End destructor user section
}
method FTModel::findDefinition {this name {isSynthetic 0}} {
[$this definitionSet] foreach definition {
if {[$definition name] == $name && [$definition isSynthetic] == $isSynthetic} {
return $definition
}
}
return ""
}
method FTModel::generate {this typeToClassDict} {
[$this definitionSet] foreach definition {
if {[$definition isSynthetic]} {
continue
}
$definition generate
set sectDict [Dictionary new]
$sectDict set "cex" [$definition getGenSect]
$sectDict set "hex" [$definition getGenSect DECL]
$typeToClassDict set [$definition ooplClass] $sectDict
}
}
# Do not delete this line -- regeneration end marker
method FTModel::definitionSet {this} {
return [$this _definitionSet]
}
method FTModel::addDefinition {this newDefinition} {
[$this _definitionSet] append $newDefinition
$newDefinition _model $this
}
method FTModel::removeDefinition {this oldDefinition} {
$oldDefinition _model ""
[$this _definitionSet] removeValue $oldDefinition
}
#---------------------------------------------------------------------------
# File: @(#)ftobject.tcl /main/hindenburg/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTObject : {GCObject} {
constructor
method destructor
method getPropValue
method setPropValue
method removePropValue
attribute name
attribute propValue
}
constructor FTObject {class this i_name} {
set this [GCObject::constructor $class $this]
$this name $i_name
$this propValue [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method FTObject::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Do not delete this line -- regeneration end marker
method FTObject::getPropValue {this name} {
return [[$this propValue] set $name]
}
method FTObject::setPropValue {this name newPropValue} {
[$this propValue] set $name $newPropValue
}
method FTObject::removePropValue {this name} {
[$this propValue] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)ftsectionl.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTSectionList : {GCObject} {
constructor
method destructor
method addSects
method getSection
method setSection
method removeSection
attribute section
}
constructor FTSectionList {class this} {
set this [GCObject::constructor $class $this]
$this section [Dictionary new]
# Start constructor user section
# End constructor user section
return $this
}
method FTSectionList::destructor {this} {
# Start destructor user section
# End destructor user section
}
method FTSectionList::addSects {this nameList} {
foreach name $nameList {
if {[string match __*__ $name]} {
# this is some ruler, like __DEF_ONLY__
continue
}
if {[$this getSection $name] == ""} {
$this setSection $name [TextSection new]
}
}
}
# Do not delete this line -- regeneration end marker
method FTSectionList::getSection {this name} {
return [[$this section] set $name]
}
method FTSectionList::setSection {this name newSection} {
[$this section] set $name $newSection
}
method FTSectionList::removeSection {this name} {
[$this section] unset $name
}
#---------------------------------------------------------------------------
# File: @(#)fttype.tcl /main/hindenburg/5
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTType : {GCObject} {
constructor
method destructor
method isArray
method isClassType
method getTypeName
method generate
attribute name
attribute isClass
attribute isPointer
attribute otherModifier
attribute arraySize
attribute classType
}
constructor FTType {class this} {
set this [GCObject::constructor $class $this]
$this isClass -1
$this isPointer 0
$this arraySize -1
# Start constructor user section
# End constructor user section
return $this
}
method FTType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method FTType::isArray {this {size -1}} {
if {$size < 1} {
if {[$this arraySize] != -1} {
return 1
}
return 0
}
if {$size == 0} {
$this arraySize -1
} else {
$this arraySize $size
}
}
method FTType::isClassType {this} {
if {[$this isPointer]} {
return 0
}
if {[$this isClass] != -1} {
return [$this isClass]
}
# take a guess
if {[$this classType] == "" || [$this otherModifier] != ""} {
return 0
}
return 1
}
method FTType::getTypeName {this curClass} {
if {[$this classType] != ""} {
set typeName [[$this classType] name]
set typeSysName [[$this classType] systemName]
if {$typeSysName == ""} {
$this name $typeName
} else {
$this name "$typeSysName.$typeName"
}
}
if {[$this classType] == "" || ![$this isClassType]} {
if {[$this name] == ""} {
set typeName "no_type"
} else {
set typeName [$this name]
}
if {[$this isArray]} {
set typeName "array\[[$this arraySize]\] of $typeName"
}
} else {
$curClass addInclude $typeSysName
$curClass addForward $typeName [[$this classType] isMapped]
if {$typeSysName != ""} {
set typeName $typeSysName.$typeName
}
if {[$this isArray]} {
set arrName Array
if {[$this arraySize] > 255} {
set arrName "Large${arrName}"
}
$curClass addInclude Framework
set typeName "Framework.$arrName of $typeName"
}
}
if {[$this isPointer]} {
set typeName "pointer to $typeName"
}
# if otherModifier is set, then
# - '$name' is replaced by $typeName
# - if there is no $name, then otherModifier is placed before $typeName
#
if {[$this otherModifier] != ""} {
if {[regsub -all {\$name} [$this otherModifier] $typeName new]} {
set typeName $new
} else {
set typeName "[$this otherModifier] $typeName"
}
}
return $typeName
}
method FTType::generate {this varName sect curClass} {
set type [$this getTypeName $curClass]
if {$varName != ""} {
$sect append $varName
if {$type != ""} {
$sect append ": $type"
}
return
}
if {$type != ""} {
$sect append $type
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftdefiniti.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTDefinition : {FTObject} {
constructor
method destructor
method model
attribute _model
attribute ooplClass
}
constructor FTDefinition {class this i_name model} {
set this [FTObject::constructor $class $this $i_name]
$this _model $model
[$model _definitionSet] append $this
# Start constructor user section
# End constructor user section
return $this
}
method FTDefinition::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTObject::destructor
}
# Do not delete this line -- regeneration end marker
method FTDefinition::model {this args} {
if {$args == ""} {
return [$this _model]
}
set ref [$this _model]
if {$ref != ""} {
[$ref _definitionSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _definitionSet] append $this
}
$this _model $obj
}
#---------------------------------------------------------------------------
# File: @(#)ftclass.tcl /main/hindenburg/6
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTClass : {FTDefinition} {
constructor
method destructor
method addInclude
method addForward
method getGenSect
method findMethods
method findMethodsX
method attrSet
method addAttr
method removeAttr
method methSet
method addMeth
method removeMeth
method addSectName
method removeSectName
attribute systemName
attribute isSynthetic
attribute isMapped
attribute kind
attribute _attrSet
attribute _methSet
attribute super
attribute includeSet
attribute forwardSet
attribute mappedForwardSet
attribute sectNameSet
attribute sections
}
constructor FTClass {class this i_name model i_systemName i_isSynthetic} {
set this [FTDefinition::constructor $class $this $i_name $model]
$this isMapped 0
$this kind "CLASS"
$this systemName $i_systemName
$this isSynthetic $i_isSynthetic
$this _attrSet [List new]
$this _methSet [List new]
$this includeSet [List new]
$this forwardSet [List new]
$this mappedForwardSet [List new]
$this sectNameSet [List new]
# Start constructor user section
if {[$this isSynthetic]} {
return $this
}
$this sections [FTSectionList new]
# End constructor user section
return $this
}
method FTClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTDefinition::destructor
}
method FTClass::addInclude {this name} {
# don't add if 1) name=="" 2) name==$this.systemName 3) already present
#
if {$name == "" || $name == [$this systemName]} {
return
}
if {[[$this includeSet] search -exact $name] == -1} {
[$this includeSet] append $name
}
}
method FTClass::addForward {this name {isMapped 0}} {
# don't add if 1) name=="" 2) name==$this.name 3) already present
#
if {$name == "" || $name == [$this name]} {
return
}
set pre "f"
if {$isMapped} {
set pre "mappedF"
}
if {[[$this ${pre}orwardSet] search -exact $name] == -1} {
[$this ${pre}orwardSet] append $name
}
}
method FTClass::getGenSect {this {forWhat "DEF"}} {
# forWhat equals "DEF" (default) or "DECL"
#
set sect [TextSection new]
if {$forWhat == "DECL" && [[$this sectNameSet] search -glob __*__] == -1} {
$sect append "-- empty\n"
return $sect
}
set pre ""
if {[$this kind] != "CLASS"} {
set pre "-- "
}
$sect append "${pre}begin [$this kind];\n\n"
$sect append "-- generated by ObjectTeam Forte code generator\n\n"
$sect append "-- START PROJECT INCLUDES\n"
[$this includeSet] foreach incl {
$sect append "-- includes $incl;\n"
}
$sect append "-- END PROJECT INCLUDES\n\n"
$sect append "-- START FORWARD CLASS DECLARATIONS\n"
[$this forwardSet] foreach fwd {
$sect append "forward $fwd;\n"
}
[$this mappedForwardSet] foreach fwd {
$sect append "forward $fwd is mapped;\n"
}
$sect append "-- END FORWARD CLASS DECLARATIONS\n\n"
set doSkip 0
[$this sectNameSet] foreach sectName {
if {[string match __*__ $sectName]} {
if {$sectName == "__END__"} {
set doSkip 0
} elseif {$sectName == "__${forWhat}_ONLY__"} {
set doSkip 0
} else {
set doSkip 1
}
continue
}
if {$doSkip} {
continue
}
if {$sectName == "map" && ![$this isMapped]} {
# poss. result of regeneration, when class UserWindow -> Object
continue
}
set genSect [[$this sections] getSection $sectName]
if {[$genSect contents] != ""} {
if {$sectName == "obsolete"} {
$sect append "/* ${FTConstants::obsoleteCode} *\n"
$sect appendSect $genSect
$sect append " * ${FTConstants::obsoleteCode} */\n"
} else {
$sect appendSect $genSect
}
$sect append "\n"
}
}
$sect append "${pre}end [$this kind];\n"
return $sect
}
method FTClass::findMethods {this name {kind ""}} {
# return a list of methods having 'name'
# 'kind' means a normal method by default, may also be 'event' (meaning
# an event handler)
# to be used during regeneration
#
set meths {}
[$this methSet] foreach meth {
if {[$meth name] == $name} {
if {$kind == "event"} {
if {[$meth isA FTEventHandler]} {
lappend meths $meth
}
} else {
lappend meths $meth
}
}
}
return $meths
}
method FTClass::findMethodsX {this name kind} {
# return list of list { meth {{par1 par2 ...} {type}} }
# to be used during regeneration
#
set lst {}
foreach meth [$this findMethods $name $kind] {
lappend lst [list $meth [$meth getSignature]]
}
return $lst
}
# Do not delete this line -- regeneration end marker
method FTClass::attrSet {this} {
return [$this _attrSet]
}
method FTClass::addAttr {this newAttr} {
[$this _attrSet] append $newAttr
$newAttr _theClass $this
}
method FTClass::removeAttr {this oldAttr} {
$oldAttr _theClass ""
[$this _attrSet] removeValue $oldAttr
}
method FTClass::methSet {this} {
return [$this _methSet]
}
method FTClass::addMeth {this newMeth} {
[$this _methSet] append $newMeth
$newMeth _theClass $this
}
method FTClass::removeMeth {this oldMeth} {
$oldMeth _theClass ""
[$this _methSet] removeValue $oldMeth
}
method FTClass::addSectName {this newSectName} {
[$this sectNameSet] append $newSectName
}
method FTClass::removeSectName {this oldSectName} {
[$this sectNameSet] removeValue $oldSectName
}
#---------------------------------------------------------------------------
# File: @(#)ftserviceo.tcl /main/hindenburg/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTServiceObject : {FTClass} {
constructor
method destructor
method generate
}
constructor FTServiceObject {class this i_name model i_systemName i_isSynthetic} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
$this kind SERVICE
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
service
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTServiceObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTServiceObject::generate {this} {
[$this methSet] foreach meth {
$meth generate
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftfeature.tcl /main/hindenburg/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTFeature : {FTObject} {
constructor
method destructor
attribute type
}
constructor FTFeature {class this i_name type} {
set this [FTObject::constructor $class $this $i_name]
$this type $type
# Start constructor user section
# End constructor user section
return $this
}
method FTFeature::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTObject::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftmethod.tcl /main/hindenburg/4
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTMethod : {FTFeature} {
constructor
method destructor
method genAccess
method genSignature
method getSignature
method getUserCode
method theClass
method paramSet
method addParam
method removeParam
attribute hasCopyType
attribute isGenerated
attribute hasOldCode
attribute access
attribute _theClass
attribute _paramSet
attribute userCode
}
constructor FTMethod {class this i_name type access theClass} {
set this [FTFeature::constructor $class $this $i_name $type]
$this hasCopyType 0
$this isGenerated 0
$this hasOldCode 0
$this access $access
$this _theClass $theClass
[$theClass _methSet] append $this
$this _paramSet [List new]
# Start constructor user section
# End constructor user section
return $this
}
method FTMethod::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTFeature::destructor
}
method FTMethod::genAccess {this sect} {
$sect append "has "
# IMPR: FTMethod::genAccess: handle default prop
if {[$this access] == "private"} {
$sect append "private "
} else {
$sect append "public "
}
}
method FTMethod::genSignature {this sect {needsParen 0}} {
# generate signature for use during generation
# it is used for both the declaration and definition of the method
# signature is composed of name, parameters (or optional parentheses), and
# return type
# it is formatted in the Forte cex layout
#
$sect append [$this name]
# parameter list
#
if {[[$this paramSet] length] > 0 || $needsParen} {
$sect append "("
set pre ""
[$this paramSet] foreach param {
$param generate $pre $sect [$this theClass]
set pre ",\n\t"
}
$sect append ")"
}
# return type (maybe a copy)
#
if {[$this type] != ""} {
$sect append ": "
if {[$this hasCopyType] && [[$this type] isClassType]} {
$sect append "copy "
}
# $sect append "[[$this type] getTypeName [$this theClass]]"
[$this type] generate "" $sect [$this theClass]
}
}
method FTMethod::getSignature {this} {
# return the signature to be used during regeneration
# signature equals list { {par1 par2 ...} {type} }
#
set paramList {}
[$this paramSet] foreach param {
lappend paramList [[$param type] getTypeName [$this theClass]]
}
set type ""
if {[$this type] != ""} {
set type [[$this type] getTypeName [$this theClass]]
}
return [list $paramList $type]
}
method FTMethod::getUserCode {this} {
if {[$this userCode] == ""} {
$this userCode [TextSection new]
}
return [$this userCode]
}
# Do not delete this line -- regeneration end marker
method FTMethod::theClass {this args} {
if {$args == ""} {
return [$this _theClass]
}
set ref [$this _theClass]
if {$ref != ""} {
[$ref _methSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _methSet] append $this
}
$this _theClass $obj
}
method FTMethod::paramSet {this} {
return [$this _paramSet]
}
method FTMethod::addParam {this newParam} {
[$this _paramSet] append $newParam
$newParam _method $this
}
method FTMethod::removeParam {this oldParam} {
$oldParam _method ""
[$this _paramSet] removeValue $oldParam
}
#---------------------------------------------------------------------------
# File: @(#)ftcursorde.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCursorDef : {FTMethod} {
constructor
method destructor
method generate
}
constructor FTCursorDef {class this i_name type access theClass} {
set this [FTMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTCursorDef::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTMethod::destructor
}
method FTCursorDef::generate {this} {
set sect [[[$this theClass] sections] getSection cursorDef]
set signSect [TextSection new]
$this genSignature $signSect
$sect append "cursor "
$sect appendSect $signSect
$sect append "\nbegin\n"
if {[$this userCode] != ""} {
$sect pushIndent 1
$sect appendSect [$this userCode]
$sect popIndent
} else {
$sect indent +
$sect append "-- !! Implement this cursor !!\n"
$sect indent -
}
$sect append "end;\n\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftcomposit.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTComposite : {FTClass} {
constructor
method destructor
method generate
method getKind
method itemSet
method addItem
method removeItem
attribute _itemSet
}
constructor FTComposite {class this i_name model i_systemName i_isSynthetic} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
$this _itemSet [List new]
# Start constructor user section
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
composite
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTComposite::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTComposite::generate {this} {
if {[$this isSynthetic]} {
return
}
set sect [[$this sections] getSection composite]
$sect append "[$this getKind] [$this name]\n"
$sect indent +
[$this itemSet] foreach item {
$item generate $sect
}
$sect indent -
$sect append "\nend [$this getKind];\n"
}
method FTComposite::getKind {this} {
return ""
}
# Do not delete this line -- regeneration end marker
method FTComposite::itemSet {this} {
return [$this _itemSet]
}
method FTComposite::addItem {this newItem} {
[$this _itemSet] append $newItem
$newItem _composite $this
}
method FTComposite::removeItem {this oldItem} {
$oldItem _composite ""
[$this _itemSet] removeValue $oldItem
}
#---------------------------------------------------------------------------
# File: @(#)ftattribut.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTAttribute : {FTFeature} {
constructor
method destructor
method genAccess
method theClass
attribute access
attribute _theClass
}
constructor FTAttribute {class this i_name type access theClass} {
set this [FTFeature::constructor $class $this $i_name $type]
$this access $access
$this _theClass $theClass
[$theClass _attrSet] append $this
# Start constructor user section
# End constructor user section
return $this
}
method FTAttribute::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTFeature::destructor
}
method FTAttribute::genAccess {this sect} {
$sect append "has "
if {[$this access] == "private"} {
$sect append "private "
} else {
$sect append "public "
}
}
# Do not delete this line -- regeneration end marker
method FTAttribute::theClass {this args} {
if {$args == ""} {
return [$this _theClass]
}
set ref [$this _theClass]
if {$ref != ""} {
[$ref _attrSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _attrSet] append $this
}
$this _theClass $obj
}
#---------------------------------------------------------------------------
# File: @(#)ftcmnmetho.tcl /main/hindenburg/6
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCmnMethod : {FTMethod} {
constructor
method destructor
method generate
method subGenerate
attribute returnEvent
attribute exceptEvent
}
constructor FTCmnMethod {class this i_name type access theClass} {
set this [FTMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTCmnMethod::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTMethod::destructor
}
method FTCmnMethod::generate {this} {
set decSect [[[$this theClass] sections] getSection method]
$this genAccess $decSect
$decSect append "method "
set signSect [TextSection new]
$this genSignature $signSect
$decSect appendSect $signSect
if {[$this returnEvent] != ""} {
$decSect append " where completion = (return = [$this returnEvent]"
}
if {[$this exceptEvent] != ""} {
if {[$this returnEvent] == ""} {
$decSect append " where completion = ("
} else {
$decSect append ", "
}
$decSect append "exception = [$this exceptEvent]"
}
if {[$this returnEvent] != "" || [$this exceptEvent] != ""} {
$decSect append ")"
}
$decSect append ";\n"
set defSect [[[$this theClass] sections] getSection methodDef]
$defSect append "method [[$this theClass] name]."
$defSect appendSect $signSect
$defSect append "\nbegin\n"
$defSect indent +
$this subGenerate $defSect
$defSect indent -
$defSect append "end method;\n\n"
}
method FTCmnMethod::subGenerate {this sect} {
if {[$this userCode] != ""} {
$sect pushIndent 1
if {[$this hasOldCode]} {
$sect append "/* ${FTConstants::oldCode} *\n"
$sect appendSect [$this userCode]
$sect append " * ${FTConstants::oldCode} */\n"
} else {
$sect appendSect [$this userCode]
$sect popIndent
return
}
$sect popIndent
}
$sect append "-- !! Implement this method !!\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftgenmetho.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTGenMethod : {FTCmnMethod} {
constructor
method destructor
method subGenerate
attribute genCode
}
constructor FTGenMethod {class this i_name type access theClass} {
set this [FTCmnMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
$this genCode [TextSection new]
# End constructor user section
return $this
}
method FTGenMethod::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTCmnMethod::destructor
}
method FTGenMethod::subGenerate {this sect} {
$sect appendSect [$this genCode]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftaccmetho.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTAccMethod : {FTGenMethod} {
constructor
method destructor
attribute belongsTo
}
constructor FTAccMethod {class this i_name type access theClass belongsTo} {
set this [FTGenMethod::constructor $class $this $i_name $type $access $theClass]
$this belongsTo $belongsTo
# Start constructor user section
$this isGenerated 1
# End constructor user section
return $this
}
method FTAccMethod::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTGenMethod::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftcmnclass.tcl /main/hindenburg/5
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCmnClass : {FTClass} {
constructor
method destructor
method generate
attribute constructor
}
constructor FTCmnClass {class this i_name model i_systemName i_isSynthetic} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
header
constant
attribute
virtualAttribute
event
method
eventHandler
property
map
trailer
__DEF_ONLY__
methodDef
eventHandlerDef
obsolete
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTCmnClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTCmnClass::generate {this} {
if {[$this isSynthetic]} {
return
}
set sect [[$this sections] getSection header]
$sect append "class [$this name] "
if {[$this isMapped]} {
$sect append "is mapped "
}
$sect append "inherits from [[$this super] getTypeName $this]\n"
[$this attrSet] foreach attr {
$attr generate
}
[$this methSet] foreach meth {
$meth generate
}
if {[$this isMapped]} {
$this generateMap
}
set sect [[$this sections] getSection trailer]
$sect append "end class;\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftwinclass.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTWinClass : {FTCmnClass} {
constructor
method destructor
method generateMap
}
constructor FTWinClass {class this i_name model i_systemName i_isSynthetic} {
set this [FTCmnClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
$this isMapped 1
# End constructor user section
return $this
}
method FTWinClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTCmnClass::destructor
}
method FTWinClass::generateMap {this} {
set sect [[$this sections] getSection map]
if {[$sect contents] != ""} {
# regenerated...
return
}
$sect append "has\n"
$sect append "+5151463100000111000000ec9fe4010100002101020000000002020600940800\n"
$sect append "+1d009fff010104210f1011120101011700009fff000000000900000bb80fa000\n"
$sect append "+000000000000000000010160600000000000000000009d0bb89d0fa000000105\n"
$sect append "+030301fffd0000000000000c0405000600000201000100000b000001000b0300\n"
$sect append "+0021010200000000050400001c01000506007a08004d009fff010101010f1011\n"
$sect append "+120101011700009fff0100000009000007d007d0000000000303030300020202\n"
$sect append "+a0a00000000000000000009d07d09d07d000000105066b010000000000000000\n"
$sect append "+060006000021000200000000061a7e898f9ce29cec12191a385e5f6b7e88898d\n"
$sect append "+8f9cad9cd39cd49ce09ce29cec9cec0000\n"
$sect append "-001e986b\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)fteventhan.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTEventHandler : {FTMethod} {
constructor
method destructor
method generate
}
constructor FTEventHandler {class this i_name type access theClass} {
set this [FTMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTEventHandler::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTMethod::destructor
}
method FTEventHandler::generate {this} {
set decSect [[[$this theClass] sections] getSection eventHandler]
$this genAccess $decSect
$decSect append "event handler "
set signSect [TextSection new]
$this genSignature $signSect 1
$decSect appendSect $signSect
$decSect append ";\n"
set defSect [[[$this theClass] sections] getSection eventHandlerDef]
$defSect append "event handler [[$this theClass] name]."
$defSect appendSect $signSect
$defSect append "\nbegin\n"
if {[$this userCode] != ""} {
$defSect pushIndent 1
if {[$this hasOldCode]} {
$defSect append "/* ${FTConstants::oldCode} *\n"
$defSect appendSect [$this userCode]
$defSect append " * ${FTConstants::oldCode} */\n"
} else {
$defSect appendSect [$this userCode]
}
$defSect popIndent
}
if {[$this userCode] == "" || [$this hasOldCode]} {
$defSect indent +
$defSect append "-- !! Implement this event handler !!\n"
$defSect indent -
}
$defSect append "end event;\n\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftconstant.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTConstant : {FTClass} {
constructor
method destructor
method generate
attribute value
}
constructor FTConstant {class this i_name model i_systemName i_isSynthetic i_value} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
$this value $i_value
# Start constructor user section
$this kind CONSTANT
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
constant
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTConstant::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTConstant::generate {this} {
set sect [[$this sections] getSection constant]
$sect append "constant [$this name] = [$this value];\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftcursor.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCursor : {FTClass} {
constructor
method destructor
method generate
}
constructor FTCursor {class this i_name model i_systemName i_isSynthetic} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
$this kind CURSOR
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
cursorDef
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTCursor::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTCursor::generate {this} {
[$this methSet] foreach meth {
$meth generate
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftevent.tcl /main/hindenburg/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTEvent : {FTMethod} {
constructor
method destructor
method generate
}
constructor FTEvent {class this i_name type access theClass} {
set this [FTMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTMethod::destructor
}
method FTEvent::generate {this} {
set sect [[[$this theClass] sections] getSection event]
$this genAccess $sect
$sect append "event "
$this genSignature $sect
$sect append ";\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftunion.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTUnion : {FTComposite} {
constructor
method destructor
method getKind
}
constructor FTUnion {class this i_name model i_systemName i_isSynthetic} {
set this [FTComposite::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
$this kind UNION
# End constructor user section
return $this
}
method FTUnion::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTComposite::destructor
}
method FTUnion::getKind {this} {
return union
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftconstatt.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTConstAttrib : {FTAttribute} {
constructor
method destructor
method generate
attribute value
}
constructor FTConstAttrib {class this i_name type access theClass i_value} {
set this [FTAttribute::constructor $class $this $i_name $type $access $theClass]
$this value $i_value
# Start constructor user section
# End constructor user section
return $this
}
method FTConstAttrib::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTAttribute::destructor
}
method FTConstAttrib::generate {this} {
set sect [[[$this theClass] sections] getSection constant]
$this genAccess $sect
$sect append "constant [$this name] = "
# IMPR: FTConstAttrib::generate: handle type, e.g. 0.0/0/''
$sect append "[$this value];\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftconstruc.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTConstructor : {FTGenMethod} {
constructor
method destructor
method generate
}
constructor FTConstructor {class this i_name type access theClass} {
set this [FTGenMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTConstructor::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTGenMethod::destructor
}
method FTConstructor::generate {this} {
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftstruct.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTStruct : {FTComposite} {
constructor
method destructor
method getKind
}
constructor FTStruct {class this i_name model i_systemName i_isSynthetic} {
set this [FTComposite::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
$this kind STRUCT
# End constructor user section
return $this
}
method FTStruct::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTComposite::destructor
}
method FTStruct::getKind {this} {
return struct
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftservice.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTService : {FTMethod} {
constructor
method destructor
method generate
}
constructor FTService {class this i_name type access theClass} {
set this [FTMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTService::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTMethod::destructor
}
method FTService::generate {this} {
set sect [[[$this theClass] sections] getSection service]
set name [[$this theClass] name]
$sect append "service $name : "
# following code has been taken from FTMethod::genSignature
#
# service type equals return type or else the name of this method
# we do this to get a real 'type' (qualified with system) iso just a 'name'
#
if {[$this type] != ""} {
set className [[$this type] getTypeName [$this theClass]]
} else {
set className [$this name]
}
$sect append $className
m4_message $M_SERVICE_OBJ $className
# parameter list
#
if {[[$this paramSet] length] > 0} {
$sect append " = ("
set pre ""
[$this paramSet] foreach param {
# parameters without default value (in terms of service objects:
# attributes without initial value) are skipped
#
if {[$param defaultVal] != ""} {
$param generate $pre $sect [$this theClass]
set pre ",\n\t"
} else {
m4_warning $W_SERVICE_OBJ3 [$param name] $name
}
}
$sect append ")"
}
$sect append ";\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftinit.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTInit : {FTGenMethod} {
constructor
method destructor
method subGenerate
}
constructor FTInit {class this i_name type access theClass} {
set this [FTGenMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
$this name Init
$this access public
# End constructor user section
return $this
}
method FTInit::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTGenMethod::destructor
}
method FTInit::subGenerate {this sect} {
$sect append "super.Init();\n"
$sect appendSect [$this genCode]
$sect append "-- ${FTConstants::startCtor}\n"
if {[$this userCode] != ""} {
$sect pushIndent 1
$sect appendSect [$this userCode]
$sect popIndent
}
$sect append "-- ${FTConstants::endCtor}\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftusermeth.tcl /main/hindenburg/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTUserMethod : {FTCmnMethod} {
constructor
method destructor
}
constructor FTUserMethod {class this i_name type access theClass} {
set this [FTCmnMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTUserMethod::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTCmnMethod::destructor
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftdisplay.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTDisplay : {FTGenMethod} {
constructor
method destructor
method subGenerate
}
constructor FTDisplay {class this i_name type access theClass} {
set this [FTGenMethod::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
$this name Display
$this access public
# End constructor user section
return $this
}
method FTDisplay::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTGenMethod::destructor
}
method FTDisplay::subGenerate {this sect} {
if {[$this userCode] != ""} {
$sect pushIndent 1
$sect appendSect [$this userCode]
$sect popIndent
return
}
$sect append "self.Open();
event loop
when task.Shutdown do
exit;
end event;\n"
$sect append "self.Close();\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftvirtattr.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTVirtAttrib : {FTAttribute} {
constructor
method destructor
method generate
attribute getExpr
attribute setExpr
}
constructor FTVirtAttrib {class this i_name type access theClass i_getExpr} {
set this [FTAttribute::constructor $class $this $i_name $type $access $theClass]
$this getExpr $i_getExpr
# Start constructor user section
# End constructor user section
return $this
}
method FTVirtAttrib::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTAttribute::destructor
}
method FTVirtAttrib::generate {this} {
set sect [[[$this theClass] sections] getSection virtualAttribute]
$this genAccess $sect
$sect append "virtual attribute "
[$this type] generate [$this name] $sect [$this theClass]
$sect append " = (get =[$this getExpr]"
if {[$this setExpr] != ""} {
$sect append ", set =[$this setExpr]"
}
$sect append ");\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)fttypedef.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTTypeDef : {FTClass} {
constructor
method destructor
method generate
attribute type
}
constructor FTTypeDef {class this i_name model i_systemName i_isSynthetic type} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
$this type $type
# Start constructor user section
$this kind TYPEDEF
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
typedef
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTTypeDef::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTTypeDef::generate {this} {
if {[$this isSynthetic]} {
return
}
set sect [[$this sections] getSection typedef]
$sect append "typedef [$this name] : [[$this type] getTypeName $this];\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftenum.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTEnum : {FTClass} {
constructor
method destructor
method generate
method itemSet
method addItem
method removeItem
attribute _itemSet
}
constructor FTEnum {class this i_name model i_systemName i_isSynthetic} {
set this [FTClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
$this _itemSet [List new]
# Start constructor user section
$this kind ENUM
if {[$this isSynthetic]} {
return $this
}
[$this sectNameSet] contents {
enum
}
[$this sections] addSects [[$this sectNameSet] contents]
# End constructor user section
return $this
}
method FTEnum::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTClass::destructor
}
method FTEnum::generate {this} {
if {[$this isSynthetic]} {
return
}
set sect [[$this sections] getSection enum]
$sect append "enum [$this name]\n"
$sect indent +
[$this itemSet] foreach item {
$item generate $sect
}
$sect indent -
$sect append "\nend enum;\n"
}
# Do not delete this line -- regeneration end marker
method FTEnum::itemSet {this} {
return [$this _itemSet]
}
method FTEnum::addItem {this newItem} {
[$this _itemSet] append $newItem
$newItem _enum $this
}
method FTEnum::removeItem {this oldItem} {
$oldItem _enum ""
[$this _itemSet] removeValue $oldItem
}
#---------------------------------------------------------------------------
# File: @(#)ftparamete.tcl /main/hindenburg/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTParameter : {FTObject} {
constructor
method destructor
method generate
method method
attribute direction
attribute asCopy
attribute defaultVal
attribute _method
attribute type
}
constructor FTParameter {class this i_name i_direction method type} {
set this [FTObject::constructor $class $this $i_name]
$this asCopy 0
$this direction $i_direction
$this _method $method
[$method _paramSet] append $this
$this type $type
# Start constructor user section
# End constructor user section
return $this
}
method FTParameter::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTObject::destructor
}
method FTParameter::generate {this pre sect curClass} {
$sect append "${pre}"
if {[$this asCopy] && [[$this type] isClassType]} {
$sect append "copy "
}
if {[$this direction] != ""} {
$sect append "[$this direction] "
}
if {[$this type] != ""} {
[$this type] generate [$this name] $sect $curClass
} else {
$sect append [$this name]
}
if {[$this defaultVal] != ""} {
$sect append " = [$this defaultVal]"
}
}
# Do not delete this line -- regeneration end marker
method FTParameter::method {this args} {
if {$args == ""} {
return [$this _method]
}
set ref [$this _method]
if {$ref != ""} {
[$ref _paramSet] removeValue $this
}
set obj [lindex $args 0]
if {$obj != ""} {
[$obj _paramSet] append $this
}
$this _method $obj
}
#---------------------------------------------------------------------------
# File: @(#)ftcmnattri.tcl /main/hindenburg/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTCmnAttrib : {FTAttribute} {
constructor
method destructor
method generate
}
constructor FTCmnAttrib {class this i_name type access theClass} {
set this [FTAttribute::constructor $class $this $i_name $type $access $theClass]
# Start constructor user section
# End constructor user section
return $this
}
method FTCmnAttrib::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTAttribute::destructor
}
method FTCmnAttrib::generate {this} {
set sect [[[$this theClass] sections] getSection attribute]
$this genAccess $sect
$sect append "attribute "
[$this type] generate [$this name] $sect [$this theClass]
$sect append ";\n"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)ftdomclass.tcl /main/hindenburg/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class FTDomClass : {FTCmnClass} {
constructor
method destructor
}
constructor FTDomClass {class this i_name model i_systemName i_isSynthetic} {
set this [FTCmnClass::constructor $class $this $i_name $model $i_systemName $i_isSynthetic]
# Start constructor user section
# End constructor user section
return $this
}
method FTDomClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this FTCmnClass::destructor
}
# Do not delete this line -- regeneration end marker