Package structure reorganization.
SmallSense is no longer Smalltalk-specific but it provides infrastructure
to build support for other languages as well. Therefore classes and class
categories were renamed to reflect whether it is a reusable *core* thing
or Smalltalk-specific code.
--- a/Make.proto Sun Aug 25 13:05:24 2013 +0100
+++ b/Make.proto Mon Aug 26 10:33:23 2013 +0100
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libwidg2 -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/goodies/roeltyper -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libview
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/goodies/roeltyper -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg2
# if you need any additional defines for embedded C code,
@@ -159,7 +159,6 @@
# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
-$(OUTDIR)SmallSense__Checker.$(O) SmallSense__Checker.$(H): SmallSense__Checker.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/SmalllintChecker.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__CompletionWindow.$(O) SmallSense__CompletionWindow.$(H): SmallSense__CompletionWindow.st $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -169,38 +168,40 @@
$(OUTDIR)SmallSense__PO.$(O) SmallSense__PO.$(H): SmallSense__PO.st $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ParseNodeInspector.$(O) SmallSense__ParseNodeInspector.$(H): SmallSense__ParseNodeInspector.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ParseNodeVisitor.$(O) SmallSense__ParseNodeVisitor.$(H): SmallSense__ParseNodeVisitor.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Parser.$(O) SmallSense__Parser.$(H): SmallSense__Parser.st $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Position.$(O) SmallSense__Position.$(H): SmallSense__Position.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__QuickFixer.$(O) SmallSense__QuickFixer.$(H): SmallSense__QuickFixer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Recognizer.$(O) SmallSense__Recognizer.$(H): SmallSense__Recognizer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ResultSet.$(O) SmallSense__ResultSet.$(H): SmallSense__ResultSet.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SelectorNode.$(O) SmallSense__SelectorNode.$(H): SmallSense__SelectorNode.st $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Service.$(O) SmallSense__Service.$(H): SmallSense__Service.st $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/SmalllintChecker.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkParser.$(O) SmallSense__SmalltalkParser.$(H): SmallSense__SmalltalkParser.st $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkQuickFixer.$(O) SmallSense__SmalltalkQuickFixer.$(H): SmallSense__SmalltalkQuickFixer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkSyntaxHighlighter.$(O) SmallSense__SmalltalkSyntaxHighlighter.$(H): SmallSense__SmalltalkSyntaxHighlighter.st $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) SmallSense__SmalltalkUnacceptedMethodEnvironment.$(H): SmallSense__SmalltalkUnacceptedMethodEnvironment.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers/BrowserEnvironment.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SyntaxHighlightingService.$(O) SmallSense__SyntaxHighlightingService.$(H): SmallSense__SyntaxHighlightingService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Type.$(O) SmallSense__Type.$(H): SmallSense__Type.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeCollector.$(O) SmallSense__TypeCollector.$(H): SmallSense__TypeCollector.st $(INCLUDE_TOP)/stx/goodies/roeltyper/TypeCollector.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeCollectorCache.$(O) SmallSense__TypeCollectorCache.$(H): SmallSense__TypeCollectorCache.st $(INCLUDE_TOP)/stx/libbasic2/CacheDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeHolder.$(O) SmallSense__TypeHolder.$(H): SmallSense__TypeHolder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__UnacceptedMethodEnvironment.$(O) SmallSense__UnacceptedMethodEnvironment.$(H): SmallSense__UnacceptedMethodEnvironment.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers/BrowserEnvironment.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)jv_smallsense.$(O) jv_smallsense.$(H): jv_smallsense.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__AbstractInstvarInterfaceExtractor.$(O) SmallSense__AbstractInstvarInterfaceExtractor.$(H): SmallSense__AbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassInfo.$(O) SmallSense__ClassInfo.$(H): SmallSense__ClassInfo.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Info.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassPO.$(O) SmallSense__ClassPO.$(H): SmallSense__ClassPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassType.$(O) SmallSense__ClassType.$(H): SmallSense__ClassType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ConstantPO.$(O) SmallSense__ConstantPO.$(H): SmallSense__ConstantPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Finder.$(O) SmallSense__Finder.$(H): SmallSense__Finder.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__ParseNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__GenericEditSupport.$(O) SmallSense__GenericEditSupport.$(H): SmallSense__GenericEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Inferencer.$(O) SmallSense__Inferencer.$(H): SmallSense__Inferencer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__ParseNodeVisitor.$(H) $(STCHDR)
$(OUTDIR)SmallSense__JavaEditSupport.$(O) SmallSense__JavaEditSupport.$(H): SmallSense__JavaEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__MethodInfo.$(O) SmallSense__MethodInfo.$(H): SmallSense__MethodInfo.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Info.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__MethodPO.$(O) SmallSense__MethodPO.$(H): SmallSense__MethodPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(O) SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(H): SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__SmalltalkParser.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkEditSupport.$(O) SmallSense__SmalltalkEditSupport.$(H): SmallSense__SmalltalkEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkInferencer.$(O) SmallSense__SmalltalkInferencer.$(H): SmallSense__SmalltalkInferencer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__ParseNodeVisitor.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SnippetPO.$(O) SmallSense__SnippetPO.$(H): SmallSense__SnippetPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__UnionType.$(O) SmallSense__UnionType.$(H): SmallSense__UnionType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__UnknownType.$(O) SmallSense__UnknownType.$(H): SmallSense__UnknownType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__VariablePO.$(O) SmallSense__VariablePO.$(H): SmallSense__VariablePO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__InstvarInterfaceExtractor.$(O) SmallSense__InstvarInterfaceExtractor.$(H): SmallSense__InstvarInterfaceExtractor.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkInstvarInterfaceExtractor.$(O) SmallSense__SmalltalkInstvarInterfaceExtractor.$(H): SmallSense__SmalltalkInstvarInterfaceExtractor.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__SmalltalkParser.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libcomp/AssignmentNode.$(H) $(INCLUDE_TOP)/stx/libcomp/MessageNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseErrorNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimaryNode.$(H) $(INCLUDE_TOP)/stx/libcomp/StatementNode.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libcomp/VariableNode.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBTransformationRule.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentView.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentFrame.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libwidg2/DoWhatIMeanSupport.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NavigationState.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/Make.spec Sun Aug 25 13:05:24 2013 +0100
+++ b/Make.spec Mon Aug 26 10:33:23 2013 +0100
@@ -50,7 +50,6 @@
STCWARNINGS=-warnNonStandard
COMMON_CLASSES= \
- SmallSense::Checker \
SmallSense::CompletionWindow \
SmallSense::CriticsWindow \
SmallSense::EditService \
@@ -60,44 +59,45 @@
SmallSense::PO \
SmallSense::ParseNodeInspector \
SmallSense::ParseNodeVisitor \
- SmallSense::Parser \
SmallSense::Position \
- SmallSense::QuickFixer \
SmallSense::Recognizer \
SmallSense::ResultSet \
SmallSense::SelectorNode \
- SmallSense::Service \
SmallSense::SettingsAppl \
+ SmallSense::SmalltalkChecker \
+ SmallSense::SmalltalkLintService \
+ SmallSense::SmalltalkParser \
+ SmallSense::SmalltalkQuickFixer \
+ SmallSense::SmalltalkSyntaxHighlighter \
+ SmallSense::SmalltalkUnacceptedMethodEnvironment \
SmallSense::SyntaxHighlightingService \
SmallSense::Type \
SmallSense::TypeCollector \
SmallSense::TypeCollectorCache \
SmallSense::TypeHolder \
- SmallSense::UnacceptedMethodEnvironment \
jv_smallsense \
- SmallSense::AbstractInstvarInterfaceExtractor \
SmallSense::ClassInfo \
SmallSense::ClassPO \
SmallSense::ClassType \
SmallSense::ConstantPO \
SmallSense::Finder \
SmallSense::GenericEditSupport \
- SmallSense::Inferencer \
SmallSense::JavaEditSupport \
SmallSense::MethodInfo \
SmallSense::MethodPO \
+ SmallSense::SmalltalkAbstractInstvarInterfaceExtractor \
SmallSense::SmalltalkEditSupport \
+ SmallSense::SmalltalkInferencer \
SmallSense::SnippetPO \
SmallSense::UnionType \
SmallSense::UnknownType \
SmallSense::VariablePO \
- SmallSense::InstvarInterfaceExtractor \
+ SmallSense::SmalltalkInstvarInterfaceExtractor \
COMMON_OBJS= \
- $(OUTDIR_SLASH)SmallSense__Checker.$(O) \
$(OUTDIR_SLASH)SmallSense__CompletionWindow.$(O) \
$(OUTDIR_SLASH)SmallSense__CriticsWindow.$(O) \
$(OUTDIR_SLASH)SmallSense__EditService.$(O) \
@@ -107,38 +107,40 @@
$(OUTDIR_SLASH)SmallSense__PO.$(O) \
$(OUTDIR_SLASH)SmallSense__ParseNodeInspector.$(O) \
$(OUTDIR_SLASH)SmallSense__ParseNodeVisitor.$(O) \
- $(OUTDIR_SLASH)SmallSense__Parser.$(O) \
$(OUTDIR_SLASH)SmallSense__Position.$(O) \
- $(OUTDIR_SLASH)SmallSense__QuickFixer.$(O) \
$(OUTDIR_SLASH)SmallSense__Recognizer.$(O) \
$(OUTDIR_SLASH)SmallSense__ResultSet.$(O) \
$(OUTDIR_SLASH)SmallSense__SelectorNode.$(O) \
- $(OUTDIR_SLASH)SmallSense__Service.$(O) \
$(OUTDIR_SLASH)SmallSense__SettingsAppl.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkChecker.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkLintService.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkParser.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkQuickFixer.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkSyntaxHighlighter.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) \
$(OUTDIR_SLASH)SmallSense__SyntaxHighlightingService.$(O) \
$(OUTDIR_SLASH)SmallSense__Type.$(O) \
$(OUTDIR_SLASH)SmallSense__TypeCollector.$(O) \
$(OUTDIR_SLASH)SmallSense__TypeCollectorCache.$(O) \
$(OUTDIR_SLASH)SmallSense__TypeHolder.$(O) \
- $(OUTDIR_SLASH)SmallSense__UnacceptedMethodEnvironment.$(O) \
$(OUTDIR_SLASH)jv_smallsense.$(O) \
- $(OUTDIR_SLASH)SmallSense__AbstractInstvarInterfaceExtractor.$(O) \
$(OUTDIR_SLASH)SmallSense__ClassInfo.$(O) \
$(OUTDIR_SLASH)SmallSense__ClassPO.$(O) \
$(OUTDIR_SLASH)SmallSense__ClassType.$(O) \
$(OUTDIR_SLASH)SmallSense__ConstantPO.$(O) \
$(OUTDIR_SLASH)SmallSense__Finder.$(O) \
$(OUTDIR_SLASH)SmallSense__GenericEditSupport.$(O) \
- $(OUTDIR_SLASH)SmallSense__Inferencer.$(O) \
$(OUTDIR_SLASH)SmallSense__JavaEditSupport.$(O) \
$(OUTDIR_SLASH)SmallSense__MethodInfo.$(O) \
$(OUTDIR_SLASH)SmallSense__MethodPO.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkEditSupport.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkInferencer.$(O) \
$(OUTDIR_SLASH)SmallSense__SnippetPO.$(O) \
$(OUTDIR_SLASH)SmallSense__UnionType.$(O) \
$(OUTDIR_SLASH)SmallSense__UnknownType.$(O) \
$(OUTDIR_SLASH)SmallSense__VariablePO.$(O) \
- $(OUTDIR_SLASH)SmallSense__InstvarInterfaceExtractor.$(O) \
+ $(OUTDIR_SLASH)SmallSense__SmalltalkInstvarInterfaceExtractor.$(O) \
$(OUTDIR_SLASH)extensions.$(O) \
--- a/SmallSense__AbstractInstvarInterfaceExtractor.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Parser subclass:#AbstractInstvarInterfaceExtractor
- instanceVariableNames:'stack copied initialStack saveStacks input collector
- blockTraversal blockArgs'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Roel Typer'
-!
-
-
-!AbstractInstvarInterfaceExtractor methodsFor:'extracting'!
-
-extractInterfacesFrom:m addTo:aTypeCollector
- |parser|
-
- method := m.
- saveStacks := Dictionary new.
- stack := OrderedCollection new.
- "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
- initialStack := stack copy.
- collector := aTypeCollector.
- parser := SmalltalkXInstvarInterfaceExtractor new.
- parser setColector:aTypeCollector.
- input := parser
- parseMethod:method source
- in:method mclass
- ignoreErrors:false
- ignoreWarnings:false.
- blockTraversal := false.
- blockArgs := 0.
-
- [ input isNil ] whileFalse:[
- self unaryExpressionFor:input.
- input :=input nextStatement.
- ]
-
- "Modified: / 24-11-2010 / 22:24:16 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-extractInterfacesFrom:sourc class:class addTo:aTypeCollector
- |parser|
-
- saveStacks := Dictionary new.
- stack := OrderedCollection new.
- "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
- initialStack := stack copy.
- collector := aTypeCollector.
- parser := SmalltalkXInstvarInterfaceExtractor new.
- parser setColector:aTypeCollector.
- input := parser
- parseMethod: sourc
- in:class
- ignoreErrors:false
- ignoreWarnings:false.
- blockTraversal := false.
- blockArgs := 0.
-
- [ input isNil ] whileFalse:[
- self unaryExpressionFor:input.
- input :=input nextStatement.
- ]
-
- "Created: / 17-03-2011 / 16:00:31 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!AbstractInstvarInterfaceExtractor methodsFor:'opcodes-control'!
-
-nativeSend: selector numArgs: na
- | receiver args |
- args := stack removeLast: na.
- receiver := stack removeLast.
- receiver isInteger
- ifTrue:
- [ collector
- addSend: selector
- to: receiver ]
- ifFalse:
- [ receiver isVariableBinding ifTrue:
- [ receiver key = #temp
- ifTrue:
- [ collector
- addSend: selector
- toTmp: receiver value ]
- ifFalse:
- [ receiver key = #return ifTrue:
- [ collector
- addSend: selector
- onReturnOfSelfMethod: receiver value ] ] ] ].
- (receiver = #self and: [ collector theClass methodDictionary includesKey: selector ]) ifTrue:
- [ args doWithIndex:
- [ :arg :index |
- collector
- handleAssignment: arg
- forTmp: index - 1
- in: collector theClass >> selector ] ].
- stack add: (collector
- pushSendOf: selector
- to: receiver
- args: args)
-
- "Modified: / 18-05-2011 / 23:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-send: selector numArgs: na
- ^self
- nativeSend: selector
- numArgs: na
-! !
-
-!AbstractInstvarInterfaceExtractor methodsFor:'opcodes-data movement'!
-
-dupFirst
- stack add: stack last
-!
-
-pop
- stack removeLast
-!
-
-pushConstant: value
- value class == BlockClosure
- ifTrue:
- [self
- readBlock: value method
- copied: 0]
- ifFalse: [
- blockArgs := value.
- stack addLast: value class]
-!
-
-pushContext
- stack add: #context
-!
-
-pushInst: index
- stack add: index
-!
-
-pushReceiver
- stack addLast: #self
-!
-
-pushStatic: assoc
- "assoc can be an association OR a variable binding. I just push the complete association, since it does not interest me for the moment."
-
- stack addLast: assoc
-! !
-
-!AbstractInstvarInterfaceExtractor methodsFor:'private'!
-
-copied: list
- copied := list
-!
-
-initialize
- super initialize.
- blockTraversal := false.
- blockArgs := 0.
-
- "Modified: / 03-11-2010 / 21:27:34 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-input
- ^input
-!
-
-method: aMethod
- method := aMethod.
- copied := #()
-!
-
-readBlock: block copied: count
- | newCopied |
- newCopied := stack removeLast: count.
- stack add: #block.
- ^(self class new)
- copied: newCopied;
- extractInterfacesFrom: block source class:block mclass
- addTo: collector
-
- "Modified: / 17-03-2011 / 16:01:39 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-reloadStack
- stack isNil
- ifTrue:
- [stack := self saveStacks
- at: self input startPosition
- ifAbsent: [initialStack copy].
- ^self].
- stack := self saveStacks
- at: self input startPosition
- ifAbsent: [stack]
-
- "Modified: / 28-10-2010 / 15:04:05 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-saveStacks
- saveStacks ifNil: [saveStacks := Dictionary new].
- ^saveStacks
-!
-
-setColector:colectorSetter
- collector := colectorSetter.
-
- "Created: / 03-11-2010 / 21:33:42 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!AbstractInstvarInterfaceExtractor class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseAbstractInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
-! !
-
--- a/SmallSense__Checker.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-SmalllintChecker subclass:#Checker
- instanceVariableNames:''
- classVariableNames:'Errors'
- poolDictionaries:''
- category:'SmallSense-Lint'
-!
-
-!Checker class methodsFor:'documentation'!
-
-documentation
-"
- SmallSenseChecker is customized SmalllintChecker used
- by SmallSense's checking services. Do not use it in your
- code, use SmalllintChecker instead.
-
- [author:]
- Jan Vrany <jan.vrany@fit.cvut.cz>
-
- [instance variables:]
-
- [class variables:]
-
- [see also:]
- SmalllintChecker
- SmallSenseService
-
-"
-! !
-
-!Checker class methodsFor:'initialization'!
-
-initialize
- "Invoked at system start or when the class is dynamically loaded."
-
- "/ please change as required (and remove this comment)
-
- Errors := Dictionary new.
-
- "Modified: / 06-09-2012 / 14:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Checker class methodsFor:'accessing'!
-
-forceDisabledRules
- "Return a list of rule class names that
- are never run by SmallSense's checker - they
- are either buggy (i.e.. not ready to be run
- incrementally) or it does not make sense to run them
- Add with care!!!!!!
- "
-
- ^ #(
- RBLawOfDemeterRule "/ Too many false positives, hard to fix
- RBImplementedNotSentRule "/ Uses Context>>#computeLiterals whichs toooo slow.
- RBSentNotImplementedRule "/ Uses Context>>#computeLiterals whichs toooo slow.
- RBUndeclaredReferenceRule "/
- )
-
- "Created: / 17-02-2012 / 13:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Checker methodsFor:'private'!
-
-checkClass: aClass
-
- "Nothing to do, SmallSense checker checks only methods"
- context selectedClass: aClass.
-
- "Created: / 16-02-2012 / 16:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-checkMethodsForClass: aClass
-
- environment selectorsForClass: aClass do: [:sel|
- context selector: sel.
- context parseTree notNil ifTrue:[
- rule flattened do:[:each|
- [
- each checkMethod: context.
- ] on: Error do:[:ex|
- Service debugging ifTrue:[
- Service debugging: false.
- ex pass.
- ] ifFalse:[
- Errors at: each class ifAbsentPut:[ context method source ].
- ]
- ]
- ].
- ].
- ]
-
- "Modified: / 24-08-2010 / 21:32:39 / Jan Vrany <enter your email here>"
- "Created: / 17-02-2012 / 00:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Checker class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseChecker.st 8046 2012-09-06 16:38:47Z vranyj1 $'
-! !
-
-
-Checker initialize!
--- a/SmallSense__ClassInfo.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__ClassInfo.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'className methods instvars'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Model'
+ category:'SmallSense-Smalltalk-Types-Info'
!
--- a/SmallSense__ClassPO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__ClassPO.st Mon Aug 26 10:33:23 2013 +0100
@@ -3,10 +3,10 @@
"{ NameSpace: SmallSense }"
PO subclass:#ClassPO
- instanceVariableNames:''
+ instanceVariableNames:'showPrefix'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
@@ -20,6 +20,40 @@
"Created: / 06-04-2011 / 23:36:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+klass
+ ^ subject
+
+ "Created: / 25-08-2013 / 13:07:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+klass: klass
+ ^ subject := klass
+
+ "Created: / 25-08-2013 / 13:07:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+name
+
+ | nm |
+
+ showPrefix ifTrue:[
+ nm := subject name.
+ ] ifFalse:[
+ nm := subject nameWithoutPrefix.
+ ].
+ ^nm
+
+ "Created: / 26-08-2013 / 10:26:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+showPrefix
+ ^ showPrefix
+!
+
+showPrefix:something
+ showPrefix := something.
+!
+
subject: aClass
super subject: aClass.
@@ -28,6 +62,63 @@
"Created: / 06-04-2011 / 21:02:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!ClassPO methodsFor:'converting'!
+
+asString
+ ^subject isJavaClass ifTrue:[
+ subject javaName
+ ] ifFalse:[
+ subject name
+ ].
+
+ "Created: / 04-04-2012 / 13:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-08-2013 / 10:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ClassPO methodsFor:'displaying'!
+
+displayOn:aGC x:x y:y opaque:opaque
+
+ | nm namespace lw cnw fg |
+
+ showPrefix ifTrue:[
+ nm := subject name.
+ namespace := nil
+ ] ifFalse:[
+ nm := subject nameWithoutPrefix.
+ subject isJavaClass ifFalse:[
+ namespace := subject nameSpace name.
+ ] ifTrue:[
+ namespace := subject javaPackage.
+ ]
+ ].
+
+ nm displayOn:aGC x:x y:y opaque:opaque.
+
+ (namespace notNil and:[namespace ~~ #Smalltalk]) ifTrue:[
+ namespace := 'in ', namespace.
+ lw := x + 16 + (name widthOn: aGC).
+ cnw := aGC widthOfString: namespace.
+
+ (aGC width > (lw + cnw + 5)) ifTrue:[
+ fg := aGC paint.
+ aGC paint: (Color gray: 40).
+ namespace displayOn:aGC x: aGC width - cnw - 5 y:y opaque:opaque.
+ aGC paint: fg.
+ ]
+ ]
+
+ "Created: / 04-04-2012 / 13:03:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 25-08-2013 / 13:10:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+displayString
+ ^ self name
+
+ "Created: / 20-04-2012 / 18:19:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-08-2013 / 10:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!ClassPO methodsFor:'testing'!
isSmallSenseClassPO
--- a/SmallSense__ClassType.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__ClassType.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'trustfullness klass'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Types'
+ category:'SmallSense-Smalltalk-Types'
!
--- a/SmallSense__CompletionWindow.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__CompletionWindow.st Mon Aug 26 10:33:23 2013 +0100
@@ -7,7 +7,7 @@
selectionUnambigous listHolder listView'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface'
+ category:'SmallSense-Core-Interface'
!
--- a/SmallSense__ConstantPO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__ConstantPO.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
--- a/SmallSense__CriticsWindow.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__CriticsWindow.st Mon Aug 26 10:33:23 2013 +0100
@@ -7,7 +7,7 @@
entered codeView'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface'
+ category:'SmallSense-Core-Interface'
!
--- a/SmallSense__EditService.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__EditService.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'support'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Core-Services'
!
!EditService class methodsFor:'accessing'!
--- a/SmallSense__EditSupport.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__EditSupport.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'service textView'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Core-Services'
!
!EditSupport class methodsFor:'instance creation'!
--- a/SmallSense__GenericEditSupport.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__GenericEditSupport.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Core-Services'
!
!GenericEditSupport methodsFor:'accessing'!
--- a/SmallSense__Inferencer.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,434 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Object subclass:#Inferencer
- instanceVariableNames:'class classInfo source parser parserClass tree'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Inference'
-!
-
-ParseNodeVisitor subclass:#Phase1
- instanceVariableNames:'classInfo sends types'
- classVariableNames:''
- poolDictionaries:''
- privateIn:Inferencer
-!
-
-ParseNodeVisitor subclass:#Phase2
- instanceVariableNames:'classInfo'
- classVariableNames:''
- poolDictionaries:''
- privateIn:Inferencer
-!
-
-!Inferencer class methodsFor:'documentation'!
-
-documentation
-"
- A heart of SmallSense - a type inferencer. For given class
- and method source, instance of inferences walks the parse tree
- and annotate each node with inferred type.
-
-
- [author:]
- Jan Vrany <jan.vrany@fit.cvut.cz>
-
- [instance variables:]
-
- [class variables:]
-
- [see also:]
-
-"
-! !
-
-!Inferencer class methodsFor:'instance creation'!
-
-forClass: class methodSource: source
-
- ^self new class: class source: source
-
- "Created: / 26-11-2011 / 12:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-forClass: class selector: selector
-
- ^self new class: class selector: selector.
-
- "Created: / 26-11-2011 / 12:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-forMethod: method
-
- ^self new method: method.
-
- "Created: / 26-11-2011 / 12:45:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer methodsFor:'accessing'!
-
-klass
- ^ class
-
- "Created: / 26-11-2011 / 17:30:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-manager
-
- ^Manager instance
-
- "Created: / 27-11-2011 / 16:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-parser
- ^ parser
-!
-
-parserClass
- ^ parserClass
-!
-
-parserClass:aClass
- parserClass := aClass.
-!
-
-source
- ^ source
-!
-
-tree
- ^ tree
-! !
-
-!Inferencer methodsFor:'initialization'!
-
-class: cls selector: sel
-
- | m |
- m := cls >> sel.
- m isNil ifTrue:[
- self error: 'No method found'.
- ].
- self method: m.
-
- "Created: / 26-11-2011 / 12:47:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-class: cls source: src
-
- class := cls.
- classInfo := self manager infoForClass: class.
- source := src.
-
- "Created: / 26-11-2011 / 14:46:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-method: method
-
- self class: method mclass source: method source.
-
- "Created: / 26-11-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer methodsFor:'private'!
-
-infer
-
-
- Phase1 process: tree in: class.
-
- "
- (SmallSenseParseNodeInspector new node: tree source: source) open
- "
-
- "Created: / 26-11-2011 / 12:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-parse
-
- parserClass isNil ifTrue:[
- parserClass := class parserClass.
- ].
- parser := parserClass
- parseMethod: source in: class
- ignoreErrors:true
- ignoreWarnings:true.
- tree := parser tree.
-
- "Created: / 26-11-2011 / 12:51:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer methodsFor:'processing'!
-
-process
-
- "Actually infer types. Returns an annotated method tree.
- The tree is also stored in an instance variable, so it
- may be obtained form receiver any time by asking for #tree."
-
- self parse.
- tree notNil ifTrue:[
- self infer.
- ].
- ^tree
-
- "Created: / 26-11-2011 / 12:50:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer::Phase1 methodsFor:'initialization'!
-
-initialize
- "Invoked when a new instance is created."
-
- "/ please change as required (and remove this comment)
- sends := Dictionary new.
- types := Dictionary new.
-
- "/ super initialize. -- commented since inherited method does nothing
-
- "Modified: / 26-11-2011 / 19:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer::Phase1 methodsFor:'private'!
-
-rootsUnderstanding: selectors
- "When the set of selectors is not empty, answer a set of the highest possible classes in the system that implement all the selectors.
- When the set of selectors is empty, return the empty set."
-
- | initialClasses nextClasses traverseStack next |
- selectors isEmpty ifTrue: [^OrderedCollection new].
- nextClasses := OrderedCollection with: Object.
- traverseStack := OrderedCollection new: 1000.
-
- selectors
- do:
- [:selector |
- initialClasses := nextClasses.
- nextClasses := OrderedCollection new.
- initialClasses
- do:
- [:initialClass |
- "inline canUnderstand: for performance"
- |cl|
- cl := initialClass.
- [(cl == nil) or: [(cl methodDictionary includesKey: selector)]] whileFalse: [cl := cl superclass].
- (cl == nil)
- ifFalse: [nextClasses addLast: initialClass]
- ifTrue:
- [|size|
- traverseStack reset.
- traverseStack addLast: initialClass.
- size := 1.
- "(traverseStack isEmpty) removed for performance"
- [size = 0]
- whileFalse:
- [
- "(traverseStack removeFirst) removed for performance"
- next := traverseStack removeFirst.
- size := size -1.
- next
- subclassesDo:
- [:subcl |
- "(subcl includesSelector: selector) removed for performance"
- (subcl methodDictionary includesKey: selector)
- ifTrue: [nextClasses addLast: subcl]
- ifFalse: [traverseStack addLast: subcl. size := size + 1]]]]]].
- ^nextClasses
-
- "Modified: / 24-11-2010 / 14:39:35 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 26-11-2011 / 14:01:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer::Phase1 methodsFor:'processing'!
-
-process: tree in: cls
-
- self process: tree in: cls info: (Manager instance infoForClass: cls)
-
- "Created: / 26-11-2011 / 13:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-process: tree in: cls info: clsInfo
-
- | i c |
-
- class := cls.
- classInfo := clsInfo.
-
- "Fill types with cached data..."
-
- c := class.
- i := classInfo.
- [ c notNil and:[i notNil] ] whileTrue:[
- c instVarNames do:[:nm|
- types at: nm put: (i infoForInstvar: nm)
- ].
- c := c superclass.
- i := i superclassInfo.
- ].
-
- self visit: tree.
-
-
- "Now, infer variable types based on collected sends"
- sends keysAndValuesDo:[:varName :sentSelectors|
- | classes |
-
- classes := self rootsUnderstanding: sentSelectors.
- (types at: varName) addClasses: classes.
- ].
-
- "Created: / 27-11-2011 / 16:22:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer::Phase1 methodsFor:'visiting'!
-
-visitAssignmentNode:anObject
-
- self visit: anObject variable.
- self visit: anObject expression.
-
- "Created: / 26-11-2011 / 13:53:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitBlockNode:anObject
- | type |
-
- super visitBlockNode:anObject.
- type := (Type withClass: BlockClosure).
- type trustfullness: 100.
- anObject inferedType: type.
-
- "Created: / 26-11-2011 / 14:46:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitConstantNode:anObject
- "Type of a constant is trivially its value class"
-
- | type |
-
- super visitConstantNode: anObject.
- type := (Type withClass: anObject value class).
- type trustfullness: 100.
- anObject inferedType: type.
-
- "Created: / 26-11-2011 / 13:55:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitMessageNode:anObject
-
- | rec |
-
- super visitMessageNode: anObject.
-
- (rec := anObject receiver) isVariableNode ifTrue:[
- "We don't have to infer types for global/class variables"
- (rec isGlobalVariable or:[rec isClassVariable]) ifFalse:[
- (sends at: rec name ifAbsentPut:[Set new]) add: anObject selector.
- ].
- ].
-
- "Created: / 26-11-2011 / 13:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitSelfNode:anObject
-
- super visitSelfNode:anObject.
- anObject inferedType:(Type withClass: class)
-
- "Created: / 26-11-2011 / 14:43:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitSuperNode:anObject
-
-
- super visitSuperNode:anObject.
- anObject inferedType:(Type withClass: class superclass)
-
- "Created: / 26-11-2011 / 14:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitUnaryNode:anObject
-
- | type sel rec |
-
- super visitUnaryNode:anObject.
-
- sel := anObject selector.
-
- sel == #class ifTrue:[
- type := anObject receiver inferedType classSide.
- anObject inferedType: type.
- ^self.
- ].
- (sel == #new or:[sel == #basicNew]) ifTrue:[
- rec := anObject receiver.
- (rec isSelf and:[class isMetaclass]) ifTrue:[
- type := Type withClass: class theNonMetaclass.
- type trustfullnessAdd: 50.
- anObject inferedType: type.
- ^self.
- ].
-
- type := anObject receiver inferedType instanceSide.
- anObject inferedType: type.
- ^self.
- ].
-
- "Created: / 27-11-2011 / 15:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-visitVariableNode:anObject
-
- | t |
-
- "Following code ensures, that all variable nodes refering same
- variable shares the inferred type"
- t := types at: anObject name ifAbsentPut:[Type unknown].
- anObject inferedType: t.
-
- anObject isGlobalVariable ifTrue:[
- t addClass: (Smalltalk at: anObject name) class.
- t trustfullness: 100.
- ^self.
- ].
- anObject isClassVariable ifTrue:[
- t addClass: (class theNonMetaclass classVarAt: anObject name asSymbol) class.
- t trustfullness: 100.
- ^self.
- ].
-
- "Created: / 26-11-2011 / 13:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer::Phase2 methodsFor:'processing'!
-
-process: tree in: cls
-
- self process: tree in: cls info: (Manager instance infoForClass: cls)
-
- "Created: / 26-11-2011 / 13:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-process: tree in: cls info: clsInfo
-
- class := cls.
- classInfo := clsInfo.
- self visit: tree.
-
- "Created: / 27-11-2011 / 16:22:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Inferencer class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseInferencer.st 8000 2012-05-17 23:16:11Z vranyj1 $'
-! !
-
--- a/SmallSense__Info.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__Info.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'manager'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Model'
+ category:'SmallSense-Smalltalk-Types-Info'
!
--- a/SmallSense__InstvarInterfaceExtractor.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,787 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-AbstractInstvarInterfaceExtractor subclass:#InstvarInterfaceExtractor
- instanceVariableNames:'assingmentsDictionary assigmentsTypeDictionary'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Roel Typer'
-!
-
-
-!InstvarInterfaceExtractor methodsFor:'assignmentParsing'!
-
-addAssignment:value to:node index:index
- |assignments|
-
- "Test if it is tmp or not tmp. Tmp variable returns nil"
- (node respondsTo:#variable) ifTrue:[
- "if we receive node"
- assignments := self assignmentsTo:node variable asString.
- ] ifFalse:[
- "if we receive string"
- assignments := self assignmentsTo:node asString.
- ].
- (assignments notNil) ifTrue:[
- "not tmp"
- collector addAssignment:value to:index.
- ] ifFalse:[
- "tmp"
- (node respondsTo:#variable) ifTrue:[
- "if we receive node"
- collector addAssignment:value toTmp:node variable asString.
- ] ifFalse:[
- "if we receive string"
- collector addAssignment:value toTmp:node asString.
- ].
- ].
-
- "Created: / 09-11-2010 / 18:32:05 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 15-02-2011 / 13:11:16 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-assignmentsTo:node
- |assignments|
- assignments := collector assignmentsTo:node asString.
- (assignments isNil)ifTrue:[
- ^nil.
- ].
- ^ assignments.
-
- "Created: / 01-12-2010 / 15:41:40 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 17-03-2011 / 15:40:37 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-assignmentsToTmp:nodeIndex
- |assignments|
-
- assignments:=collector assignmentsTmpTo:nodeIndex.
- (assignments isNil)ifTrue:[
- ^nil.
- ].
- ^ assignments.
-
- "Created: / 01-12-2010 / 16:04:10 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-createIndexFromNode:node
- "Creates index of node or string for roelTyper"
-
- (node respondsTo:#index) ifTrue:[
- ^ node index.
- ].
- (node respondsTo:#variable) ifTrue:[
- ^ node variable index.
- ] ifFalse:[
- ^ collector absoluteIndexForVar:node asString.
- ].
-
- "Created: / 14-12-2010 / 22:25:22 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-handleAssignmentToNode:nodeAssignment receiverNode:nodeReceiver
- |assignments nodeReceiverIndex nodeAssignmentIndex|
-
- nodeReceiverIndex := self createIndexFromNode:nodeReceiver.
- nodeAssignmentIndex := self createIndexFromNode:nodeAssignment.
- "b:=true. a:=b.
- nodeAssignment - node which can have some type (b)
- nodeReceiver - node, which contains nodeAssignment (a)
- nodeReceiverIndex - node receiver index
- nodeAssignmentIndex - node assignmentIndex"
- assignments := self assignmentsTo:nodeAssignment asString.
- (assignments isNil) ifTrue:[
- assignments := self assignmentsToTmp:nodeAssignment asString.
- ].
- (assignments size = 0) ifTrue:[
- assignments := nil.
- ].
- "All assgnments to specific node"
- (assignments isNil) ifTrue:[
- ^ nil
- ].
- assignments do:[:assinment |
- self
- addAssignment:assinment
- to:nodeReceiver
- index:nodeReceiverIndex.
- ]
-
- "Created: / 01-12-2010 / 15:53:05 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 15-02-2011 / 13:14:38 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-handleAssignmentToNode:node type:type
- |set|
- (node respondsTo:#variable)ifTrue:[
- set := assingmentsDictionary at:node variable asString ifAbsent:nil.
- ]ifFalse:[
- set := assingmentsDictionary at:node asString ifAbsent:nil.
- ].
- "if some variable(a) is initialized(a:=2,a:=true...) then the other variables, which refers b:=a can have similar type."
- (set isNil) ifTrue:[
- ^ nil.
- ].
- set do:[:refNode |
- self
- addAssignment:type
- to:node
- index:(self createIndexFromNode:refNode).
- ]
-
- "Created: / 04-11-2010 / 19:44:46 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 14-12-2010 / 22:29:35 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeBinaryNode:node nodeExpression:expression
- |helperNode|
-
- "v=3"
- helperNode := node.
- ((expression receiver) isKindOf:VariableNode) ifTrue:[
- ((expression selector) = #'='
- or:[
- (expression selector) = #'=='
- or:[
- (expression selector) = #'>'
- or:[
- (expression selector) = #'<'
- or:[
- (expression selector) = #'<='
- or:[
- (expression selector) = #'>='
- or:[ (expression selector) = #'=~' or:[ (expression selector) = #'~~' ] ]
- ]
- ]
- ]
- ]
- ])
- ifTrue:[
- self
- addAssignment:(#Boolean sunitAsClass)
- to:(node)
- index:(self createIndexFromNode:node).
- self handleAssignmentToNode:node type:(#Boolean sunitAsClass)
- ].
- ].
- ((expression receiver) isKindOf:MessageNode) ifTrue:[
- self parseAssignmentNodeMessageNode:node
- nodeExpression:expression receiver
- ].
-
- "Created: / 10-11-2010 / 14:51:11 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 31-03-2011 / 19:30:36 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeConstantNode:node nodeExpression: expression
- |helperNode |
-
- helperNode := node.
- (expression isKindOf:ConstantNode) ifTrue:[
-
- "Check if expression has some type"
- (expression type notNil and:[expression type sunitAsClass notNil]) ifTrue:[
- "If True or false then superClass(only for to have the type boolean)"
- ((expression type sunitAsClass superclass) == Boolean) ifTrue:[
- self
- addAssignment:((expression type sunitAsClass) superclass)
- to:(node)
- index:(self createIndexFromNode:node).
- "add assignment to all nodes which refer this node"
- self handleAssignmentToNode:node
- type:(expression type sunitAsClass superclass)
- ] ifFalse:[
- self
- addAssignment:(expression type sunitAsClass)
- to:node
- index:(self createIndexFromNode:node ).
- "add assignment to all nodes which refer this node"
- self handleAssignmentToNode:node type:(expression type sunitAsClass)
- ].
- ].
- ^ self.
- ].
-
- "Created: / 10-11-2010 / 14:53:09 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 14-12-2010 / 22:30:38 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 28-04-2011 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-parseAssignmentNodeMessageNode:node nodeExpression:expression
- |helperNode|
-
- helperNode := node.
- (expression respondsTo:#receiver) ifTrue:[
- ((expression receiver) isKindOf:VariableNode) ifTrue:[
- ((expression receiver name) respondsTo:#sunitAsClass) ifTrue:[
- self
- addAssignment:(expression receiver name sunitAsClass)
- to:(node)
- index:(self createIndexFromNode:node).
- ]ifFalse:[
- self parseAssignmentNodeVariableNode:node nodeExpression: expression receiver.
- ].
- ].
- ((expression receiver) isKindOf:ConstantNode) ifTrue:[
- self parseAssignmentNodeConstantNode:node
- nodeExpression:expression receiver.
- ].
- ((expression receiver) isKindOf:SelfNode) ifTrue:[
- self parseAssignmentNodeSelfNode:node
- nodeExpression:expression receiver.
- ].
- ].
-
- "Created: / 10-11-2010 / 14:55:13 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 14-12-2010 / 22:31:00 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeSelfNode:node nodeExpression:expression
- |helperNode var ret|
-
- "indirect assignments check"
- helperNode := node.
- var := helperNode expression selector asString subString:1
- to:helperNode expression selector asString size - 1.
- "Check if selector is class Variable"
- ret := collector assignmentsTo:var.
- (ret notNil) ifTrue:[
- "Check if has only one argument"
- (helperNode expression argumentCount = 1) ifTrue:[
- "Check nil"
- (helperNode expression arg1 notNil) ifTrue:[
- "Test ConstantNode(u:=3 u:=true...)"
- (helperNode expression arg1 isKindOf:ConstantNode) ifTrue:[
- self parseAssignmentNodeConstantNode:var
- nodeExpression:helperNode expression arg1.
- ].
- "Test VariableNode (u:=a)"
- (helperNode expression arg1 isKindOf:VariableNode) ifTrue:[
- self parseAssignmentNodeVariableNode:var
- nodeExpression:helperNode expression arg1.
- ].
- "Test UnaryNode"
- (helperNode expression arg1 isKindOf:UnaryNode) ifTrue:[
- self parseAssignmentNodeUnaryNode:var
- nodeExpression:helperNode expression arg1.
- ].
- "Test MessageNode"
- (helperNode expression arg1 isKindOf:MessageNode) ifTrue:[
- self parseAssignmentNodeMessageNode:var
- nodeExpression:helperNode expression arg1.
- ].
- "Test binary node"
- (helperNode expression arg1 isKindOf:BinaryNode) ifTrue:[
- self parseAssignmentNodeBinaryNode:var
- nodeExpression:helperNode expression arg1.
- ].
- ].
- ].
- ].
-
- "Created: / 14-12-2010 / 22:04:07 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeToTypeCollector:node
- |helperNode expression nodeName|
-
- "basic method to handle assignments"
- helperNode := node.
- expression := node expression.
- "Test ConstantNode(u:=3 u:=true...)"
- (expression isKindOf:ConstantNode) ifTrue:[
- self parseAssignmentNodeConstantNode:node nodeExpression:expression.
- ].
- "Test VariableNode (u:=a)"
- (expression isKindOf:VariableNode) ifTrue:[
- self parseAssignmentNodeVariableNode:node nodeExpression:expression.
- ].
- "Test AssignmentNode u:=a:=3"
- (expression isKindOf:AssignmentNode) ifTrue:[
- nodeName := self parseAssignmentNodeToTypeCollector:expression.
- self handleAssignmentToNode:nodeName receiverNode:node.
- ].
- "Test UnaryNode"
- (expression isKindOf:UnaryNode) ifTrue:[
- self parseAssignmentNodeUnaryNode:node nodeExpression:expression.
- ].
- "Test MessageNode"
- (expression isKindOf:MessageNode) ifTrue:[
- self parseAssignmentNodeMessageNode:node nodeExpression:expression.
- ].
- "Test binary node"
- (expression isKindOf:BinaryNode) ifTrue:[
- self parseAssignmentNodeBinaryNode:node nodeExpression:expression.
- ].
- (node respondsTo:#variable) ifTrue:[
- ^ node variable.
- ] ifFalse:[ ^ node. ].
-
- "Created: / 03-11-2010 / 23:00:17 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 14-12-2010 / 23:45:30 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeUnaryNode:node nodeExpression:expression
- |helperNode|
-
- helperNode := node.
- "x asInteger. b floor"
- (expression respondsTo:#receiver) ifTrue:[
- ((expression receiver) isKindOf:VariableNode) ifTrue:[
- ((expression receiver name) respondsTo:#sunitAsClass) ifTrue:[
- self
- addAssignment:(expression receiver name sunitAsClass)
- to:(node)
- index:(self createIndexFromNode:node).
- "add assignment to all nodes which refer this node"
- self handleAssignmentToNode:node
- type:(expression receiver name sunitAsClass)
- ].
- ].
- ].
-
- "Created: / 10-11-2010 / 14:54:26 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 30-03-2011 / 17:57:04 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseAssignmentNodeVariableNode:node nodeExpression:expression
- |helperNode set|
-
- "Test VariableNode(u:=a.b:=a.c:=a)
- AssignMentDictionary will contain set nodes which assignment this node
- a->Set(u,b,c) if a will get some value we change assignment in all nodes"
- helperNode := node.
- ((expression type) = #GlobalVariable) ifTrue:[
- "checking assignments metaclass"
- ((expression name) respondsTo:#sunitAsClass) ifTrue:[
- self
- addAssignment:expression name sunitAsClass class
- to:node variable
- index:(self createIndexFromNode:node).
- "add assignment to all nodes which refer this node"
- self handleAssignmentToNode:node type:(expression type sunitAsClass).
- ^ self.
- ].
- ].
- set := assingmentsDictionary at:(expression name) ifAbsent:nil.
- (set isNil) ifTrue:[
- set := Set new.
- ].
- set add:node variable.
- "Check if this index exists. if exists then remove it(to update dictionary)"
- (assingmentsDictionary includesKey:expression name) ifTrue:[
- assingmentsDictionary removeKey:expression name.
- ].
- "(updateDictionary"
- assingmentsDictionary at:(expression name) put:set.
- "Check if we can update this"
- self handleAssignmentToNode:expression receiverNode:node.
- ^ self
-
- "Created: / 10-11-2010 / 14:53:46 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 30-03-2011 / 18:09:05 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!InstvarInterfaceExtractor methodsFor:'extracting'!
-
-extractInterfacesFrom:m addTo:aTypeCollector
- |parser|
-
- method := m.
- saveStacks := Dictionary new.
- stack := OrderedCollection new.
- "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
- initialStack := stack copy.
- collector := aTypeCollector.
- parser := SmalltalkXInstvarInterfaceExtractor new.
- parser setColector:aTypeCollector.
- input := parser
- parseMethod:method source
- in:method mclass
- ignoreErrors:false
- ignoreWarnings:false.
- blockTraversal := false.
- blockArgs := 0.
-
- [ input isNil ] whileFalse:[
- self unaryExpressionFor:input.
- input :=input nextStatement.
- ]
-
- "Modified: / 24-11-2010 / 22:24:16 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-extractInterfacesFrom:sourc class:class addTo:aTypeCollector
- |parser|
-
- saveStacks := Dictionary new.
- stack := OrderedCollection new.
- "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
- initialStack := stack copy.
- collector := aTypeCollector.
- parser := InstvarInterfaceExtractor new.
- parser setColector:aTypeCollector.
- input := parser
- parseMethod: sourc
- in:class
- ignoreErrors:false
- ignoreWarnings:false.
- blockTraversal := false.
- blockArgs := 0.
-
- [ input isNil ] whileFalse:[
- self unaryExpressionFor:input.
- input :=input nextStatement.
- ]
-
- "Created: / 17-03-2011 / 16:00:31 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 04-04-2011 / 22:31:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!InstvarInterfaceExtractor methodsFor:'initialization'!
-
-initialize
- super initialize.
- assingmentsDictionary := Dictionary new.
- assigmentsTypeDictionary:=Dictionary new.
-
- "Created: / 04-11-2010 / 19:09:04 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 04-11-2010 / 23:46:36 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!InstvarInterfaceExtractor methodsFor:'opcodes-control'!
-
-nativeSend: selector numArgs: na
- | receiver args |
- args := stack removeLast: na.
- receiver := stack removeLast.
- receiver isInteger
- ifTrue:
- [ collector
- addSend: selector
- to: receiver ]
- ifFalse:
- [ receiver isVariableBinding ifTrue:
- [ receiver key = #temp
- ifTrue:
- [ collector
- addSend: selector
- toTmp: receiver value ]
- ifFalse:
- [ receiver key = #return ifTrue:
- [ collector
- addSend: selector
- onReturnOfSelfMethod: receiver value ] ] ] ].
- (receiver = #self and: [ collector theClass methodDictionary includesKey: selector ]) ifTrue:
- [ args doWithIndex:
- [ :arg :index |
- collector
- handleAssignment: arg
- forTmp: index - 1
- in: collector theClass >> selector ] ].
- stack add: (collector
- pushSendOf: selector
- to: receiver
- args: args)
-
- "Modified: / 18-05-2011 / 23:47:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-send: selector numArgs: na
- ^self
- nativeSend: selector
- numArgs: na
-! !
-
-!InstvarInterfaceExtractor methodsFor:'opcodes-data movement'!
-
-dupFirst
- stack add: stack last
-!
-
-pop
- stack removeLast
-!
-
-pushConstant: value
- value class == BlockClosure
- ifTrue:
- [self
- readBlock: value method
- copied: 0]
- ifFalse: [
- blockArgs := value.
- stack addLast: value class]
-!
-
-pushContext
- stack add: #context
-!
-
-pushInst: index
- stack add: index
-!
-
-pushReceiver
- stack addLast: #self
-!
-
-pushStatic: assoc
- "assoc can be an association OR a variable binding. I just push the complete association, since it does not interest me for the moment."
-
- stack addLast: assoc
-! !
-
-!InstvarInterfaceExtractor methodsFor:'parsing-expressions'!
-
-binaryExpressionFor:receiverArg
- |node|
-
- node := super binaryExpressionFor:receiverArg.
- self parseNode:node.
- ^ node
-
- "Modified: / 14-12-2010 / 23:50:17 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseCascadeNodetypeCollector:node expression:expression
- |receiver ret break collectionSends|
-
- receiver := expression receiver.
- break := false.
- collectionSends := Set new.
- "we add first selector"
- collectionSends add:expression selector.
- "we must find receiver"
- [
- (receiver isKindOf:VariableNode) or:[ break ]
- ] whileFalse:[
- (receiver respondsTo:#receiver) ifTrue:[
- (receiver respondsTo:#selector) ifTrue:[
- "we remember all selectors x print;size;all;pro"
- collectionSends add:receiver selector.
- ].
- receiver := receiver receiver.
- ] ifFalse:[
- receiver := nil.
- ].
- (receiver isNil) ifTrue:[
- break := true.
- ].
- ].
- "we found first receiver and add represantive ."
- collectionSends do:[:sendSelector |
- (((receiver) respondsTo:#index) and:[ receiver index notNil ]) ifTrue:[
- ret := collector assignmentsTo:receiver name.
- (ret notNil) ifTrue:[
- collector addSend:sendSelector to:receiver index
- ] ifFalse:[
- collector addSend:sendSelector selector toTmp:receiver.
- ].
- ].
- ].
-
- "Created: / 10-11-2010 / 16:05:10 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 15-02-2011 / 13:04:21 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseMessageNodeToTypeCollector:node
- |helperNode receiver break ret|
-
- helperNode := node.
- "Getting receiver"
- receiver := helperNode receiver.
- break := false.
-
-(receiver isKindOf:MessageNode)
- ifTrue:[
- self parseMessageNodeToTypeCollector:receiver.
- ].
- "Check if receiver is variable. If not then receiver is some kind of node result"
- (receiver isKindOf:VariableNode)
- ifFalse:[
- ^self.
- ].
-
-
- (((receiver) respondsTo:#index) and:[ receiver index notNil ]) ifTrue:[
- "Check if receiver is tmp"
- ret := collector assignmentsTo:receiver name.
- (ret notNil) ifTrue:[
- "not tmp"
- collector addSend:helperNode selector to:receiver index
- ] ifFalse:[
- "tmp"
- collector addSend:helperNode selector toTmp:receiver .
- ].
- ].
-
- "Created: / 03-11-2010 / 22:25:23 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 15-02-2011 / 13:04:28 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseNode:node
-|helperNode|
-
-helperNode := node.
- (node isKindOf: StatementNode)ifTrue:[
- "x printString; size"
- self parseStatementNodeToTypeCollector:node.
- ].
-
- (node isKindOf:UnaryNode)ifTrue:[
- "(Point new. a new. b floor) -> we must recognize and parse node with single message(easy to parse)"
- self parseUnaryNodeToTypeCollector:node.
- ^ node.
- ].
-
- (node isKindOf:MessageNode)ifTrue:[
- "Every node which can send message except unary node ( x point:a. x point:a left....)"
- self parseMessageNodeToTypeCollector:node.
- ].
-
- (node isKindOf: AssignmentNode)ifTrue:[
- self parseAssignmentNodeToTypeCollector:node.
- self parseNode:node expression.
- ].
-
- "Created: / 14-12-2010 / 23:48:27 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseStatementNodeToTypeCollector:node
- |helperNode expression|
-
- helperNode := node.
-
- ((helperNode) respondsTo:#expression) ifTrue:[
- expression := helperNode expression.
- (expression isKindOf:CascadeNode) ifTrue:[
- self parseCascadeNodetypeCollector:node expression:expression.
- ].
- (expression isKindOf:MessageNode)ifTrue:[
- "Check indirect assignments"
- (expression receiver isKindOf:SelfNode)ifTrue:[
- self parseAssignmentNodeToTypeCollector:node.
- ].
- self parseMessageNodeToTypeCollector:expression.
- ]
- ].
-
- "Created: / 10-11-2010 / 15:55:06 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 14-12-2010 / 22:06:17 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-parseUnaryNodeToTypeCollector:node
- |helperNode ret|
-"(Point new. a new. b floor) node with single message."
- helperNode := node.
-
-"Check indirect sends"
-((helperNode receiver) isKindOf:UnaryNode)ifTrue:[
- "Check if receiver is self"
- (helperNode receiver receiver isKindOf:SelfNode)ifTrue:[
- "Check if selector is class Variable"
- ret := collector assignmentsTo:helperNode receiver selector asString.
-
- (ret notNil) ifTrue:[
- collector addSend:helperNode selector to:( collector absoluteIndexForVar:(helperNode receiver selector asString)).
- ].
- ]ifFalse:[
- self parseUnaryNodeToTypeCollector:node receiver.
- ].
-].
-
-
-
- (((helperNode receiver) respondsTo:#index)
- and:[ helperNode receiver index notNil ])
- ifTrue:[
- "we can simple find if receiver is tmp variable or not"
- ret := collector assignmentsTo:helperNode receiver name.
- (ret notNil) ifTrue:[
- "it is not tmp variable"
- collector addSend:helperNode selector to:helperNode receiver index
- ] ifFalse:[
- "it is tmp variable"
- collector addSend:helperNode selector toTmp:helperNode receiver.
- ].
- ].
-
- "Created: / 03-11-2010 / 22:19:09 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 04-03-2011 / 16:58:11 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-unaryExpressionFor:receiverArg
- |node|
- node := super unaryExpressionFor:receiverArg.
- self parseNode:node.
- ^ node
-
- "Created: / 30-10-2010 / 15:45:45 / Jakub <zelenja7@fel.cvut.cz>"
- "Modified: / 17-03-2011 / 16:19:23 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!InstvarInterfaceExtractor methodsFor:'private'!
-
-copied: list
- copied := list
-!
-
-input
- ^input
-!
-
-method: aMethod
- method := aMethod.
- copied := #()
-!
-
-readBlock: block copied: count
- | newCopied |
- newCopied := stack removeLast: count.
- stack add: #block.
- ^(self class new)
- copied: newCopied;
- extractInterfacesFrom: block source class:block mclass
- addTo: collector
-
- "Modified: / 17-03-2011 / 16:01:39 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-reloadStack
- stack isNil
- ifTrue:
- [stack := self saveStacks
- at: self input startPosition
- ifAbsent: [initialStack copy].
- ^self].
- stack := self saveStacks
- at: self input startPosition
- ifAbsent: [stack]
-
- "Modified: / 28-10-2010 / 15:04:05 / Jakub <zelenja7@fel.cvut.cz>"
-!
-
-saveStacks
- saveStacks ifNil: [saveStacks := Dictionary new].
- ^saveStacks
-!
-
-setColector:colectorSetter
- collector := colectorSetter.
-
- "Created: / 03-11-2010 / 21:33:42 / Jakub <zelenja7@fel.cvut.cz>"
-! !
-
-!InstvarInterfaceExtractor class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
-! !
-
--- a/SmallSense__JavaEditSupport.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__JavaEditSupport.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'lastTypedKey0 lastTypedKey1 lastTypedKey2 lastTypedKey3'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Java'
!
!JavaEditSupport methodsFor:'accessing'!
--- a/SmallSense__Manager.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__Manager.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'classes accessLock updater'
classVariableNames:'Instance'
poolDictionaries:''
- category:'SmallSense-Model'
+ category:'SmallSense-Smalltalk-Types-Info'
!
@@ -193,10 +193,11 @@
method mclass isNil ifTrue:["Obsolete method" ^ self ].
method mclass programmingLanguage isSmalltalk ifFalse: [ ^ self ].
"/ Transcript showCR: 'SmallSense: updating info for: ', method printString.
- inferencer := Inferencer forMethod: method.
+ inferencer := SmalltalkInferencer forMethod: method.
inferencer process.
"Created: / 27-11-2011 / 18:06:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-08-2013 / 10:20:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!Manager class methodsFor:'documentation'!
--- a/SmallSense__MethodInfo.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__MethodInfo.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'classInfo selector returnType'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Model'
+ category:'SmallSense-Smalltalk-Types-Info'
!
--- a/SmallSense__MethodPO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__MethodPO.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'class'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
--- a/SmallSense__PO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__PO.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'subject icon label name description'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
--- a/SmallSense__ParseNodeInspector.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__ParseNodeInspector.st Mon Aug 26 10:33:23 2013 +0100
@@ -7,7 +7,7 @@
sourceView inspectorView'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface'
+ category:'SmallSense-Core-Interface'
!
HierarchicalItem subclass:#ParseNodeItem
--- a/SmallSense__Parser.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,376 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-SyntaxHighlighter subclass:#Parser
- instanceVariableNames:'error'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Core'
-!
-
-
-!Parser methodsFor:'error handling'!
-
-parseError:message position:startPos to:endPos
-
- error := ParseErrorNode new
- errorString: message;
- errorToken: (token notNil ifTrue:[token asString] ifFalse:[nil]);
- startPosition: startPos endPosition: endPos.
- ^error
-
- "Created: / 27-11-2011 / 09:35:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 15-08-2013 / 12:21:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-syntaxError:message position:startPos to:endPos
-
- ^self parseError:message position:startPos to:endPos
-
- "Created: / 27-11-2011 / 09:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser methodsFor:'parsing'!
-
-blockStatementList
- "parse a blocks statementlist; return a node-tree, nil or #Error"
-
- |thisStatement prevStatement firstStatement eMsg blockStart|
-
- blockStart := tokenPosition.
-
- (tokenType == $] ) ifTrue:[^ nil].
-
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[^ #Error].
- firstStatement := thisStatement.
- [tokenType == $] ] whileFalse:[
- (tokenType == $.) ifFalse:[
- (tokenType == #EOF) ifTrue:[
- | errnode |
- errnode := self syntaxError:'missing '']'' in block' position:blockStart to:(source position + 1).
- errnode children: (Array with: firstStatement).
- ^errnode
- ].
-
- (tokenType == $) ) ifTrue:[
- eMsg := 'missing '']'' or bad '')'' in block'
- ] ifFalse:[
- eMsg := 'missing ''.'' between statements (i.e. ''' , tokenType printString , '''-token unexpected)'
- ].
-
- self syntaxError:eMsg position:thisStatement startPosition to:tokenPosition.
- "/ ^ #Error --- can proceed
- ] ifTrue:[
- self nextToken.
- ].
-
- prevStatement := thisStatement.
-
- tokenType == $] ifTrue:[
- "
- *** I had a warning here (since it was not defined
- *** in the blue-book; but PD-code contains a lot of
- *** code with periods at the end so that the warnings
- *** became annoying
-
- self warning:'period after last statement in block'.
- "
- self markBracketAt:tokenPosition.
- ^ self statementListRewriteHookFor:firstStatement
- ].
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[^ #Error].
- prevStatement nextStatement:thisStatement
- ].
- self markBracketAt:tokenPosition.
- ^ self statementListRewriteHookFor:firstStatement
-
- "Created: / 15-08-2013 / 12:16:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-parseExpressionWithSelf:anObject notifying:someOne ignoreErrors:ignoreErrors ignoreWarnings:ignoreWarnings inNameSpace:aNameSpaceOrNil
-
- |tree token|
-
- aNameSpaceOrNil notNil ifTrue:[
- self currentNameSpace:aNameSpaceOrNil
- ].
- self setSelf:anObject.
- self notifying:someOne.
- self ignoreErrors:ignoreErrors.
- self ignoreWarnings:ignoreWarnings.
- token := self nextToken.
- (token == $^) ifTrue:[
- self nextToken.
- ].
- (token == #EOF) ifTrue:[
- ^ nil
- ].
- "/tree := self expression.
- tree := self statementList.
- (self errorFlag or:[tree == #Error]) ifTrue:[^ #Error].
- ^ tree
-
- "Created: / 14-12-1999 / 15:11:37 / cg"
- "Created: / 09-07-2011 / 22:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser methodsFor:'parsing-expressions'!
-
-primary
- | nodeOrError |
-
- nodeOrError := super primary.
- ^ (nodeOrError == #Error and:[error notNil]) ifTrue:[
- error
- ] ifFalse:[
- nodeOrError
- ]
-
- "Created: / 19-08-2013 / 14:07:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-primary_expression
- "parse a parentized expression primary; return a node-tree, or raise an Error."
-
- |pos val eMsg|
-
- pos := tokenPosition.
-
- self nextToken.
- val := self expression.
- (val == #Error) ifTrue:[^ #Error].
- (tokenType == $) ) ifFalse:[
- | errnode |
- tokenType isCharacter ifTrue:[
- eMsg := 'missing '')'' (i.e. ''' , tokenType asString , ''' unexpected)'.
- ] ifFalse:[
- eMsg := 'missing '')'''.
- ].
- errnode := self syntaxError:eMsg withCRs position:pos to:tokenPosition.
- errnode children: (Array with: val).
- ^ errnode
- ].
- self markParenthesisAt:tokenPosition.
- parenthesisLevel := parenthesisLevel - 1.
- self nextToken.
- (self noAssignmentAllowed:'Invalid assignment to an expression' at:pos) ifFalse:[
- ^ #Error
- ].
- val parenthesized:true.
- ^ val
-
- "Created: / 15-08-2013 / 15:23:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser methodsFor:'parsing-tweaks'!
-
-_blockStatementList
- "parse a blocks statementlist; return a node-tree, nil or #Error"
-
- |thisStatement prevStatement firstStatement eMsg blockStart|
-
- blockStart := tokenPosition.
- (tokenType == $]) ifTrue:[
- ^ nil
- ].
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[
- ^ #Error
- ].
- firstStatement := thisStatement.
- [
- tokenType == $] or:[ tokenType == #EOF ]
- ] whileFalse:[
- (tokenType == $.) ifFalse:[
- (tokenType == #EOF) ifTrue:[
- " self syntaxError:'missing '']'' in block' position:blockStart to:(source position1Based).
- ^ #Error."
- ].
- (tokenType == $)) ifTrue:[
- eMsg := 'missing '']'' or bad '')'' in block'
- ] ifFalse:[
- eMsg := 'missing ''.'' between statements (i.e. '''
- , tokenType printString , '''-token unexpected)'
- ].
- "self syntaxError:eMsg position:blockStart to:tokenPosition.
- ^ #Error"
- ].
-
- prevStatement := thisStatement.
- (eMsg isNil ) ifTrue:[
- self nextToken.
- ].
- tokenType == $] ifTrue:[
- "
- *** I had a warning here (since it was not defined
- *** in the blue-book; but PD-code contains a lot of
- *** code with periods at the end so that the warnings
- *** became annoying
-
- self warning:'period after last statement in block'."
- self markBracketAt:tokenPosition.
- ^ firstStatement
- ].
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[
- ^ #Error
- ].
- prevStatement nextStatement:thisStatement.
- (eMsg notNil) ifTrue:[
- self nextToken.
- ].
- eMsg := nil.
- ].
- self markBracketAt:tokenPosition.
- ^ self statementListRewriteHookFor:firstStatement
-
- "Created: / 05-08-2013 / 14:56:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-_primary
- "parse a primary-expression; return a node-tree, nil or #Error.
- This also cares for namespace-access-pathes."
-
- | node |
- node := super primary.
- "/If an error occured, return the error node"
- node == #Error ifTrue:[
- self assert: error notNil description: 'Parse error occured but no error node.'.
- node := error. error := nil.
- ].
- ^node
-
- "Created: / 05-08-2013 / 14:56:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-_statementList
- "parse a statementlist; return a node-tree, nil or #Error.
- Statements must be separated by periods.
-
- statementList ::= <statement>
- | <statementList> . <statement>"
-
- |thisStatement prevStatement firstStatement periodPos prevExpr|
-
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[
- self breakPoint: #jv.
- ^ #Error
- ].
- firstStatement := thisStatement.
- [ tokenType == #EOF ] whileFalse:[
- prevExpr := thisStatement expression.
- (prevExpr notNil
- and:[ prevExpr isMessage and:[ thisStatement isReturnNode not ] ])
- ifTrue:[
- (#( #'=' #'==' ) includes:prevExpr selector) ifTrue:[
- self
- warning:'useless computation - mistyped assignment (i.e. did you mean '':='') ?'
- position:prevExpr selectorPosition
- ].
- ].
- periodPos := tokenPosition.
-
- (tokenType == $. or:[ firstStatement = thisStatement and:[firstStatement expression isErrorNode] ]) ifTrue:[
- self nextToken.
- ].
- tokenType == $. ifTrue:[
- self emptyStatement.
- ].
- (tokenType == $]) ifTrue:[
- currentBlock isNil ifTrue:[
-
- ] ifFalse:[
- ^ self statementListRewriteHookFor:firstStatement
- ].
- ].
- (tokenType == #EOF) ifTrue:[
- currentBlock notNil ifTrue:[
- "self parseError:''']'' expected (block nesting error)'."
- ] ifFalse:[
- ^ self statementListRewriteHookFor:firstStatement
- ].
- ].
- prevStatement := thisStatement.
- prevStatement isReturnNode ifTrue:[
- self warning:'statements after return' position:tokenPosition
- ].
- thisStatement := self statement.
- (thisStatement == #Error) ifTrue:[
- self breakPoint: #jv.
- ^ #Error
- ].
- (thisStatement expression isNil or:[thisStatement expression isErrorNode]) ifTrue:[
- self nextToken.
- ].
-
- prevStatement nextStatement:thisStatement
- ].
- ^ self statementListRewriteHookFor:firstStatement
-
- "Created: / 05-08-2013 / 14:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser methodsFor:'private'!
-
-findNameSpaceWith:varName
- | ns |
-
- "The super #findNameSpaceWith: checks whether the the gloval named 'varName' exists,
- if not, returns the current namespace which is then prepended to 'varName'.
-
- Here we have to deal with uncomplete global names, so trick the caller by returning
- nil if the partially typed global name starts with current namespace prefix."
-
- classToCompileFor notNil ifTrue:[
- ns := classToCompileFor topNameSpace.
- (varName = ns name) ifTrue:[
- ^ nil
- ]
- ].
-
- ^ super findNameSpaceWith:varName
-
- "Created: / 28-07-2013 / 13:49:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser methodsFor:'syntax coloring'!
-
-markBracketAt:pos
-
- sourceText isNil ifTrue:[^self].
- ^super markBracketAt:pos
-
- "Created: / 03-04-2011 / 22:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
-
- sourceText isNil ifTrue:[^self].
- super markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
-
- "Created: / 03-04-2011 / 22:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-markFrom:pos1 to:pos2 withEmphasis:fontEmp color:fgClr1 ifNil:fgClr2 backgroundColor:bgClr
-
- sourceText isNil ifTrue:[^self].
- super markFrom:pos1 to:pos2 withEmphasis:fontEmp color:fgClr1 ifNil:fgClr2 backgroundColor:bgClr
-
- "Created: / 14-02-2012 / 11:08:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Parser class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseParser.st 7922 2012-03-09 07:57:34Z vranyj1 $'
-! !
-
--- a/SmallSense__QuickFixer.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Object subclass:#QuickFixer
- instanceVariableNames:'view rule fixes'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Lint'
-!
-
-Object subclass:#QuickFix
- instanceVariableNames:'rule label action'
- classVariableNames:''
- poolDictionaries:''
- privateIn:QuickFixer
-!
-
-
-!QuickFixer class methodsFor:'instance creation'!
-
-for: rule
-
- ^self new initializeForRule: rule.
-
- "Created: / 01-02-2012 / 12:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-for: rule view: view
-
- ^self new initializeForRule: rule view: view
-
- "Created: / 17-02-2012 / 00:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer methodsFor:'adding'!
-
-fix
- "Create and return new quick fix. Caller MUST set its
- label and action"
-
- | fix |
-
- fix := QuickFix new.
- fix rule: rule.
- fixes add: fix.
- ^fix
-
- "Created: / 01-02-2012 / 10:51:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer methodsFor:'initialization'!
-
-initializeForRule: anRBLintRule view: aCodeView2
- rule := anRBLintRule.
- view := aCodeView2.
- fixes := OrderedCollection new: 3.
- rule fixes: self.
-
- "Created: / 17-02-2012 / 00:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer methodsFor:'performing fixes'!
-
-performFix: index
-
- index <= fixes size ifTrue:[
- (fixes at: index) performFix.
- ] ifFalse:[
- ^ Dialog warn: ('No such fix (%1)' bindWith: index).
- ]
-
- "Created: / 16-02-2012 / 14:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer methodsFor:'printing & storing'!
-
-printHtmlOn: html
-
- fixes isEmptyOrNil ifTrue:[ ^ self ].
- fixes size > 1 ifTrue:[
- html nextPutAll: '<br>'.
- html nextPutLine: 'Possible fixes'.
- ].
- html nextPutLine:'<ul>'.
- fixes withIndexDo:[:fix :index|
- html
- nextPutAll:'<li><a action="doit: self doQuickFix:';
- nextPutAll: index printString;
- nextPutAll:'">';
- nextPutAll: fix label;
- nextPutAll:'</a></li>'.
- ].
- html nextPutLine:'</ul>'.
-
- "Created: / 01-02-2012 / 12:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer methodsFor:'utilities'!
-
-apply: allChanges
- | changes |
-
- changes := Tools::ChangeSetBrowser2 confirmChanges: allChanges.
- changes isEmptyOrNil ifTrue:[ ^ self ].
- (changes size == 1 and:[view reallyModified]) ifTrue:[
- view contents: changes anElement source clear: false.
- ] ifFalse:[
- | browser |
-
-
- self halt.
- ]
-
- "Created: / 16-02-2012 / 14:46:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!QuickFixer::QuickFix methodsFor:'accessing'!
-
-action
- ^ action
-!
-
-action:aBlock
- action := aBlock.
-!
-
-label
- ^ label
-!
-
-label:aString
- label := aString.
-!
-
-performFix
-
- ^action value
-
- "Created: / 16-02-2012 / 14:48:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-rule
- ^ rule
-!
-
-rule:anRBLintRule
- rule := anRBLintRule.
-! !
-
-!QuickFixer class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseQuickFixer.st 7911 2012-02-22 09:55:48Z vranyj1 $'
-! !
-
--- a/SmallSense__Service.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,417 +0,0 @@
-"
- COPYRIGHT (c) 2006 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.
-"
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Tools::BackgroundSourceProcessingService subclass:#Service
- instanceVariableNames:'rulesHolder rules highlighter support'
- classVariableNames:'Debugging'
- poolDictionaries:''
- category:'SmallSense-Services'
-!
-
-!Service class methodsFor:'documentation'!
-
-copyright
-"
- COPYRIGHT (c) 2006 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.
-"
-! !
-
-!Service class methodsFor:'initialization'!
-
-initialize
-
- "
- | map |
- map := Screen current keyboardMap.
- map bindValue:#CodeCompletion to: #'Ctrl '.
- map bindValue:#CodeCompletion to: #'Ctrlspace'.
- "
-
- Smalltalk isInitialized ifTrue:[
- Smalltalk addStartBlock:[
- Screen current notNil ifTrue:[
- | map |
- map := Screen current keyboardMap.
- (map keyAtValue:#CodeCompletion) isNil ifTrue:[
- map bindValue:#CodeCompletion to: #'Ctrl '.
- map bindValue:#CodeCompletion to: #'Ctrlspace'.
- ].
- ]
- ]
- ]
-
- "Modified: / 15-08-2013 / 15:19:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service class methodsFor:'accessing'!
-
-debugging
- ^Debugging == true
-
- "Created: / 17-02-2012 / 00:48:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-debugging: aBoolean
-
- Debugging := aBoolean
-
- "Created: / 16-02-2012 / 16:22:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-label
-
- "Answers short label - for UI"
-
- ^'SmallSense - Static Checking'
-
- "Created: / 07-03-2010 / 14:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 27-07-2013 / 22:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-priority
- "Answers a priority of the service. Services with higher priority
- will get the event notification before ones with lower priority.
- Therefore, a lower-priority service might not get the event if high
- priority service processes it"
-
- ^ 10
-
- "Created: / 01-02-2012 / 10:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service class methodsFor:'queries'!
-
-isUsefulFor:aCodeView
- "this filters useful services.
- must be redefined to return true in subclasses (but each class must do it only
- for itself - not for subclasses"
-
- ^ self == Service.
-
- "Created: / 24-07-2013 / 11:35:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service class methodsFor:'testing'!
-
-isAvailable
-
- ^UserPreferences current smallSenseEnabled
-
- "Created: / 04-02-2012 / 22:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'accessing'!
-
-syntaxHighlighter
-
- ^highlighter
-
- "Created: / 05-08-2011 / 10:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'aspects'!
-
-rulesHolder
- "return/create the 'rulesHolder' value holder (automatically generated)"
-
- rulesHolder isNil ifTrue:[
- rulesHolder := ValueHolder new.
- rulesHolder addDependent:self.
- ].
- ^ rulesHolder
-!
-
-rulesHolder:something
- "set the 'rulesHolder' value holder (automatically generated)"
-
- |oldValue newValue|
-
- rulesHolder notNil ifTrue:[
- oldValue := rulesHolder value.
- rulesHolder removeDependent:self.
- ].
- rulesHolder := something.
- rulesHolder notNil ifTrue:[
- rulesHolder addDependent:self.
- ].
- newValue := rulesHolder value.
- oldValue ~~ newValue ifTrue:[
- self update:#value with:newValue from:rulesHolder.
- ].
-! !
-
-!Service methodsFor:'change & update'!
-
-sourceChanged:force
- | lang |
-
- rules isNil ifTrue:[ ^ self ].
- ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
- rules resetResult.
- highlighter reset.
- super sourceChanged:force.
-
- "Created: / 18-02-2012 / 22:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-update:something with:aParameter from:changedObject
- "Invoked when an object that I depend upon sends a change notification."
-
- changedObject == rulesHolder ifTrue:[
- UserPreferences current smallSenseBackgroundLintEnabled ifTrue:[
- | ruleList |
-
- ruleList := rulesHolder value flattened reject:[:each| Checker forceDisabledRules includes: each class name].
- rules := RBCompositeLintRule rules: ruleList.
- highlighter rules: ruleList.
-
- self process.
- ].
- ^ self.
- ].
-
- super update:something with:aParameter from:changedObject
-
- "Modified (format): / 27-07-2013 / 22:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'event handling'!
-
-buttonPress:button x:x y:y in:view
- |lineNr|
-
- rules isNil ifTrue:[
- ^ false
- ].
- view == gutterView ifTrue:[
- button == 1 ifTrue:[
- lineNr := textView yVisibleToLineNr:y.
- lineNr notNil ifTrue:[
- ^ self showInfoWindowForLine: lineNr
- ].
- ^ false.
- ].
- ].
- ^ false
-
- "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-viewRealized
-
- | browser |
-
- UserPreferences current smallSenseBackgroundLintEnabled ifFalse:[ ^ self ].
-
- (browser := codeView browser) notNil ifTrue:[
- browser navigationState canvasType ~~ #smallLintByRuleResultBrowserSpec ifTrue:[
- self rulesHolder: browser smalllintRulesOrDefaultHolder.
- ].
- ].
-
- "Created: / 23-01-2012 / 10:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 28-02-2013 / 22:43:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'initialization'!
-
-initialize
-
- super initialize.
-
- highlighter := Tools::LintHighlighter new.
-
- "Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'private'!
-
-annotationAtLine: lineNo
- | annotations |
-
- (annotations := highlighter annotations) isEmptyOrNil ifTrue:[ ^ nil ].
- annotations do:[:a|
- | l |
-
- (l := a line) isNil ifTrue:[
- l := codeView lineOfCharacterPosition: a startPosition.
- a line: l.
- ].
- l > lineNo ifTrue:[ ^ nil ].
- l == lineNo ifTrue:[ ^ a ].
- ].
- ^nil
-
- "Created: / 30-01-2012 / 21:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-process
- "(Re)starts the processing job. Should be called whenever a source
- must be (re)processed."
-
- rules isNil ifTrue:[
- ^self
- ].
-
- ^super process.
-
- "Created: / 24-01-2012 / 12:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-process: delayed
- "Do the real source processing. If delayed is true, actuall data update must
- be done within the event queue using #pushUserEvent:...
- "
- | cls env oldCodeList oldCode |
-
- rules isNil ifTrue:[ ^ self ].
- codeView codeAspect ~~ #method ifTrue:[ ^ self ].
- codeView language isNil ifTrue: [ ^ self ].
- codeView language isSmalltalk ifFalse: [ ^ self ].
- done := false.
- modified := false.
-
- cls := codeView klass.
- cls isNil ifTrue:[^ self ].
-
-
- Delay waitForMilliseconds: 200."Give user some time to write"
-
- (cls notNil and:[cls isObsolete]) ifTrue:[
- cls isMeta ifTrue:[
- cls := (Smalltalk at:cls theNonMetaclass name) class
- ] ifFalse:[
- cls := Smalltalk at:cls name
- ].
- ].
-
- "textView" modified ifFalse:[
- oldCodeList := textView list copy.
- oldCodeList isEmptyOrNil ifTrue: [ ^ self ].
- "textView" modified ifFalse:[
- oldCodeList isNil ifFalse:[
- oldCode := oldCodeList asStringWithoutEmphasis.
- oldCode isEmptyOrNil ifTrue:[ ^ self ].
- "textView" modified ifFalse:[
- Screen currentScreenQuerySignal answer:codeView device
- do:[
- Error handle:[:ex |
- |errMsg|
-
- errMsg := ex description asStringCollection first asString.
-
- Debugging == true ifTrue:[
- Debugging := false.
- ex pass.
- ].
-
- "/ Transcript topView raiseDeiconified.
- "/ Transcript showCR:'ParseError: ', ex description.
-"/ self halt.
- "/ self showInfo:(errMsg colorizeAllWith:Color red).
- ] do:[
- env := (SmallSense::UnacceptedMethodEnvironment onClass:cls methodSource: oldCode).
- Checker runRule: rules onEnvironment: env
- ].
- delayed ifTrue:[
- codeView sensor pushUserEvent:#rehighlight: for:self withArgument: true.
- ] ifFalse:[
- self rehighlight: true.
- ]
- ]
- ]
- ]
- ]
- ]
-
- "Created: / 24-01-2012 / 12:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 24-07-2013 / 23:06:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-rehighlight: delayed
-
- | service |
- service := self service: SyntaxHighlightingService name.
- service isNil ifTrue:[
- service := self service: Tools::CodeHighlightingService name
- ].
- service notNil ifTrue:[
- service sourceChanged: true.
- ]
-
- "Created: / 27-01-2012 / 17:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 06-08-2013 / 10:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-showInfoWindowForLine: lineNo
- | ann |
-
- ann := self annotationAtLine: lineNo.
- ann isNil ifTrue:[ ^ false ].
-
- CriticsWindow new
- rule: ann rule;
- codeView: codeView;
- allButOpen;
- openWindowAt: (Screen current pointerPosition - (20@20)).
-
- ^true
-
- "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service methodsFor:'redrawing'!
-
-drawLine:lineNo in:view atX:x y:y width:w height:h from:startCol to:endColOrNil with:fg and:bg
- "Called by both gutterView and textView (well, not yet) to
- allow services to draw custom things on text view.
- Ask JV what the args means if unsure (I'm lazy to document
- them, now it is just an experiment...)"
-
- | lang annotation |
-
- ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
-
- annotation := self annotationAtLine: lineNo.
- annotation notNil ifTrue:[
- self drawAnnotationIcon: (ToolbarIconLibrary smalllintWarning16x16)
- atX: x y: y width: w height: h.
- ].
-
- "Created: / 30-01-2012 / 15:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 07-08-2013 / 00:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!Service class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseService.st 8039 2012-08-13 22:12:37Z vranyj1 $'
-! !
-
-
-Service initialize!
--- a/SmallSense__SettingsAppl.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__SettingsAppl.st Mon Aug 26 10:33:23 2013 +0100
@@ -7,7 +7,7 @@
smallSenseEnabled smallSenseElectricEditSupportEnabled'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface'
+ category:'SmallSense-Core-Interface'
!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,222 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+SmalltalkParser subclass:#SmalltalkAbstractInstvarInterfaceExtractor
+ instanceVariableNames:'stack copied initialStack saveStacks input collector
+ blockTraversal blockArgs'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer (obsolete)'
+!
+
+
+!SmalltalkAbstractInstvarInterfaceExtractor methodsFor:'extracting'!
+
+extractInterfacesFrom:m addTo:aTypeCollector
+ |parser|
+
+ method := m.
+ saveStacks := Dictionary new.
+ stack := OrderedCollection new.
+ "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
+ initialStack := stack copy.
+ collector := aTypeCollector.
+ parser := SmalltalkXInstvarInterfaceExtractor new.
+ parser setColector:aTypeCollector.
+ input := parser
+ parseMethod:method source
+ in:method mclass
+ ignoreErrors:false
+ ignoreWarnings:false.
+ blockTraversal := false.
+ blockArgs := 0.
+
+ [ input isNil ] whileFalse:[
+ self unaryExpressionFor:input.
+ input :=input nextStatement.
+ ]
+
+ "Modified: / 24-11-2010 / 22:24:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+extractInterfacesFrom:sourc class:class addTo:aTypeCollector
+ |parser|
+
+ saveStacks := Dictionary new.
+ stack := OrderedCollection new.
+ "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
+ initialStack := stack copy.
+ collector := aTypeCollector.
+ parser := SmalltalkXInstvarInterfaceExtractor new.
+ parser setColector:aTypeCollector.
+ input := parser
+ parseMethod: sourc
+ in:class
+ ignoreErrors:false
+ ignoreWarnings:false.
+ blockTraversal := false.
+ blockArgs := 0.
+
+ [ input isNil ] whileFalse:[
+ self unaryExpressionFor:input.
+ input :=input nextStatement.
+ ]
+
+ "Created: / 17-03-2011 / 16:00:31 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkAbstractInstvarInterfaceExtractor methodsFor:'opcodes-control'!
+
+nativeSend: selector numArgs: na
+ | receiver args |
+ args := stack removeLast: na.
+ receiver := stack removeLast.
+ receiver isInteger
+ ifTrue:
+ [ collector
+ addSend: selector
+ to: receiver ]
+ ifFalse:
+ [ receiver isVariableBinding ifTrue:
+ [ receiver key = #temp
+ ifTrue:
+ [ collector
+ addSend: selector
+ toTmp: receiver value ]
+ ifFalse:
+ [ receiver key = #return ifTrue:
+ [ collector
+ addSend: selector
+ onReturnOfSelfMethod: receiver value ] ] ] ].
+ (receiver = #self and: [ collector theClass methodDictionary includesKey: selector ]) ifTrue:
+ [ args doWithIndex:
+ [ :arg :index |
+ collector
+ handleAssignment: arg
+ forTmp: index - 1
+ in: collector theClass >> selector ] ].
+ stack add: (collector
+ pushSendOf: selector
+ to: receiver
+ args: args)
+
+ "Modified: / 18-05-2011 / 23:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+send: selector numArgs: na
+ ^self
+ nativeSend: selector
+ numArgs: na
+! !
+
+!SmalltalkAbstractInstvarInterfaceExtractor methodsFor:'opcodes-data movement'!
+
+dupFirst
+ stack add: stack last
+!
+
+pop
+ stack removeLast
+!
+
+pushConstant: value
+ value class == BlockClosure
+ ifTrue:
+ [self
+ readBlock: value method
+ copied: 0]
+ ifFalse: [
+ blockArgs := value.
+ stack addLast: value class]
+!
+
+pushContext
+ stack add: #context
+!
+
+pushInst: index
+ stack add: index
+!
+
+pushReceiver
+ stack addLast: #self
+!
+
+pushStatic: assoc
+ "assoc can be an association OR a variable binding. I just push the complete association, since it does not interest me for the moment."
+
+ stack addLast: assoc
+! !
+
+!SmalltalkAbstractInstvarInterfaceExtractor methodsFor:'private'!
+
+copied: list
+ copied := list
+!
+
+initialize
+ super initialize.
+ blockTraversal := false.
+ blockArgs := 0.
+
+ "Modified: / 03-11-2010 / 21:27:34 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+input
+ ^input
+!
+
+method: aMethod
+ method := aMethod.
+ copied := #()
+!
+
+readBlock: block copied: count
+ | newCopied |
+ newCopied := stack removeLast: count.
+ stack add: #block.
+ ^(self class new)
+ copied: newCopied;
+ extractInterfacesFrom: block source class:block mclass
+ addTo: collector
+
+ "Modified: / 17-03-2011 / 16:01:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+reloadStack
+ stack isNil
+ ifTrue:
+ [stack := self saveStacks
+ at: self input startPosition
+ ifAbsent: [initialStack copy].
+ ^self].
+ stack := self saveStacks
+ at: self input startPosition
+ ifAbsent: [stack]
+
+ "Modified: / 28-10-2010 / 15:04:05 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+saveStacks
+ saveStacks ifNil: [saveStacks := Dictionary new].
+ ^saveStacks
+!
+
+setColector:colectorSetter
+ collector := colectorSetter.
+
+ "Created: / 03-11-2010 / 21:33:42 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkAbstractInstvarInterfaceExtractor class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseAbstractInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkChecker.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,112 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+SmalllintChecker subclass:#SmalltalkChecker
+ instanceVariableNames:''
+ classVariableNames:'Errors'
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk-Lint'
+!
+
+!SmalltalkChecker class methodsFor:'documentation'!
+
+documentation
+"
+ SmallSenseChecker is customized SmalllintChecker used
+ by SmallSense's checking services. Do not use it in your
+ code, use SmalllintChecker instead.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+ SmalllintChecker
+ SmallSenseService
+
+"
+! !
+
+!SmalltalkChecker class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ Errors := Dictionary new.
+
+ "Modified: / 06-09-2012 / 14:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkChecker class methodsFor:'accessing'!
+
+forceDisabledRules
+ "Return a list of rule class names that
+ are never run by SmallSense's checker - they
+ are either buggy (i.e.. not ready to be run
+ incrementally) or it does not make sense to run them
+ Add with care!!!!!!
+ "
+
+ ^ #(
+ RBLawOfDemeterRule "/ Too many false positives, hard to fix
+ RBImplementedNotSentRule "/ Uses Context>>#computeLiterals whichs toooo slow.
+ RBSentNotImplementedRule "/ Uses Context>>#computeLiterals whichs toooo slow.
+ RBUndeclaredReferenceRule "/
+ )
+
+ "Created: / 17-02-2012 / 13:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkChecker methodsFor:'private'!
+
+checkClass: aClass
+
+ "Nothing to do, SmallSense checker checks only methods"
+ context selectedClass: aClass.
+
+ "Created: / 16-02-2012 / 16:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+checkMethodsForClass: aClass
+
+ environment selectorsForClass: aClass do: [:sel|
+ context selector: sel.
+ context parseTree notNil ifTrue:[
+ rule flattened do:[:each|
+ [
+ each checkMethod: context.
+ ] on: Error do:[:ex|
+ Service debugging ifTrue:[
+ Service debugging: false.
+ ex pass.
+ ] ifFalse:[
+ Errors at: each class ifAbsentPut:[ context method source ].
+ ]
+ ]
+ ].
+ ].
+ ]
+
+ "Modified: / 24-08-2010 / 21:32:39 / Jan Vrany <enter your email here>"
+ "Created: / 17-02-2012 / 00:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkChecker class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseChecker.st 8046 2012-09-06 16:38:47Z vranyj1 $'
+! !
+
+
+SmalltalkChecker initialize!
--- a/SmallSense__SmalltalkEditSupport.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__SmalltalkEditSupport.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'lastTypedKey0 lastTypedKey1 lastTypedKey2 lastTypedKey3'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Smalltalk'
!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkInferencer.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,434 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Object subclass:#SmalltalkInferencer
+ instanceVariableNames:'class classInfo source parser parserClass tree'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk-Types-Inference'
+!
+
+ParseNodeVisitor subclass:#Phase1
+ instanceVariableNames:'classInfo sends types'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmalltalkInferencer
+!
+
+ParseNodeVisitor subclass:#Phase2
+ instanceVariableNames:'classInfo'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmalltalkInferencer
+!
+
+!SmalltalkInferencer class methodsFor:'documentation'!
+
+documentation
+"
+ A heart of SmallSense - a type inferencer. For given class
+ and method source, instance of inferences walks the parse tree
+ and annotate each node with inferred type.
+
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!SmalltalkInferencer class methodsFor:'instance creation'!
+
+forClass: class methodSource: source
+
+ ^self new class: class source: source
+
+ "Created: / 26-11-2011 / 12:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+forClass: class selector: selector
+
+ ^self new class: class selector: selector.
+
+ "Created: / 26-11-2011 / 12:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+forMethod: method
+
+ ^self new method: method.
+
+ "Created: / 26-11-2011 / 12:45:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer methodsFor:'accessing'!
+
+klass
+ ^ class
+
+ "Created: / 26-11-2011 / 17:30:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+manager
+
+ ^Manager instance
+
+ "Created: / 27-11-2011 / 16:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parser
+ ^ parser
+!
+
+parserClass
+ ^ parserClass
+!
+
+parserClass:aClass
+ parserClass := aClass.
+!
+
+source
+ ^ source
+!
+
+tree
+ ^ tree
+! !
+
+!SmalltalkInferencer methodsFor:'initialization'!
+
+class: cls selector: sel
+
+ | m |
+ m := cls >> sel.
+ m isNil ifTrue:[
+ self error: 'No method found'.
+ ].
+ self method: m.
+
+ "Created: / 26-11-2011 / 12:47:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+class: cls source: src
+
+ class := cls.
+ classInfo := self manager infoForClass: class.
+ source := src.
+
+ "Created: / 26-11-2011 / 14:46:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+method: method
+
+ self class: method mclass source: method source.
+
+ "Created: / 26-11-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer methodsFor:'private'!
+
+infer
+
+
+ Phase1 process: tree in: class.
+
+ "
+ (SmallSenseParseNodeInspector new node: tree source: source) open
+ "
+
+ "Created: / 26-11-2011 / 12:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parse
+
+ parserClass isNil ifTrue:[
+ parserClass := class parserClass.
+ ].
+ parser := parserClass
+ parseMethod: source in: class
+ ignoreErrors:true
+ ignoreWarnings:true.
+ tree := parser tree.
+
+ "Created: / 26-11-2011 / 12:51:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer methodsFor:'processing'!
+
+process
+
+ "Actually infer types. Returns an annotated method tree.
+ The tree is also stored in an instance variable, so it
+ may be obtained form receiver any time by asking for #tree."
+
+ self parse.
+ tree notNil ifTrue:[
+ self infer.
+ ].
+ ^tree
+
+ "Created: / 26-11-2011 / 12:50:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer::Phase1 methodsFor:'initialization'!
+
+initialize
+ "Invoked when a new instance is created."
+
+ "/ please change as required (and remove this comment)
+ sends := Dictionary new.
+ types := Dictionary new.
+
+ "/ super initialize. -- commented since inherited method does nothing
+
+ "Modified: / 26-11-2011 / 19:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer::Phase1 methodsFor:'private'!
+
+rootsUnderstanding: selectors
+ "When the set of selectors is not empty, answer a set of the highest possible classes in the system that implement all the selectors.
+ When the set of selectors is empty, return the empty set."
+
+ | initialClasses nextClasses traverseStack next |
+ selectors isEmpty ifTrue: [^OrderedCollection new].
+ nextClasses := OrderedCollection with: Object.
+ traverseStack := OrderedCollection new: 1000.
+
+ selectors
+ do:
+ [:selector |
+ initialClasses := nextClasses.
+ nextClasses := OrderedCollection new.
+ initialClasses
+ do:
+ [:initialClass |
+ "inline canUnderstand: for performance"
+ |cl|
+ cl := initialClass.
+ [(cl == nil) or: [(cl methodDictionary includesKey: selector)]] whileFalse: [cl := cl superclass].
+ (cl == nil)
+ ifFalse: [nextClasses addLast: initialClass]
+ ifTrue:
+ [|size|
+ traverseStack reset.
+ traverseStack addLast: initialClass.
+ size := 1.
+ "(traverseStack isEmpty) removed for performance"
+ [size = 0]
+ whileFalse:
+ [
+ "(traverseStack removeFirst) removed for performance"
+ next := traverseStack removeFirst.
+ size := size -1.
+ next
+ subclassesDo:
+ [:subcl |
+ "(subcl includesSelector: selector) removed for performance"
+ (subcl methodDictionary includesKey: selector)
+ ifTrue: [nextClasses addLast: subcl]
+ ifFalse: [traverseStack addLast: subcl. size := size + 1]]]]]].
+ ^nextClasses
+
+ "Modified: / 24-11-2010 / 14:39:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 26-11-2011 / 14:01:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer::Phase1 methodsFor:'processing'!
+
+process: tree in: cls
+
+ self process: tree in: cls info: (Manager instance infoForClass: cls)
+
+ "Created: / 26-11-2011 / 13:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+process: tree in: cls info: clsInfo
+
+ | i c |
+
+ class := cls.
+ classInfo := clsInfo.
+
+ "Fill types with cached data..."
+
+ c := class.
+ i := classInfo.
+ [ c notNil and:[i notNil] ] whileTrue:[
+ c instVarNames do:[:nm|
+ types at: nm put: (i infoForInstvar: nm)
+ ].
+ c := c superclass.
+ i := i superclassInfo.
+ ].
+
+ self visit: tree.
+
+
+ "Now, infer variable types based on collected sends"
+ sends keysAndValuesDo:[:varName :sentSelectors|
+ | classes |
+
+ classes := self rootsUnderstanding: sentSelectors.
+ (types at: varName) addClasses: classes.
+ ].
+
+ "Created: / 27-11-2011 / 16:22:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer::Phase1 methodsFor:'visiting'!
+
+visitAssignmentNode:anObject
+
+ self visit: anObject variable.
+ self visit: anObject expression.
+
+ "Created: / 26-11-2011 / 13:53:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitBlockNode:anObject
+ | type |
+
+ super visitBlockNode:anObject.
+ type := (Type withClass: BlockClosure).
+ type trustfullness: 100.
+ anObject inferedType: type.
+
+ "Created: / 26-11-2011 / 14:46:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitConstantNode:anObject
+ "Type of a constant is trivially its value class"
+
+ | type |
+
+ super visitConstantNode: anObject.
+ type := (Type withClass: anObject value class).
+ type trustfullness: 100.
+ anObject inferedType: type.
+
+ "Created: / 26-11-2011 / 13:55:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitMessageNode:anObject
+
+ | rec |
+
+ super visitMessageNode: anObject.
+
+ (rec := anObject receiver) isVariableNode ifTrue:[
+ "We don't have to infer types for global/class variables"
+ (rec isGlobalVariable or:[rec isClassVariable]) ifFalse:[
+ (sends at: rec name ifAbsentPut:[Set new]) add: anObject selector.
+ ].
+ ].
+
+ "Created: / 26-11-2011 / 13:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSelfNode:anObject
+
+ super visitSelfNode:anObject.
+ anObject inferedType:(Type withClass: class)
+
+ "Created: / 26-11-2011 / 14:43:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSuperNode:anObject
+
+
+ super visitSuperNode:anObject.
+ anObject inferedType:(Type withClass: class superclass)
+
+ "Created: / 26-11-2011 / 14:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitUnaryNode:anObject
+
+ | type sel rec |
+
+ super visitUnaryNode:anObject.
+
+ sel := anObject selector.
+
+ sel == #class ifTrue:[
+ type := anObject receiver inferedType classSide.
+ anObject inferedType: type.
+ ^self.
+ ].
+ (sel == #new or:[sel == #basicNew]) ifTrue:[
+ rec := anObject receiver.
+ (rec isSelf and:[class isMetaclass]) ifTrue:[
+ type := Type withClass: class theNonMetaclass.
+ type trustfullnessAdd: 50.
+ anObject inferedType: type.
+ ^self.
+ ].
+
+ type := anObject receiver inferedType instanceSide.
+ anObject inferedType: type.
+ ^self.
+ ].
+
+ "Created: / 27-11-2011 / 15:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitVariableNode:anObject
+
+ | t |
+
+ "Following code ensures, that all variable nodes refering same
+ variable shares the inferred type"
+ t := types at: anObject name ifAbsentPut:[Type unknown].
+ anObject inferedType: t.
+
+ anObject isGlobalVariable ifTrue:[
+ t addClass: (Smalltalk at: anObject name) class.
+ t trustfullness: 100.
+ ^self.
+ ].
+ anObject isClassVariable ifTrue:[
+ t addClass: (class theNonMetaclass classVarAt: anObject name asSymbol) class.
+ t trustfullness: 100.
+ ^self.
+ ].
+
+ "Created: / 26-11-2011 / 13:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer::Phase2 methodsFor:'processing'!
+
+process: tree in: cls
+
+ self process: tree in: cls info: (Manager instance infoForClass: cls)
+
+ "Created: / 26-11-2011 / 13:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+process: tree in: cls info: clsInfo
+
+ class := cls.
+ classInfo := clsInfo.
+ self visit: tree.
+
+ "Created: / 27-11-2011 / 16:22:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInferencer class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseInferencer.st 8000 2012-05-17 23:16:11Z vranyj1 $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkInstvarInterfaceExtractor.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,787 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+SmalltalkAbstractInstvarInterfaceExtractor subclass:#SmalltalkInstvarInterfaceExtractor
+ instanceVariableNames:'assingmentsDictionary assigmentsTypeDictionary'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer (obsolete)'
+!
+
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'assignmentParsing'!
+
+addAssignment:value to:node index:index
+ |assignments|
+
+ "Test if it is tmp or not tmp. Tmp variable returns nil"
+ (node respondsTo:#variable) ifTrue:[
+ "if we receive node"
+ assignments := self assignmentsTo:node variable asString.
+ ] ifFalse:[
+ "if we receive string"
+ assignments := self assignmentsTo:node asString.
+ ].
+ (assignments notNil) ifTrue:[
+ "not tmp"
+ collector addAssignment:value to:index.
+ ] ifFalse:[
+ "tmp"
+ (node respondsTo:#variable) ifTrue:[
+ "if we receive node"
+ collector addAssignment:value toTmp:node variable asString.
+ ] ifFalse:[
+ "if we receive string"
+ collector addAssignment:value toTmp:node asString.
+ ].
+ ].
+
+ "Created: / 09-11-2010 / 18:32:05 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 15-02-2011 / 13:11:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+assignmentsTo:node
+ |assignments|
+ assignments := collector assignmentsTo:node asString.
+ (assignments isNil)ifTrue:[
+ ^nil.
+ ].
+ ^ assignments.
+
+ "Created: / 01-12-2010 / 15:41:40 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 15:40:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+assignmentsToTmp:nodeIndex
+ |assignments|
+
+ assignments:=collector assignmentsTmpTo:nodeIndex.
+ (assignments isNil)ifTrue:[
+ ^nil.
+ ].
+ ^ assignments.
+
+ "Created: / 01-12-2010 / 16:04:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+createIndexFromNode:node
+ "Creates index of node or string for roelTyper"
+
+ (node respondsTo:#index) ifTrue:[
+ ^ node index.
+ ].
+ (node respondsTo:#variable) ifTrue:[
+ ^ node variable index.
+ ] ifFalse:[
+ ^ collector absoluteIndexForVar:node asString.
+ ].
+
+ "Created: / 14-12-2010 / 22:25:22 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+handleAssignmentToNode:nodeAssignment receiverNode:nodeReceiver
+ |assignments nodeReceiverIndex nodeAssignmentIndex|
+
+ nodeReceiverIndex := self createIndexFromNode:nodeReceiver.
+ nodeAssignmentIndex := self createIndexFromNode:nodeAssignment.
+ "b:=true. a:=b.
+ nodeAssignment - node which can have some type (b)
+ nodeReceiver - node, which contains nodeAssignment (a)
+ nodeReceiverIndex - node receiver index
+ nodeAssignmentIndex - node assignmentIndex"
+ assignments := self assignmentsTo:nodeAssignment asString.
+ (assignments isNil) ifTrue:[
+ assignments := self assignmentsToTmp:nodeAssignment asString.
+ ].
+ (assignments size = 0) ifTrue:[
+ assignments := nil.
+ ].
+ "All assgnments to specific node"
+ (assignments isNil) ifTrue:[
+ ^ nil
+ ].
+ assignments do:[:assinment |
+ self
+ addAssignment:assinment
+ to:nodeReceiver
+ index:nodeReceiverIndex.
+ ]
+
+ "Created: / 01-12-2010 / 15:53:05 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 15-02-2011 / 13:14:38 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+handleAssignmentToNode:node type:type
+ |set|
+ (node respondsTo:#variable)ifTrue:[
+ set := assingmentsDictionary at:node variable asString ifAbsent:nil.
+ ]ifFalse:[
+ set := assingmentsDictionary at:node asString ifAbsent:nil.
+ ].
+ "if some variable(a) is initialized(a:=2,a:=true...) then the other variables, which refers b:=a can have similar type."
+ (set isNil) ifTrue:[
+ ^ nil.
+ ].
+ set do:[:refNode |
+ self
+ addAssignment:type
+ to:node
+ index:(self createIndexFromNode:refNode).
+ ]
+
+ "Created: / 04-11-2010 / 19:44:46 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 14-12-2010 / 22:29:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeBinaryNode:node nodeExpression:expression
+ |helperNode|
+
+ "v=3"
+ helperNode := node.
+ ((expression receiver) isKindOf:VariableNode) ifTrue:[
+ ((expression selector) = #'='
+ or:[
+ (expression selector) = #'=='
+ or:[
+ (expression selector) = #'>'
+ or:[
+ (expression selector) = #'<'
+ or:[
+ (expression selector) = #'<='
+ or:[
+ (expression selector) = #'>='
+ or:[ (expression selector) = #'=~' or:[ (expression selector) = #'~~' ] ]
+ ]
+ ]
+ ]
+ ]
+ ])
+ ifTrue:[
+ self
+ addAssignment:(#Boolean sunitAsClass)
+ to:(node)
+ index:(self createIndexFromNode:node).
+ self handleAssignmentToNode:node type:(#Boolean sunitAsClass)
+ ].
+ ].
+ ((expression receiver) isKindOf:MessageNode) ifTrue:[
+ self parseAssignmentNodeMessageNode:node
+ nodeExpression:expression receiver
+ ].
+
+ "Created: / 10-11-2010 / 14:51:11 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 31-03-2011 / 19:30:36 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeConstantNode:node nodeExpression: expression
+ |helperNode |
+
+ helperNode := node.
+ (expression isKindOf:ConstantNode) ifTrue:[
+
+ "Check if expression has some type"
+ (expression type notNil and:[expression type sunitAsClass notNil]) ifTrue:[
+ "If True or false then superClass(only for to have the type boolean)"
+ ((expression type sunitAsClass superclass) == Boolean) ifTrue:[
+ self
+ addAssignment:((expression type sunitAsClass) superclass)
+ to:(node)
+ index:(self createIndexFromNode:node).
+ "add assignment to all nodes which refer this node"
+ self handleAssignmentToNode:node
+ type:(expression type sunitAsClass superclass)
+ ] ifFalse:[
+ self
+ addAssignment:(expression type sunitAsClass)
+ to:node
+ index:(self createIndexFromNode:node ).
+ "add assignment to all nodes which refer this node"
+ self handleAssignmentToNode:node type:(expression type sunitAsClass)
+ ].
+ ].
+ ^ self.
+ ].
+
+ "Created: / 10-11-2010 / 14:53:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 14-12-2010 / 22:30:38 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 28-04-2011 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parseAssignmentNodeMessageNode:node nodeExpression:expression
+ |helperNode|
+
+ helperNode := node.
+ (expression respondsTo:#receiver) ifTrue:[
+ ((expression receiver) isKindOf:VariableNode) ifTrue:[
+ ((expression receiver name) respondsTo:#sunitAsClass) ifTrue:[
+ self
+ addAssignment:(expression receiver name sunitAsClass)
+ to:(node)
+ index:(self createIndexFromNode:node).
+ ]ifFalse:[
+ self parseAssignmentNodeVariableNode:node nodeExpression: expression receiver.
+ ].
+ ].
+ ((expression receiver) isKindOf:ConstantNode) ifTrue:[
+ self parseAssignmentNodeConstantNode:node
+ nodeExpression:expression receiver.
+ ].
+ ((expression receiver) isKindOf:SelfNode) ifTrue:[
+ self parseAssignmentNodeSelfNode:node
+ nodeExpression:expression receiver.
+ ].
+ ].
+
+ "Created: / 10-11-2010 / 14:55:13 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 14-12-2010 / 22:31:00 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeSelfNode:node nodeExpression:expression
+ |helperNode var ret|
+
+ "indirect assignments check"
+ helperNode := node.
+ var := helperNode expression selector asString subString:1
+ to:helperNode expression selector asString size - 1.
+ "Check if selector is class Variable"
+ ret := collector assignmentsTo:var.
+ (ret notNil) ifTrue:[
+ "Check if has only one argument"
+ (helperNode expression argumentCount = 1) ifTrue:[
+ "Check nil"
+ (helperNode expression arg1 notNil) ifTrue:[
+ "Test ConstantNode(u:=3 u:=true...)"
+ (helperNode expression arg1 isKindOf:ConstantNode) ifTrue:[
+ self parseAssignmentNodeConstantNode:var
+ nodeExpression:helperNode expression arg1.
+ ].
+ "Test VariableNode (u:=a)"
+ (helperNode expression arg1 isKindOf:VariableNode) ifTrue:[
+ self parseAssignmentNodeVariableNode:var
+ nodeExpression:helperNode expression arg1.
+ ].
+ "Test UnaryNode"
+ (helperNode expression arg1 isKindOf:UnaryNode) ifTrue:[
+ self parseAssignmentNodeUnaryNode:var
+ nodeExpression:helperNode expression arg1.
+ ].
+ "Test MessageNode"
+ (helperNode expression arg1 isKindOf:MessageNode) ifTrue:[
+ self parseAssignmentNodeMessageNode:var
+ nodeExpression:helperNode expression arg1.
+ ].
+ "Test binary node"
+ (helperNode expression arg1 isKindOf:BinaryNode) ifTrue:[
+ self parseAssignmentNodeBinaryNode:var
+ nodeExpression:helperNode expression arg1.
+ ].
+ ].
+ ].
+ ].
+
+ "Created: / 14-12-2010 / 22:04:07 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeToTypeCollector:node
+ |helperNode expression nodeName|
+
+ "basic method to handle assignments"
+ helperNode := node.
+ expression := node expression.
+ "Test ConstantNode(u:=3 u:=true...)"
+ (expression isKindOf:ConstantNode) ifTrue:[
+ self parseAssignmentNodeConstantNode:node nodeExpression:expression.
+ ].
+ "Test VariableNode (u:=a)"
+ (expression isKindOf:VariableNode) ifTrue:[
+ self parseAssignmentNodeVariableNode:node nodeExpression:expression.
+ ].
+ "Test AssignmentNode u:=a:=3"
+ (expression isKindOf:AssignmentNode) ifTrue:[
+ nodeName := self parseAssignmentNodeToTypeCollector:expression.
+ self handleAssignmentToNode:nodeName receiverNode:node.
+ ].
+ "Test UnaryNode"
+ (expression isKindOf:UnaryNode) ifTrue:[
+ self parseAssignmentNodeUnaryNode:node nodeExpression:expression.
+ ].
+ "Test MessageNode"
+ (expression isKindOf:MessageNode) ifTrue:[
+ self parseAssignmentNodeMessageNode:node nodeExpression:expression.
+ ].
+ "Test binary node"
+ (expression isKindOf:BinaryNode) ifTrue:[
+ self parseAssignmentNodeBinaryNode:node nodeExpression:expression.
+ ].
+ (node respondsTo:#variable) ifTrue:[
+ ^ node variable.
+ ] ifFalse:[ ^ node. ].
+
+ "Created: / 03-11-2010 / 23:00:17 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 14-12-2010 / 23:45:30 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeUnaryNode:node nodeExpression:expression
+ |helperNode|
+
+ helperNode := node.
+ "x asInteger. b floor"
+ (expression respondsTo:#receiver) ifTrue:[
+ ((expression receiver) isKindOf:VariableNode) ifTrue:[
+ ((expression receiver name) respondsTo:#sunitAsClass) ifTrue:[
+ self
+ addAssignment:(expression receiver name sunitAsClass)
+ to:(node)
+ index:(self createIndexFromNode:node).
+ "add assignment to all nodes which refer this node"
+ self handleAssignmentToNode:node
+ type:(expression receiver name sunitAsClass)
+ ].
+ ].
+ ].
+
+ "Created: / 10-11-2010 / 14:54:26 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 30-03-2011 / 17:57:04 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseAssignmentNodeVariableNode:node nodeExpression:expression
+ |helperNode set|
+
+ "Test VariableNode(u:=a.b:=a.c:=a)
+ AssignMentDictionary will contain set nodes which assignment this node
+ a->Set(u,b,c) if a will get some value we change assignment in all nodes"
+ helperNode := node.
+ ((expression type) = #GlobalVariable) ifTrue:[
+ "checking assignments metaclass"
+ ((expression name) respondsTo:#sunitAsClass) ifTrue:[
+ self
+ addAssignment:expression name sunitAsClass class
+ to:node variable
+ index:(self createIndexFromNode:node).
+ "add assignment to all nodes which refer this node"
+ self handleAssignmentToNode:node type:(expression type sunitAsClass).
+ ^ self.
+ ].
+ ].
+ set := assingmentsDictionary at:(expression name) ifAbsent:nil.
+ (set isNil) ifTrue:[
+ set := Set new.
+ ].
+ set add:node variable.
+ "Check if this index exists. if exists then remove it(to update dictionary)"
+ (assingmentsDictionary includesKey:expression name) ifTrue:[
+ assingmentsDictionary removeKey:expression name.
+ ].
+ "(updateDictionary"
+ assingmentsDictionary at:(expression name) put:set.
+ "Check if we can update this"
+ self handleAssignmentToNode:expression receiverNode:node.
+ ^ self
+
+ "Created: / 10-11-2010 / 14:53:46 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 30-03-2011 / 18:09:05 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'extracting'!
+
+extractInterfacesFrom:m addTo:aTypeCollector
+ |parser|
+
+ method := m.
+ saveStacks := Dictionary new.
+ stack := OrderedCollection new.
+ "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
+ initialStack := stack copy.
+ collector := aTypeCollector.
+ parser := SmalltalkXInstvarInterfaceExtractor new.
+ parser setColector:aTypeCollector.
+ input := parser
+ parseMethod:method source
+ in:method mclass
+ ignoreErrors:false
+ ignoreWarnings:false.
+ blockTraversal := false.
+ blockArgs := 0.
+
+ [ input isNil ] whileFalse:[
+ self unaryExpressionFor:input.
+ input :=input nextStatement.
+ ]
+
+ "Modified: / 24-11-2010 / 22:24:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+extractInterfacesFrom:sourc class:class addTo:aTypeCollector
+ |parser|
+
+ saveStacks := Dictionary new.
+ stack := OrderedCollection new.
+ "0 to: method numTemps - 1 do: [:i | stack add: #temp -> i ]."
+ initialStack := stack copy.
+ collector := aTypeCollector.
+ parser := InstvarInterfaceExtractor new.
+ parser setColector:aTypeCollector.
+ input := parser
+ parseMethod: sourc
+ in:class
+ ignoreErrors:false
+ ignoreWarnings:false.
+ blockTraversal := false.
+ blockArgs := 0.
+
+ [ input isNil ] whileFalse:[
+ self unaryExpressionFor:input.
+ input :=input nextStatement.
+ ]
+
+ "Created: / 17-03-2011 / 16:00:31 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 22:31:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'initialization'!
+
+initialize
+ super initialize.
+ assingmentsDictionary := Dictionary new.
+ assigmentsTypeDictionary:=Dictionary new.
+
+ "Created: / 04-11-2010 / 19:09:04 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-11-2010 / 23:46:36 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'opcodes-control'!
+
+nativeSend: selector numArgs: na
+ | receiver args |
+ args := stack removeLast: na.
+ receiver := stack removeLast.
+ receiver isInteger
+ ifTrue:
+ [ collector
+ addSend: selector
+ to: receiver ]
+ ifFalse:
+ [ receiver isVariableBinding ifTrue:
+ [ receiver key = #temp
+ ifTrue:
+ [ collector
+ addSend: selector
+ toTmp: receiver value ]
+ ifFalse:
+ [ receiver key = #return ifTrue:
+ [ collector
+ addSend: selector
+ onReturnOfSelfMethod: receiver value ] ] ] ].
+ (receiver = #self and: [ collector theClass methodDictionary includesKey: selector ]) ifTrue:
+ [ args doWithIndex:
+ [ :arg :index |
+ collector
+ handleAssignment: arg
+ forTmp: index - 1
+ in: collector theClass >> selector ] ].
+ stack add: (collector
+ pushSendOf: selector
+ to: receiver
+ args: args)
+
+ "Modified: / 18-05-2011 / 23:47:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+send: selector numArgs: na
+ ^self
+ nativeSend: selector
+ numArgs: na
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'opcodes-data movement'!
+
+dupFirst
+ stack add: stack last
+!
+
+pop
+ stack removeLast
+!
+
+pushConstant: value
+ value class == BlockClosure
+ ifTrue:
+ [self
+ readBlock: value method
+ copied: 0]
+ ifFalse: [
+ blockArgs := value.
+ stack addLast: value class]
+!
+
+pushContext
+ stack add: #context
+!
+
+pushInst: index
+ stack add: index
+!
+
+pushReceiver
+ stack addLast: #self
+!
+
+pushStatic: assoc
+ "assoc can be an association OR a variable binding. I just push the complete association, since it does not interest me for the moment."
+
+ stack addLast: assoc
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'parsing-expressions'!
+
+binaryExpressionFor:receiverArg
+ |node|
+
+ node := super binaryExpressionFor:receiverArg.
+ self parseNode:node.
+ ^ node
+
+ "Modified: / 14-12-2010 / 23:50:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseCascadeNodetypeCollector:node expression:expression
+ |receiver ret break collectionSends|
+
+ receiver := expression receiver.
+ break := false.
+ collectionSends := Set new.
+ "we add first selector"
+ collectionSends add:expression selector.
+ "we must find receiver"
+ [
+ (receiver isKindOf:VariableNode) or:[ break ]
+ ] whileFalse:[
+ (receiver respondsTo:#receiver) ifTrue:[
+ (receiver respondsTo:#selector) ifTrue:[
+ "we remember all selectors x print;size;all;pro"
+ collectionSends add:receiver selector.
+ ].
+ receiver := receiver receiver.
+ ] ifFalse:[
+ receiver := nil.
+ ].
+ (receiver isNil) ifTrue:[
+ break := true.
+ ].
+ ].
+ "we found first receiver and add represantive ."
+ collectionSends do:[:sendSelector |
+ (((receiver) respondsTo:#index) and:[ receiver index notNil ]) ifTrue:[
+ ret := collector assignmentsTo:receiver name.
+ (ret notNil) ifTrue:[
+ collector addSend:sendSelector to:receiver index
+ ] ifFalse:[
+ collector addSend:sendSelector selector toTmp:receiver.
+ ].
+ ].
+ ].
+
+ "Created: / 10-11-2010 / 16:05:10 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 15-02-2011 / 13:04:21 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseMessageNodeToTypeCollector:node
+ |helperNode receiver break ret|
+
+ helperNode := node.
+ "Getting receiver"
+ receiver := helperNode receiver.
+ break := false.
+
+(receiver isKindOf:MessageNode)
+ ifTrue:[
+ self parseMessageNodeToTypeCollector:receiver.
+ ].
+ "Check if receiver is variable. If not then receiver is some kind of node result"
+ (receiver isKindOf:VariableNode)
+ ifFalse:[
+ ^self.
+ ].
+
+
+ (((receiver) respondsTo:#index) and:[ receiver index notNil ]) ifTrue:[
+ "Check if receiver is tmp"
+ ret := collector assignmentsTo:receiver name.
+ (ret notNil) ifTrue:[
+ "not tmp"
+ collector addSend:helperNode selector to:receiver index
+ ] ifFalse:[
+ "tmp"
+ collector addSend:helperNode selector toTmp:receiver .
+ ].
+ ].
+
+ "Created: / 03-11-2010 / 22:25:23 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 15-02-2011 / 13:04:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseNode:node
+|helperNode|
+
+helperNode := node.
+ (node isKindOf: StatementNode)ifTrue:[
+ "x printString; size"
+ self parseStatementNodeToTypeCollector:node.
+ ].
+
+ (node isKindOf:UnaryNode)ifTrue:[
+ "(Point new. a new. b floor) -> we must recognize and parse node with single message(easy to parse)"
+ self parseUnaryNodeToTypeCollector:node.
+ ^ node.
+ ].
+
+ (node isKindOf:MessageNode)ifTrue:[
+ "Every node which can send message except unary node ( x point:a. x point:a left....)"
+ self parseMessageNodeToTypeCollector:node.
+ ].
+
+ (node isKindOf: AssignmentNode)ifTrue:[
+ self parseAssignmentNodeToTypeCollector:node.
+ self parseNode:node expression.
+ ].
+
+ "Created: / 14-12-2010 / 23:48:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseStatementNodeToTypeCollector:node
+ |helperNode expression|
+
+ helperNode := node.
+
+ ((helperNode) respondsTo:#expression) ifTrue:[
+ expression := helperNode expression.
+ (expression isKindOf:CascadeNode) ifTrue:[
+ self parseCascadeNodetypeCollector:node expression:expression.
+ ].
+ (expression isKindOf:MessageNode)ifTrue:[
+ "Check indirect assignments"
+ (expression receiver isKindOf:SelfNode)ifTrue:[
+ self parseAssignmentNodeToTypeCollector:node.
+ ].
+ self parseMessageNodeToTypeCollector:expression.
+ ]
+ ].
+
+ "Created: / 10-11-2010 / 15:55:06 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 14-12-2010 / 22:06:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+parseUnaryNodeToTypeCollector:node
+ |helperNode ret|
+"(Point new. a new. b floor) node with single message."
+ helperNode := node.
+
+"Check indirect sends"
+((helperNode receiver) isKindOf:UnaryNode)ifTrue:[
+ "Check if receiver is self"
+ (helperNode receiver receiver isKindOf:SelfNode)ifTrue:[
+ "Check if selector is class Variable"
+ ret := collector assignmentsTo:helperNode receiver selector asString.
+
+ (ret notNil) ifTrue:[
+ collector addSend:helperNode selector to:( collector absoluteIndexForVar:(helperNode receiver selector asString)).
+ ].
+ ]ifFalse:[
+ self parseUnaryNodeToTypeCollector:node receiver.
+ ].
+].
+
+
+
+ (((helperNode receiver) respondsTo:#index)
+ and:[ helperNode receiver index notNil ])
+ ifTrue:[
+ "we can simple find if receiver is tmp variable or not"
+ ret := collector assignmentsTo:helperNode receiver name.
+ (ret notNil) ifTrue:[
+ "it is not tmp variable"
+ collector addSend:helperNode selector to:helperNode receiver index
+ ] ifFalse:[
+ "it is tmp variable"
+ collector addSend:helperNode selector toTmp:helperNode receiver.
+ ].
+ ].
+
+ "Created: / 03-11-2010 / 22:19:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-03-2011 / 16:58:11 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+unaryExpressionFor:receiverArg
+ |node|
+ node := super unaryExpressionFor:receiverArg.
+ self parseNode:node.
+ ^ node
+
+ "Created: / 30-10-2010 / 15:45:45 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 16:19:23 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkInstvarInterfaceExtractor methodsFor:'private'!
+
+copied: list
+ copied := list
+!
+
+input
+ ^input
+!
+
+method: aMethod
+ method := aMethod.
+ copied := #()
+!
+
+readBlock: block copied: count
+ | newCopied |
+ newCopied := stack removeLast: count.
+ stack add: #block.
+ ^(self class new)
+ copied: newCopied;
+ extractInterfacesFrom: block source class:block mclass
+ addTo: collector
+
+ "Modified: / 17-03-2011 / 16:01:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+reloadStack
+ stack isNil
+ ifTrue:
+ [stack := self saveStacks
+ at: self input startPosition
+ ifAbsent: [initialStack copy].
+ ^self].
+ stack := self saveStacks
+ at: self input startPosition
+ ifAbsent: [stack]
+
+ "Modified: / 28-10-2010 / 15:04:05 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+saveStacks
+ saveStacks ifNil: [saveStacks := Dictionary new].
+ ^saveStacks
+!
+
+setColector:colectorSetter
+ collector := colectorSetter.
+
+ "Created: / 03-11-2010 / 21:33:42 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmalltalkInstvarInterfaceExtractor class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkLintService.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,417 @@
+"
+ COPYRIGHT (c) 2006 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.
+"
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Tools::BackgroundSourceProcessingService subclass:#SmalltalkLintService
+ instanceVariableNames:'rulesHolder rules highlighter support'
+ classVariableNames:'Debugging'
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk-Lint'
+!
+
+!SmalltalkLintService class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 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.
+"
+! !
+
+!SmalltalkLintService class methodsFor:'initialization'!
+
+initialize
+
+ "
+ | map |
+ map := Screen current keyboardMap.
+ map bindValue:#CodeCompletion to: #'Ctrl '.
+ map bindValue:#CodeCompletion to: #'Ctrlspace'.
+ "
+
+ Smalltalk isInitialized ifTrue:[
+ Smalltalk addStartBlock:[
+ Screen current notNil ifTrue:[
+ | map |
+ map := Screen current keyboardMap.
+ (map keyAtValue:#CodeCompletion) isNil ifTrue:[
+ map bindValue:#CodeCompletion to: #'Ctrl '.
+ map bindValue:#CodeCompletion to: #'Ctrlspace'.
+ ].
+ ]
+ ]
+ ]
+
+ "Modified: / 15-08-2013 / 15:19:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService class methodsFor:'accessing'!
+
+debugging
+ ^Debugging == true
+
+ "Created: / 17-02-2012 / 00:48:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+debugging: aBoolean
+
+ Debugging := aBoolean
+
+ "Created: / 16-02-2012 / 16:22:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+
+ "Answers short label - for UI"
+
+ ^'SmallSense - Static Checking'
+
+ "Created: / 07-03-2010 / 14:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 27-07-2013 / 22:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+priority
+ "Answers a priority of the service. Services with higher priority
+ will get the event notification before ones with lower priority.
+ Therefore, a lower-priority service might not get the event if high
+ priority service processes it"
+
+ ^ 10
+
+ "Created: / 01-02-2012 / 10:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService class methodsFor:'queries'!
+
+isUsefulFor:aCodeView
+ "this filters useful services.
+ must be redefined to return true in subclasses (but each class must do it only
+ for itself - not for subclasses"
+
+ ^ self == Service.
+
+ "Created: / 24-07-2013 / 11:35:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService class methodsFor:'testing'!
+
+isAvailable
+
+ ^UserPreferences current smallSenseEnabled
+
+ "Created: / 04-02-2012 / 22:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'accessing'!
+
+syntaxHighlighter
+
+ ^highlighter
+
+ "Created: / 05-08-2011 / 10:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'aspects'!
+
+rulesHolder
+ "return/create the 'rulesHolder' value holder (automatically generated)"
+
+ rulesHolder isNil ifTrue:[
+ rulesHolder := ValueHolder new.
+ rulesHolder addDependent:self.
+ ].
+ ^ rulesHolder
+!
+
+rulesHolder:something
+ "set the 'rulesHolder' value holder (automatically generated)"
+
+ |oldValue newValue|
+
+ rulesHolder notNil ifTrue:[
+ oldValue := rulesHolder value.
+ rulesHolder removeDependent:self.
+ ].
+ rulesHolder := something.
+ rulesHolder notNil ifTrue:[
+ rulesHolder addDependent:self.
+ ].
+ newValue := rulesHolder value.
+ oldValue ~~ newValue ifTrue:[
+ self update:#value with:newValue from:rulesHolder.
+ ].
+! !
+
+!SmalltalkLintService methodsFor:'change & update'!
+
+sourceChanged:force
+ | lang |
+
+ rules isNil ifTrue:[ ^ self ].
+ ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
+ rules resetResult.
+ highlighter reset.
+ super sourceChanged:force.
+
+ "Created: / 18-02-2012 / 22:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+update:something with:aParameter from:changedObject
+ "Invoked when an object that I depend upon sends a change notification."
+
+ changedObject == rulesHolder ifTrue:[
+ UserPreferences current smallSenseBackgroundLintEnabled ifTrue:[
+ | ruleList |
+
+ ruleList := rulesHolder value flattened reject:[:each| Checker forceDisabledRules includes: each class name].
+ rules := RBCompositeLintRule rules: ruleList.
+ highlighter rules: ruleList.
+
+ self process.
+ ].
+ ^ self.
+ ].
+
+ super update:something with:aParameter from:changedObject
+
+ "Modified (format): / 27-07-2013 / 22:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'event handling'!
+
+buttonPress:button x:x y:y in:view
+ |lineNr|
+
+ rules isNil ifTrue:[
+ ^ false
+ ].
+ view == gutterView ifTrue:[
+ button == 1 ifTrue:[
+ lineNr := textView yVisibleToLineNr:y.
+ lineNr notNil ifTrue:[
+ ^ self showInfoWindowForLine: lineNr
+ ].
+ ^ false.
+ ].
+ ].
+ ^ false
+
+ "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+viewRealized
+
+ | browser |
+
+ UserPreferences current smallSenseBackgroundLintEnabled ifFalse:[ ^ self ].
+
+ (browser := codeView browser) notNil ifTrue:[
+ browser navigationState canvasType ~~ #smallLintByRuleResultBrowserSpec ifTrue:[
+ self rulesHolder: browser smalllintRulesOrDefaultHolder.
+ ].
+ ].
+
+ "Created: / 23-01-2012 / 10:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 28-02-2013 / 22:43:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'initialization'!
+
+initialize
+
+ super initialize.
+
+ highlighter := Tools::LintHighlighter new.
+
+ "Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'private'!
+
+annotationAtLine: lineNo
+ | annotations |
+
+ (annotations := highlighter annotations) isEmptyOrNil ifTrue:[ ^ nil ].
+ annotations do:[:a|
+ | l |
+
+ (l := a line) isNil ifTrue:[
+ l := codeView lineOfCharacterPosition: a startPosition.
+ a line: l.
+ ].
+ l > lineNo ifTrue:[ ^ nil ].
+ l == lineNo ifTrue:[ ^ a ].
+ ].
+ ^nil
+
+ "Created: / 30-01-2012 / 21:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+process
+ "(Re)starts the processing job. Should be called whenever a source
+ must be (re)processed."
+
+ rules isNil ifTrue:[
+ ^self
+ ].
+
+ ^super process.
+
+ "Created: / 24-01-2012 / 12:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+process: delayed
+ "Do the real source processing. If delayed is true, actuall data update must
+ be done within the event queue using #pushUserEvent:...
+ "
+ | cls env oldCodeList oldCode |
+
+ rules isNil ifTrue:[ ^ self ].
+ codeView codeAspect ~~ #method ifTrue:[ ^ self ].
+ codeView language isNil ifTrue: [ ^ self ].
+ codeView language isSmalltalk ifFalse: [ ^ self ].
+ done := false.
+ modified := false.
+
+ cls := codeView klass.
+ cls isNil ifTrue:[^ self ].
+
+
+ Delay waitForMilliseconds: 200."Give user some time to write"
+
+ (cls notNil and:[cls isObsolete]) ifTrue:[
+ cls isMeta ifTrue:[
+ cls := (Smalltalk at:cls theNonMetaclass name) class
+ ] ifFalse:[
+ cls := Smalltalk at:cls name
+ ].
+ ].
+
+ "textView" modified ifFalse:[
+ oldCodeList := textView list copy.
+ oldCodeList isEmptyOrNil ifTrue: [ ^ self ].
+ "textView" modified ifFalse:[
+ oldCodeList isNil ifFalse:[
+ oldCode := oldCodeList asStringWithoutEmphasis.
+ oldCode isEmptyOrNil ifTrue:[ ^ self ].
+ "textView" modified ifFalse:[
+ Screen currentScreenQuerySignal answer:codeView device
+ do:[
+ Error handle:[:ex |
+ |errMsg|
+
+ errMsg := ex description asStringCollection first asString.
+
+ Debugging == true ifTrue:[
+ Debugging := false.
+ ex pass.
+ ].
+
+ "/ Transcript topView raiseDeiconified.
+ "/ Transcript showCR:'ParseError: ', ex description.
+"/ self halt.
+ "/ self showInfo:(errMsg colorizeAllWith:Color red).
+ ] do:[
+ env := (SmallSense::SmalltalkUnacceptedMethodEnvironment onClass:cls methodSource: oldCode).
+ SmalltalkChecker runRule: rules onEnvironment: env
+ ].
+ delayed ifTrue:[
+ codeView sensor pushUserEvent:#rehighlight: for:self withArgument: true.
+ ] ifFalse:[
+ self rehighlight: true.
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+
+ "Created: / 24-01-2012 / 12:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-08-2013 / 10:19:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+rehighlight: delayed
+
+ | service |
+ service := self service: SyntaxHighlightingService name.
+ service isNil ifTrue:[
+ service := self service: Tools::CodeHighlightingService name
+ ].
+ service notNil ifTrue:[
+ service sourceChanged: true.
+ ]
+
+ "Created: / 27-01-2012 / 17:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 06-08-2013 / 10:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+showInfoWindowForLine: lineNo
+ | ann |
+
+ ann := self annotationAtLine: lineNo.
+ ann isNil ifTrue:[ ^ false ].
+
+ CriticsWindow new
+ rule: ann rule;
+ codeView: codeView;
+ allButOpen;
+ openWindowAt: (Screen current pointerPosition - (20@20)).
+
+ ^true
+
+ "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService methodsFor:'redrawing'!
+
+drawLine:lineNo in:view atX:x y:y width:w height:h from:startCol to:endColOrNil with:fg and:bg
+ "Called by both gutterView and textView (well, not yet) to
+ allow services to draw custom things on text view.
+ Ask JV what the args means if unsure (I'm lazy to document
+ them, now it is just an experiment...)"
+
+ | lang annotation |
+
+ ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
+
+ annotation := self annotationAtLine: lineNo.
+ annotation notNil ifTrue:[
+ self drawAnnotationIcon: (ToolbarIconLibrary smalllintWarning16x16)
+ atX: x y: y width: w height: h.
+ ].
+
+ "Created: / 30-01-2012 / 15:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 07-08-2013 / 00:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkLintService class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseService.st 8039 2012-08-13 22:12:37Z vranyj1 $'
+! !
+
+
+SmalltalkLintService initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkParser.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,376 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+SyntaxHighlighter subclass:#SmalltalkParser
+ instanceVariableNames:'error'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk'
+!
+
+
+!SmalltalkParser methodsFor:'error handling'!
+
+parseError:message position:startPos to:endPos
+
+ error := ParseErrorNode new
+ errorString: message;
+ errorToken: (token notNil ifTrue:[token asString] ifFalse:[nil]);
+ startPosition: startPos endPosition: endPos.
+ ^error
+
+ "Created: / 27-11-2011 / 09:35:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 15-08-2013 / 12:21:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+syntaxError:message position:startPos to:endPos
+
+ ^self parseError:message position:startPos to:endPos
+
+ "Created: / 27-11-2011 / 09:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser methodsFor:'parsing'!
+
+blockStatementList
+ "parse a blocks statementlist; return a node-tree, nil or #Error"
+
+ |thisStatement prevStatement firstStatement eMsg blockStart|
+
+ blockStart := tokenPosition.
+
+ (tokenType == $] ) ifTrue:[^ nil].
+
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[^ #Error].
+ firstStatement := thisStatement.
+ [tokenType == $] ] whileFalse:[
+ (tokenType == $.) ifFalse:[
+ (tokenType == #EOF) ifTrue:[
+ | errnode |
+ errnode := self syntaxError:'missing '']'' in block' position:blockStart to:(source position + 1).
+ errnode children: (Array with: firstStatement).
+ ^errnode
+ ].
+
+ (tokenType == $) ) ifTrue:[
+ eMsg := 'missing '']'' or bad '')'' in block'
+ ] ifFalse:[
+ eMsg := 'missing ''.'' between statements (i.e. ''' , tokenType printString , '''-token unexpected)'
+ ].
+
+ self syntaxError:eMsg position:thisStatement startPosition to:tokenPosition.
+ "/ ^ #Error --- can proceed
+ ] ifTrue:[
+ self nextToken.
+ ].
+
+ prevStatement := thisStatement.
+
+ tokenType == $] ifTrue:[
+ "
+ *** I had a warning here (since it was not defined
+ *** in the blue-book; but PD-code contains a lot of
+ *** code with periods at the end so that the warnings
+ *** became annoying
+
+ self warning:'period after last statement in block'.
+ "
+ self markBracketAt:tokenPosition.
+ ^ self statementListRewriteHookFor:firstStatement
+ ].
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[^ #Error].
+ prevStatement nextStatement:thisStatement
+ ].
+ self markBracketAt:tokenPosition.
+ ^ self statementListRewriteHookFor:firstStatement
+
+ "Created: / 15-08-2013 / 12:16:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parseExpressionWithSelf:anObject notifying:someOne ignoreErrors:ignoreErrors ignoreWarnings:ignoreWarnings inNameSpace:aNameSpaceOrNil
+
+ |tree token|
+
+ aNameSpaceOrNil notNil ifTrue:[
+ self currentNameSpace:aNameSpaceOrNil
+ ].
+ self setSelf:anObject.
+ self notifying:someOne.
+ self ignoreErrors:ignoreErrors.
+ self ignoreWarnings:ignoreWarnings.
+ token := self nextToken.
+ (token == $^) ifTrue:[
+ self nextToken.
+ ].
+ (token == #EOF) ifTrue:[
+ ^ nil
+ ].
+ "/tree := self expression.
+ tree := self statementList.
+ (self errorFlag or:[tree == #Error]) ifTrue:[^ #Error].
+ ^ tree
+
+ "Created: / 14-12-1999 / 15:11:37 / cg"
+ "Created: / 09-07-2011 / 22:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser methodsFor:'parsing-expressions'!
+
+primary
+ | nodeOrError |
+
+ nodeOrError := super primary.
+ ^ (nodeOrError == #Error and:[error notNil]) ifTrue:[
+ error
+ ] ifFalse:[
+ nodeOrError
+ ]
+
+ "Created: / 19-08-2013 / 14:07:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+primary_expression
+ "parse a parentized expression primary; return a node-tree, or raise an Error."
+
+ |pos val eMsg|
+
+ pos := tokenPosition.
+
+ self nextToken.
+ val := self expression.
+ (val == #Error) ifTrue:[^ #Error].
+ (tokenType == $) ) ifFalse:[
+ | errnode |
+ tokenType isCharacter ifTrue:[
+ eMsg := 'missing '')'' (i.e. ''' , tokenType asString , ''' unexpected)'.
+ ] ifFalse:[
+ eMsg := 'missing '')'''.
+ ].
+ errnode := self syntaxError:eMsg withCRs position:pos to:tokenPosition.
+ errnode children: (Array with: val).
+ ^ errnode
+ ].
+ self markParenthesisAt:tokenPosition.
+ parenthesisLevel := parenthesisLevel - 1.
+ self nextToken.
+ (self noAssignmentAllowed:'Invalid assignment to an expression' at:pos) ifFalse:[
+ ^ #Error
+ ].
+ val parenthesized:true.
+ ^ val
+
+ "Created: / 15-08-2013 / 15:23:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser methodsFor:'parsing-tweaks'!
+
+_blockStatementList
+ "parse a blocks statementlist; return a node-tree, nil or #Error"
+
+ |thisStatement prevStatement firstStatement eMsg blockStart|
+
+ blockStart := tokenPosition.
+ (tokenType == $]) ifTrue:[
+ ^ nil
+ ].
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[
+ ^ #Error
+ ].
+ firstStatement := thisStatement.
+ [
+ tokenType == $] or:[ tokenType == #EOF ]
+ ] whileFalse:[
+ (tokenType == $.) ifFalse:[
+ (tokenType == #EOF) ifTrue:[
+ " self syntaxError:'missing '']'' in block' position:blockStart to:(source position1Based).
+ ^ #Error."
+ ].
+ (tokenType == $)) ifTrue:[
+ eMsg := 'missing '']'' or bad '')'' in block'
+ ] ifFalse:[
+ eMsg := 'missing ''.'' between statements (i.e. '''
+ , tokenType printString , '''-token unexpected)'
+ ].
+ "self syntaxError:eMsg position:blockStart to:tokenPosition.
+ ^ #Error"
+ ].
+
+ prevStatement := thisStatement.
+ (eMsg isNil ) ifTrue:[
+ self nextToken.
+ ].
+ tokenType == $] ifTrue:[
+ "
+ *** I had a warning here (since it was not defined
+ *** in the blue-book; but PD-code contains a lot of
+ *** code with periods at the end so that the warnings
+ *** became annoying
+
+ self warning:'period after last statement in block'."
+ self markBracketAt:tokenPosition.
+ ^ firstStatement
+ ].
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[
+ ^ #Error
+ ].
+ prevStatement nextStatement:thisStatement.
+ (eMsg notNil) ifTrue:[
+ self nextToken.
+ ].
+ eMsg := nil.
+ ].
+ self markBracketAt:tokenPosition.
+ ^ self statementListRewriteHookFor:firstStatement
+
+ "Created: / 05-08-2013 / 14:56:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_primary
+ "parse a primary-expression; return a node-tree, nil or #Error.
+ This also cares for namespace-access-pathes."
+
+ | node |
+ node := super primary.
+ "/If an error occured, return the error node"
+ node == #Error ifTrue:[
+ self assert: error notNil description: 'Parse error occured but no error node.'.
+ node := error. error := nil.
+ ].
+ ^node
+
+ "Created: / 05-08-2013 / 14:56:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_statementList
+ "parse a statementlist; return a node-tree, nil or #Error.
+ Statements must be separated by periods.
+
+ statementList ::= <statement>
+ | <statementList> . <statement>"
+
+ |thisStatement prevStatement firstStatement periodPos prevExpr|
+
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[
+ self breakPoint: #jv.
+ ^ #Error
+ ].
+ firstStatement := thisStatement.
+ [ tokenType == #EOF ] whileFalse:[
+ prevExpr := thisStatement expression.
+ (prevExpr notNil
+ and:[ prevExpr isMessage and:[ thisStatement isReturnNode not ] ])
+ ifTrue:[
+ (#( #'=' #'==' ) includes:prevExpr selector) ifTrue:[
+ self
+ warning:'useless computation - mistyped assignment (i.e. did you mean '':='') ?'
+ position:prevExpr selectorPosition
+ ].
+ ].
+ periodPos := tokenPosition.
+
+ (tokenType == $. or:[ firstStatement = thisStatement and:[firstStatement expression isErrorNode] ]) ifTrue:[
+ self nextToken.
+ ].
+ tokenType == $. ifTrue:[
+ self emptyStatement.
+ ].
+ (tokenType == $]) ifTrue:[
+ currentBlock isNil ifTrue:[
+
+ ] ifFalse:[
+ ^ self statementListRewriteHookFor:firstStatement
+ ].
+ ].
+ (tokenType == #EOF) ifTrue:[
+ currentBlock notNil ifTrue:[
+ "self parseError:''']'' expected (block nesting error)'."
+ ] ifFalse:[
+ ^ self statementListRewriteHookFor:firstStatement
+ ].
+ ].
+ prevStatement := thisStatement.
+ prevStatement isReturnNode ifTrue:[
+ self warning:'statements after return' position:tokenPosition
+ ].
+ thisStatement := self statement.
+ (thisStatement == #Error) ifTrue:[
+ self breakPoint: #jv.
+ ^ #Error
+ ].
+ (thisStatement expression isNil or:[thisStatement expression isErrorNode]) ifTrue:[
+ self nextToken.
+ ].
+
+ prevStatement nextStatement:thisStatement
+ ].
+ ^ self statementListRewriteHookFor:firstStatement
+
+ "Created: / 05-08-2013 / 14:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser methodsFor:'private'!
+
+findNameSpaceWith:varName
+ | ns |
+
+ "The super #findNameSpaceWith: checks whether the the gloval named 'varName' exists,
+ if not, returns the current namespace which is then prepended to 'varName'.
+
+ Here we have to deal with uncomplete global names, so trick the caller by returning
+ nil if the partially typed global name starts with current namespace prefix."
+
+ classToCompileFor notNil ifTrue:[
+ ns := classToCompileFor topNameSpace.
+ (varName = ns name) ifTrue:[
+ ^ nil
+ ]
+ ].
+
+ ^ super findNameSpaceWith:varName
+
+ "Created: / 28-07-2013 / 13:49:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser methodsFor:'syntax coloring'!
+
+markBracketAt:pos
+
+ sourceText isNil ifTrue:[^self].
+ ^super markBracketAt:pos
+
+ "Created: / 03-04-2011 / 22:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
+
+ sourceText isNil ifTrue:[^self].
+ super markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
+
+ "Created: / 03-04-2011 / 22:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markFrom:pos1 to:pos2 withEmphasis:fontEmp color:fgClr1 ifNil:fgClr2 backgroundColor:bgClr
+
+ sourceText isNil ifTrue:[^self].
+ super markFrom:pos1 to:pos2 withEmphasis:fontEmp color:fgClr1 ifNil:fgClr2 backgroundColor:bgClr
+
+ "Created: / 14-02-2012 / 11:08:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkParser class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseParser.st 7922 2012-03-09 07:57:34Z vranyj1 $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkQuickFixer.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,161 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Object subclass:#SmalltalkQuickFixer
+ instanceVariableNames:'view rule fixes'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk-Lint'
+!
+
+Object subclass:#QuickFix
+ instanceVariableNames:'rule label action'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmalltalkQuickFixer
+!
+
+
+!SmalltalkQuickFixer class methodsFor:'instance creation'!
+
+for: rule
+
+ ^self new initializeForRule: rule.
+
+ "Created: / 01-02-2012 / 12:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+for: rule view: view
+
+ ^self new initializeForRule: rule view: view
+
+ "Created: / 17-02-2012 / 00:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer methodsFor:'adding'!
+
+fix
+ "Create and return new quick fix. Caller MUST set its
+ label and action"
+
+ | fix |
+
+ fix := QuickFix new.
+ fix rule: rule.
+ fixes add: fix.
+ ^fix
+
+ "Created: / 01-02-2012 / 10:51:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer methodsFor:'initialization'!
+
+initializeForRule: anRBLintRule view: aCodeView2
+ rule := anRBLintRule.
+ view := aCodeView2.
+ fixes := OrderedCollection new: 3.
+ rule fixes: self.
+
+ "Created: / 17-02-2012 / 00:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer methodsFor:'performing fixes'!
+
+performFix: index
+
+ index <= fixes size ifTrue:[
+ (fixes at: index) performFix.
+ ] ifFalse:[
+ ^ Dialog warn: ('No such fix (%1)' bindWith: index).
+ ]
+
+ "Created: / 16-02-2012 / 14:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer methodsFor:'printing & storing'!
+
+printHtmlOn: html
+
+ fixes isEmptyOrNil ifTrue:[ ^ self ].
+ fixes size > 1 ifTrue:[
+ html nextPutAll: '<br>'.
+ html nextPutLine: 'Possible fixes'.
+ ].
+ html nextPutLine:'<ul>'.
+ fixes withIndexDo:[:fix :index|
+ html
+ nextPutAll:'<li><a action="doit: self doQuickFix:';
+ nextPutAll: index printString;
+ nextPutAll:'">';
+ nextPutAll: fix label;
+ nextPutAll:'</a></li>'.
+ ].
+ html nextPutLine:'</ul>'.
+
+ "Created: / 01-02-2012 / 12:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer methodsFor:'utilities'!
+
+apply: allChanges
+ | changes |
+
+ changes := Tools::ChangeSetBrowser2 confirmChanges: allChanges.
+ changes isEmptyOrNil ifTrue:[ ^ self ].
+ (changes size == 1 and:[view reallyModified]) ifTrue:[
+ view contents: changes anElement source clear: false.
+ ] ifFalse:[
+ | browser |
+
+
+ self halt.
+ ]
+
+ "Created: / 16-02-2012 / 14:46:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkQuickFixer::QuickFix methodsFor:'accessing'!
+
+action
+ ^ action
+!
+
+action:aBlock
+ action := aBlock.
+!
+
+label
+ ^ label
+!
+
+label:aString
+ label := aString.
+!
+
+performFix
+
+ ^action value
+
+ "Created: / 16-02-2012 / 14:48:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+rule
+ ^ rule
+!
+
+rule:anRBLintRule
+ rule := anRBLintRule.
+! !
+
+!SmalltalkQuickFixer class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseQuickFixer.st 7911 2012-02-22 09:55:48Z vranyj1 $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkSyntaxHighlighter.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,810 @@
+"
+ COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
+ All Rights Reserved
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the 'Software'), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+"
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+SyntaxHighlighter subclass:#SmalltalkSyntaxHighlighter
+ instanceVariableNames:'elements lastVariableElements lastSelectorElement
+ ignoreBadIdentifier'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk'
+!
+
+!SmalltalkSyntaxHighlighter class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
+ All Rights Reserved
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the 'Software'), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+"
+! !
+
+!SmalltalkSyntaxHighlighter class methodsFor:'highlighting'!
+
+format:aString parsingWith:aBlock in:aClass elementsInto:elements
+ "common code for formatStatementList, formatExpression, ...
+ format (recolor) whatever is parsed in aBlock (within the context of a given class).
+ Return the text containing font changes and color information.
+ As a side effect, put syntax elements into the passed in elements container
+ (for element-highlighting in codeView2)"
+
+ |parser tree text endPos|
+
+ aString isNil ifTrue:[^ nil].
+
+ parser := self for:(ReadStream on:aString string) in:aClass.
+ parser elements: elements.
+ parser ignoreErrors:true.
+ parser ignoreWarnings:true.
+ parser sourceText:(text := aString string asText).
+ "/ use an array here - this can be changed much faster using #at:put:
+ text emphasisCollection:(Array new:aString size).
+
+ parser nextToken.
+ tree := aBlock value:parser.
+ "/ now, convert the emphasis-array to a runArray
+ text emphasisCollection:(text emphasis asRunArray).
+
+ tree == #Error ifTrue:[
+ "/ mhmh - which is better ...
+ "/ alternative1: color rest after error in red
+"/ text
+"/ emphasizeFrom:(parser sourceStream position)
+"/ to:text size
+"/ with:(#color->Color red).
+
+
+ "/ alternative2: take original emphasis for rest
+
+ endPos := parser sourceStream position + 1.
+ endPos >= text size ifTrue:[
+ ^ text
+ ].
+ ^ ((text copyTo:endPos) , (aString copyFrom:(endPos+1))).
+
+ "/ alternative3: no emphasis for rest.
+
+"/ ^ text "/ aString
+ ].
+ ^ text
+
+ "
+ self
+ formatStatementList:'(1 + 2) max:5. 1 + 2'
+ in:UndefinedObject
+ elementsInto:(OrderedCollection new).
+ "
+!
+
+formatClassDefinition:aString in:aClass elementsInto: elements
+ "format (recolor) a class definition expression in a given class.
+ Return the text containing font changes and color information."
+
+ ^ self formatExpression:aString in:aClass elementsInto: elements
+
+ "Created: / 10-04-2011 / 18:18:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:aString in:aClass elementsInto: elements
+ "format (recolor) an expression in a given class.
+ Return the text containing font changes and color information."
+
+ |parser tree text endPos|
+
+ aString isNil ifTrue:[^ nil].
+
+ parser := self for:(ReadStream on:aString string) in:aClass.
+ parser elements: elements.
+ parser ignoreErrors:true.
+ parser ignoreWarnings:true.
+ parser sourceText:(text := aString string asText).
+ "/ use an array here - this can be changed much faster using #at:put:
+ text emphasisCollection:(Array new:aString size).
+
+ parser nextToken.
+ tree := parser "expression"statementList.
+ "/ now, convert the emphasis-array to a runArray
+ text emphasisCollection:(text emphasis asRunArray).
+
+ tree == #Error ifTrue:[
+ "/ mhmh - which is better ...
+ "/ alternative1: color rest after error in red
+"/ text
+"/ emphasizeFrom:(parser sourceStream position)
+"/ to:text size
+"/ with:(#color->Color red).
+
+
+ "/ alternative2: take original emphasis for rest
+
+ endPos := parser sourceStream position1Based.
+ endPos >= text size ifTrue:[
+ ^ text
+ ].
+ ^ ((text copyTo:endPos) , (aString copyFrom:(endPos+1))).
+
+ "/ alternative3: no emphasis for rest.
+
+"/ ^ text "/ aString
+ ].
+ ^ text
+
+ "
+ self
+ formatExpression:'(1 + 2) max:5'
+ in:UndefinedObject
+ "
+
+ "Created: / 25-07-2010 / 08:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 25-07-2010 / 10:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:aString in:aClass using:preferencesOrNil elementsInto: elements
+ "format (recolor) a method in a given class.
+ Return the text containing font changes and color information."
+
+ "/ obsolete interface
+ ^ self
+ formatMethod:nil
+ source:aString
+ in:aClass
+ using:preferencesOrNil elementsInto:elements
+
+ "Created: / 25-07-2010 / 08:56:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 05-07-2011 / 11:07:50 / cg"
+!
+
+formatMethod:aMethodOrNil source:aString in:aClass using:preferencesOrNil elementsInto: elements
+ "format (recolor) a method in a given class.
+ Return the text containing font changes and color information."
+
+ |highlighter tree text endPos eColor|
+
+ aString isNil ifTrue:[^ nil].
+
+ Error handle:[:ex |
+ ex creator isHandled ifTrue:[
+ ex reject.
+ ].
+ (self parseErrorSignal handles:ex) ifFalse:[
+ "Parse error may happen when re-formatting incomplete code while editing"
+ ('SyntaxHighlighter [info]: error during highlight: ' , ex description) infoPrintCR.
+ "/ ex suspendedContext fullPrintAll.
+ ].
+ ^ aString
+ ] do:[
+ highlighter := self for:(ReadStream on:aString string) in:aClass.
+ highlighter elements: elements.
+ preferencesOrNil notNil ifTrue:[highlighter preferences:preferencesOrNil].
+ "/ highlighter ignoreErrors:true.
+ highlighter ignoreWarnings:true.
+ highlighter sourceText:(text := aString string asText).
+ "/ use an array here - this can be changed much faster using #at:put:
+ text emphasisCollection:(Array new:aString size).
+
+ tree := highlighter parseMethod.
+ "/ now, convert the emphasis-array to a runArray
+ text emphasisCollection:(text emphasis asRunArray).
+
+ tree == #Error ifTrue:[
+ eColor := UserPreferences current errorColor.
+ eColor notNil ifTrue:[
+ "/ mhmh - which is better ...
+ "/ alternative1: color rest after error in red
+ text
+ emphasizeFrom:(highlighter sourceStream position + 1)
+ to:text size
+ with:(#color->eColor).
+ ] ifFalse:[
+ "/ alternative2: take original emphasis for rest
+
+ endPos := highlighter sourceStream position + 1.
+ endPos >= text size ifTrue:[
+ ^ Array with: text with: highlighter elements
+ ].
+ ^ ((text copyTo:endPos) , (aString copyFrom:(endPos+1)))
+ ].
+ "/ alternative3: no emphasis for rest.
+ ].
+ ^text
+ ]
+ "
+ self
+ formatMethod:'foo
+ ^ self bar:''hello''.
+
+ ' , (Character doubleQuote asString) , 'some comment' , (Character doubleQuote asString) , '
+'
+ in:UndefinedObject
+ "
+
+ "Modified: / 22-08-2006 / 13:32:04 / cg"
+ "Created: / 05-07-2011 / 10:39:21 / cg"
+ "Modified: / 28-05-2013 / 22:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkSyntaxHighlighter methodsFor:'accessing'!
+
+elements
+ ^ elements
+!
+
+elements:aParseTreeIndex
+ "the element collection, to collect variables, selectors etc. into"
+
+ elements := aParseTreeIndex.
+
+ "Modified (comment): / 21-08-2011 / 09:13:31 / cg"
+!
+
+tree: aParseNode
+ super tree: aParseNode.
+ elements tree: aParseNode
+
+ "Created: / 16-02-2012 / 09:56:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkSyntaxHighlighter methodsFor:'initialization'!
+
+initialize
+
+ super initialize.
+ elements := ParseTreeIndex new.
+ lastVariableElements := Dictionary new.
+
+ "Created: / 14-02-2010 / 13:08:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 21-08-2011 / 09:37:35 / cg"
+ "Modified: / 16-02-2012 / 09:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkSyntaxHighlighter methodsFor:'parsing-expressions'!
+
+_binaryExpressionFor:receiverArg
+ "parse a binary-expression; return a node-tree, nil or #Error"
+
+ |receiver expr arg sel pos1 pos2 lno|
+
+ receiver := receiverArg.
+ (receiver == #Error) ifTrue:[^ #Error].
+
+ "special kludge: since Scanner cannot know if -digit is a binary
+ expression or a negative constant, handle cases here"
+
+ [(tokenType == #BinaryOperator)
+ or:[(tokenType == $|)
+ or:[(tokenType == $^ and:[parserFlags allowCaretAsBinop])
+ or:[((tokenType == #Integer) or:[tokenType == #Float])
+ and:[tokenValue < 0]]]]
+ ] whileTrue:[
+ "/ kludge alarm: in a function-call argList, #, is not a binarySelector
+ inFunctionCallArgument == true ifTrue:[
+ ((tokenType == #BinaryOperator) and:[tokenName = ',']) ifTrue:[
+ ^ receiver
+ ].
+ ].
+
+ pos1 := tokenPosition.
+ lno := tokenLineNr.
+
+ "/ kludge alarm: bar, caret and minus are not scanned as binop
+ (tokenType == $|) ifTrue:[
+ sel := '|'.
+ sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition.
+ self nextToken.
+ ] ifFalse:[
+ (tokenType == $^) ifTrue:[
+ sel := '^'.
+ sel := self selectorCheck:sel for:receiver position:tokenPosition to:tokenPosition.
+ self nextToken.
+ ] ifFalse:[
+ (tokenType == #BinaryOperator) ifTrue:[
+ sel := tokenName.
+ sel := self selectorCheck:sel for:receiver position:tokenPosition to:(tokenPosition + tokenName size - 1).
+ self nextToken
+ ] ifFalse:[
+ sel := '-'.
+ token := tokenValue := tokenValue negated.
+ tokenPosition := tokenPosition + 1. "/ to skip the sign
+ ]
+ ].
+ ].
+
+ pos2 := pos1 + sel size - 1.
+ self markSelector:sel from:pos1 to:pos2 receiverNode:receiver.
+ lastSelectorElement := nil.
+
+ arg := self unaryExpression.
+ (arg == #Error) ifTrue:[^ #Error].
+
+ expr := BinaryNode receiver:receiver selector:sel arg:arg fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self parseError:(expr errorString) position:pos1 to:tokenPosition.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := BinaryNode receiver:receiver selector:sel arg:arg fold:nil.
+ ].
+ expr lineNumber:lno.
+ expr selectorPosition:pos1.
+
+ self checkPlausibilityOf:expr from:pos1 to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+ receiver := expr. "/ for next message
+ ].
+ ^ receiver
+
+ "Modified: / 09-01-1998 / 19:05:18 / stefan"
+ "Modified: / 14-02-2010 / 17:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-01-2012 / 10:46:49 / cg"
+ "Created: / 16-02-2012 / 21:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_keywordExpressionFor:receiverArg
+ "parse a keyword-expression; return a node-tree, nil or #Error.
+
+ keywordExpression ::= binaryexpression
+ | { KEYWORD-PART binaryExpression }
+ "
+
+ |expr receiver sel arg args posR1 posR2 pos1 pos2 lno positions constVal|
+
+ receiver := receiverArg.
+ posR1 := tokenPosition.
+ (tokenType == #Keyword) ifFalse:[^ receiver].
+
+ pos1 := posR2 := tokenPosition.
+ pos2 := tokenPosition + tokenName size - 1.
+ positions := OrderedCollection with:(pos1 to:pos2).
+ sel := tokenName.
+ lno := tokenLineNr.
+ self nextToken.
+ arg := self binaryExpression.
+ (arg == #Error) ifTrue:[^ #Error].
+ args := Array with:arg.
+ [tokenType == #Keyword] whileTrue:[
+ sel := sel , tokenName.
+ pos2 := tokenPosition + tokenName size - 1.
+ positions add:(tokenPosition to:pos2).
+ self nextToken.
+ arg := self binaryExpression.
+ (arg == #Error) ifTrue:[^ #Error].
+ args := args copyWith:arg.
+ ].
+
+ positions do:[:p |
+ self markSelector:sel from:p start to:p stop receiverNode:receiver.
+ ].
+ lastSelectorElement := nil.
+ sel := self selectorCheck:sel for:receiver positions:positions.
+
+ ignoreWarnings ifFalse:[
+ (Class definitionSelectors includes:sel) ifTrue:[
+ (receiver isVariable and:[receiver isUndeclared]) ifTrue:[
+ "this is not an error - the undefined class may be loaded after this code!!"
+ self warning:('as yet undefined superclass: ' , receiver name) position:pos1 to:pos2.
+ ].
+ ].
+ ].
+
+ expr := MessageNode receiver:receiver selector:sel args:args fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self parseError:(expr errorString) position:pos1 to:pos2.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := MessageNode receiver:receiver selector:sel args:args fold:nil.
+ ].
+ expr lineNumber:lno.
+ self checkPlausibilityOf:expr from:pos1 to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+
+"/ (contextToEvaluateIn isNil and:[selfValue isNil]) ifTrue:[ "/ do not check this for doits
+"/ receiver isSuper ifTrue:[
+"/ sel ~= selector ifTrue:[
+"/ self warnCommonMistake:'possible bad super message (selector should be same as in current method) ?'
+"/ position:posR1 to:posR2-1
+"/ ].
+"/ ].
+"/ ].
+"/
+
+ (sel = #ifTrue: or:[sel = #ifFalse: or:[sel = #ifTrue:ifFalse: or:[sel = #ifFalse:ifTrue:]]]) ifTrue:[
+ (expr receiver withConstantValueDo:[:val | constVal := val]) ifTrue:[
+ |indexOfArgNotExecuted|
+
+ "/ receiver evaluates to a constant
+ constVal == true ifTrue:[
+ (sel startsWith: #ifFalse:) ifTrue:[
+ indexOfArgNotExecuted := 1.
+ ] ifFalse:[
+ indexOfArgNotExecuted := 2.
+ ]
+ ].
+ constVal == false ifTrue:[
+ (sel startsWith: #ifTrue:) ifTrue:[
+ indexOfArgNotExecuted := 1.
+ ] ifFalse:[
+ indexOfArgNotExecuted := 2.
+ ]
+ ].
+ indexOfArgNotExecuted == 2 ifTrue:[
+ args size == 1 ifTrue:[ indexOfArgNotExecuted := nil]
+ ].
+
+ indexOfArgNotExecuted notNil ifTrue:[
+ |argIsNotExecuted|
+
+ "/ self warning:'receiver is constant; arg',indexOfArgNotExecuted printString,' is never executed' position:pos1 to:tokenPosition.
+ argIsNotExecuted := expr args at:indexOfArgNotExecuted.
+ argIsNotExecuted isBlockNode ifTrue:[
+ self markCommentFrom:argIsNotExecuted startPosition to:argIsNotExecuted endPosition.
+ ].
+ ].
+ ].
+ ].
+
+ (ignoreErrors or:[ignoreWarnings]) ifFalse:[
+ (sel = #and: or:[sel = #or:]) ifTrue:[
+ expr arg1 isBlock ifFalse:[
+ (expr arg1 isVariable
+ and:[ (expr arg1 name asLowercase includesString:'block')]) ifFalse:[
+ self warnCommonMistake:'(possible common mistake) missing block brackets ?'
+ position:pos2+1 to:tokenPosition-1
+ ]
+ ].
+ ^ expr.
+ ].
+
+ (sel = #whileTrue: or:[sel = #whileFalse:]) ifTrue:[
+ expr receiver isBlock ifFalse:[
+ (expr receiver isVariable
+ and:[ (expr receiver name asLowercase includesString:'block')]) ifFalse:[
+ self warnCommonMistake:'(possible common mistake) missing block brackets ?'
+ position:pos1 to:pos2
+ ]
+ ].
+ ^ expr.
+ ].
+
+ (sel = #ifTrue: or:[sel = #ifFalse:]) ifTrue:[
+ expr receiver isMessage ifTrue:[
+ (expr receiver selector = #whileTrue or:[expr receiver selector = #whileFalse]) ifTrue:[
+ self warnCommonMistake:'strange receiver expression'
+ position:pos1 to:pos2
+ ].
+ ].
+ ^ expr
+ ].
+ ].
+
+ ^ expr.
+
+ "Modified: / 14-02-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-01-2012 / 10:47:01 / cg"
+ "Created: / 16-02-2012 / 21:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+_unaryExpressionFor:receiverArg
+ "parse a unary-expression; return a node-tree, nil or #Error"
+
+ |receiver expr sel pos pos2 lNr arguments|
+
+ receiver := receiverArg.
+ (receiver == #Error) ifTrue:[^ #Error].
+
+ [ self isValidUnarySelector:tokenType ] whileTrue:[
+ pos := tokenPosition.
+ pos2 := pos + tokenName size - 1.
+ lNr := tokenLineNr.
+ sel := tokenName.
+
+ self markSelector:sel from:pos to:pos2 receiverNode:receiver.
+ lastSelectorElement := nil.
+
+ self nextToken.
+ tokenType == $( ifTrue:[
+ parserFlags allowSqueakExtensions == true ifTrue:[
+ "/ croquet/squeak extension - c/java-style arguments
+ arguments := self functionCallArgList.
+ "/ synthetic selector: foo[:[with:[with:[...]]]]
+ arguments notEmpty ifTrue:[
+ sel := sel , ':'.
+ arguments size - 1 timesRepeat:[ sel := sel , 'with:' ].
+ ].
+ sel := self selectorCheck:sel for:receiver position:pos to:pos2.
+ expr := MessageNode receiver:receiver selector:sel args:arguments fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self parseError:(expr errorString) position:pos to:pos2.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := MessageNode receiver:receiver selector:sel args:arguments fold:nil.
+ ].
+ expr lineNumber:lNr.
+ self checkPlausibilityOf:expr from:pos to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+ ^ expr.
+ ].
+ ].
+
+ sel := self selectorCheck:sel for:receiver position:pos to:pos2.
+ expr := UnaryNode receiver:receiver selector:sel fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self warning:(expr errorString , '.\\If you proceed, that error will happen at runtime.') withCRs position:pos to:pos2.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := UnaryNode receiver:receiver selector:sel fold:nil.
+ ].
+ expr lineNumber:lNr.
+
+ self checkPlausibilityOf:expr from:pos to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+
+ receiver := expr. "/ for next message
+ ].
+ ^ receiver
+
+ "Modified: / 14-02-2010 / 17:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-01-2012 / 10:47:37 / cg"
+ "Created: / 16-02-2012 / 21:54:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+binaryExpression
+ | node savedLastSelectorElement |
+
+ savedLastSelectorElement := lastSelectorElement.
+ lastSelectorElement := nil.
+ node := super binaryExpression.
+ (lastSelectorElement notNil and:[node ~~ #Error and:[node isMessage]]) ifTrue:[
+ lastSelectorElement node parent: node.
+ ].
+ lastSelectorElement := savedLastSelectorElement.
+ ^node
+
+ "Modified: / 19-01-2000 / 16:22:16 / cg"
+ "Created: / 16-02-2012 / 21:56:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+expression
+ | node savedLastSelectorElement |
+
+ savedLastSelectorElement := lastSelectorElement.
+ lastSelectorElement := nil.
+ node := super expression.
+ ((node ~~ #Error) and:[node isMessage]) ifTrue:[
+ [ lastSelectorElement notNil ] whileTrue:[
+ lastSelectorElement node parent: node.
+ lastSelectorElement := lastSelectorElement prev.
+ ].
+ ].
+ lastSelectorElement := savedLastSelectorElement.
+ ^node
+
+ "Modified: / 19-01-2000 / 16:22:16 / cg"
+ "Modified: / 16-02-2012 / 23:39:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+unaryExpressionFor:receiverArg
+ "parse a unary-expression; return a node-tree, nil or #Error"
+
+ |receiver expr sel pos pos2 lNr arguments savedLastSelectorElement|
+
+ savedLastSelectorElement := lastSelectorElement.
+ receiver := receiverArg.
+ (receiver == #Error) ifTrue:[^ #Error].
+
+ [ self isValidUnarySelector:tokenType ] whileTrue:[
+ pos := tokenPosition.
+ pos2 := pos + tokenName size - 1.
+ lNr := tokenLineNr.
+ sel := tokenName.
+
+ lastSelectorElement := nil.
+ self markSelector:sel from:pos to:pos2 receiverNode:receiver.
+
+ self nextToken.
+ tokenType == $( ifTrue:[
+ parserFlags allowSqueakExtensions == true ifTrue:[
+ "/ croquet/squeak extension - c/java-style arguments
+ arguments := self functionCallArgList.
+ "/ synthetic selector: foo[:[with:[with:[...]]]]
+ arguments notEmpty ifTrue:[
+ sel := sel , ':'.
+ arguments size - 1 timesRepeat:[ sel := sel , 'with:' ].
+ ].
+ sel := self selectorCheck:sel for:receiver position:pos to:pos2.
+ expr := MessageNode receiver:receiver selector:sel args:arguments fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self parseError:(expr errorString) position:pos to:pos2.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := MessageNode receiver:receiver selector:sel args:arguments fold:nil.
+ ].
+ lastSelectorElement node parent: expr.
+ expr lineNumber:lNr.
+ self checkPlausibilityOf:expr from:pos to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+ ^ expr.
+ ].
+ ].
+
+ sel := self selectorCheck:sel for:receiver position:pos to:pos2.
+ expr := UnaryNode receiver:receiver selector:sel fold:foldConstants.
+ expr isErrorNode ifTrue:[
+ self warning:(expr errorString , '.\\If you proceed, that error will happen at runtime.') withCRs position:pos to:pos2.
+ errorFlag := false. "ok, user wants it - so he'll get it"
+ expr := UnaryNode receiver:receiver selector:sel fold:nil.
+ ].
+ expr lineNumber:lNr.
+ lastSelectorElement node parent: expr.
+
+ self checkPlausibilityOf:expr from:pos to:pos2.
+ parseForCode ifFalse:[
+ self rememberSelectorUsed:sel receiver:receiver
+ ].
+
+ receiver := expr. "/ for next message
+ ].
+ lastSelectorElement := savedLastSelectorElement.
+ ^ receiver
+
+ "Modified: / 19-01-2012 / 10:47:37 / cg"
+ "Created: / 16-02-2012 / 23:50:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+variable
+ | node |
+
+ ignoreBadIdentifier := classToCompileFor isNil.
+ node := super variable.
+ ignoreBadIdentifier := false.
+ node isVariable ifTrue:[
+ | el prevEl |
+
+ el := elements newElementFor: node.
+ prevEl := lastVariableElements at:node name ifAbsent:[nil].
+ prevEl notNil ifTrue:[prevEl next:el].
+ lastVariableElements at:node name put:el.
+ elements add: el.
+ ].
+ ^node
+
+ "Modified: / 19-01-2000 / 16:22:16 / cg"
+ "Created: / 16-02-2012 / 22:21:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkSyntaxHighlighter methodsFor:'syntax detection'!
+
+markArgumentIdentifierFrom:pos1 to:pos2
+ | node el prevEl |
+
+ super markArgumentIdentifierFrom:pos1 to:pos2.
+ node := VariableNode methodArgumentNamed:(sourceText string copyFrom: pos1 to: pos2).
+ node startPosition: pos1 endPosition: pos2.
+ el := elements newElementFor: node.
+ prevEl := lastVariableElements at:node name ifAbsent:[nil].
+ prevEl notNil ifTrue:[prevEl next:el].
+ lastVariableElements at:node name put:el.
+ elements add: el.
+
+ "Created: / 24-07-2010 / 09:25:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 21-08-2011 / 09:27:26 / cg"
+ "Modified: / 16-02-2012 / 22:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markBadIdentifierFrom:pos1 to:pos2
+
+ super markBadIdentifierFrom:pos1 to:pos2
+
+ "Created: / 17-03-2012 / 19:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markLocalIdentifierFrom:pos1 to:pos2
+ | node el prevEl |
+
+ super markLocalIdentifierFrom:pos1 to:pos2.
+ node := VariableNode methodLocalNamed:(sourceText string copyFrom: pos1 to: pos2).
+ node startPosition: pos1 endPosition: pos2.
+ el := elements newElementFor: node.
+ prevEl := lastVariableElements at:node name ifAbsent:[nil].
+ prevEl notNil ifTrue:[prevEl next:el].
+ lastVariableElements at:node name put:el.
+ elements add: el.
+
+ "Modified: / 21-08-2011 / 09:27:26 / cg"
+ "Created: / 16-02-2012 / 22:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode
+
+ | element selectorSymbol |
+
+ "Special hack for Java class references - I would like to have them
+ marked specially (and not as an error when the class is not yet loaded -
+ the code is correct as JavaClassAccessor loads it lazily"
+ (aReceiverNode isJavaPackageReference) ifTrue:[
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:preferences globalClassIdentifierEmphasis
+ color: preferences globalClassIdentifierColor
+ ] ifFalse:[
+ super markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNode.
+ ].
+
+ "don't create symbols for partial typed selectors"
+ selectorSymbol := selectorString asSymbolIfInterned.
+
+ element := elements newElementFor: (SelectorNode value: selectorString from: pos1 to: pos2).
+
+ (lastSelectorElement notNil "and:[lastSelectorElement value = selectorString]") ifTrue:[
+ lastSelectorElement next: element.
+ ].
+ elements add: element.
+ lastSelectorElement := "(self isValidUnarySelector:tokenType)"false
+ ifTrue:[nil]
+ ifFalse:[element].
+
+ "Created: / 14-02-2010 / 17:40:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 14-02-2010 / 19:24:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 21-08-2011 / 09:18:21 / cg"
+ "Modified: / 19-04-2012 / 09:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markUnknownIdentifierFrom:pos1 to:pos2
+
+ ignoreBadIdentifier == true ifTrue:[ ^ self ].
+
+ super markUnknownIdentifierFrom:pos1 to:pos2
+
+ "Created: / 31.3.1998 / 19:09:26 / cg"
+ "Modified: / 31.3.1998 / 19:10:30 / cg"
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkUnacceptedMethodEnvironment.st Mon Aug 26 10:33:23 2013 +0100
@@ -0,0 +1,98 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+BrowserEnvironment subclass:#SmalltalkUnacceptedMethodEnvironment
+ instanceVariableNames:'class method'
+ classVariableNames:'UnacceptedSelector'
+ poolDictionaries:''
+ category:'SmallSense-Smalltalk-Lint'
+!
+
+
+!SmalltalkUnacceptedMethodEnvironment class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ UnacceptedSelector := #'* * UnacceptedSelector * *'
+
+ "Modified: / 27-01-2012 / 16:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment class methodsFor:'instance creation'!
+
+onClass: realClass methodSource: source
+
+ ^self new setupForClass: realClass source: source
+
+ "Created: / 27-01-2012 / 15:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment methodsFor:'accessing'!
+
+methodsInto:arg
+ "raise an error: must be redefined in concrete subclass(es)"
+
+ ^ self shouldImplement
+!
+
+selectorsForClass: aClass do: aBlock
+
+ self assert: aClass == class.
+ aBlock value: (method selector) ? UnacceptedSelector
+
+ "Created: / 27-01-2012 / 15:50:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment methodsFor:'accessing-classes'!
+
+classesDo: aBlock
+
+ ^aBlock value: class.
+
+ "Created: / 27-01-2012 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment methodsFor:'initialization'!
+
+setupForClass: realClass source: source
+
+ | ns |
+
+ ns := RBNamespace onEnvironment: BrowserEnvironment new.
+ class := realClass isMetaclass
+ ifTrue:[RBMetaclass existingNamed: realClass theNonMetaclass name]
+ ifFalse:[RBClass existingNamed: realClass name].
+ class model: ns.
+ method := RBMethod for: class source: source selector: nil.
+ class addMethod: method.
+
+ "Created: / 27-01-2012 / 15:42:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment methodsFor:'testing'!
+
+includesSelector: aSelector in: aClass
+
+ ^aClass == method mclass
+ and:[aSelector == #' fake selector '].
+
+ "Created: / 27-01-2012 / 15:51:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkUnacceptedMethodEnvironment class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+ ^ '$Id: SmallSenseUnacceptedMethodEnvironment.st 7911 2012-02-22 09:55:48Z vranyj1 $'
+! !
+
+
+SmalltalkUnacceptedMethodEnvironment initialize!
--- a/SmallSense__SnippetPO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__SnippetPO.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
--- a/SmallSense__SyntaxHighlightingService.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__SyntaxHighlightingService.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'lastLineFromChanged lastLineToChanged lastContentsList'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Services'
+ category:'SmallSense-Core-Services'
!
@@ -20,6 +20,23 @@
"Created: / 27-07-2013 / 22:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!SyntaxHighlightingService methodsFor:'accessing'!
+
+syntaxHighlighter
+ | highlighter |
+
+ highlighter := super syntaxHighlighter.
+ highlighter == SyntaxHighlighter ifTrue:[
+ ^ SmalltalkSyntaxHighlighter
+ ].
+ highlighter == SyntaxHighlighter2 ifTrue:[
+ ^ SmalltalkSyntaxHighlighter
+ ].
+ ^ highlighter
+
+ "Created: / 26-08-2013 / 09:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!SyntaxHighlightingService methodsFor:'change & update'!
sourceChanged:force
@@ -238,14 +255,14 @@
"textView" modified ifFalse:[
oldCodeList := textView list copy.
"textView" modified ifFalse:[
- oldCodeList isNil ifFalse:[
+ oldCodeList notNil ifTrue:[
oldCode := oldCodeList asStringWithoutEmphasis.
"textView" modified ifFalse:[
Screen currentScreenQuerySignal answer:codeView device do:[
Parser parseErrorSignal handle:[:ex |
- |errMsg|
+"/ |errMsg|
- errMsg := ex description asStringCollection first asString.
+"/ errMsg := ex description asStringCollection first asString.
"/ Transcript topView raiseDeiconified.
"/ Transcript showCR:'ParseError: ', ex description.
@@ -396,7 +413,7 @@
]
"Created: / 03-08-2013 / 11:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-08-2013 / 23:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-08-2013 / 09:35:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!SyntaxHighlightingService class methodsFor:'documentation'!
--- a/SmallSense__Type.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__Type.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:''
classVariableNames:'ObjectType'
poolDictionaries:''
- category:'SmallSense-Types'
+ category:'SmallSense-Smalltalk-Types'
!
!Type class methodsFor:'documentation'!
--- a/SmallSense__TypeCollector.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__TypeCollector.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'master'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Roel Typer'
+ category:'SmallSense-Roel Typer (obsolete)'
!
--- a/SmallSense__TypeCollectorCache.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__TypeCollectorCache.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'typingJob'
classVariableNames:'SharedCache'
poolDictionaries:''
- category:'SmallSense-Roel Typer'
+ category:'SmallSense-Roel Typer (obsolete)'
!
--- a/SmallSense__TypeHolder.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__TypeHolder.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'type'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Types'
+ category:'SmallSense-Smalltalk-Types'
!
--- a/SmallSense__UnacceptedMethodEnvironment.st Sun Aug 25 13:05:24 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-BrowserEnvironment subclass:#UnacceptedMethodEnvironment
- instanceVariableNames:'class method'
- classVariableNames:'UnacceptedSelector'
- poolDictionaries:''
- category:'SmallSense-Lint'
-!
-
-
-!UnacceptedMethodEnvironment class methodsFor:'initialization'!
-
-initialize
- "Invoked at system start or when the class is dynamically loaded."
-
- "/ please change as required (and remove this comment)
-
- UnacceptedSelector := #'* * UnacceptedSelector * *'
-
- "Modified: / 27-01-2012 / 16:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment class methodsFor:'instance creation'!
-
-onClass: realClass methodSource: source
-
- ^self new setupForClass: realClass source: source
-
- "Created: / 27-01-2012 / 15:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment methodsFor:'accessing'!
-
-methodsInto:arg
- "raise an error: must be redefined in concrete subclass(es)"
-
- ^ self shouldImplement
-!
-
-selectorsForClass: aClass do: aBlock
-
- self assert: aClass == class.
- aBlock value: (method selector) ? UnacceptedSelector
-
- "Created: / 27-01-2012 / 15:50:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment methodsFor:'accessing-classes'!
-
-classesDo: aBlock
-
- ^aBlock value: class.
-
- "Created: / 27-01-2012 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment methodsFor:'initialization'!
-
-setupForClass: realClass source: source
-
- | ns |
-
- ns := RBNamespace onEnvironment: BrowserEnvironment new.
- class := realClass isMetaclass
- ifTrue:[RBMetaclass existingNamed: realClass theNonMetaclass name]
- ifFalse:[RBClass existingNamed: realClass name].
- class model: ns.
- method := RBMethod for: class source: source selector: nil.
- class addMethod: method.
-
- "Created: / 27-01-2012 / 15:42:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment methodsFor:'testing'!
-
-includesSelector: aSelector in: aClass
-
- ^aClass == method mclass
- and:[aSelector == #' fake selector '].
-
- "Created: / 27-01-2012 / 15:51:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!UnacceptedMethodEnvironment class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
- ^ '$Id: SmallSenseUnacceptedMethodEnvironment.st 7911 2012-02-22 09:55:48Z vranyj1 $'
-! !
-
-
-UnacceptedMethodEnvironment initialize!
--- a/SmallSense__UnionType.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__UnionType.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'types trustfullness trustfullnessBonus'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Types'
+ category:'SmallSense-Smalltalk-Types'
!
--- a/SmallSense__UnknownType.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__UnknownType.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Types'
+ category:'SmallSense-Smalltalk-Types'
!
UnknownType class instanceVariableNames:'theOneAndOnlyInstance'
--- a/SmallSense__VariablePO.st Sun Aug 25 13:05:24 2013 +0100
+++ b/SmallSense__VariablePO.st Mon Aug 26 10:33:23 2013 +0100
@@ -6,7 +6,7 @@
instanceVariableNames:'class type'
classVariableNames:''
poolDictionaries:''
- category:'SmallSense-Interface-PO'
+ category:'SmallSense-Core-Interface-PO'
!
--- a/abbrev.stc Sun Aug 25 13:05:24 2013 +0100
+++ b/abbrev.stc Mon Aug 26 10:33:23 2013 +0100
@@ -2,49 +2,50 @@
# this file is needed for stc to be able to compile modules independently.
# it provides information about a classes filename, category and especially namespace.
SmallSense::BaseTestClass SmallSense__BaseTestClass jv:smallsense 'SmallSense-Tests' 1
-SmallSense::Checker SmallSense__Checker jv:smallsense 'SmallSense-Lint' 0
-SmallSense::CompletionWindow SmallSense__CompletionWindow jv:smallsense 'SmallSense-Interface' 1
-SmallSense::CriticsWindow SmallSense__CriticsWindow jv:smallsense 'SmallSense-Interface' 1
-SmallSense::EditService SmallSense__EditService jv:smallsense 'SmallSense-Services' 0
-SmallSense::EditSupport SmallSense__EditSupport jv:smallsense 'SmallSense-Services' 0
-SmallSense::Info SmallSense__Info jv:smallsense 'SmallSense-Model' 0
-SmallSense::Manager SmallSense__Manager jv:smallsense 'SmallSense-Model' 0
-SmallSense::PO SmallSense__PO jv:smallsense 'SmallSense-Interface-PO' 0
-SmallSense::ParseNodeInspector SmallSense__ParseNodeInspector jv:smallsense 'SmallSense-Interface' 1
+SmallSense::CompletionWindow SmallSense__CompletionWindow jv:smallsense 'SmallSense-Core-Interface' 1
+SmallSense::CriticsWindow SmallSense__CriticsWindow jv:smallsense 'SmallSense-Core-Interface' 1
+SmallSense::EditService SmallSense__EditService jv:smallsense 'SmallSense-Core-Services' 0
+SmallSense::EditSupport SmallSense__EditSupport jv:smallsense 'SmallSense-Core-Services' 0
+SmallSense::FinderTests SmallSense__FinderTests jv:smallsense 'SmallSense-Tests' 1
+SmallSense::Info SmallSense__Info jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
+SmallSense::Manager SmallSense__Manager jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
+SmallSense::PO SmallSense__PO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::ParseNodeInspector SmallSense__ParseNodeInspector jv:smallsense 'SmallSense-Core-Interface' 1
SmallSense::ParseNodeVisitor SmallSense__ParseNodeVisitor jv:smallsense 'SmallSense-Core' 0
-SmallSense::Parser SmallSense__Parser jv:smallsense 'SmallSense-Core' 3
+SmallSense::ParserTests SmallSense__ParserTests jv:smallsense 'SmallSense-Tests' 0
SmallSense::Position SmallSense__Position jv:smallsense 'SmallSense-Core' 0
-SmallSense::QuickFixer SmallSense__QuickFixer jv:smallsense 'SmallSense-Lint' 0
SmallSense::Recognizer SmallSense__Recognizer jv:smallsense 'SmallSense-Core' 0
+SmallSense::RecognizerTests SmallSense__RecognizerTests jv:smallsense 'SmallSense-Tests' 0
SmallSense::ResultSet SmallSense__ResultSet jv:smallsense 'SmallSense-Core' 0
SmallSense::SelectorNode SmallSense__SelectorNode jv:smallsense 'SmallSense-Core' 0
-SmallSense::Service SmallSense__Service jv:smallsense 'SmallSense-Services' 0
-SmallSense::SettingsAppl SmallSense__SettingsAppl jv:smallsense 'SmallSense-Interface' 1
-SmallSense::SyntaxHighlightingService SmallSense__SyntaxHighlightingService jv:smallsense 'SmallSense-Services' 0
+SmallSense::SettingsAppl SmallSense__SettingsAppl jv:smallsense 'SmallSense-Core-Interface' 1
+SmallSense::SmalltalkChecker SmallSense__SmalltalkChecker jv:smallsense 'SmallSense-Smalltalk-Lint' 0
+SmallSense::SmalltalkLintService SmallSense__SmalltalkLintService jv:smallsense 'SmallSense-Smalltalk-Lint' 0
+SmallSense::SmalltalkParser SmallSense__SmalltalkParser jv:smallsense 'SmallSense-Smalltalk' 3
+SmallSense::SmalltalkQuickFixer SmallSense__SmalltalkQuickFixer jv:smallsense 'SmallSense-Smalltalk-Lint' 0
+SmallSense::SmalltalkSyntaxHighlighter SmallSense__SmalltalkSyntaxHighlighter jv:smallsense 'SmallSense-Smalltalk' 3
+SmallSense::SmalltalkUnacceptedMethodEnvironment SmallSense__SmalltalkUnacceptedMethodEnvironment jv:smallsense 'SmallSense-Smalltalk-Lint' 0
+SmallSense::SyntaxHighlightingService SmallSense__SyntaxHighlightingService jv:smallsense 'SmallSense-Core-Services' 0
SmallSense::TestCase SmallSense__TestCase jv:smallsense 'SmallSense-Tests' 1
-SmallSense::Type SmallSense__Type jv:smallsense 'SmallSense-Types' 0
-SmallSense::TypeCollector SmallSense__TypeCollector jv:smallsense 'SmallSense-Roel Typer' 0
-SmallSense::TypeCollectorCache SmallSense__TypeCollectorCache jv:smallsense 'SmallSense-Roel Typer' 0
-SmallSense::TypeHolder SmallSense__TypeHolder jv:smallsense 'SmallSense-Types' 0
-SmallSense::UnacceptedMethodEnvironment SmallSense__UnacceptedMethodEnvironment jv:smallsense 'SmallSense-Lint' 0
+SmallSense::Type SmallSense__Type jv:smallsense 'SmallSense-Smalltalk-Types' 0
+SmallSense::TypeCollector SmallSense__TypeCollector jv:smallsense 'SmallSense-Roel Typer (obsolete)' 0
+SmallSense::TypeCollectorCache SmallSense__TypeCollectorCache jv:smallsense 'SmallSense-Roel Typer (obsolete)' 0
+SmallSense::TypeHolder SmallSense__TypeHolder jv:smallsense 'SmallSense-Smalltalk-Types' 0
jv_smallsense jv_smallsense jv:smallsense '* Projects & Packages *' 3
-SmallSense::AbstractInstvarInterfaceExtractor SmallSense__AbstractInstvarInterfaceExtractor jv:smallsense 'SmallSense-Roel Typer' 3
-SmallSense::ClassInfo SmallSense__ClassInfo jv:smallsense 'SmallSense-Model' 0
-SmallSense::ClassPO SmallSense__ClassPO jv:smallsense 'SmallSense-Interface-PO' 0
-SmallSense::ClassType SmallSense__ClassType jv:smallsense 'SmallSense-Types' 0
-SmallSense::ConstantPO SmallSense__ConstantPO jv:smallsense 'SmallSense-Interface-PO' 0
+SmallSense::ClassInfo SmallSense__ClassInfo jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
+SmallSense::ClassPO SmallSense__ClassPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::ClassType SmallSense__ClassType jv:smallsense 'SmallSense-Smalltalk-Types' 0
+SmallSense::ConstantPO SmallSense__ConstantPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
SmallSense::Finder SmallSense__Finder jv:smallsense 'SmallSense-Core' 0
-SmallSense::FinderTests SmallSense__FinderTests jv:smallsense 'SmallSense-Tests' 1
-SmallSense::GenericEditSupport SmallSense__GenericEditSupport jv:smallsense 'SmallSense-Services' 0
-SmallSense::Inferencer SmallSense__Inferencer jv:smallsense 'SmallSense-Inference' 0
-SmallSense::JavaEditSupport SmallSense__JavaEditSupport jv:smallsense 'SmallSense-Services' 0
-SmallSense::MethodInfo SmallSense__MethodInfo jv:smallsense 'SmallSense-Model' 0
-SmallSense::MethodPO SmallSense__MethodPO jv:smallsense 'SmallSense-Interface-PO' 0
-SmallSense::ParserTests SmallSense__ParserTests jv:smallsense 'SmallSense-Tests' 1
-SmallSense::RecognizerTests SmallSense__RecognizerTests jv:smallsense 'SmallSense-Tests' 1
-SmallSense::SmalltalkEditSupport SmallSense__SmalltalkEditSupport jv:smallsense 'SmallSense-Services' 0
-SmallSense::SnippetPO SmallSense__SnippetPO jv:smallsense 'SmallSense-Interface-PO' 0
-SmallSense::UnionType SmallSense__UnionType jv:smallsense 'SmallSense-Types' 0
-SmallSense::UnknownType SmallSense__UnknownType jv:smallsense 'SmallSense-Types' 1
-SmallSense::VariablePO SmallSense__VariablePO jv:smallsense 'SmallSense-Interface-PO' 0
-SmallSense::InstvarInterfaceExtractor SmallSense__InstvarInterfaceExtractor jv:smallsense 'SmallSense-Roel Typer' 3
+SmallSense::GenericEditSupport SmallSense__GenericEditSupport jv:smallsense 'SmallSense-Core-Services' 0
+SmallSense::JavaEditSupport SmallSense__JavaEditSupport jv:smallsense 'SmallSense-Java' 0
+SmallSense::MethodInfo SmallSense__MethodInfo jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
+SmallSense::MethodPO SmallSense__MethodPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::SmalltalkAbstractInstvarInterfaceExtractor SmallSense__SmalltalkAbstractInstvarInterfaceExtractor jv:smallsense 'SmallSense-Roel Typer (obsolete)' 3
+SmallSense::SmalltalkEditSupport SmallSense__SmalltalkEditSupport jv:smallsense 'SmallSense-Smalltalk' 0
+SmallSense::SmalltalkInferencer SmallSense__SmalltalkInferencer jv:smallsense 'SmallSense-Smalltalk-Types-Inference' 0
+SmallSense::SnippetPO SmallSense__SnippetPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::UnionType SmallSense__UnionType jv:smallsense 'SmallSense-Smalltalk-Types' 0
+SmallSense::UnknownType SmallSense__UnknownType jv:smallsense 'SmallSense-Smalltalk-Types' 1
+SmallSense::VariablePO SmallSense__VariablePO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::SmalltalkInstvarInterfaceExtractor SmallSense__SmalltalkInstvarInterfaceExtractor jv:smallsense 'SmallSense-Roel Typer (obsolete)' 3
--- a/bc.mak Sun Aug 25 13:05:24 2013 +0100
+++ b/bc.mak Mon Aug 26 10:33:23 2013 +0100
@@ -34,7 +34,7 @@
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libwidg2 -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\goodies\roeltyper -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libview
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\goodies\roeltyper -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg2
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -83,7 +83,6 @@
# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
-$(OUTDIR)SmallSense__Checker.$(O) SmallSense__Checker.$(H): SmallSense__Checker.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\SmalllintChecker.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__CompletionWindow.$(O) SmallSense__CompletionWindow.$(H): SmallSense__CompletionWindow.st $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -93,38 +92,40 @@
$(OUTDIR)SmallSense__PO.$(O) SmallSense__PO.$(H): SmallSense__PO.st $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ParseNodeInspector.$(O) SmallSense__ParseNodeInspector.$(H): SmallSense__ParseNodeInspector.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ParseNodeVisitor.$(O) SmallSense__ParseNodeVisitor.$(H): SmallSense__ParseNodeVisitor.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Parser.$(O) SmallSense__Parser.$(H): SmallSense__Parser.st $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Position.$(O) SmallSense__Position.$(H): SmallSense__Position.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__QuickFixer.$(O) SmallSense__QuickFixer.$(H): SmallSense__QuickFixer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Recognizer.$(O) SmallSense__Recognizer.$(H): SmallSense__Recognizer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ResultSet.$(O) SmallSense__ResultSet.$(H): SmallSense__ResultSet.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SelectorNode.$(O) SmallSense__SelectorNode.$(H): SmallSense__SelectorNode.st $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Service.$(O) SmallSense__Service.$(H): SmallSense__Service.st $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\SmalllintChecker.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkParser.$(O) SmallSense__SmalltalkParser.$(H): SmallSense__SmalltalkParser.st $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkQuickFixer.$(O) SmallSense__SmalltalkQuickFixer.$(H): SmallSense__SmalltalkQuickFixer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkSyntaxHighlighter.$(O) SmallSense__SmalltalkSyntaxHighlighter.$(H): SmallSense__SmalltalkSyntaxHighlighter.st $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) SmallSense__SmalltalkUnacceptedMethodEnvironment.$(H): SmallSense__SmalltalkUnacceptedMethodEnvironment.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers\BrowserEnvironment.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SyntaxHighlightingService.$(O) SmallSense__SyntaxHighlightingService.$(H): SmallSense__SyntaxHighlightingService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Type.$(O) SmallSense__Type.$(H): SmallSense__Type.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeCollector.$(O) SmallSense__TypeCollector.$(H): SmallSense__TypeCollector.st $(INCLUDE_TOP)\stx\goodies\roeltyper\TypeCollector.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeCollectorCache.$(O) SmallSense__TypeCollectorCache.$(H): SmallSense__TypeCollectorCache.st $(INCLUDE_TOP)\stx\libbasic2\CacheDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__TypeHolder.$(O) SmallSense__TypeHolder.$(H): SmallSense__TypeHolder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__UnacceptedMethodEnvironment.$(O) SmallSense__UnacceptedMethodEnvironment.$(H): SmallSense__UnacceptedMethodEnvironment.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers\BrowserEnvironment.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)jv_smallsense.$(O) jv_smallsense.$(H): jv_smallsense.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__AbstractInstvarInterfaceExtractor.$(O) SmallSense__AbstractInstvarInterfaceExtractor.$(H): SmallSense__AbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassInfo.$(O) SmallSense__ClassInfo.$(H): SmallSense__ClassInfo.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Info.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassPO.$(O) SmallSense__ClassPO.$(H): SmallSense__ClassPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ClassType.$(O) SmallSense__ClassType.$(H): SmallSense__ClassType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__ConstantPO.$(O) SmallSense__ConstantPO.$(H): SmallSense__ConstantPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__Finder.$(O) SmallSense__Finder.$(H): SmallSense__Finder.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__ParseNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__GenericEditSupport.$(O) SmallSense__GenericEditSupport.$(H): SmallSense__GenericEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__Inferencer.$(O) SmallSense__Inferencer.$(H): SmallSense__Inferencer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__ParseNodeVisitor.$(H) $(STCHDR)
$(OUTDIR)SmallSense__JavaEditSupport.$(O) SmallSense__JavaEditSupport.$(H): SmallSense__JavaEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__MethodInfo.$(O) SmallSense__MethodInfo.$(H): SmallSense__MethodInfo.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Info.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__MethodPO.$(O) SmallSense__MethodPO.$(H): SmallSense__MethodPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(O) SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(H): SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__SmalltalkParser.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkEditSupport.$(O) SmallSense__SmalltalkEditSupport.$(H): SmallSense__SmalltalkEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkInferencer.$(O) SmallSense__SmalltalkInferencer.$(H): SmallSense__SmalltalkInferencer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__ParseNodeVisitor.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SnippetPO.$(O) SmallSense__SnippetPO.$(H): SmallSense__SnippetPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__UnionType.$(O) SmallSense__UnionType.$(H): SmallSense__UnionType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__UnknownType.$(O) SmallSense__UnknownType.$(H): SmallSense__UnknownType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__VariablePO.$(O) SmallSense__VariablePO.$(H): SmallSense__VariablePO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__InstvarInterfaceExtractor.$(O) SmallSense__InstvarInterfaceExtractor.$(H): SmallSense__InstvarInterfaceExtractor.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkInstvarInterfaceExtractor.$(O) SmallSense__SmalltalkInstvarInterfaceExtractor.$(H): SmallSense__SmalltalkInstvarInterfaceExtractor.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__SmalltalkAbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__SmalltalkParser.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libwidg2\DoWhatIMeanSupport.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/jv_smallsense.st Sun Aug 25 13:05:24 2013 +0100
+++ b/jv_smallsense.st Mon Aug 26 10:33:23 2013 +0100
@@ -40,13 +40,12 @@
(the browser has a menu function for that)"
^ #(
- #'stx:goodies/refactoryBrowser/helpers' "BrowserEnvironment - superclass of SmallSense::UnacceptedMethodEnvironment "
+ #'stx:goodies/refactoryBrowser/helpers' "BrowserEnvironment - superclass of SmallSense::SmalltalkUnacceptedMethodEnvironment "
#'stx:goodies/refactoryBrowser/lint' "RBLintRule - extended "
#'stx:goodies/roeltyper' "TypeCollector - superclass of SmallSense::TypeCollector "
- #'stx:goodies/sunit' "TestAsserter - superclass of SmallSense::BaseTestClass "
- #'stx:libbasic' "Collection - extended "
+ #'stx:libbasic' "Autoload - superclass of SmallSense::BaseTestClass "
#'stx:libbasic2' "CacheDictionary - superclass of SmallSense::TypeCollectorCache "
- #'stx:libcomp' "AbstractSyntaxHighlighter - superclass of SmallSense::AbstractInstvarInterfaceExtractor "
+ #'stx:libcomp' "AbstractSyntaxHighlighter - superclass of SmallSense::SmalltalkAbstractInstvarInterfaceExtractor "
#'stx:libhtml' "HTMLDocumentFrame - extended "
#'stx:libtool' "AbstractSettingsApplication - superclass of SmallSense::SettingsAppl "
#'stx:libview' "DeviceGraphicsContext - extended "
@@ -116,52 +115,53 @@
^ #(
"<className> or (<className> attributes...) in load order"
(#'SmallSense::BaseTestClass' autoload)
- #'SmallSense::Checker'
#'SmallSense::CompletionWindow'
#'SmallSense::CriticsWindow'
#'SmallSense::EditService'
#'SmallSense::EditSupport'
+ (#'SmallSense::FinderTests' autoload)
#'SmallSense::Info'
#'SmallSense::Manager'
#'SmallSense::PO'
#'SmallSense::ParseNodeInspector'
#'SmallSense::ParseNodeVisitor'
- #'SmallSense::Parser'
+ (#'SmallSense::ParserTests' autoload)
#'SmallSense::Position'
- #'SmallSense::QuickFixer'
#'SmallSense::Recognizer'
+ (#'SmallSense::RecognizerTests' autoload)
#'SmallSense::ResultSet'
#'SmallSense::SelectorNode'
- #'SmallSense::Service'
#'SmallSense::SettingsAppl'
+ #'SmallSense::SmalltalkChecker'
+ #'SmallSense::SmalltalkLintService'
+ #'SmallSense::SmalltalkParser'
+ #'SmallSense::SmalltalkQuickFixer'
+ #'SmallSense::SmalltalkSyntaxHighlighter'
+ #'SmallSense::SmalltalkUnacceptedMethodEnvironment'
#'SmallSense::SyntaxHighlightingService'
(#'SmallSense::TestCase' autoload)
#'SmallSense::Type'
#'SmallSense::TypeCollector'
#'SmallSense::TypeCollectorCache'
#'SmallSense::TypeHolder'
- #'SmallSense::UnacceptedMethodEnvironment'
#'jv_smallsense'
- #'SmallSense::AbstractInstvarInterfaceExtractor'
#'SmallSense::ClassInfo'
#'SmallSense::ClassPO'
#'SmallSense::ClassType'
#'SmallSense::ConstantPO'
#'SmallSense::Finder'
- (#'SmallSense::FinderTests' autoload)
#'SmallSense::GenericEditSupport'
- #'SmallSense::Inferencer'
#'SmallSense::JavaEditSupport'
#'SmallSense::MethodInfo'
#'SmallSense::MethodPO'
- (#'SmallSense::ParserTests' autoload)
- (#'SmallSense::RecognizerTests' autoload)
+ #'SmallSense::SmalltalkAbstractInstvarInterfaceExtractor'
#'SmallSense::SmalltalkEditSupport'
+ #'SmallSense::SmalltalkInferencer'
#'SmallSense::SnippetPO'
#'SmallSense::UnionType'
#'SmallSense::UnknownType'
#'SmallSense::VariablePO'
- #'SmallSense::InstvarInterfaceExtractor'
+ #'SmallSense::SmalltalkInstvarInterfaceExtractor'
)
!
--- a/libInit.cc Sun Aug 25 13:05:24 2013 +0100
+++ b/libInit.cc Mon Aug 26 10:33:23 2013 +0100
@@ -27,7 +27,6 @@
void _libjv_smallsense_Init(pass, __pRT__, snd)
OBJ snd; struct __vmData__ *__pRT__; {
__BEGIN_PACKAGE2__("libjv_smallsense", _libjv_smallsense_Init, "jv:smallsense");
-_SmallSense__Checker_Init(pass,__pRT__,snd);
_SmallSense__CompletionWindow_Init(pass,__pRT__,snd);
_SmallSense__CriticsWindow_Init(pass,__pRT__,snd);
_SmallSense__EditService_Init(pass,__pRT__,snd);
@@ -37,38 +36,40 @@
_SmallSense__PO_Init(pass,__pRT__,snd);
_SmallSense__ParseNodeInspector_Init(pass,__pRT__,snd);
_SmallSense__ParseNodeVisitor_Init(pass,__pRT__,snd);
-_SmallSense__Parser_Init(pass,__pRT__,snd);
_SmallSense__Position_Init(pass,__pRT__,snd);
-_SmallSense__QuickFixer_Init(pass,__pRT__,snd);
_SmallSense__Recognizer_Init(pass,__pRT__,snd);
_SmallSense__ResultSet_Init(pass,__pRT__,snd);
_SmallSense__SelectorNode_Init(pass,__pRT__,snd);
-_SmallSense__Service_Init(pass,__pRT__,snd);
_SmallSense__SettingsAppl_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkChecker_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkLintService_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkParser_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkQuickFixer_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkSyntaxHighlighter_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkUnacceptedMethodEnvironment_Init(pass,__pRT__,snd);
_SmallSense__SyntaxHighlightingService_Init(pass,__pRT__,snd);
_SmallSense__Type_Init(pass,__pRT__,snd);
_SmallSense__TypeCollector_Init(pass,__pRT__,snd);
_SmallSense__TypeCollectorCache_Init(pass,__pRT__,snd);
_SmallSense__TypeHolder_Init(pass,__pRT__,snd);
-_SmallSense__UnacceptedMethodEnvironment_Init(pass,__pRT__,snd);
_jv_137smallsense_Init(pass,__pRT__,snd);
-_SmallSense__AbstractInstvarInterfaceExtractor_Init(pass,__pRT__,snd);
_SmallSense__ClassInfo_Init(pass,__pRT__,snd);
_SmallSense__ClassPO_Init(pass,__pRT__,snd);
_SmallSense__ClassType_Init(pass,__pRT__,snd);
_SmallSense__ConstantPO_Init(pass,__pRT__,snd);
_SmallSense__Finder_Init(pass,__pRT__,snd);
_SmallSense__GenericEditSupport_Init(pass,__pRT__,snd);
-_SmallSense__Inferencer_Init(pass,__pRT__,snd);
_SmallSense__JavaEditSupport_Init(pass,__pRT__,snd);
_SmallSense__MethodInfo_Init(pass,__pRT__,snd);
_SmallSense__MethodPO_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkAbstractInstvarInterfaceExtractor_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkEditSupport_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkInferencer_Init(pass,__pRT__,snd);
_SmallSense__SnippetPO_Init(pass,__pRT__,snd);
_SmallSense__UnionType_Init(pass,__pRT__,snd);
_SmallSense__UnknownType_Init(pass,__pRT__,snd);
_SmallSense__VariablePO_Init(pass,__pRT__,snd);
-_SmallSense__InstvarInterfaceExtractor_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkInstvarInterfaceExtractor_Init(pass,__pRT__,snd);
_jv_137smallsense_extensions_Init(pass,__pRT__,snd);
__END_PACKAGE__();
--- a/smallsense.rc Sun Aug 25 13:05:24 2013 +0100
+++ b/smallsense.rc Mon Aug 26 10:33:23 2013 +0100
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.0\0"
- VALUE "ProductDate", "Sat, 24 Aug 2013 21:10:01 GMT\0"
+ VALUE "ProductDate", "Mon, 26 Aug 2013 09:30:14 GMT\0"
END
END