|
Class: CodeGeneratorTool
Object
|
+--CodeGeneratorTool
|
+--JavaScriptCodeGeneratorTool
|
+--SmalltalkCodeGeneratorTool
- Package:
- stx:libtool
- Category:
- Interface-Browsers
- Version:
- rev:
1.143
date: 2023/12/08 14:34:17
- user: cg
- file: CodeGeneratorTool.st directory: libtool
- module: stx stc-classLibrary: libtool
This utility class contains various code generation facilites;
these were extracted from the old and newBrowser.
There is probably more to come...
Note: being refactored into separate per-language generators
copyrightCOPYRIGHT (c) 2002 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
code generation
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly
-
create accessors in aClass
-
createApplicationCodeFor: aClass
-
create an empty application framework
-
createClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol
-
createClassTypeTestMethodsIn: aClass forClasses: subClasses
-
create a #isXXX test methods (I'm tired of typing)
-
createDocumentationMethodsFor: aClass
-
create empty documentation methods
-
createEnumTypeCodeFor: aClass
-
-
createInitializationMethodIn: aClass
-
create a #initialize methods (I'm tired of typing)
-
createInitializedInstanceCreationMethodsIn: aClass
-
create a #new and #initialize methods (I'm tired of typing)
-
createIsAbstractMethodIn: aClass
-
create a #isABstract query method (I'm tired of typing)
-
createIsObsoleteMethodIn: aClass
-
create a #isABstract query method (I'm tired of typing)
-
createParametrizedInstanceCreationMethodsNamed: selector in: aClass
-
create a #selector instance creation method (I'm tired of typing)
-
createRedefinedInstanceCreationMethodsIn: aClass
-
create a redefined #new method
-
createSingletonPatternInstanceCreationMethodsIn: aClass usingVariable: varName
-
create redefined #new method for singleton pattern
-
createStandaloneStartupCodeFor: aClass
-
create an empty console application framework
-
createStartupCodeFor: aClass forStartOf: anApplicationClassOrNil
-
create standAloneStartup code
-
createTestCaseSampleCodeFor: aClass
-
create an (almost) empty testCase class
-
createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass
-
create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)
-
createWebApplicationCodeFor: aClass
-
create an empty webApplication framework
-
createWebServiceCodeFor: aClass
-
create an empty webService framework
-
createWidgetCodeFor: aClass
-
create usually required widget code (redraw, model update, event handling)
-
createWindowSpecSourceCodeFor: aSpec class: className selector: methodName forFileIn: forFileIn
-
generate the code for the method to be compiled/filedIn
-
initialMenuSpecMethodSourceForApplications
-
return code for a menuSpec with typical stuff in it
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initialPageMenuSpecMethodSourceForWebApplications
-
return code for a menuSpec with typical stuff in it
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initialPageSpecMethodSourceForWebApplications
-
return an empty pageSpec
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initialToolbarMenuSpecMethodSource
-
return a menuSpec with typical stuff in it
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initialWindowSpecMethodSourceForApplications
-
return an empty windowSpec with an initial menubar in it
** This method must be redefined in concrete classes (subclassResponsibility) **
-
initialWindowSpecMethodSourceForDialogs
-
return an empty windowSpec for dialogs
** This method must be redefined in concrete classes (subclassResponsibility) **
code generation-basic
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
code generation-individual methods
-
createAcceptVisitorMethod: selector in: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
-
createAcceptVisitorMethodIn: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
-
createAspectMethodFor: anAspectSymbol in: aClass
-
create an aspect method.
-
createCopyrightMethodFor: aClass
-
add copyright method containing your/your companies
copyright template but only if not already present.
this is only added, if specified in the
COPYRIGHT_TEMPLATE_FILE resources.
-
createDocumentationMethodFor: aClass
-
add documentation method containing doc template
but only if not already present.
-
createExamplesMethodFor: aClass
-
add examples method containing examples template
but only if not already present.
-
createFalseReturnMethodFor: aSelector category: cat in: aClass
-
add a ^ false method;
but only if not already present.
-
createImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
-
createInitialHistoryMethodFor: aClass
-
add history method containing created-entry
but only if not already present.
-
createInstanceCreationMethodWithSetupFor: selector category: category in: aMetaClass
-
add an inst-creation method
-
createMultiSetterInstanceCreationMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter instance creator method for instvars.
This creates a multi setter method (a:val1 b:val2 c:val3...)
and a corresponding new method on the class side.
-
createMultiSetterMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter method (a:val1 b:val2 c:val3...) for instvars.
-
createSubclassResponsibilityMethodFor: aSelector category: cat in: aClass
-
add a subclassResponsibility method;
but only if not already present.
-
createUncachedPNGImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
-
createUpdateMethodIn: aClass
-
create an update:with:from:-method
(I'm tired of typing)
-
createVersionMethodFor: aClass
-
add a version method containing RCS template
but only if not already present and it's not a private class.
code generation-menus
-
createActionMethodFor: aSelector in: aClass category: aCategory redefine: redefine
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createAspectMethodFor: aSelector in: aClass category: aCategory redefine: redefine
-
** This method must be redefined in concrete classes (subclassResponsibility) **
compilation
-
compile: theCode forClass: aClass inCategory: cat
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
defaults
-
copyrightTemplate
-
return the contents of COPYRIGHT_TEMPLATE_FILE resources
or a standard template
-
copyrightTemplate: aString
-
set the COPYRIGHT_TEMPLATE_FILE
-
copyrightTemplateFor: aYearNumber
-
return the contents of COPYRIGHT_TEMPLATE_FILE resources
or a standard template
instance creation
-
new
-
(comment from inherited method)
return an instance of myself without indexed variables
interface specs
-
initialMenuSpecForApplications
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
Usage example(s):
MenuEditor new openOnClass:CodeGeneratorTool andSelector:#initialMenuSpecForApplications
(Menu new fromLiteralArrayEncoding:(CodeGeneratorTool initialMenuSpecForApplications)) startUp
|
-
initialPageMenuSpecForWebApplications
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
Usage example(s):
MenuEditor new openOnClass:CodeGeneratorTool andSelector:#initialPageMenuSpecForWebApplications
(Menu new fromLiteralArrayEncoding:(CodeGeneratorTool initialPageMenuSpecForWebApplications)) startUp
|
-
initialPageSpecForWebApplications
-
Do not manually edit this! If it is corrupted,
the UIPainter may not be able to read the specification.
Usage example(s):
UIPainter new openOnClass:self andSelector:#initialPageSpecForWebApplications
|
-
initialToolbarMenuSpec
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
Usage example(s):
MenuEditor new openOnClass:CodeGeneratorTool andSelector:#initialToolbarMenuSpec
(Menu new fromLiteralArrayEncoding:(CodeGeneratorTool initialToolbarMenuSpec)) startUp
|
-
initialWindowSpecForApplications
-
This resource specification was automatically generated
by the UIPainter of ST/X.
Usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications
|
-
initialWindowSpecForApplications2
-
This resource specification was automatically generated
by the UIPainter of ST/X.
Usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications2
|
-
initialWindowSpecForDialogs
-
This resource specification was automatically generated
by the UIPainter of ST/X.
Usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForDialogs
|
private
-
canUseRefactoringSupport
-
check if refactory browser stuff is available
-
methodNameTemplateFor: aSelector
-
** This method must be redefined in concrete classes (subclassResponsibility) **
queries
-
isAbstract
-
(comment from inherited method)
Return if this class is an abstract class.
True is returned for Object here; false for subclasses.
Abstract subclasses must redefine this again.
utilities
-
missingRequiredProtocolFor: aClass
-
return the missing required protocol;
that is the set of selectors which send #subclassResponsibility in a superclass and
have no implementation in aClass or in any class between aClass and that superclass
utilities - source code
-
codeGenerationCommentForClass: generatingClass
-
returns a comment for the method code generated by generatingClass
-
methodTemplate
-
return a method definition template string
-
methodTemplateForDocumentation
-
return a method definition template string for a documentation method
-
methodTemplateForPackageDocumentation
-
return a documentation method definition template string for a package
-
methodTemplateForVersionMethodCVS
-
careful to avoid expansion by cvs here!
bulk changes
-
addChange: aChange
-
-
executeCollectedChangesNamed: name
-
if both the compositeChangeCollector and I myself think, that it should be confirmed,
the let user do it - I am not sure, if the heuristics here is useful;
it might be better to let the generator decide (for example, if it does high-impact
changes, as opposed to simple ones)
-
startCollectChanges
-
code generation
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly
-
create accessors in aClass
-
createApplicationCodeFor: aClass
-
create an empty application framework
-
createClassInitializeMethodIn: aClass
-
create a #initialize method on the class side (I'm tired of typing)
-
createClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol
-
createClassTypeTestMethodsIn: aClass forClasses: subClasses
-
create a #isXXX test methods (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createDocumentationMethodsFor: aClass
-
create empty documentation methods
-
createEnumTypeCodeFor: aClass
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createExamplesMethodForViewClass: aClass
-
create an examples method
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createInitializationMethodIn: aClass
-
create a #initialize methods (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createInitializedInstanceCreationMethodsIn: aClass
-
create a #new and #initialize methods (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createIsAbstractMethodIn: aClass
-
create a #isAbstract query method (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createIsObsoleteMethodIn: aClass
-
create a #isObsolete query method (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createParametrizedInstanceCreationMethodsNamed: selector in: aClass
-
create a #selector instance creation method (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createPoolInitializationCodeFor: aClass
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createRedefinedInstanceCreationMethodsIn: aClass
-
create a redefined #new methods
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createSingletonPatternInstanceCreationMethodsIn: aClass usingVariable: varName
-
create redefined #new methods for a singleton pattern
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createStandaloneStartupCodeFor: aClass
-
create an empty console application framework
-
createStandardPrintOnMethodIn: aClass
-
create a #printOn: method (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createStartupCodeFor: aClass forStartOf: anApplicationClassOrNil
-
create startup code (main)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createTestCaseSampleCodeFor: aClass
-
create an (almost) empty testCase class
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createVisitorMethodsIn: visitedClass andCompilerClass: visitorClass
-
This is much like createVisitorMethodsIn:andVisitorClass:,
but generates
acceptVisitor:forEffect:
and
visit<NODE>:forEffect:
in visit* methods.
-
createVisitorMethodsIn: visitedClass andVisitorClass2: visitorClass
-
This is much like createVisitorMethodsIn:andVisitorClass:,
but generates
self visitSuperclass: anObject
in visit* methods.
-
createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass
-
create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createVisitorMethodsIn: arg1 andVisitorClass: arg2 withParameter: arg3 withSuper: arg4
-
raise an error: must be redefined in concrete subclass(es)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createWebApplicationCodeFor: aClass
-
create an empty webApplication framework
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createWebServiceCodeFor: aClass
-
create an empty webService framework
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createWidgetCodeFor: aClass
-
create usually required widget code (redraw, model update, event handling)
** This method must be redefined in concrete classes (subclassResponsibility) **
code generation-basic
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createCollectionAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createGetterFor: aVarName in: aClass
-
-
createSetterFor: aVarName in: aClass
-
-
createValueHoldersFor: aCollectionOfVarNames in: aClass lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
** This method must be redefined in concrete classes (subclassResponsibility) **
code generation-individual methods
-
createAcceptVisitorMethod: selector in: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createAcceptVisitorMethodIn: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createAspectMethodFor: anAspectSymbol in: aClass
-
create an aspect method.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createCopyrightMethodFor: aClass
-
add copyright method containing your/your companies
copyright template but only if not already present.
this is only added, if specified in the
COPYRIGHT_TEMPLATE_FILE resources.
-
createCopyrightMethodFor: copyRightText for: aClass
-
add copyright method containing text,
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createDocumentationMethodFor: aClass
-
add documentation method containing doc template
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createExamplesMethodFor: aClass
-
add examples method containing examples template
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createFalseReturnMethodFor: aSelector category: cat in: aClass
-
add a ^false method;
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createInitialHistoryMethodFor: aClass
-
add history method containing created-entry
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createInstanceCreationMethodWithSetupFor: selector category: category in: aMetaClass
-
add an inst-creation method
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createMultiSetterInstanceCreationMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter instance creator method for instvars.
This creates a multi setter method (a:val1 b:val2 c:val3...)
and a corresponding new method on the class side.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createMultiSetterMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter method (a:val1 b:val2 c:val3...) for instvars.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createShouldImplementMethodFor: aSelector category: cat in: aClass
-
add a shouldImplement method;
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createSubclassResponsibilityMethodFor: aSelector category: cat in: aClass
-
add a subclassResponsibility method;
but only if not already present.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createUncachedPNGImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createUpdateMethodIn: aClass
-
create an update:with:from:-method
(I'm tired of typing)
** This method must be redefined in concrete classes (subclassResponsibility) **
-
createVersionMethodFor: aClass
-
add version method containing RCS template
but only if not already present and its not a private class.
** This method must be redefined in concrete classes (subclassResponsibility) **
** This is an obsolete interface - do not use it (it may vanish in future versions) **
code templates
-
codeFor_classInitialize
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_closeAccept
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_closeDownViews
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_closeRequest
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_doSaveAs
-
-
codeFor_emptyMenuActionCodeFor: selector menuItem: item
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_hasUnsavedChanges
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_menuNew
-
-
codeFor_menuOpen
-
-
codeFor_menuReload
-
-
codeFor_menuSave
-
-
codeFor_menuSaveAs
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_openAboutThisApplication
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_openDocumentation
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_postBuildWith
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_postOpenWith
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_shouldImplementFor: selector inClass: aClass
-
used in the 'generate required protocol' to generate a shouldImplement-sending
method for each subclassClassresponsibility method above aClass.
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_standAloneApplicationRegistryPath
-
-
codeFor_standAloneApplicationRegistryPathFor: aClass
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_standAloneApplicationUUID
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_standAloneMain
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_standAloneRealMainMethodFor: aClass
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeFor_standAloneUsage
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeToAssign: expr to: var
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_buttonPress
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_initialize
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_keyPress
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_redraw
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_sizeChanged
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
code_forWidget_update
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
eolCommentString
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
nilValueString
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
selfValueString
-
** This method must be redefined in concrete classes (subclassResponsibility) **
compilation
-
compile: theCode forClass: aClass inCategory: cat
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
-
compile: theCode forClass: aClass inCategory: categoryOrNil skipIfSame: skipIfSame
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
-
compilerClass
-
Return a real compiler classto use to compile code
** This method must be redefined in concrete classes (subclassResponsibility) **
initialization
-
confirmChanges
-
if true, let user confirm complicated changes; if false, just do it
-
confirmChanges: aBoolean
-
if true, let user confirm complicated changes; if false, just do it
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
private
-
canUseRefactoringSupport
-
check if refactory browser stuff is available
-
privCreateClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol.
aClass may be a a MetaClass or a non-MetaClass
|