home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
stgglobal.tcl
< prev
next >
Wrap
Text File
|
1997-06-03
|
3KB
|
126 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)stgglobal.tcl /main/hindenburg/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)stgglobal.tcl /main/hindenburg/4 3 Jun 1997 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
global globals
# End user added include file section
# This class manages the global information for the generator.
Class STGGlobal : {GCObject} {
method destructor
constructor
method setGeneratePrint
method setDefaultCategory
method setUserCodeMarker
method setErrorDictionary
method setGeneratedMethodMarker
# Maps the error codes to error messages.
#
attribute errorDictionary
# Indicates whether print methods must be generated.
#
attribute generatePrint
# Default category naming: based on system or diagram names.
#
attribute defaultCategory
# The marker for user added code.
#
attribute startUserCodeMarker
# The marker for generated methods.
#
attribute generatedMethodMarker
}
method STGGlobal::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Set all the instance variables by calling their set methods.
#
constructor STGGlobal {class this} {
set this [GCObject::constructor $class $this]
$this setGeneratePrint
$this setDefaultCategory
$this setUserCodeMarker
$this errorDictionary [Dictionary new]
$this setErrorDictionary
return $this
}
# Sets generatePrint according to M4_st_generate_print.
# Default is 0.
#
method STGGlobal::setGeneratePrint {this} {
set generatePrint [m4_var get M4_st_generate_print]
if { [string tolower $generatePrint] == "on" } {
set generatePrint 1
} elseif { [string tolower $generatePrint] == "off" } {
set generatePrint 0
} elseif { $generatePrint == "0" } {
set generatePrint 0
} elseif { $generatePrint == "1" } {
set generatePrint 1
} else {
set generatePrint 1
}
$this generatePrint $generatePrint
}
# Sets defaultCategory according to M4_st_default_category.
# Default is System.
#
method STGGlobal::setDefaultCategory {this} {
set defaultCategory [m4_var get M4_st_default_category]
if { $defaultCategory == "" } {
set defaultCategory "System"
}
$this defaultCategory $defaultCategory
}
# Sets startUserCodeMarker.
#
method STGGlobal::setUserCodeMarker {this} {
$this startUserCodeMarker "\"Start user added code\""
}
# Sets errorDictionary with error codes as keys
# and error messages as values.
#
method STGGlobal::setErrorDictionary {this} {
[$this errorDictionary] set PARAMETER_NIL "Parameter nil for mandatory association"
[$this errorDictionary] set ASSOC_OBJ_NOT_FOUND "Associated object not found"
[$this errorDictionary] set QUAL_NOT_FOUND "Qualifier not found"
[$this errorDictionary] set CONSTRAINT "Constraint violation"
[$this errorDictionary] set CANNOT_RELEASE "Cannot release"
}
# Sets generatedMethodMarker.
#
method STGGlobal::setGeneratedMethodMarker {this} {
$this generatedMethodMarker "\"Generated\""
}
# Do not delete this line -- regeneration end marker