--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Make.proto Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,164 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libtool_smallsense at 2012-01-27 21:20:01.304.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# The Makefile as generated by this Make.proto supports the following targets:
+# make - compile all st-files to a classLib
+# make clean - clean all temp files
+# make clobber - clean all
+#
+# This file contains definitions for Unix based platforms.
+# It shares common definitions with the win32-make in Make.spec.
+
+#
+# position (of this package) in directory hierarchy:
+# (must point to ST/X top directory, for tools and includes)
+TOP=../..
+INCLUDE_TOP=$(TOP)/..
+
+# subdirectories where targets are to be made:
+SUBDIRS=
+
+
+# subdirectories where Makefiles are to be made:
+# (only define if different from SUBDIRS)
+# ALLSUBDIRS=
+
+REQUIRED_SUPPORT_DIRS=
+
+# if your embedded C code requires any system includes,
+# add the path(es) here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALINCLUDES=-Ifoo -Ibar
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/goodies/roeltyper -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libwidg2 -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers
+
+
+# if you need any additional defines for embedded C code,
+# add them here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
+LOCALDEFINES=
+
+LIBNAME=libstx_libtool_smallsense
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=. -varPrefix=$(LIBNAME)
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C-libraries that should be pre-linked with the class-objects
+LD_OBJ_LIBS=
+LOCAL_SHARED_LIBS=
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C targets or libraries should be added below
+LOCAL_EXTRA_TARGETS=
+
+OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
+
+
+
+all:: preMake classLibRule postMake
+
+pre_objs:: update-svn-revision
+
+
+
+update-svn-revision:
+ if [ -d .svn ]; then \
+ rev=$(shell svnversion -n); \
+ if [ ! -r .svnversion -o "$$rev" != "$$(cat .svnversion)" ]; then \
+ echo -n $$rev > .svnversion; \
+ rev2=$$(printf "%15s" \'$$rev\'); \
+ sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"$$rev2\"\$$\"/g" \
+ stx_libtool_smallsense.st; \
+ fi \
+ fi
+.PHONY: update-svn-revision
+
+
+
+
+# add more install actions here
+install::
+
+# add more install actions for aux-files (resources) here
+installAux::
+
+# add more preMake actions here
+preMake::
+
+# add more postMake actions here
+postMake:: cleanjunk
+
+prereq: $(REQUIRED_SUPPORT_DIRS)
+ cd ../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../goodies/refactoryBrowser/helpers && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../goodies/refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libboss && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../libwidg3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../goodies/roeltyper && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../librun && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+cleanjunk::
+ -rm -f *.s *.s2
+
+clean::
+ -rm -f *.o *.H
+
+clobber:: clean
+ -rm -f *.so *.dll
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)SmallSenseInfo.$(O) SmallSenseInfo.$(H): SmallSenseInfo.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseManager.$(O) SmallSenseManager.$(H): SmallSenseManager.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseParseNodeInspector.$(O) SmallSenseParseNodeInspector.$(H): SmallSenseParseNodeInspector.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)SmallSenseParseNodeVisitor.$(O) SmallSenseParseNodeVisitor.$(H): SmallSenseParseNodeVisitor.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseParser.$(O) SmallSenseParser.$(H): SmallSenseParser.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)SmallSensePosition.$(O) SmallSensePosition.$(H): SmallSensePosition.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseRecognizer.$(O) SmallSenseRecognizer.$(H): SmallSenseRecognizer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseResultItem.$(O) SmallSenseResultItem.$(H): SmallSenseResultItem.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseResultSet.$(O) SmallSenseResultSet.$(H): SmallSenseResultSet.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseSelectorNode.$(O) SmallSenseSelectorNode.$(H): SmallSenseSelectorNode.st $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseService.$(O) SmallSenseService.$(H): SmallSenseService.st $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseType.$(O) SmallSenseType.$(H): SmallSenseType.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseTypeCollector.$(O) SmallSenseTypeCollector.$(H): SmallSenseTypeCollector.st $(INCLUDE_TOP)/stx/goodies/roeltyper/TypeCollector.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseTypeCollectorCache.$(O) SmallSenseTypeCollectorCache.$(H): SmallSenseTypeCollectorCache.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)SmallSenseTypeHolder.$(O) SmallSenseTypeHolder.$(H): SmallSenseTypeHolder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnacceptedMethodEnvironment.$(O) SmallSenseUnacceptedMethodEnvironment.$(H): SmallSenseUnacceptedMethodEnvironment.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers/BrowserEnvironment.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseWindow.$(O) SmallSenseWindow.$(H): SmallSenseWindow.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)stx_libtool_smallsense.$(O) stx_libtool_smallsense.$(H): stx_libtool_smallsense.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseAbstractInstvarInterfaceExtractor.$(O) SmallSenseAbstractInstvarInterfaceExtractor.$(H): SmallSenseAbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseParser.$(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)SmallSenseClass.$(O) SmallSenseClass.$(H): SmallSenseClass.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseResultItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseClassInfo.$(O) SmallSenseClassInfo.$(H): SmallSenseClassInfo.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseInfo.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseClassType.$(O) SmallSenseClassType.$(H): SmallSenseClassType.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseConstant.$(O) SmallSenseConstant.$(H): SmallSenseConstant.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseResultItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseFinder.$(O) SmallSenseFinder.$(H): SmallSenseFinder.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseParseNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseInferencer.$(O) SmallSenseInferencer.$(H): SmallSenseInferencer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseParseNodeVisitor.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseMethod.$(O) SmallSenseMethod.$(H): SmallSenseMethod.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseResultItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseMethodInfo.$(O) SmallSenseMethodInfo.$(H): SmallSenseMethodInfo.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseInfo.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseSnippet.$(O) SmallSenseSnippet.$(H): SmallSenseSnippet.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseResultItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnionType.$(O) SmallSenseUnionType.$(H): SmallSenseUnionType.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnknownType.$(O) SmallSenseUnknownType.$(H): SmallSenseUnknownType.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseVariable.$(O) SmallSenseVariable.$(H): SmallSenseVariable.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseResultItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseInstvarInterfaceExtractor.$(O) SmallSenseInstvarInterfaceExtractor.$(H): SmallSenseInstvarInterfaceExtractor.st $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseAbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)/stx/libtool/smallsense/SmallSenseParser.$(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/BlockNode.$(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/libtool/Tools_NavigationState.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__VariableList.$(H) $(INCLUDE_TOP)/stx/libtool/Tools_BrowserList.$(H) $(INCLUDE_TOP)/stx/libtool/Tools_NavigatorModel.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(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) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Make.spec Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,125 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libtool_smallsense at 2012-01-27 21:20:00.139.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains specifications which are common to all platforms.
+#
+
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+# to find the source code of a class and to find the library for a package)
+MODULE=stx
+MODULE_DIR=libtool/smallsense
+PACKAGE=$(MODULE):$(MODULE_DIR)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+# -headerDir=. : create header files locally
+# (if removed, they will be created as common
+# -Pxxx : defines the package
+# -Zxxx : a prefix for variables within the classLib
+# -Dxxx : defines passed to to CC for inline C-code
+# -Ixxx : include path passed to CC for inline C-code
+# +optspace : optimized for space
+# +optspace2 : optimized more for space
+# +optspace3 : optimized even more for space
+# +optinline : generate inline code for some ST constructs
+# +inlineNew : additionally inline new
+# +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=+optspace3
+
+
+# Argument(s) to the stc compiler (stc --usage).
+# -warn : no warnings
+# -warnNonStandard : no warnings about ST/X extensions
+# -warnEOLComments : no warnings about EOL comment extension
+# -warnPrivacy : no warnings about privateClass extension
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=-warnNonStandard
+
+COMMON_CLASSES= \
+ SmallSenseParseNodeVisitor \
+ SmallSenseParser \
+ SmallSenseRecognizer \
+ SmallSenseResultItem \
+ SmallSenseResultSet \
+ SmallSenseSelectorNode \
+ SmallSenseService \
+ SmallSenseTypeCollector \
+ SmallSenseTypeCollectorCache \
+ SmallSenseWindow \
+ stx_libtool_smallsense \
+ SmallSenseAbstractInstvarInterfaceExtractor \
+ SmallSenseClass \
+ SmallSenseConstant \
+ SmallSenseMethod \
+ SmallSenseSnippet \
+ SmallSenseVariable \
+ SmallSenseInstvarInterfaceExtractor \
+ SmallSenseParseNodeInspector \
+ SmallSenseFinder \
+ SmallSensePosition \
+ SmallSenseType \
+ SmallSenseInferencer \
+ SmallSenseInfo \
+ SmallSenseManager \
+ SmallSenseMethodInfo \
+ SmallSenseClassInfo \
+ SmallSenseTypeHolder \
+ SmallSenseClassType \
+ SmallSenseUnionType \
+ SmallSenseUnknownType \
+ SmallSenseUnacceptedMethodEnvironment \
+
+
+
+
+COMMON_OBJS= \
+ $(OUTDIR)SmallSenseParseNodeVisitor.$(O) \
+ $(OUTDIR)SmallSenseParser.$(O) \
+ $(OUTDIR)SmallSenseRecognizer.$(O) \
+ $(OUTDIR)SmallSenseResultItem.$(O) \
+ $(OUTDIR)SmallSenseResultSet.$(O) \
+ $(OUTDIR)SmallSenseSelectorNode.$(O) \
+ $(OUTDIR)SmallSenseService.$(O) \
+ $(OUTDIR)SmallSenseTypeCollector.$(O) \
+ $(OUTDIR)SmallSenseTypeCollectorCache.$(O) \
+ $(OUTDIR)SmallSenseWindow.$(O) \
+ $(OUTDIR)stx_libtool_smallsense.$(O) \
+ $(OUTDIR)SmallSenseAbstractInstvarInterfaceExtractor.$(O) \
+ $(OUTDIR)SmallSenseClass.$(O) \
+ $(OUTDIR)SmallSenseConstant.$(O) \
+ $(OUTDIR)SmallSenseMethod.$(O) \
+ $(OUTDIR)SmallSenseSnippet.$(O) \
+ $(OUTDIR)SmallSenseVariable.$(O) \
+ $(OUTDIR)SmallSenseInstvarInterfaceExtractor.$(O) \
+ $(OUTDIR)SmallSenseParseNodeInspector.$(O) \
+ $(OUTDIR)SmallSenseFinder.$(O) \
+ $(OUTDIR)SmallSensePosition.$(O) \
+ $(OUTDIR)SmallSenseType.$(O) \
+ $(OUTDIR)SmallSenseInferencer.$(O) \
+ $(OUTDIR)SmallSenseInfo.$(O) \
+ $(OUTDIR)SmallSenseManager.$(O) \
+ $(OUTDIR)SmallSenseMethodInfo.$(O) \
+ $(OUTDIR)SmallSenseClassInfo.$(O) \
+ $(OUTDIR)SmallSenseTypeHolder.$(O) \
+ $(OUTDIR)SmallSenseClassType.$(O) \
+ $(OUTDIR)SmallSenseUnionType.$(O) \
+ $(OUTDIR)SmallSenseUnknownType.$(O) \
+ $(OUTDIR)SmallSenseUnacceptedMethodEnvironment.$(O) \
+ $(OUTDIR)extensions.$(O) \
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,19 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+
+.PHONY: run
+
+run: makefile
+ $(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile:
+ $(TOP)/rules/stmkmf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseAbstractInstvarInterfaceExtractor.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,214 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseParser subclass:#SmallSenseAbstractInstvarInterfaceExtractor
+ instanceVariableNames:'stack copied initialStack saveStacks input collector
+ blockTraversal blockArgs'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer'
+!
+
+
+!SmallSenseAbstractInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseAbstractInstvarInterfaceExtractor 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
+! !
+
+!SmallSenseAbstractInstvarInterfaceExtractor 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
+! !
+
+!SmallSenseAbstractInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseAbstractInstvarInterfaceExtractor class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseAbstractInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseBaseTestClass.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,46 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+TestCase subclass:#SmallSenseBaseTestClass
+ instanceVariableNames:'u v'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Tests'
+!
+
+
+!SmallSenseBaseTestClass methodsFor:'generate'!
+
+doForSource:src
+ |parser|
+
+ parser := SmallSenseParser new.
+ parser
+ parseMethod:'gen' , src
+ in:self class
+ ignoreErrors:false
+ ignoreWarnings:false.
+ ^ parser.
+
+ "Created: / 16-03-2011 / 12:27:38 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 17:45:23 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+processMethod: aCompiledMethod
+ "Fail by default. Needs to be overridden by subclasses to trigger the base testing backbone."
+
+ | collector |
+ collector := TypeCollector onClass: self class.
+ collector currentExtractedMethod: aCompiledMethod.
+ TypeCollector new newExtractor
+ extractInterfacesFrom: aCompiledMethod source class:aCompiledMethod mclass
+ addTo: collector.
+ ^collector
+
+ "Created: / 17-03-2011 / 16:56:07 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseBaseTestClass class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseBaseTestClass.st 7700 2011-04-06 19:18:57Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseClass.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,39 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseResultItem subclass:#SmallSenseClass
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseClass methodsFor:'accessing'!
+
+icon
+
+ icon ifNil:[icon := SystemBrowser iconForClass: subject].
+ ^icon
+
+ "Created: / 06-04-2011 / 23:36:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+subject: aClass
+
+ super subject: aClass.
+ name := aClass name.
+
+ "Created: / 06-04-2011 / 21:02:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClass methodsFor:'testing'!
+
+isSmallSenseClass
+ ^ true
+! !
+
+!SmallSenseClass class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseClass.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseClassInfo.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,106 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseInfo subclass:#SmallSenseClassInfo
+ instanceVariableNames:'className methods instvars'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Model'
+!
+
+
+!SmallSenseClassInfo class methodsFor:'instance creation'!
+
+new
+ "return an initialized instance"
+
+ ^ self basicNew initialize.
+! !
+
+!SmallSenseClassInfo methodsFor:'accessing'!
+
+className
+ ^ className
+!
+
+infoForInstvar: ivarName
+
+ ^instvars at: ivarName ifAbsentPut:[
+ SmallSenseType default.
+ ]
+
+ "Created: / 27-11-2011 / 16:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+infoForInstvarOrNil: ivarName
+
+ ^instvars at: ivarName ifAbsent: nil
+
+ "Created: / 27-11-2011 / 17:15:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+infoForSelector: selector
+
+ ^methods at: selector ifAbsentPut:[
+ SmallSenseMethodInfo new setManager: manager classInfo: self selector: selector.
+
+ ]
+
+ "Created: / 27-11-2011 / 16:26:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+infoForSelectorOrNil: selector
+
+ ^methods at: selector ifAbsent:nil
+
+ "Created: / 27-11-2011 / 17:15:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+superclassInfo
+
+ | nm meta cls |
+
+ (className endsWith:' class') ifTrue:[
+ nm := (className copyTo: className size - 6) asSymbol.
+ meta := true.
+ ] ifFalse:[
+ nm := className asSymbol.
+ meta := false.
+ ].
+ cls := Smalltalk at: nm.
+ cls isNil ifTrue:[ ^ nil ].
+ meta ifTrue:[cls := cls theMetaclass].
+
+ ^ manager infoForClass: cls superclass
+
+ "Modified: / 29-11-2011 / 16:02:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassInfo methodsFor:'initialization'!
+
+initialize
+ "Invoked when a new instance is created."
+
+ "/ please change as required (and remove this comment)
+ "/ superclassInfo := nil.
+ "/ className := nil.
+ methods := Dictionary new.
+ instvars := Dictionary new.
+
+ "/ super initialize. -- commented since inherited method does nothing
+
+ "Modified: / 27-11-2011 / 16:53:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+setManager: mgr className: nm
+
+ manager := mgr.
+ className := nm
+
+ "Created: / 29-11-2011 / 15:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassInfo class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseClassInfo.st 7840 2011-12-16 08:48:11Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseClassType.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,89 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseType subclass:#SmallSenseClassType
+ instanceVariableNames:'klass'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Types'
+!
+
+
+!SmallSenseClassType methodsFor:'accessing'!
+
+klass
+ ^ klass
+!
+
+klass:aClass
+ klass := aClass.
+! !
+
+!SmallSenseClassType methodsFor:'comparing'!
+
+= another
+
+ ^self class == another class
+ and:[klass == another klass]
+
+ "Modified: / 16-12-2011 / 13:38:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hash
+
+ ^ klass hash
+
+ "Modified: / 16-12-2011 / 13:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassType methodsFor:'enumerating'!
+
+classesDo:aBlock
+ "Enumerate all classes that this type represents"
+
+ ^ aBlock value: klass
+
+ "Modified: / 16-12-2011 / 13:33:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassType methodsFor:'operations'!
+
+classSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new klass: klass class
+
+ "Modified: / 16-12-2011 / 13:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new klass: klass theNonMetaclass
+
+ "Modified: / 16-12-2011 / 13:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassType methodsFor:'printing & storing'!
+
+printWithoutAnglesOn:aStream
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ klass printOn: aStream
+
+ "Modified: / 16-12-2011 / 01:54:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassType methodsFor:'testing'!
+
+isClassType
+
+ ^true
+
+ "Created: / 16-12-2011 / 02:00:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseClassType class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseClassType.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseConstant.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,21 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseResultItem subclass:#SmallSenseConstant
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseConstant methodsFor:'testing'!
+
+isSmallSenseConstant
+ ^ true
+! !
+
+!SmallSenseConstant class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseConstant.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseFinder.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,70 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseParseNodeVisitor subclass:#SmallSenseFinder
+ instanceVariableNames:'position match previous'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseFinder methodsFor:'finding'!
+
+findNodeIn: source tree: tree line: line column: col
+
+ | sourceS |
+ sourceS := source readStream.
+ line - 1 timesRepeat:[
+ (sourceS nextLine) isNil ifTrue:[
+ "No such line"
+ ^nil
+ ].
+ ].
+ ^self findNodeIn: source tree: tree position: sourceS position + col
+
+ "Created: / 26-11-2011 / 15:33:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+findNodeIn: source tree: tree position: pos
+
+ position := pos - 1.
+ self visit: tree.
+ ^SmallSensePosition node: match ? previous position: pos.
+
+ "Created: / 26-11-2011 / 15:37:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseFinder methodsFor:'visiting'!
+
+visit:anObject
+
+ anObject isNil ifTrue:[^self].
+
+ (position > anObject endPosition) ifTrue:[
+ previous := anObject.
+ anObject acceptVisitor: self.
+ ^self.
+ ].
+
+ (position between: anObject startPosition and: anObject endPosition) ifTrue:[
+ match := anObject.
+ anObject acceptVisitor: self.
+ ].
+
+ "Created: / 26-11-2011 / 15:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitStatementNode:anObject
+
+ self visit: anObject expression.
+ self visit: anObject nextStatement.
+
+ "Modified: / 25-07-2011 / 22:34:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 26-11-2011 / 15:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseFinder class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseFinder.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseFinderTests.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,9696 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseTestCase subclass:#SmallSenseFinderTests
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Tests'
+!
+
+
+!SmallSenseFinderTests methodsFor:'BeforeStatementTests'!
+
+testBeforeStatement1
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement isNil).
+
+ "Created: / 02-03-2011 / 20:02:25 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement10
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 20:16:47 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement11
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:23
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 21:13:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement12
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:24
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 21:13:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement13
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:25
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 21:20:04 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement14
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:26
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+ self assert:(foundNode beforeStatement name = 'u').
+
+ "Created: / 02-03-2011 / 21:20:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement15
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:31
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+ self assert:(foundNode beforeStatement name = 'u').
+
+ "Created: / 02-03-2011 / 21:37:15 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement16
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:32
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 21:37:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement17
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:33
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 21:42:47 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement18
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:35
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 21:44:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement19
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:36
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 21:45:11 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement2
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:24
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 20:02:40 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement20
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:38
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 21:59:58 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement21
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:40
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 22:00:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement22
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 22:13:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement23
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:22
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 22:13:51 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement24
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:23
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 22:14:12 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement25
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:29
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 22:14:52 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement26
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:30
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:18:54 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement27
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:31
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:31:14 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement28
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:32
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:37:05 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement29
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:33
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:37:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement3
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:26
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 20:07:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement30
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:40
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:37:57 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement31
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:43:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement32
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:22
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:44:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement33
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:23
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 22:44:48 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement34
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:24
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 22:51:21 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement35
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:29
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 22:51:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement36
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:30
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:51:50 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement37
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:31
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:52:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement38
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:33
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isConstant).
+
+ "Created: / 02-03-2011 / 22:52:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement39
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:35
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 22:57:40 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement4
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:27
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 20:07:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement40
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:37
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:58:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement41
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 22:58:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement42
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:26
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelf).
+
+ "Created: / 02-03-2011 / 22:59:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement43
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:45
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:00:06 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement44
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:49
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:01:40 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 00:05:41 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement45
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:51
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:02:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement46
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:55
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:03:14 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement47
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:60
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:04:14 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement48
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:63
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:04:38 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement49
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:65
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:14:59 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement5
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 20:07:50 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement50
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:68
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:15:18 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement51
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:73
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:15:34 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement52
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:75
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:16:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement53
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:77
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:16:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement54
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:83
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:16:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement55
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:17:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement56
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:28
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:43:04 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement57
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:41
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:43:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement58
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:44
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 23:44:12 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement59
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:9
+ position:42
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 23:44:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement6
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:22
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 20:15:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement60
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:22
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 23:46:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement61
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:27
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:46:50 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement62
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:45
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:47:36 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement63
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:35
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 23:57:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement64
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:51
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isBlock).
+
+ "Created: / 02-03-2011 / 23:58:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement65
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u .
+ d floor: 3 b:u .
+ self rememberSymbolUsed:nil . c call: b . b call: c dd:d .
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:61
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 23:59:03 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement7
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:23
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 20:15:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement8
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:24
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 20:15:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBeforeStatement9
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:27
+ tree:collector tree.
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 02-03-2011 / 20:16:10 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseFinderTests methodsFor:'FinderTests'!
+
+testFinder1
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u .
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ] .
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:1
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode position) = 1).
+ self assert:((foundNode line) = 3).
+ self assert:(foundNode node isNil).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 22-02-2011 / 14:40:34 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 27-02-2011 / 23:36:22 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder10
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3 .
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:24
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 5).
+ self assert:((foundNode position) = 24).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:46:15 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 25-02-2011 / 17:13:25 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder100
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:22
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 22).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:29:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder101
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 18).
+ self assert:(foundNode node charIndex = 23).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:44:06 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder102
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:24
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 24).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 18).
+ self assert:(foundNode node charIndex = 23).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:45:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder103
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 25).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 18.
+ self assert:(foundNode node selectorsPosition = 24).
+ self assert:(foundNode node selectors asString = '==').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:45:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder104
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:26
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 18.
+ self assert:(foundNode node selectorsPosition = 24).
+ self assert:(foundNode node selectors asString = '==').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:48:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder105
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:27
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 27).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = #Symbol).
+ self assert:(foundNode node line = 18).
+ self assert:(foundNode node charIndex = 27).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:48:41 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder106
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:34
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 34).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = #Symbol).
+ self assert:(foundNode node line = 18).
+ self assert:(foundNode node charIndex = 27).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:49:43 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder107
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:35
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 35).
+ self assert:(foundNode node isMessage).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:52:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder108
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:36
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 36).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 18.
+ self assert:((foundNode node selectorsPosition at:1) = 36).
+ self assert:(foundNode node selectors asString = 'or:').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:53:20 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder109
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:39
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 39).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 18.
+ self assert:((foundNode node selectorsPosition at:1) = 36).
+ self assert:(foundNode node selectors asString = 'or:').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:55:26 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder11
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:29
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 5).
+ self assert:((foundNode position) = 29).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:47:36 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 28-02-2011 / 19:52:00 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder110
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:40
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 40).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 18.
+ self assert:((foundNode node selectorsPosition at:1) = 36).
+ self assert:(foundNode node selectors asString = 'or:').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:56:26 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder111
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:19
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 19).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode node isMessage).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:57:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder112
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:42
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 42).
+ self assert:(foundNode node isMessage).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:39:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder113
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:19
+ position:25
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 19).
+ self assert:((foundNode position) = 25).
+ self assert:(foundNode node isMessage).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:46:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder114
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:19
+ position:27
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 19).
+ self assert:((foundNode position) = 27).
+ self assert:(foundNode node isBlock).
+ self assert:(foundNode node lineNumber = 18).
+ self assert:(foundNode node endLineNumber = 19).
+ self assert:(foundNode node charStartIndex = 40).
+ self assert:(foundNode node charEndIndex = 26).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:47:30 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder115
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:19
+ position:29
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 19).
+ self assert:((foundNode position) = 29).
+ self assert:(foundNode node isBlock).
+ self assert:(foundNode node lineNumber = 18).
+ self assert:(foundNode node endLineNumber = 19).
+ self assert:(foundNode node charStartIndex = 40).
+ self assert:(foundNode node charEndIndex = 26).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:48:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder116
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:19
+ position:30
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 19).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isBlock).
+ self assert:(foundNode node lineNumber = 18).
+ self assert:(foundNode node endLineNumber = 19).
+ self assert:(foundNode node charStartIndex = 21).
+ self assert:(foundNode node charEndIndex = 29).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:48:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder117
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:23
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 23).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'dd').
+ self assert:(foundNode node line = 23).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:54:03 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder118
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+
+.
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:27
+ position:23
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 27).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isBlock).
+ self assert:(foundNode node lineNumber = 26).
+ self assert:(foundNode node endLineNumber = 27).
+ self assert:(foundNode node charStartIndex = 27).
+ self assert:(foundNode node charEndIndex = 21).
+ self assert:((foundNode node) ~= (foundNode statement)).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:56:23 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder119
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [
+ u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+
+.
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:26
+ position:29
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 26).
+ self assert:((foundNode position) = 29).
+ self assert:(foundNode node isMessage).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 19:59:44 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder12
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 6).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:48:20 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder13
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 21).
+ self assert:((foundNode line) = 6).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 6).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:48:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder14
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 22).
+ self assert:((foundNode line) = 6).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 6).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:49:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder15
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 23).
+ self assert:((foundNode line) = 6).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:49:48 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder16
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:24
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 24).
+ self assert:((foundNode line) = 6).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 6).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:50:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder17
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 25).
+ self assert:((foundNode line) = 6).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 6).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:51:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder18
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:6
+ position:26
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 6).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:51:45 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 25-02-2011 / 17:31:30 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder19
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 7).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:52:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder2
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 21).
+ self assert:((foundNode line) = 3).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 3).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:34:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder20
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 21).
+ self assert:((foundNode line) = 7).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode node name = 'c').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder21
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 22).
+ self assert:((foundNode line) = 7).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode node name = 'c').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder22
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 7).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 14:30:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder23
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:24
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 24).
+ self assert:((foundNode line) = 7).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder24
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 25).
+ self assert:((foundNode line) = 7).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder26
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:7
+ position:26
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode position) = 26).
+ self assert:((foundNode line) = 7).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder27
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:1
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode position) = 1).
+ self assert:((foundNode line) = 8).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 7).
+ self assert:(foundNode node charIndex = 24).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder28
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 25).
+ self assert:((foundNode line) = 8).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 8.
+ self assert:(foundNode node selectorsPosition = 25).
+ self assert:(foundNode node selectors asString = 'floor').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder29
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:30
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 30).
+ self assert:((foundNode line) = 8).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 8.
+ self assert:(foundNode node selectorsPosition = 25).
+ self assert:(foundNode node selectors asString = 'floor').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder3
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 22).
+ self assert:((foundNode line) = 3).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node line = 3).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:36:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder30
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:8
+ position:32
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode position) = 32).
+ self assert:((foundNode line) = 8).
+ self assert:(foundNode node isUnaryMessage).
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder31
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:9
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 25).
+ self assert:((foundNode line) = 9).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node lines size = 1).
+ self assert:(foundNode node lines at:1) = 9.
+ self assert:(foundNode node selectorsPosition = 25).
+ self assert:(foundNode node selectors asString = 'aa').
+ self assert:(foundNode statement isAssignment)
+!
+
+testFinder32
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:9
+ position:28
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 9).
+ self assert:((foundNode position) = 28).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 14:41:23 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 25-02-2011 / 17:40:06 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder33
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:9
+ position:30
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 9).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 14:32:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder34
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:9
+ position:31
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 9).
+ self assert:((foundNode position) = 31).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:33:08 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder35
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:34:07 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder36
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 10).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:34:41 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder37
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 22).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 10).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:36:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder38
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:23
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 10).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:37:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder39
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:24
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 24).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 24).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 10).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:37:53 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:08:24 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder4
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 23).
+ self assert:((foundNode line) = 3).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:39:04 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder40
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:27
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 27).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 24).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 10).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:43:08 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:08:34 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder41
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:29
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 29).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 24).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 10).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:43:42 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:08:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder42
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:30
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 24).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 10).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:43:57 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:08:45 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder43
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:31
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 31).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 10).
+ self assert:(foundNode node charIndex = 31).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:44:31 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder44
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:32
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 32).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 10).
+ self assert:(foundNode node charIndex = 31).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:45:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder45
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:10
+ position:33
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 10).
+ self assert:((foundNode position) = 33).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:45:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder46
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 14:47:00 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder47
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:34:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder48
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 22).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:36:14 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder49
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 31).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:36:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:08:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder5
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:1
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode position) = 1).
+ self assert:((foundNode line) = 4).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:40:43 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder50
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:28
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 28).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 31).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:41:42 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:01 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder51
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:29
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 29).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = 3).
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 29).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:42:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder52
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:30
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = 3).
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 29).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:54:26 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder53
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:31
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 31).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = 3).
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 29).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:55:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder54
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:32
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 32).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 32).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:55:30 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:06 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder55
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:33
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 33).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 32).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:56:34 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:12 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder550
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:30
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 34).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 03-03-2011 / 21:01:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder551
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor: 3 b: u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:37
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 37).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'floor:b:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 23).
+ self assert:((foundNode node selectorsPosition at:2) = 34).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 11).
+ self assert:((foundNode node lines at:2) = 11).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 03-03-2011 / 21:02:22 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:22 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder552
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor: 3 b: u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:38
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 38).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 03-03-2011 / 21:02:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder553
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor: 3 b: u .
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:40
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 40).
+ self assert:(foundNode node isMessage).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 03-03-2011 / 21:04:05 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder56
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:34
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 34).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 34).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:56:58 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder57
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:35
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 35).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'u').
+ self assert:(foundNode node line = 11).
+ self assert:(foundNode node charIndex = 34).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:57:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder58
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:11
+ position:36
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 11).
+ self assert:((foundNode position) = 36).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:58:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder59
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:58:52 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder6
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:20
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 5).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:41:15 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder60
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isSelf).
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 15:59:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder61
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 25).
+ self assert:(foundNode node isSelf).
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:04:08 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder62
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:26
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors isSymbol).
+ self assert:(foundNode node selectors asString = 'rememberSymbolUsed:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 26).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 12).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:04:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder63
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:44
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 44).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors isSymbol).
+ self assert:(foundNode node selectors asString = 'rememberSymbolUsed:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 26).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 12).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:06:15 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder64
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil. c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:45
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 45).
+ self assert:(foundNode node isConstant).
+ self assert:((foundNode node type) = #Nil).
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 45).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:06:43 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder65
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:48
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 48).
+ self assert:(foundNode node isConstant).
+ self assert:((foundNode node type) = #Nil).
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 45).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:08:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder66
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:49
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 49).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:09:03 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder67
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:50
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 50).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:29:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder68
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b. b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:51
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 51).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:29:26 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder69
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:52
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 52).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'c').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 52).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:30:18 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder7
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 4).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:42:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder70
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:53
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 53).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'c').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 52).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:31:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder71
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:54
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 54).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'c').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 52).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:32:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder72
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call:b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:55
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 55).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'call:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 55).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 12).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 16:32:49 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder73
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:59
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 59).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'call:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 55).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 12).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:28:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder74
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:60
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 60).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors asString = 'call:').
+ self assert:(foundNode node selectorsPosition size = 1).
+ self assert:((foundNode node selectorsPosition at:1) = 55).
+ self assert:(foundNode node lines size = 1).
+ self assert:((foundNode node lines at:1) = 12).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:29:57 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:09:38 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder75
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:61
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 61).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 61).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:30:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder76
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:62
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 62).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 61).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:31:03 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder77
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:64
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 64).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:31:44 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder78
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:65
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 65).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:34:50 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder79
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:66
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 66).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 66).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:35:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder8
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:22
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 5).
+ self assert:((foundNode position) = 22).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = 3).
+ self assert:(foundNode node line = 5).
+ self assert:(foundNode node charIndex = 22).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:43:50 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder80
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:79
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 79).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'd').
+ self assert:(foundNode node line = 12).
+ self assert:(foundNode node charIndex = 78).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 17:36:26 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder81
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:12
+ position:80
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 12).
+ self assert:((foundNode position) = 80).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:36:59 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder82
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:13
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 13).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:38:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder83
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:13
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 13).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'array').
+ self assert:(foundNode node line = 13).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:39:51 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder84
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:13
+ position:26
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 13).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'array').
+ self assert:(foundNode node line = 13).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:40:54 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder85
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:13
+ position:30
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 13).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node type = #Array).
+ self assert:(foundNode node line = 13).
+ self assert:(foundNode node charIndex = 30).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:41:18 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder86
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:14
+ position:30
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 14).
+ self assert:((foundNode position) = 30).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node type = #Array).
+ self assert:(foundNode node line = 13).
+ self assert:(foundNode node charIndex = 30).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:42:54 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder87
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:15
+ position:22
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 15).
+ self assert:((foundNode position) = 22).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:43:20 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder88
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:44:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder89
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'val').
+ self assert:(foundNode node line = 16).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 17:51:48 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder9
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil.
+ array:=#(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:5
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 5).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode node value = 3).
+ self assert:(foundNode node line = 5).
+ self assert:(foundNode node charIndex = 22).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 25-02-2011 / 13:44:06 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder90
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:24
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 24).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'val').
+ self assert:(foundNode node line = 16).
+ self assert:(foundNode node charIndex = 21).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:16:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder91
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 25).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:16:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder92
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:27
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 27).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:17:24 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder93
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:28
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 28).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name isSymbol).
+ self assert:(foundNode node name asString = 'ConstantNode').
+ self assert:(foundNode node line = 16).
+ self assert:(foundNode node charIndex = 28).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:17:40 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder94
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:40
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 40).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name isSymbol).
+ self assert:(foundNode node name asString = 'ConstantNode').
+ self assert:(foundNode node line = 16).
+ self assert:(foundNode node charIndex = 28).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:19:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder95
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:17
+ position:41
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 17).
+ self assert:((foundNode position) = 41).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode node selectors isSymbol).
+ self assert:(foundNode node selectors asString = 'type:value:').
+ self assert:(foundNode node selectorsPosition size = 2).
+ self assert:((foundNode node selectorsPosition at:1) = 41).
+ self assert:((foundNode node selectorsPosition at:2) = 41).
+ self assert:(foundNode node lines size = 2).
+ self assert:((foundNode node lines at:1) = 16).
+ self assert:((foundNode node lines at:2) = 17).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:19:53 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder96
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:16
+ position:55
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 16).
+ self assert:((foundNode position) = 55).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'tokenType').
+ self assert:(foundNode node line = 16).
+ self assert:(foundNode node charIndex = 46).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:23:07 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder97
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:17
+ position:57
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 17).
+ self assert:((foundNode position) = 57).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'tokenValue').
+ self assert:(foundNode node line = 17).
+ self assert:(foundNode node charIndex = 47).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 28-02-2011 / 18:24:30 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder98
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:20
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 20).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:25:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinder99
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd tokenType array|
+ u
+ :=
+ 3.
+ b:=u.
+ c:=u
+ floor
+ aa .
+ d floor: u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4
+ 5 6
+ ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:18
+ position:21
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 18).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 28-02-2011 / 18:26:31 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseFinderTests methodsFor:'FinderTestsErrorNode'!
+
+testFinderErrorNode1
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:1
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 2).
+ self assert:((foundNode position) = 1).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 15:34:00 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode10
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 f
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:9
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 9).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:27:59 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode11
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:14
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 14).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:29:25 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode12
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: (
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:16
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 16).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:30:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode13
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( s
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:18
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 18).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:31:44 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode14
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:21
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 21).
+ self assert:(foundNode node isSelf).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:33:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode15
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:22
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 22).
+ self assert:(foundNode node isSelf).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:33:20 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode16
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:23
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 23).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:35:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode17
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:26
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:36:02 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode18
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:25
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 25).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 02-03-2011 / 17:38:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 03-03-2011 / 18:22:41 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode19
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:26
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 26).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 02-03-2011 / 20:01:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 03-03-2011 / 18:23:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode2
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:2
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 2).
+ self assert:((foundNode position) = 2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken = ':=').
+ self assert:(foundNode beforeStatement isNil).
+
+ "Created: / 02-03-2011 / 15:34:12 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode20
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:)
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:27
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 27).
+ self assert:(foundNode node isErrorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 03-03-2011 / 18:24:01 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode21
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) r
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:28
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 28).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isMessage).
+
+ "Created: / 03-03-2011 / 18:26:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode22
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) round:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:34
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 34).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 03-03-2011 / 18:27:16 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode23
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) round: a
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:36
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 36).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 03-03-2011 / 21:05:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode24
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) round: a:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:37
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 37).
+ self assert:(foundNode node isSelectorNode).
+ self assert:(foundNode statement isAssignment).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isSelectorNode).
+
+ "Created: / 03-03-2011 / 21:05:49 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode25
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) round: a:.
+:
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:2
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 4).
+ self assert:((foundNode position) = 2).
+ self assert:(foundNode node isErrorNode).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 03-03-2011 / 21:09:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode26
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3 floor: ( self b b:) round: a:.
+:=
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:4
+ position:3
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 4).
+ self assert:((foundNode position) = 3).
+ self assert:(foundNode node isErrorNode).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isAssignment).
+
+ "Created: / 03-03-2011 / 21:12:12 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode3
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+||
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:2
+ position:3
+ tree:collector tree.
+ self assert:(foundNode beforeNode).
+ self assert:((foundNode line) = 2).
+ self assert:((foundNode position) = 3).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 16:31:36 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode4
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:2
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 2).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 3).
+ self assert:(foundNode node charIndex = 1).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 02-03-2011 / 16:33:15 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode5
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:3
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 3).
+ self assert:(foundNode node isVariable).
+ self assert:(foundNode node name = 'b').
+ self assert:(foundNode node line = 3).
+ self assert:(foundNode node charIndex = 1).
+ self assert:(foundNode statement isMessage).
+
+ "Created: / 02-03-2011 / 16:38:07 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode6
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b :
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:4
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 4).
+ self assert:(foundNode node isErrorNode).
+ self assert:(foundNode node errorToken = ':').
+ self assert:(foundNode node line = 3).
+ self assert:(foundNode node charIndex = 3).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode beforeStatement notNil).
+ self assert:(foundNode beforeStatement isVariable).
+
+ "Created: / 02-03-2011 / 16:38:34 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode7
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b :=
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:5
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 5).
+ self assert:(foundNode node isAssignment).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 16:41:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode8
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:7
+ tree:collector tree.
+ self assert:(foundNode inNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 7).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:26:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testFinderErrorNode9
+ |collector finder foundNode|
+
+ collector := self
+ doForSource:'
+|helperNode b c d|
+b := 3
+ u := 3.
+ b:=u.
+ c:=u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ finder := SmallSenseFinder new.
+ foundNode := finder
+ find:3
+ position:8
+ tree:collector tree.
+ self assert:(foundNode afterNode).
+ self assert:((foundNode line) = 3).
+ self assert:((foundNode position) = 8).
+ self assert:(foundNode node isConstant).
+ self assert:(foundNode statement isAssignment).
+
+ "Created: / 02-03-2011 / 17:27:33 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseFinderTests class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseFinderTests.st 7705 2011-04-08 09:49:06Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseInferencer.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,419 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseInferencer
+ instanceVariableNames:'class classInfo source parser parserClass tree'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Inference'
+!
+
+SmallSenseParseNodeVisitor subclass:#Phase1
+ instanceVariableNames:'classInfo sends types'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmallSenseInferencer
+!
+
+SmallSenseParseNodeVisitor subclass:#Phase2
+ instanceVariableNames:'classInfo'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmallSenseInferencer
+!
+
+!SmallSenseInferencer 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:]
+
+"
+! !
+
+!SmallSenseInferencer 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>"
+! !
+
+!SmallSenseInferencer methodsFor:'accessing'!
+
+klass
+ ^ class
+
+ "Created: / 26-11-2011 / 17:30:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+manager
+
+ ^SmallSenseManager 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
+! !
+
+!SmallSenseInferencer 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>"
+! !
+
+!SmallSenseInferencer 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>"
+! !
+
+!SmallSenseInferencer 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>"
+! !
+
+!SmallSenseInferencer::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>"
+! !
+
+!SmallSenseInferencer::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>"
+! !
+
+!SmallSenseInferencer::Phase1 methodsFor:'processing'!
+
+process: tree in: cls
+
+ self process: tree in: cls info: (SmallSenseManager 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>"
+! !
+
+!SmallSenseInferencer::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
+
+ super visitBlockNode:anObject.
+
+ anObject inferedType: (SmallSenseType withClass: BlockClosure)
+
+ "Modified: / 25-07-2011 / 22:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "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"
+
+ super visitConstantNode: anObject.
+ anObject inferedType: (SmallSenseType withClass: anObject value class)
+
+ "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:(SmallSenseType withClass: class)
+
+ "Created: / 26-11-2011 / 14:43:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSuperNode:anObject
+
+
+ super visitSuperNode:anObject.
+ anObject inferedType:(SmallSenseType 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 := SmallSenseType withClass: class theNonMetaclass.
+ 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:[SmallSenseType default].
+ anObject inferedType: t.
+
+ anObject isGlobalVariable ifTrue:[
+ t addClass: (Smalltalk at: anObject name) class.
+ ^self.
+ ].
+ anObject isClassVariable ifTrue:[
+ t addClass: (class theNonMetaclass classVarAt: anObject name asSymbol) class.
+ ^self.
+ ].
+
+ "Created: / 26-11-2011 / 13:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseInferencer::Phase2 methodsFor:'processing'!
+
+process: tree in: cls
+
+ self process: tree in: cls info: (SmallSenseManager 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>"
+! !
+
+!SmallSenseInferencer class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseInferencer.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseInfo.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,15 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseInfo
+ instanceVariableNames:'manager'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Model'
+!
+
+
+!SmallSenseInfo class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseInfo.st 7834 2011-11-29 19:25:06Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseInstvarInterfaceExtractor.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,779 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseAbstractInstvarInterfaceExtractor subclass:#SmallSenseInstvarInterfaceExtractor
+ instanceVariableNames:'assingmentsDictionary assigmentsTypeDictionary'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer'
+!
+
+
+!SmallSenseInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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 := SmallSenseInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseInstvarInterfaceExtractor 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>"
+! !
+
+!SmallSenseInstvarInterfaceExtractor class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseInstvarInterfaceExtractor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseManager.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,200 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseManager
+ instanceVariableNames:'classes accessLock updater'
+ classVariableNames:'Instance'
+ poolDictionaries:''
+ category:'SmallSense-Model'
+!
+
+
+!SmallSenseManager class methodsFor:'instance creation'!
+
+flush
+ "flushes the cached singleton"
+
+ Instance := nil
+
+ "
+ self flushSingleton
+ "
+
+ "Created: / 16-12-2011 / 01:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+flushSingleton
+ "flushes the cached singleton"
+
+ Instance := nil
+
+ "
+ self flushSingleton
+ "
+!
+
+instance
+ "returns a singleton"
+
+ Instance isNil ifTrue:[
+ Instance := self basicNew initialize.
+ ].
+ ^ Instance.
+
+ "Created: / 27-11-2011 / 15:30:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+new
+ "returns a singleton"
+
+ ^ self instance.
+
+ "Modified: / 27-11-2011 / 15:30:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'accessing'!
+
+infoForClass: class
+
+ | info |
+
+ accessLock critical:[
+ info := self basicInfoForClass: class.
+ ].
+ ^info
+
+ "Created: / 27-11-2011 / 16:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+infoForClassOrNil: class
+
+ ^classes at: class name ifAbsent: nil
+
+ "Created: / 27-11-2011 / 17:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'accessing-private'!
+
+basicInfoForClass: class
+
+ class isNil ifTrue:[^nil].
+
+ ^classes at: class name ifAbsentPut:[
+ SmallSenseClassInfo new
+ setManager: self
+ className: class name
+ ].
+
+ "Created: / 27-11-2011 / 16:47:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'change & update'!
+
+update:what with:param from:sender
+ "Invoked when an object that I depend upon sends a change notification."
+
+ sender ~~ Smalltalk ifTrue:[
+ super update:what with:param from:sender.
+ ^self.
+ ].
+
+ what == #methodInClass ifTrue:[
+ self updateInfoForMethod: (param first >> param second).
+ ^self.
+ ].
+
+
+"/ Transcript show: 'SmallSense: Smalltalk changed: ', what , ' with: ', param printString.
+
+ "Modified: / 02-12-2011 / 23:41:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'initialization'!
+
+initialize
+ "Invoked when a new instance is created."
+
+ classes := Dictionary new.
+ accessLock := Semaphore forMutualExclusion.
+ updater := BackgroundQueueProcessingJob
+ named: 'SmallSense background updater'
+ on: [:classOrMethod|self delayedUpdateInfoForClassOrMethod: classOrMethod].
+ updater priority: Processor userBackgroundPriority - 1.
+
+ UserPreferences current smallSenseEnabled ifTrue:[
+ Smalltalk addDependent: self.
+ ].
+
+ "Modified (format): / 28-11-2011 / 19:31:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'updating'!
+
+updateInfoForClass: class
+
+ | info |
+
+ info := self infoForClassOrNil: class.
+ info isNil ifTrue:[
+ updater add: class
+ ].
+
+ "Created: / 27-11-2011 / 17:46:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateInfoForMethod: method
+
+ | info |
+
+ info := self basicInfoForClass: method mclass.
+ info isNil ifTrue:[
+ updater add: method mclass
+ ] ifFalse:[
+ updater add: method
+ ]
+
+ "Created: / 28-11-2011 / 19:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager methodsFor:'updating-delayed'!
+
+delayedUpdateInfoForClass: class
+
+ | superclass |
+
+ superclass := class superclass.
+ superclass notNil ifTrue:[self updateInfoForClass: superclass].
+ class methodsDo:[:mthd|updater add:mthd].
+
+ "Created: / 27-11-2011 / 18:04:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+delayedUpdateInfoForClassOrMethod: classOrMethod
+
+ classOrMethod isBehavior ifTrue:[
+ self delayedUpdateInfoForClass: classOrMethod.
+ ].
+ classOrMethod isMethod ifTrue:[
+ self delayedUpdateInfoForMethod: classOrMethod.
+ ]
+
+ "Created: / 27-11-2011 / 18:01:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+delayedUpdateInfoForMethod: method
+
+ | inferencer |
+
+ method mclass isNil ifTrue:["Obsolete method" ^ self ].
+ method mclass programmingLanguage isSmalltalk ifFalse: [ ^ self ].
+"/ Transcript showCR: 'SmallSense: updating info for: ', method printString.
+ inferencer := SmallSenseInferencer forMethod: method.
+ inferencer process.
+
+ "Created: / 27-11-2011 / 18:06:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseManager class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseManager.st 7840 2011-12-16 08:48:11Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseMethod.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,92 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseResultItem subclass:#SmallSenseMethod
+ instanceVariableNames:'class'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseMethod class methodsFor:'Instance creation'!
+
+name:name description:description class:class
+ ^ (self new)
+ name:name;
+ description:description;
+ class:class.
+
+ "Created: / 06-04-2011 / 16:50:05 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseMethod methodsFor:'accessing'!
+
+class:something
+ class := something.
+
+ "Created: / 06-04-2011 / 16:51:42 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+cursorColumnAfterComplete
+
+ | idx |
+ idx := name indexOf: $:.
+ ^idx == 0 ifTrue:[name size + 1] ifFalse:[idx + 1].
+
+ "Created: / 05-04-2011 / 17:08:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+
+ ^super label
+
+"/ label ifNil:
+"/ [label := name asText , ((' [' , class name , ']') asText colorizeAllWith: Color gray).
+"/ ].
+"/ ^label
+
+ "Created: / 07-04-2011 / 09:56:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 21-05-2011 / 10:59:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringToComplete
+
+ ^String
+ fromStringCollection: (name tokensBasedOn: $:)
+ separatedBy: ': '.
+
+ "Created: / 05-04-2011 / 16:51:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseMethod methodsFor:'displaying'!
+
+displayOn:aGC x:x y:y opaque:opaque
+
+ | lw cn cnw fg |
+
+ super displayOn:aGC x:x y:y opaque:opaque.
+ lw := x + 16 + (self label widthOn: aGC).
+ cn := class nameWithoutPrefix.
+ cnw := aGC widthOfString: cn.
+
+ (aGC width > (lw + cnw + 5)) ifTrue:
+ [fg := aGC paint.
+ aGC paint: Color gray .
+ aGC displayString: cn x: aGC width - cnw - 5 y: y.
+ aGC paint: fg.
+ ]
+
+ "Created: / 21-05-2011 / 11:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseMethod methodsFor:'testing'!
+
+isSmallSenseMethod
+ ^ true
+! !
+
+!SmallSenseMethod class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseMethod.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseMethodInfo.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,37 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseInfo subclass:#SmallSenseMethodInfo
+ instanceVariableNames:'classInfo selector returnType'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Model'
+!
+
+
+!SmallSenseMethodInfo class methodsFor:'instance creation'!
+
+forClassInfo: clsInfo selector: sel
+
+ ^self new
+ setClassInfo: clsInfo selector: sel;
+ yourself
+
+ "Created: / 27-11-2011 / 16:37:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseMethodInfo methodsFor:'initialization'!
+
+setManager: mgr classInfo: clsInfo selector: sel
+
+ manager := mgr.
+ classInfo := clsInfo.
+ selector := sel.
+
+ "Created: / 29-11-2011 / 15:58:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseMethodInfo class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseMethodInfo.st 7834 2011-11-29 19:25:06Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseParseNodeInspector.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,589 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+ApplicationModel subclass:#SmallSenseParseNodeInspector
+ instanceVariableNames:'nodeHolder sourceHolder sourceView inspectorView'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Perseus-UI-AST Inspector'
+!
+
+HierarchicalItem subclass:#ParseNodeItem
+ instanceVariableNames:'astNode ivarName'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SmallSenseParseNodeInspector
+!
+
+
+!SmallSenseParseNodeInspector class methodsFor:'instance creation'!
+
+node: node source: source
+
+ ^self new node: node source: source
+
+ "Created: / 14-09-2011 / 17:25:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'interface opening'!
+
+openOnClass: class selector: selector
+
+ ^self new
+ class: class;
+ selector: selector;
+ open
+
+ "Created: / 26-11-2011 / 12:30:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'interface specs'!
+
+inspectorTabSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:Tools::ParseNodeInspector andSelector:#inspectorTabSpec
+ Tools::ParseNodeInspector new openInterface:#inspectorTabSpec
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(FullSpec
+ name: inspectorTabSpec
+ window:
+ (WindowSpec
+ label: 'InspectorTab'
+ name: 'InspectorTab'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 300 300)
+ )
+ component:
+ (SpecCollection
+ collection: (
+ (NonScrollableArbitraryComponentSpec
+ name: 'InspectorView'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ component: parseNodeInspectorView
+ )
+ )
+
+ )
+ )
+!
+
+sourceTabSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:Tools::ParseNodeInspector andSelector:#sourceTabSpec
+ Tools::ParseNodeInspector new openInterface:#sourceTabSpec
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(FullSpec
+ name: sourceTabSpec
+ window:
+ (WindowSpec
+ label: 'SourceTab'
+ name: 'SourceTab'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 300 300)
+ )
+ component:
+ (SpecCollection
+ collection: (
+ (TextEditorSpec
+ name: 'SourceView'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: sourceHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ hasKeyboardFocusInitially: false
+ postBuildCallback: postBuildSourceView:
+ )
+ )
+
+ )
+ )
+
+ "Modified: / 14-09-2011 / 17:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:SmallSenseParseNodeInspector andSelector:#windowSpec
+ SmallSenseParseNodeInspector new openInterface:#windowSpec
+ SmallSenseParseNodeInspector open
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(FullSpec
+ name: windowSpec
+ window:
+ (WindowSpec
+ label: 'Parse Tree Inspector'
+ name: 'Parse Tree Inspector'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 630 322)
+ )
+ component:
+ (SpecCollection
+ collection: (
+ (VariableHorizontalPanelSpec
+ name: 'QueryTreeAndSourcePanel'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ showHandle: true
+ snapMode: both
+ handlePosition: right
+ component:
+ (SpecCollection
+ collection: (
+ (HierarchicalListViewSpec
+ name: 'QueryTree'
+ model: selectionHolder
+ menu: queryTreeMenu
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: parseTree
+ useIndex: false
+ highlightMode: line
+ useDefaultIcons: false
+ )
+ (UISubSpecification
+ name: 'SourceSoec'
+ minorKey: sourceTabSpec
+ )
+ )
+
+ )
+ handles: (Any 0.3 1.0)
+ )
+ )
+
+ )
+ )
+
+ "Modified: / 26-11-2011 / 12:22:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+windowSpecWithInspector
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:Tools::ParseNodeInspector andSelector:#windowSpec
+ Tools::ParseNodeInspector new openInterface:#windowSpec
+ Tools::ParseNodeInspector open
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(FullSpec
+ name: windowSpec
+ window:
+ (WindowSpec
+ label: 'Parse Tree Inspector'
+ name: 'Parse Tree Inspector'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 630 322)
+ )
+ component:
+ (SpecCollection
+ collection: (
+ (VariableHorizontalPanelSpec
+ name: 'QueryTreeAndSourcePanel'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ showHandle: true
+ snapMode: both
+ handlePosition: right
+ component:
+ (SpecCollection
+ collection: (
+ (HierarchicalListViewSpec
+ name: 'QueryTree'
+ model: selectionHolder
+ menu: queryTreeMenu
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: parseTree
+ useIndex: false
+ highlightMode: line
+ useDefaultIcons: false
+ )
+ (NoteBookViewSpec
+ name: 'NoteBook'
+ menu: tabList
+ )
+ )
+
+ )
+ handles: (Any 0.3 1.0)
+ )
+ )
+
+ )
+ )
+
+ "Created: / 26-11-2011 / 11:41:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'list specs'!
+
+tabList
+ "This resource specification was automatically generated
+ by the TabListEditor of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the TabListEditor may not be able to read the specification."
+
+ "
+ TabListEditor new openOnClass: self andSelector:#tabList
+ "
+
+ <resource: #tabList>
+
+ ^ #(
+ (TabItem
+ label: 'Source'
+ createNewBuilder: false
+ minorKey: sourceTabSpec
+ )
+ (TabItem
+ label: 'Object'
+ createNewBuilder: false
+ minorKey: inspectorTabSpec
+ )
+ )
+
+ collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]
+
+ "Modified: / 31-10-2007 / 12:21:19 / janfrog"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'menu specs'!
+
+queryTreeMenu
+ "This resource specification was automatically generated
+ by the MenuEditor of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the MenuEditor may not be able to read the specification."
+
+ "
+ MenuEditor new openOnClass:XQuery::QueryInspectorUI andSelector:#queryTreeMenu
+ (Menu new fromLiteralArrayEncoding:(XQuery::QueryInspectorUI queryTreeMenu)) startUp
+ "
+
+ <resource: #menu>
+
+ ^
+ #(Menu
+ (
+ (MenuItem
+ label: 'Inspect AST node'
+ itemValue: queryTreeMenuInspectAstNode
+ translateLabel: true
+ )
+ )
+ nil
+ nil
+ )
+
+ "Created: / 12-04-2007 / 11:46:57 / janfrog"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'plugIn spec'!
+
+aspectSelectors
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this. If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "Return a description of exported aspects;
+ these can be connected to aspects of an embedding application
+ (if this app is embedded in a subCanvas)."
+
+ ^ #(
+ #model
+ ).
+
+! !
+
+!SmallSenseParseNodeInspector methodsFor:'accessing'!
+
+node: node source: source
+
+ self nodeHolder value: node.
+ self sourceHolder value: source.
+
+ "Created: / 14-09-2011 / 17:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selection
+
+ | item |
+ (item := self selectionHolder value) notNil ifTrue:[
+ ^item
+ ] ifFalse:[
+ ^nil
+ ]
+
+ "Created: / 12-04-2007 / 12:29:08 / janfrog"
+ "Created: / 26-11-2011 / 11:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector methodsFor:'aspects'!
+
+nodeHolder
+ "return/create the 'nodeHolder' value holder (automatically generated)"
+
+ nodeHolder isNil ifTrue:[
+ nodeHolder := ValueHolder new.
+ ].
+ ^ nodeHolder
+!
+
+nodeHolder:something
+ "set the 'nodeHolder' value holder (automatically generated)"
+
+ nodeHolder := something.
+!
+
+nodeInspectorView
+
+ inspectorView ifNil:[inspectorView := InspectorView new].
+ ^inspectorView
+
+ "Created: / 31-10-2007 / 12:20:02 / janfrog"
+ "Created: / 14-09-2011 / 17:24:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+parseTree
+
+ ^self
+ aspectAt: #parseTree
+ ifAbsentPut:
+ [PluggableAdaptor on: self nodeHolder getter:
+ [:m|
+ | rootAstNodeItem hl |
+ rootAstNodeItem := ParseNodeItem new
+ ivarName: 'AST';
+ astNode: self nodeHolder value.
+
+ hl := HierarchicalList new
+ root: rootAstNodeItem;
+ showRoot: true.
+ rootAstNodeItem expand.
+ hl]]
+
+ "Created: / 28-03-2007 / 15:58:31 / janfrog"
+ "Modified: / 31-10-2007 / 12:11:46 / janfrog"
+ "Created: / 14-09-2011 / 17:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectionHolder
+
+ ^self
+ aspectAt: #selectionHolder
+ ifAbsentPut:
+ [nil asValue
+ onChangeSend:#updateSourceViewSelection to:self;
+ onChangeSend:#updateInspectorView to:self;
+ yourself]
+
+ "Created: / 28-03-2007 / 16:46:30 / janfrog"
+ "Modified: / 31-10-2007 / 12:25:54 / janfrog"
+ "Created: / 14-09-2011 / 17:24:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+sourceHolder
+ "return/create the 'sourceHolder' value holder (automatically generated)"
+
+ sourceHolder isNil ifTrue:[
+ sourceHolder := ValueHolder new.
+ ].
+ ^ sourceHolder
+!
+
+sourceHolder:something
+ "set the 'sourceHolder' value holder (automatically generated)"
+
+ sourceHolder := something.
+!
+
+tabList
+ "Generated by the TabListEditor"
+
+ |list|
+
+ (list := builder bindingAt:#tabList) isNil ifTrue:[
+ builder aspectAt:#tabList put:(list := self class tabList).
+ ].
+ ^ list
+
+ "Created: / 31-10-2007 / 12:21:18 / janfrog"
+! !
+
+!SmallSenseParseNodeInspector methodsFor:'callbacks - post build'!
+
+postBuildSourceView: aView
+
+ sourceView := aView scrolledView
+
+ "Created: / 12-04-2007 / 12:28:14 / janfrog"
+! !
+
+!SmallSenseParseNodeInspector methodsFor:'change & update'!
+
+updateInspectorView
+
+ inspectorView notNil ifTrue:[
+ inspectorView inspect: self selection node
+ ]
+
+ "Created: / 31-10-2007 / 12:25:25 / janfrog"
+ "Modified: / 26-11-2011 / 11:48:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateSourceViewSelection
+
+ | astNode startPosition stopPosition |
+ sourceView ifNil:[^self].
+ (astNode := self selection) ifNil:[^self].
+ (startPosition := astNode node startPosition)
+ ifNil:[^sourceView unselect].
+ (stopPosition := astNode node endPosition)
+ ifNil:[^sourceView unselect].
+
+ sourceView
+ selectFromCharacterPosition: startPosition
+ to: stopPosition
+
+ "Created: / 12-04-2007 / 12:29:42 / janfrog"
+ "Modified: / 26-11-2011 / 11:48:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector methodsFor:'menu actions'!
+
+queryTreeMenuInspectAstNode
+
+ ^self selection node inspect
+
+ "Created: / 12-04-2007 / 11:47:48 / janfrog"
+ "Modified: / 26-11-2011 / 12:12:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector::ParseNodeItem class methodsFor:'documentation'!
+
+version
+ ^'$Id: SmallSenseParseNodeInspector.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
+
+!SmallSenseParseNodeInspector::ParseNodeItem methodsFor:'accessing'!
+
+astNode
+ ^ astNode
+
+ "Created: / 28-03-2007 / 15:51:49 / janfrog"
+!
+
+astNode:anAstNode
+ astNode := anAstNode.
+
+ "Created: / 28-03-2007 / 15:51:49 / janfrog"
+!
+
+astNodeName
+
+ ^astNode class name
+
+ "Created: / 12-04-2007 / 11:29:57 / janfrog"
+ "Modified: / 31-10-2007 / 12:13:34 / janfrog"
+ "Modified: / 26-11-2011 / 10:47:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+children
+
+ children isNil ifTrue:[
+ children := OrderedCollection new.
+ astNode childNamesAndValuesDo:[:ivarName :astNode|
+ astNode notNil ifTrue:[
+ children add: (self class new
+ ivarName: ivarName;
+ astNode: astNode;
+ parent: self)
+ ]
+ ].
+ ].
+ ^children
+
+ "Created: / 28-03-2007 / 15:55:24 / janfrog"
+ "Modified: / 12-04-2007 / 11:35:24 / janfrog"
+ "Modified: / 26-11-2011 / 10:46:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+icon
+
+ ^nil
+
+ "Created: / 31-10-2007 / 12:14:52 / janfrog"
+ "Modified: / 26-11-2011 / 10:47:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+ivarName
+ ^ ivarName ? '?'
+
+ "Created: / 12-04-2007 / 11:29:28 / janfrog"
+!
+
+ivarName:something
+ ivarName := something.
+
+ "Created: / 12-04-2007 / 11:29:28 / janfrog"
+!
+
+label
+
+ ^self ivarName ,' <', self astNodeName, '>'
+
+ "Created: / 28-03-2007 / 15:53:18 / janfrog"
+ "Modified: / 12-04-2007 / 11:30:23 / janfrog"
+!
+
+node
+ ^ astNode
+
+ "Created: / 28-03-2007 / 15:51:49 / janfrog"
+ "Created: / 26-11-2011 / 11:48:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeInspector class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseParseNodeInspector.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseParseNodeVisitor.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,198 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseParseNodeVisitor
+ instanceVariableNames:'class'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+!SmallSenseParseNodeVisitor class methodsFor:'documentation'!
+
+documentation
+"
+ An abstract parse tree visitor. Copied from libcomp
+ as ParseNodeVisitor is autoloaded and we need smallsense
+ to be fully compiled.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!SmallSenseParseNodeVisitor class methodsFor:'instance creation'!
+
+new
+ "return an initialized instance"
+
+ ^ self basicNew initialize.
+! !
+
+!SmallSenseParseNodeVisitor class methodsFor:'processing'!
+
+process: tree in: class
+
+ ^self new process: tree in: class
+
+ "Created: / 26-11-2011 / 13:48:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeVisitor methodsFor:'initialization'!
+
+initialize
+ "Invoked when a new instance is created."
+
+ "/ please change as required (and remove this comment)
+
+ "/ super initialize. -- commented since inherited method does nothing
+! !
+
+!SmallSenseParseNodeVisitor methodsFor:'processing'!
+
+process: tree in: cls
+
+ class := cls.
+ self visit: tree
+
+ "Created: / 26-11-2011 / 13:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeVisitor methodsFor:'visiting'!
+
+visit:anObject
+
+ | stmt |
+
+ ^anObject isStatementNode ifTrue:[
+ stmt := anObject.
+ [ stmt isNil ] whileFalse:[
+ stmt acceptVisitor:self.
+ stmt := stmt nextStatement.
+ ]
+ ] ifFalse:[
+ anObject acceptVisitor: self.
+ ]
+
+ "Modified: / 25-07-2011 / 22:33:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitAssignmentNode:anObject
+
+ self visit: anObject variable.
+ self visit: anObject expression.
+
+ "Modified: / 26-11-2011 / 13:20:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitBinaryNode:anObject
+
+ ^self visitMessageNode: anObject
+
+ "Modified: / 25-07-2011 / 22:30:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitBlockNode:anObject
+
+ anObject statements ifNotNil:[
+ self visit: anObject statements
+ ].
+
+ "Modified: / 25-07-2011 / 22:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitCascadeNode:anObject
+
+ self visitMessageNode: anObject.
+
+ "Modified: / 25-07-2011 / 22:37:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitConstantNode:anObject
+
+ "Modified: / 25-07-2011 / 22:41:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitECompletionConstantNode:anObject
+ "dispatched back from the visited eCompletionConstantNode-object (visitor pattern)"
+
+ "fall back to general object-case - please change as required"
+
+ ^ self visitObject:anObject
+!
+
+visitMessageNode:anObject
+
+ self visit: anObject receiver.
+ anObject arguments do:[:arg|
+ self visit: arg.
+ ]
+
+ "Modified: / 25-07-2011 / 22:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitObject:anObject
+ "dispatched back from the visited objects (visitor pattern)"
+
+ "general fallBack - please change as required"
+
+ self halt:'not yet implemented'
+!
+
+visitParseErrorNode:anObject
+
+ "Modified: / 25-07-2011 / 22:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitPrimitiveNode:anObject
+
+ "Modified: / 25-07-2011 / 22:38:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitReturnNode:anObject
+
+ self visitStatementNode: anObject
+
+ "Modified: / 25-07-2011 / 22:34:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSelfNode:anObject
+
+ "Modified: / 25-07-2011 / 22:38:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitStatementNode:anObject
+
+ self visit: anObject expression.
+
+ "Modified: / 25-07-2011 / 22:34:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSuperNode:anObject
+
+ "Modified: / 25-07-2011 / 22:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitUnaryNode:anObject
+
+ self visitMessageNode: anObject
+
+ "Modified: / 25-07-2011 / 22:38:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitVariableNode:anObject
+
+ "Modified: / 25-07-2011 / 22:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParseNodeVisitor class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseParseNodeVisitor.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseParser.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,238 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SyntaxHighlighter subclass:#SmallSenseParser
+ instanceVariableNames:'error'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseParser methodsFor:'error handling'!
+
+parseError:message position:startPos to:endPos
+
+ error := ParseErrorNode new
+ errorString: message;
+ errorToken: tokenType asString;
+ startPosition: startPos endPosition: endPos.
+ ^error
+
+ "Created: / 27-11-2011 / 09:35:19 / 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>"
+! !
+
+!SmallSenseParser methodsFor:'parsing'!
+
+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>"
+! !
+
+!SmallSenseParser 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
+
+ "Modified: / 27-07-2010 / 08:57:02 / cg"
+ "Modified: / 18-02-2011 / 21:40:33 / Jakub <zelenja7@fel.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
+
+ "Modified: / 18-10-2006 / 19:37:50 / cg"
+ "Created: / 07-02-2011 / 18:09:31 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 22:40:05 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 27-11-2011 / 09:42:58 / 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
+
+ "Modified: / 20-11-2006 / 14:05:52 / cg"
+ "Created: / 07-02-2011 / 17:10:44 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:34:56 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 27-11-2011 / 16:11:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParser methodsFor:'syntax coloring'!
+
+markBracketAt:pos
+
+ sourceText ifNil:[^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 ifNil:[^self].
+ super markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
+
+ "Created: / 03-04-2011 / 22:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseParser class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseParser.st 7827 2011-11-27 17:24:24Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseParserTests.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,875 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseTestCase subclass:#SmallSenseParserTests
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Tests'
+!
+
+
+!SmallSenseParserTests methodsFor:'parseTests'!
+
+test1
+ |collector|
+ collector := self
+ doForSource:'
+ |u w b c d tokenValue val uu bb cc dd |
+ u := 3.
+ b:=u.
+ c:=u floor.
+ d floor:u.
+ d floor:3 b:u.
+ self rememberSymbolUsed:tokenValue.
+ array:=#( 3 4 5 6 ).
+ val := ConstantNode type:tokenType value:tokenValue.
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ].
+ ^self.
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+
+ "Created: / 21-12-2010 / 23:07:13 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 22-02-2011 / 12:35:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test10
+ |collector|
+
+ collector := self
+ doForSource:'
+ | b|
+ u := 3.
+ b:=u.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree nextStatement nextStatement) isNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression expression) isConstant.
+ self assert:(collector tree nextStatement expression) isAssignment.
+ self assert:(collector tree nextStatement expression variable) isVariable.
+ self
+ assert:(collector tree nextStatement expression expression) isVariable.
+
+ "Created: / 15-02-2011 / 15:23:50 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 16:49:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test11
+ |collector|
+ collector := self
+ doForSource:'
+ | b|
+ u := 3
+ b:=u.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree nextStatement nextStatement nextStatement) isNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression variable name= 'u').
+ self assert:(collector tree expression expression) isUnaryMessage.
+ self assert:(collector tree expression expression receiver) isConstant.
+ self assert:(collector tree expression expression receiver value=3) .
+ self assert:(collector tree expression expression selector asString)='b'.
+ self assert:(collector tree expression expression args isNil ).
+ self assert:(collector tree nextStatement expression) isErrorNode.
+ self assert:(collector tree nextStatement expression errorToken)= ':='.
+ self assert:(collector tree nextStatement nextStatement expression) isVariable.
+ self assert:(collector tree nextStatement nextStatement expression name)='u'.
+
+ "Created: / 15-02-2011 / 15:24:01 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 16:58:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test12
+ |collector|
+ collector := self
+ doForSource:'
+ | b|
+ : 3
+ '.
+self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree nextStatement nextStatement) isNil.
+ self assert:(collector tree expression) isErrorNode.
+ self assert:(collector tree expression errorToken =':').
+ self assert:(collector tree nextStatement expression) isConstant.
+ self assert:(collector tree nextStatement expression value=3).
+
+ "Created: / 15-02-2011 / 15:25:36 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 17:08:54 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test13
+ |collector|
+
+ collector := self
+ doForSource:'
+ | b|
+ u := 3
+ :=u.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self
+ assert:(collector tree nextStatement nextStatement nextStatement) isNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression variable name = 'u').
+ self assert:(collector tree expression expression) isConstant.
+ self assert:(collector tree expression expression value =3).
+ self assert:(collector tree nextStatement expression) isErrorNode.
+ self assert:(collector tree nextStatement expression errorToken) = ':='.
+ self
+ assert:(collector tree nextStatement nextStatement expression) isVariable.
+ self
+ assert:(collector tree nextStatement nextStatement expression name) = 'u'.
+
+ "Created: / 15-02-2011 / 16:48:11 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 17:21:48 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test14
+ |collector|
+ collector := self
+ doForSource:'
+ | b|
+ u := 3
+ :u.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self
+ assert:(collector tree nextStatement nextStatement nextStatement) isNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression variable name = 'u').
+ self assert:(collector tree expression expression) isConstant.
+ self assert:(collector tree expression expression value =3).
+ self assert:(collector tree nextStatement expression) isErrorNode.
+ self assert:(collector tree nextStatement expression errorToken) = ':'.
+ self
+ assert:(collector tree nextStatement nextStatement expression) isVariable.
+ self
+ assert:(collector tree nextStatement nextStatement expression name) = 'u'.
+
+ "Created: / 15-02-2011 / 17:03:42 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 19:52:39 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test15
+ |collector|
+ collector := self
+ doForSource:'
+ | b|
+ u := 3
+ =u.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self
+ assert:(collector tree nextStatement ) isNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression variable name = 'u').
+ self assert:(collector tree expression expression) isBinaryMessage.
+ self assert:(collector tree expression expression receiver value =3).
+ self assert:(collector tree expression expression receiver ) isConstant.
+ self assert:(collector tree expression expression selector )= #=.
+ self assert:(collector tree expression expression args size=1 ).
+ self assert:(collector tree expression expression arg ) isVariable.
+ self assert:(collector tree expression expression arg name='u' ).
+
+ "Created: / 15-02-2011 / 17:04:33 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 19:56:28 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test19
+ |collector|
+ collector := self
+ doForSource:'
+ |b c|
+ u := 3 u:=
+ c u floor.
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isAssignment.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isUnaryMessage.
+
+ "Created: / 15-02-2011 / 18:15:51 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:00:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test2
+
+ |collector|
+ collector := self
+ doForSource:'
+ u :'.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:(collector tree expression name ='u').
+self assert:(collector tree expression) isVariable.
+self assert:(collector tree nextStatement expression isErrorNode).
+self assert: collector tree nextStatement expression errorToken=':'.
+
+ "Created: / 09-02-2011 / 20:54:42 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:04:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test24
+ |collector|
+ collector := self
+ doForSource:'
+ |u w|
+ self : '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isSelf.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':'.
+
+ "Created: / 15-02-2011 / 18:37:23 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:02:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test25
+ |collector|
+" collector := self
+ doForSource:'
+ |u w|
+ self :=5 '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isSelf.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isConstant."
+
+ "Created: / 15-02-2011 / 18:37:56 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 28-02-2011 / 17:28:20 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test26
+ |collector|
+ collector := self
+ doForSource:'
+ |u w|
+ false :=5 '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isConstant.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isConstant.
+
+ "Created: / 15-02-2011 / 19:50:17 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:05:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test27
+ |collector|
+ collector := self
+ doForSource:'
+ |u w|
+ nil :=5 '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isConstant.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isConstant.
+
+ "Created: / 15-02-2011 / 19:51:02 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:05:32 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test28
+ |collector|
+ collector := self
+ doForSource:'
+ |d w tokenValue|
+ d floor:3 b:u
+ self rememberSymbolUsed:tokenValue. '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+
+ "Created: / 15-02-2011 / 19:52:23 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:06:33 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test29
+ |collector|
+ collector := self
+ doForSource:'
+ |d u w|
+ d floor:3 b:u
+ self '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+
+ "Created: / 15-02-2011 / 19:53:15 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:06:46 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test3
+ |collector|
+
+ collector := self doForSource:'
+ u ='.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isBinaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector) == #=.
+ self assert:(collector tree expression args size) = 1.
+ self assert:(collector tree expression arg) isErrorNode.
+ self assert:(collector tree expression arg errorToken = 'EOF').
+
+ "Created: / 11-02-2011 / 15:32:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:20:22 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test30
+ |collector|
+ collector := self
+ doForSource:'
+ |array |
+ self rememberSymbolUsed:tokenValue
+ array:=#( 3 4 5 6 ). '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+
+ "Created: / 15-02-2011 / 19:54:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test31
+ |collector|
+ collector := self
+ doForSource:'
+ |array tokenValue|
+ self rememberSymbolUsed:tokenValue
+ array:=( 3 4 5 6 ). '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isMessage.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isUnaryMessage.
+
+ "Created: / 16-02-2011 / 15:51:47 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:15:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test32
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w|
+ [u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+
+ ].
+
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+
+ "Created: / 16-02-2011 / 15:54:07 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test33
+ |collector|
+
+ collector := self
+ doForSource:'
+ |uu w|
+ u== #Symbol or:[u=3]]ifTrue:[
+ uu := 4.
+
+ ].
+
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:collector tree expression isMessage.
+ self assert:collector tree expression receiver isBinaryMessage.
+ self assert:collector tree expression receiver receiver isVariable.
+ self assert:collector tree expression receiver receiver name = 'u'.
+ self assert:collector tree expression receiver selector = #'=='.
+ self assert:collector tree expression receiver args size = 1.
+ self assert:collector tree expression receiver arg isConstant.
+ self assert:collector tree expression receiver arg value = #Symbol.
+ self assert:collector tree expression selector = #or:.
+ self assert:collector tree expression args size = 1.
+ self assert:collector tree expression arg1 isBlock.
+ self assert:collector tree expression arg1 statements expression
+ isBinaryMessage.
+ self assert:collector tree nextStatement expression isErrorNode.
+ self assert:collector tree nextStatement expression errorToken = ']'.
+ self
+ assert:collector tree nextStatement nextStatement expression isMessage.
+ self
+ assert:collector tree nextStatement nextStatement expression receiver
+ isErrorNode.
+ self
+ assert:collector tree nextStatement nextStatement expression receiver
+ errorToken = 'Keyword'.
+ self
+ assert:collector tree nextStatement nextStatement expression selector
+ = #ifTrue:.
+ self
+ assert:collector tree nextStatement nextStatement expression args size = 1.
+ self
+ assert:collector tree nextStatement nextStatement expression arg1
+ statements expression
+ isAssignment.
+
+ "Created: / 16-02-2011 / 15:55:49 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:52:03 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test34
+ |collector|
+ collector := self
+ doForSource:'
+ |array |
+ self rememberSymbolUsed:tokenValue
+ array:=#( 3 4 5 6 . '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isMessage.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isConstant.
+
+ "Created: / 16-02-2011 / 16:09:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:16:54 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test35
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w|
+ [u== #Symbol or:u=3]]ifTrue:[
+ uu := 4.
+
+ ].
+
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:collector tree expression isBlock.
+ self assert:collector tree expression statements expression isMessage.
+ self assert:collector tree expression statements expression receiver isBinaryMessage.
+ self assert:collector tree expression statements expression receiver receiver isVariable.
+ self assert:collector tree expression statements expression receiver receiver name = 'u'.
+ self assert:collector tree expression statements expression receiver selector = #'=='.
+ self assert:collector tree expression statements expression receiver args size = 1.
+ self assert:collector tree expression statements expression receiver arg isConstant.
+ self assert:collector tree expression statements expression receiver arg value = #Symbol.
+ self assert:collector tree expression statements expression selector = #or:.
+ self assert:collector tree expression statements expression args size = 1.
+ self assert:collector tree expression statements expression arg1 isBinaryMessage.
+ self assert:collector tree nextStatement expression isErrorNode.
+ self assert:collector tree nextStatement expression errorToken = ']'.
+ self
+ assert:collector tree nextStatement nextStatement expression isMessage.
+ self
+ assert:collector tree nextStatement nextStatement expression receiver
+ isErrorNode.
+ self
+ assert:collector tree nextStatement nextStatement expression receiver
+ errorToken = 'Keyword'.
+ self
+ assert:collector tree nextStatement nextStatement expression selector
+ = #ifTrue:.
+ self
+ assert:collector tree nextStatement nextStatement expression args size = 1.
+ self
+ assert:collector tree nextStatement nextStatement expression arg1
+ statements expression
+ isAssignment.
+
+ "Created: / 16-02-2011 / 16:47:18 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 20:56:11 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test36
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w|
+ [u== #Symbol ifTrue:[
+ uu := 4.
+
+ ].
+
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:collector tree expression isBlock.
+ self assert:collector tree expression statements expression isMessage.
+ self assert:collector tree expression statements expression receiver isBinaryMessage.
+ self assert:collector tree expression statements expression receiver receiver isVariable.
+ self assert:collector tree expression statements expression receiver receiver name = 'u'.
+ self assert:collector tree expression statements expression receiver selector = #'=='.
+ self assert:collector tree expression statements expression receiver args size = 1.
+ self assert:collector tree expression statements expression receiver arg isConstant.
+ self assert:collector tree expression statements expression receiver arg value = #Symbol.
+ self assert:collector tree expression statements expression selector = #ifTrue: .
+ self assert:collector tree expression statements expression args size = 1.
+ self assert:collector tree expression statements expression arg1 isBlock.
+ self assert:collector tree expression statements expression arg1 statements expression
+ isAssignment.
+
+ "Created: / 16-02-2011 / 16:48:07 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 21:13:22 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test37
+ |collector|
+
+ collector := self
+ doForSource:'
+ |uu w|
+ [u== #Symbol) ifTrue:[
+ uu := 4.
+
+ ].
+
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:collector tree expression isBlock.
+ self
+ assert:collector tree expression statements expression isBinaryMessage.
+ self
+ assert:collector tree expression statements expression receiver name = 'u'.
+ self
+ assert:collector tree expression statements expression selector = #'=='.
+ self assert:collector tree expression statements expression args size = 1.
+ self
+ assert:collector tree expression statements expression arg1 value = #Symbol.
+ self
+ assert:collector tree expression statements nextStatement expression
+ isErrorNode.
+ self
+ assert:collector tree expression statements nextStatement expression
+ errorToken = ')'.
+ self
+ assert:collector tree expression statements nextStatement nextStatement
+ expression isMessage.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression
+ receiver isErrorNode.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression
+ receiver errorToken
+ = 'Keyword'.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression
+ selector = #ifTrue:.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression args
+ size = 1.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression arg1
+ isBlock.
+ self
+ assert:collector tree expression statements nextStatement nextStatement expression arg1
+ statements expression
+ isAssignment.
+
+ "Created: / 16-02-2011 / 17:21:06 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 21:25:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test38
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w|
+ [:=
+
+ ].
+
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isBlock.
+self assert:collector tree expression statements expression isErrorNode.
+self assert:collector tree expression statements expression errorToken=':='.
+
+ "Created: / 18-02-2011 / 11:55:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 21:40:40 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test39
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w|
+ :=3
+
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isErrorNode.
+self assert:collector tree expression errorToken=':='.
+self assert:collector tree nextStatement expression isConstant.
+self assert:collector tree nextStatement expression value=3.
+
+ "Created: / 18-02-2011 / 17:11:24 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test4
+ |collector|
+
+ collector := self doForSource:'
+ u 3'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isUnaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector asString) = '3'.
+
+ "Created: / 15-02-2011 / 14:13:48 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:10:14 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test40
+ |collector|
+ collector := self
+ doForSource:'
+ |array tokenValue|
+ self rememberSymbolUsed:tokenValue
+ array:=( 3 4 5 6. '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isMessage.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isUnaryMessage.
+
+ "Created: / 18-02-2011 / 20:17:31 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test41
+ |collector|
+ collector := self
+ doForSource:'
+ |array tokenValue|
+ self rememberSymbolUsed:tokenValue
+ array:=( 3 4 5 6 :=u '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isMessage.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isUnaryMessage.
+self assert:collector tree nextStatement nextStatement nextStatement expression isErrorNode.
+self assert:collector tree nextStatement nextStatement nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement nextStatement nextStatement expression isVariable.
+
+ "Created: / 18-02-2011 / 20:35:35 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test42
+ |collector|
+ collector := self
+ doForSource:'
+ |array tokenValue|
+ self rememberSymbolUsed:tokenValue
+ array:= 3 4 5 6 :=u) '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isMessage.
+self assert:collector tree nextStatement expression isErrorNode.
+self assert:collector tree nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement expression isUnaryMessage.
+self assert:collector tree nextStatement nextStatement nextStatement expression isErrorNode.
+self assert:collector tree nextStatement nextStatement nextStatement expression errorToken=':='.
+self assert:collector tree nextStatement nextStatement nextStatement nextStatement expression isVariable.
+self assert:collector tree nextStatement nextStatement nextStatement nextStatement nextStatement expression isErrorNode.
+self assert:collector tree nextStatement nextStatement nextStatement nextStatement nextStatement expression errorToken=')'.
+
+ "Created: / 18-02-2011 / 20:37:17 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test43
+ |collector|
+ collector := self
+ doForSource:'
+ |uu w b|
+ [u== #Symbol ifTrue:[
+ uu := 4.
+
+ ].
+ b:=3
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:collector tree expression isBlock.
+ self assert:collector tree expression statements expression isMessage.
+ self assert:collector tree expression statements expression receiver isBinaryMessage.
+ self assert:collector tree expression statements expression receiver receiver isVariable.
+ self assert:collector tree expression statements expression receiver receiver name = 'u'.
+ self assert:collector tree expression statements expression receiver selector = #'=='.
+ self assert:collector tree expression statements expression receiver args size = 1.
+ self assert:collector tree expression statements expression receiver arg isConstant.
+ self assert:collector tree expression statements expression receiver arg value = #Symbol.
+ self assert:collector tree expression statements expression selector = #ifTrue: .
+ self assert:collector tree expression statements expression args size = 1.
+ self assert:collector tree expression statements expression arg1 isBlock.
+ self assert:collector tree expression statements expression arg1 statements expression
+ isAssignment.
+
+ "Created: / 18-02-2011 / 21:16:10 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test44
+ |collector|
+ collector := self
+ doForSource:'
+ |b c|
+ u :=b b: u:c
+ '.
+self assert:collector notNil.
+self assert:collector tree notNil.
+self assert:collector tree expression isAssignment.
+
+ "Created: / 20-02-2011 / 18:54:11 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test5
+ |collector|
+
+ collector := self doForSource:'
+ u +'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isBinaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector) isSymbol.
+ self assert:(collector tree expression selector asString) = '+'.
+ self assert:(collector tree expression args size) = 1.
+ self assert:(collector tree expression arg) isErrorNode.
+ self assert:(collector tree expression arg errorToken = 'EOF').
+
+ "Created: / 15-02-2011 / 15:18:25 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:31:37 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test6
+ |collector|
+
+ collector := self doForSource:'
+ u +.'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isBinaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector) isSymbol.
+ self assert:(collector tree expression selector asString) = '+'.
+ self assert:(collector tree expression args size) = 1.
+ self assert:(collector tree expression arg) isErrorNode.
+ self assert:(collector tree expression arg errorToken = '.').
+
+ "Created: / 15-02-2011 / 15:19:08 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:32:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test7
+ |collector|
+
+ collector := self doForSource:'
+ u 3.'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isUnaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector asString) = '3'.
+
+ "Created: / 15-02-2011 / 15:19:22 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 22:10:21 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test8
+ |collector|
+
+ collector := self doForSource:'
+ u =.'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isBinaryMessage.
+ self assert:(collector tree expression receiver name = 'u').
+ self assert:(collector tree expression receiver) isVariable.
+ self assert:(collector tree expression selector) == #'='.
+ self assert:(collector tree expression args size) = 1.
+ self assert:(collector tree expression arg) isErrorNode.
+ self assert:(collector tree expression arg errorToken = '.').
+
+ "Created: / 15-02-2011 / 15:19:38 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:34:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+test9
+ |collector|
+
+ collector := self doForSource:'
+ u :.'.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression name = 'u').
+ self assert:(collector tree expression) isVariable.
+ self assert:(collector tree nextStatement expression isErrorNode).
+ self assert:collector tree nextStatement expression errorToken = ':'.
+ self assert:collector tree nextStatement nextStatement isNil.
+
+ "Created: / 15-02-2011 / 15:19:52 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-02-2011 / 15:35:42 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testBadAssignment
+ |collector|
+
+ collector := self doForSource:'
+ u := '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ self assert:(collector tree expression) isAssignment.
+ self assert:(collector tree expression variable name = 'u').
+ self assert:(collector tree expression variable) isVariable.
+ self assert:(collector tree expression expression) isErrorNode.
+ self assert:(collector tree expression expression errorToken = 'EOF').
+
+ "Modified: / 18-02-2011 / 15:39:33 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseParserTests class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseParserTests.st 7694 2011-04-04 19:53:25Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSensePosition.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,68 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSensePosition
+ instanceVariableNames:'node position position1'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSensePosition class methodsFor:'instance creation'!
+
+node: node position: position
+
+ ^self new node: node position: position
+
+ "Created: / 26-11-2011 / 16:22:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSensePosition methodsFor:'accessing'!
+
+node
+ ^ node
+!
+
+position
+ ^ position
+! !
+
+!SmallSensePosition methodsFor:'initialization'!
+
+node:nd position: pos
+
+ node := nd.
+ position := pos.
+ position1 := pos - 1
+
+ "Created: / 26-11-2011 / 16:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSensePosition methodsFor:'queries'!
+
+afterNode
+
+ ^node endPosition < position1
+
+ "Created: / 26-11-2011 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+beforeNode
+
+ ^position < node startPosition
+
+ "Created: / 26-11-2011 / 16:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+inNode
+
+ ^position1 between: node startPosition and: node endPosition
+
+ "Created: / 26-11-2011 / 16:24:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSensePosition class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSensePosition.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseRecognizer.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,756 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseRecognizer
+ instanceVariableNames:'resultSet collector'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseRecognizer class methodsFor:'utilities'!
+
+old_resultSetFor: mode source: source class: class row: row column: col
+
+ | parser tree |
+
+
+ mode == #method ifTrue:[
+ parser := SmallSenseParser new.
+ parser
+ parseMethod:source asString
+ in: class
+ ignoreErrors:false
+ ignoreWarnings:false.
+ ] ifFalse:[
+ parser := SmallSenseParser for: (source asString readStream).
+ "JV@2011-06-13: HACK, use polymorphism"
+ tree := parser
+ parseExpressionWithSelf:nil
+ notifying:nil
+ ignoreErrors:false
+ ignoreWarnings:false
+ inNameSpace:nil.
+ parser tree: tree.
+ ].
+ ^ self new
+ recognize:row
+ position:col
+ collector:parser
+
+ "Modified: / 07-04-2011 / 22:55:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 14:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+resultSetFor: mode source: source class: class line: line column: col
+
+ | inferencer tree |
+
+
+ mode == #method ifTrue:[
+ inferencer := SmallSenseInferencer forClass: class methodSource: source asString.
+ inferencer parserClass: SmallSenseParser.
+ inferencer process.
+ ] ifFalse:[
+ self breakPoint: #jv.
+ ^self.
+ inferencer := SmallSenseParser for: (source asString readStream).
+ "JV@2011-06-13: HACK, use polymorphism"
+ tree := inferencer
+ parseExpressionWithSelf:nil
+ notifying:nil
+ ignoreErrors:false
+ ignoreWarnings:false
+ inNameSpace:nil.
+ inferencer tree: tree.
+ ].
+ ^ self new
+ completeAtLine:line
+ column:col
+ collector:inferencer
+
+ "Modified: / 07-04-2011 / 22:55:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 17:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseRecognizer methodsFor:'adding'!
+
+addGlobalsStartingWith: prefix
+
+ | class ns cls |
+ class := collector klass.
+ class classVarNames do:[:nm|
+ (nm startsWith: prefix) ifTrue:[
+ resultSet add:(SmallSenseVariable classVariable: nm in: class).
+ ].
+ ].
+ ns := class nameSpace.
+ "nameSpace may return private class, sigh"
+ [ ns isNameSpace ] whileFalse:[ ns := ns nameSpace ].
+ ns keysDo:[:nm|
+ (nm startsWith: prefix) ifTrue:[
+ cls := ns classNamed: nm.
+ cls notNil ifTrue:[
+ cls isBehavior ifTrue:[
+ resultSet add:(SmallSenseClass new subject: cls; name: nm).
+ ] ifFalse:[
+ resultSet add:(SmallSenseVariable globalVariable: cls).
+ ]
+ ]
+ ].
+ ].
+ ns ~~ Smalltalk ifTrue:[
+ Smalltalk keysDo:[:nm|
+ (nm startsWith: prefix) ifTrue:[
+ cls := Smalltalk classNamed: nm.
+ cls notNil ifTrue:[
+ cls isBehavior ifTrue:[
+ resultSet add:(SmallSenseClass new subject: cls ).
+ ] ifFalse:[
+ resultSet add:(SmallSenseVariable globalVariable: cls).
+ ]
+ ]
+ ]
+ ].
+ ]
+
+ "Created: / 26-11-2011 / 17:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethods: type
+
+ type classesDo:[:each|
+ | class |
+
+ class := each.
+ [ class isNil ] whileFalse:[
+ class
+ selectorsAndMethodsDo:[:selector :met |
+ resultSet add:(SmallSenseMethod
+ name:selector
+ description:"met source"nil
+ class:class).
+ ].
+ class := class superclass.
+ ].
+ ].
+
+ "Created: / 26-11-2011 / 17:03:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addVariables
+
+ "Add Instance variables"
+ collector klass allInstVarNames do:[:nm|
+ resultSet add: (SmallSenseVariable instanceVariable: nm in: collector klass).
+ ].
+ "Add pseudo variables"
+ #(self super here thisContext) do:[:nm|
+ resultSet add: (SmallSenseVariable new name: nm).
+ ].
+ "Add arguments"
+ collector parser methodArgs ? #() do:[:nm|
+ resultSet add: (SmallSenseVariable argument: nm).
+
+ ].
+ "Add temporaries"
+ collector parser methodVars ? #() do:[:nm|
+ resultSet add: (SmallSenseVariable variable: nm).
+ ].
+
+ "Created: / 26-11-2011 / 17:29:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseRecognizer methodsFor:'completion'!
+
+completeAtLine:line column:col collector:coll
+ "find most possible codeCompletion object"
+
+ | position |
+ resultSet := SmallSenseResultSet new.
+ collector := coll.
+
+ (collector tree == #Error) ifTrue:[ ^resultSet ].
+ (collector tree == nil) ifTrue:[ ^resultSet ].
+
+
+
+ position := SmallSenseFinder new
+ findNodeIn: collector source tree: collector tree
+ line: line column: col.
+ resultSet position: position.
+
+
+ (position afterNode) ifTrue:[
+ self completeAfter:position node.
+ ^resultSet.
+ ].
+
+ (position inNode) ifTrue:[
+ self completeIn:position node.
+ ^resultSet.
+ ].
+
+ (position beforeNode) ifTrue:[
+ self completeBefore:position node.
+ ^resultSet.
+ ].
+
+ "Created: / 04-03-2011 / 13:01:14 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 10:52:59 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 17:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseRecognizer methodsFor:'completion-private'!
+
+completeAfter:node
+ "return collection of completion items after given node"
+
+ self addMethods: node inferedType
+
+ "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 17:07:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeBefore:node
+
+ self breakPoint: #jv. "Not yet implemented"
+
+ "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 17:07:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeIn:node
+ "return collection which can be afterNode"
+
+ node isVariableNode ifTrue:[
+ node name first isUppercase ifTrue:[
+ self addGlobalsStartingWith: node name
+ ] ifFalse:[
+ self addVariables
+ ].
+ ^self.
+ ].
+
+ node isMessage ifTrue:[
+ self addMethods: node receiver inferedType.
+ ^self.
+ ].
+
+ self breakPoint: #jv.
+
+ "Created: / 07-03-2011 / 18:59:02 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 09:31:51 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 17:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseRecognizer methodsFor:'obsolete'!
+
+addSendsAndMethodFromAssignmentsFromRoelTyperResult:result
+ "we have roelTyperResult for exact node we add all sends and all methods which we can find in assignments"
+
+ |retCollection class|
+
+ retCollection := SmallSenseResultSet new.
+
+ "
+ (result interface) do:[:send|
+ retCollection add: (SmallSenseMethod name:send description:'Used sender.').
+ ].
+ "
+ result assignments do:[:assignment |
+ class := assignment.
+ [ class isNil ] whileFalse:[
+ class
+ selectorsAndMethodsDo:[:selector :met |
+ retCollection add:(SmallSenseMethod
+ name:selector
+ description:"met source"nil
+ class:class).
+ ].
+ class := class superclass.
+ ].
+ ].
+ ^ retCollection.
+
+ "Created: / 07-03-2011 / 18:20:15 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 10:15:20 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 18:51:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+before
+ "BasicCollection for allNode which are before "
+
+ |retCollection|
+
+ retCollection := SmallSenseResultSet new.
+ retCollection join:(self beforeConstant).
+ retCollection join:(self beforeBlock).
+ ^ retCollection.
+
+ "Created: / 04-03-2011 / 12:36:56 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:32:38 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+before:foundNode collector:collector
+ "BasicCollection for allNode which are before node"
+
+ |retCollection helper receiver node helperNode ret|
+
+ "Check nil node"
+ retCollection := SmallSenseResultSet new.
+ (foundNode isNil) ifTrue:[
+ retCollection join:(self beforeConstant).
+ retCollection join:(self beforeBlock).
+ retCollection join:(self beforeVariable:collector).
+ ^ retCollection.
+ ].
+ (foundNode node isNil) ifTrue:[
+ node := foundNode statement.
+ ] ifFalse:[
+ node := foundNode node.
+ ].
+ helperNode := foundNode node.
+ (node isErrorNode) ifTrue:[
+ helper := foundNode beforeStatement.
+ (helper notNil) ifTrue:[
+ foundNode node:helper.
+ foundNode beforeNode:false.
+ foundNode afterNode:true.
+ ret := self after:foundNode collector:collector.
+ foundNode node:helperNode.
+ ^ ret.
+ ]
+ ].
+ node isSelector ifTrue:[
+ receiver := self getReceiverinNodeForSelector:node
+ node:foundNode statement.
+ (receiver notNil) ifTrue:[
+ (receiver isMessage
+ or:[
+ receiver isAssignment
+ or:[ receiver isErrorNode or:[ receiver isSelector ] ]
+ ])
+ ifFalse:[
+ foundNode node:receiver.
+ foundNode beforeNode:false.
+ foundNode afterNode:true.
+ ret := self after:foundNode collector:collector.
+ foundNode node:helperNode.
+ ^ ret.
+ ]
+ ].
+ ].
+ retCollection join:(self beforeBlockVariable:foundNode).
+ retCollection join:(self beforeConstant).
+ retCollection join:(self beforeBlock).
+ retCollection join:(self beforeVariable:collector).
+ ^ retCollection.
+
+ "Created: / 04-03-2011 / 13:02:42 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 18:48:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+beforeBlock
+ "There is some basic blocks which can be before node"
+
+ |retCollection|
+
+ retCollection := SmallSenseResultSet new.
+ retCollection add:(SmallSenseSnippet name:'()ifTrue:[].'
+ description:'True block
+ ()ifTrue:[].').
+ retCollection add:(SmallSenseSnippet name:'()ifFalse:[].'
+ description:'False block
+ ()ifFalse:[].').
+ retCollection add:(SmallSenseSnippet name:'[]whileTrue:[].'
+ description:'WhileTrue block
+ ()whileTrue:[].').
+ retCollection add:(SmallSenseSnippet name:'[]whileFalse:[].'
+ description:'WhileFalse block
+ ()whileFalse:[].').
+ retCollection
+ add:(SmallSenseSnippet name:'[]' description:'Closure to block').
+ retCollection add:(SmallSenseSnippet name:'()' description:'Brackets').
+ ^ retCollection.
+
+ "Created: / 04-03-2011 / 12:46:15 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 17:31:25 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 13:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+beforeBlockVariable:foundNode
+ "Add variables from Block Node"
+
+ |retCollection|
+
+ retCollection := SmallSenseResultSet new.
+ (foundNode blockVariables notNil) ifTrue:[
+ foundNode blockVariables do:[:each |
+ retCollection add:(SmallSenseVariable name:each name
+ description:'Variables in the method. Defined in block [:val| ]').
+ ].
+ ].
+ ^ retCollection
+
+ "Created: / 06-04-2011 / 18:48:29 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 20-05-2011 / 14:36:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+beforeConstant
+ "There is some basic constant which can be before node"
+
+ |retCollection|
+ retCollection := SmallSenseResultSet new.
+ retCollection add:(SmallSenseConstant name:'^'
+ description:'Return symbol from method.
+For example: ^ nil').
+ retCollection
+ add:(SmallSenseConstant name:':=' description:'Assignment to variable').
+ retCollection add:(SmallSenseConstant name:'self'
+ description:'Reference to self class.
+Access to method from this class.
+For example: self someMethod.').
+ retCollection add:(SmallSenseConstant name:'super'
+ description:'Reference to super class.
+Access to method from super class.
+For example: super someMethod.').
+ retCollection add:(SmallSenseConstant name:'nil'
+ description:'Nil. In c# or java null. Something empty').
+ retCollection add:(SmallSenseConstant name:'true' description:'True.').
+ retCollection add:(SmallSenseConstant name:'false' description:'False').
+ retCollection add:(SmallSenseConstant name:'#'
+ description:'Symbol reference.
+For example: #Symbol').
+ retCollection add:(SmallSenseConstant name:'$'
+ description:'Character symbol.
+For example #a').
+ ^retCollection.
+
+ "Created: / 04-03-2011 / 12:40:45 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 13:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 07-04-2011 / 23:01:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+beforeVariable:collector
+ "There is some variables which can be before node"
+
+ |retCollection roelTyper helper class|
+ retCollection := SmallSenseResultSet new.
+ (collector isNil) ifTrue:[
+ ^ retCollection.
+ ].
+ (collector methodArgs notNil) ifTrue:[
+ collector methodArgs do:[:each |
+ retCollection add:(SmallSenseVariable name:each
+ description:'Arguments in the method. Defined in method:val').
+ ].
+ ].
+ roelTyper := self doForSource:collector.
+ roelTyper instVars do:[:var |
+ retCollection add:(SmallSenseVariable name:var
+ description:'Instance variables. Variables defined in instanceVariableNames')
+ ].
+ helper := roelTyper localTypingResults
+ at:roelTyper currentExtractedMethod.
+ helper do:[:each |
+ (each tempName notNil) ifTrue:[
+ retCollection add:(SmallSenseVariable name:each tempName
+ description:'Variables in the method. Defined in |val val2|').
+ ].
+ ].
+ class := collector targetClass.
+ [ class notNil ] whileTrue:[
+ class classVarNames do:[:each |
+ retCollection add:(SmallSenseVariable name:each
+ description:'Class variables. Variables defined in classVariableNames').
+ ].
+ class := class superclass.
+ ].
+ ^ retCollection.
+
+ "Created: / 04-03-2011 / 13:03:44 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 13:44:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 07-04-2011 / 22:54:47 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+beforeVariable:collector nodeName:nodeName
+ "There is some variables which can be before node"
+
+ |retCollection roelTyper helper class|
+
+ retCollection := SmallSenseResultSet new.
+ (collector isNil) ifTrue:[
+ ^ retCollection.
+ ].
+ (collector methodArgs notNil) ifTrue:[
+ collector methodArgs do:[:each |
+ (each asLowercase startsWith:nodeName asLowercase) ifTrue:[
+ retCollection add:(SmallSenseVariable name:each
+ description:'Arguments in the method. Defined in method:val').
+ ].
+ ].
+ ].
+ roelTyper := self doForSource:collector.
+ roelTyper instVars do:[:var |
+ (var asLowercase startsWith:nodeName asLowercase) ifTrue:[
+ retCollection add:(SmallSenseVariable name:var
+ description:'Instance variables. Variables defined in instanceVariableNames')
+ ].
+ ].
+ helper := roelTyper localTypingResults
+ at:roelTyper currentExtractedMethod.
+ helper do:[:each |
+ (each tempName notNil) ifTrue:[
+ (each tempName asLowercase startsWith:nodeName asLowercase) ifTrue:[
+ retCollection add:(SmallSenseVariable name:each tempName
+ description:'Variables in the method. Defined in |val val2|').
+ ].
+ ].
+ ].
+ class := collector targetClass.
+ [ class notNil ] whileTrue:[
+ class classVarNames do:[:each |
+ (each asLowercase startsWith:nodeName asLowercase) ifTrue:[
+ retCollection add:(SmallSenseVariable name:each
+ description:'Class variables. Variables defined in classVariableNames').
+ ].
+ ].
+ class := class superclass.
+ ].
+ ^ retCollection.
+
+ "Modified: / 04-04-2011 / 13:44:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 06-04-2011 / 16:34:15 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 23:48:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+createSelectorFromMessageNode:actualStatement
+ "Creates selector node from selector in messageNode"
+
+ |helperNode|
+
+ (actualStatement isNil) ifTrue:[
+ helperNode := SmallSenseSelectorNode new.
+ ] ifFalse:[
+ helperNode := SelectorNode new.
+ helperNode receiver: actualStatement receiver.
+ helperNode selectors:actualStatement selector.
+ helperNode selectorsPosition:actualStatement selectorPosition.
+ helperNode lines:actualStatement lines.
+ ].
+ ^ helperNode.
+
+ "Created: / 07-03-2011 / 17:49:33 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 21:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doForSource: compiller
+ " | parser|
+ parser:=SmallSenseParser new.
+ parser sourceText:(compiller sourceStream collection asString) asText.
+ parser
+ parseMethod:compiller sourceStream collection asString
+ in:compiller targetClass
+ ignoreErrors:false
+ ignoreWarnings:false."
+^self processMethod: compiller sourceStream collection asString class:compiller targetClass parser:compiller.
+
+ "Created: / 04-03-2011 / 12:54:09 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 14:13:15 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+getReceiverinNodeForSelector:selector node:node
+ "Gets receiver for selectorNode in node"
+
+ |helperSelector receiver|
+
+ selector receiver ifNotNil:[^selector receiver].
+
+ (node isMessage) ifFalse:[
+ "no reciver"
+ ^ nil.
+ ].
+ receiver := node receiver.
+ helperSelector := self createSelectorFromMessageNode:node.
+ ((selector lines) = (helperSelector lines)
+ and:[
+ (selector selectors asString) = (helperSelector selectors asString)
+ and:[ (selector selectorsPosition) = (helperSelector selectorsPosition) ]
+ ])
+ ifTrue:[
+ ^ receiver.
+ ]
+ ifFalse:[
+ (receiver isMessage) ifTrue:[
+ ^ self getReceiverinNodeForSelector:selector node:node receiver.
+ ]
+ ].
+ ^ nil.
+
+ "Created: / 07-03-2011 / 19:01:44 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 18:35:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+inClassName:nodeName
+ "Find all classes which start this Name"
+
+ |classes retCollection|
+
+ classes := Smalltalk allClasses
+ select:[:cls | cls name startsWith:nodeName].
+ retCollection := SmallSenseResultSet new.
+ classes do:[:cls |
+ retCollection
+ add:(SmallSenseClass subject: cls)
+ ].
+ ^ retCollection.
+
+ "Created: / 06-04-2011 / 16:21:53 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 18:37:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+inNode:foundNode collector:collector
+ "return collection which can be afterNode"
+
+ |retCollection receiver node befStatement|
+
+ (foundNode node isNil) ifTrue:[
+ node := foundNode statement.
+ ] ifFalse:[
+ node := foundNode node.
+ ].
+ retCollection := SmallSenseResultSet new.
+ (node isVariable) ifTrue:[
+ retCollection := self beforeVariable:collector nodeName:node name.
+ retCollection join:(self beforeBlockVariable:foundNode).
+ retCollection join:(self inClassName:node name).
+ ^ retCollection.
+ ].
+ (node isConstant) ifTrue:[
+ ^ nil.
+ ].
+ (node isSelf) ifTrue:[
+ retCollection add:(SmallSenseConstant name:'self'
+ description:'Reference to self class.
+Access to method from this class.
+For example: self someMethod.').
+ ^ retCollection.
+ ].
+ (node isSuper) ifTrue:[
+ retCollection add:(SmallSenseConstant name:'super'
+ description:'Reference to super class.
+Access to method from super class.
+For example: super someMethod.').
+ ^ retCollection.
+ ].
+ (node isAssignment) ifTrue:[
+ ^ self before:foundNode collector:collector.
+ ].
+ (node isMessage) ifTrue:[
+ ^ self before:foundNode collector:collector.
+ ].
+ (node isBlock) ifTrue:[
+ retCollection join:(self before:foundNode collector:collector).
+ ^ retCollection.
+ ].
+ node isSelector ifTrue:[
+ receiver := self getReceiverinNodeForSelector:node
+ node:foundNode statement.
+ (receiver isNil) ifTrue:[
+ "Try to get receiver from cascadeNode"
+ befStatement := foundNode beforeStatement.
+ [
+ befStatement isMessage
+ ] whileTrue:[
+ receiver := befStatement receiver.
+ befStatement := receiver.
+ ].
+ ].
+ (receiver notNil) ifTrue:[
+ (receiver isMessage
+ or:[
+ receiver isAssignment
+ or:[ receiver isErrorNode or:[ receiver isSelector ] ]
+ ])
+ ifFalse:[
+ foundNode node:receiver.
+ foundNode beforeNode:false.
+ foundNode afterNode:true.
+ ^ self after:foundNode collector:collector.
+ ]
+ ].
+ ^ retCollection.
+ ].
+ (foundNode node isErrorNode) ifTrue:[
+ ^ self before:foundNode collector:collector.
+ ].
+
+ "Created: / 07-03-2011 / 18:59:02 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 09:31:51 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+old_recognize:line position:pos collector:collector
+ "find most possible codeCompletion object"
+
+ |node finder position|
+ resultSet := SmallSenseResultSet new.
+ (collector tree ~= #Error) ifTrue:[
+ finder := SmallSenseFinder new.
+ (collector tree isNil) ifTrue:[
+ self breakPoint: #jv. ^nil.
+ ] ifFalse:[
+ position := finder findNodeIn: collector source tree: collector tree
+ line: line column: pos.
+ (position beforeNode) ifTrue:[
+ self before:position node collector:collector.
+ ].
+ (position afterNode) ifTrue:[
+ self after:position node collector:collector.
+ ].
+ (position inNode) ifTrue:[
+ self inNode:position node collector:collector.
+ ].
+ ].
+ ] ifFalse:[
+ self before.
+ ].
+ (resultSet objectNameCollection isNil
+ or:[ resultSet objectNameCollection size = 0 ])
+ ifTrue:[
+ resultSet join:(self afterSelfNode:node collector:collector).
+ resultSet join:(self before:node collector:collector).
+ ].
+ resultSet position:position.
+ ^ resultSet.
+
+ "Created: / 04-03-2011 / 13:01:14 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 10:52:59 / Jakub <zelenja7@fel.cvut.cz>"
+ "Created: / 26-11-2011 / 16:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+processMethod:source class:class parser:parser
+
+ |collector|
+
+ collector := SmallSenseTypeCollector onClass: class.
+ collector addMethod:parser.
+ SmallSenseTypeCollector new newExtractor
+ extractInterfacesFrom:source
+ class:class
+ addTo:collector.
+
+ ^ collector
+
+ "Created: / 17-03-2011 / 18:12:26 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 22:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 06-04-2011 / 14:18:50 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseRecognizer class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseRecognizer.st 7826 2011-11-27 09:48:43Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseRecognizerTests.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,767 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseTestCase subclass:#SmallSenseRecognizerTests
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Tests'
+!
+
+
+!SmallSenseRecognizerTests methodsFor:'RecognizerTest'!
+
+testRecognizer1
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| ahoj|
+
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:2
+ position:2
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 17).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 04-03-2011 / 12:55:37 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:45:41 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer10
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:7
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 18).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:27:26 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:49:13 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer11
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c fl
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:7
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 18).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:34:06 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:50:27 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer12
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c fl:[
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:12
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 48).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:39:40 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:04:40 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer13
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c fl:[# >
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:14
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 48).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:40:28 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:04:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer14
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c fl:[# > he
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:18
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size = 3).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:43:01 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:05:34 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer15
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ c fl:[# > he ah
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:23
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 48).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:55:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:05:44 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer16
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+self
+
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:2
+ position:6
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= self class selectors size).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 04-04-2011 / 14:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:05:56 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer2
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| ahoj|
+ u
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:7
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size > 92).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 04-03-2011 / 16:23:04 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:46:09 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer3
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ helper
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:12
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size =1).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 04-03-2011 / 17:40:05 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:47:48 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer4
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ 10
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:8
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= 142).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 18:14:26 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:41:05 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer5
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ self
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:10
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= self class selectors size).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 18:33:31 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 14:06:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:06:08 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer6
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ super
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:11
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= 503).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 18:35:35 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 08-04-2011 / 00:06:23 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer7
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ :
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:11
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >17).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 18:39:58 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 18:45:29 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer8
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ :
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:6
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= 48).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:26:53 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:07:02 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+testRecognizer9
+ |collector recognizer foundCollection|
+
+ collector := self
+ doForSource:'
+| helper|
+ :
+ u := 3.
+ b:=u.
+ c:= u floor aa .
+ d floor: u.
+ d floor: 3 b:u.
+ self rememberSymbolUsed:nil . c call: b . b call:c dd:d.
+ array := #(3 4 5 6 ).
+ val := ConstantNode type:tokenType
+ value:tokenValue.
+ [ u== #Symbol or: [u=3 ] ] ifTrue:[
+ uu := 4.
+ bb:=uu.
+ cc:=uu floor.
+ dd floor:uu.
+ dd floor:3 b:uu.
+ ].
+ dd do:[:w|w seduce.
+ ]
+ ^self.
+ '.
+ self assert:collector notNil.
+ self assert:collector tree notNil.
+ recognizer := SmallSenseRecognizer new.
+ foundCollection := recognizer
+ recognize:3
+ position:4
+ collector:collector.
+ self assert:(foundCollection ~~ OrderedCollection).
+ self assert:(foundCollection objectNameCollection size >= 48).
+
+ " self assert:(foundNode beforeNode).
+ self assert:((foundNode line)=2).
+ self assert:((foundNode position)=2).
+ self assert:(foundNode statement isErrorNode).
+ self assert:(foundNode statement errorToken =':=').
+ self assert:(foundNode beforeStatement isNil)."
+
+ "Created: / 07-03-2011 / 19:27:11 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 06-04-2011 / 19:07:13 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseRecognizerTests class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseRecognizerTests.st 7705 2011-04-08 09:49:06Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseResultItem.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,159 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseResultItem
+ instanceVariableNames:'subject icon label name description'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseResultItem class methodsFor:'Instance Creation'!
+
+name: name description:description
+
+ ^ self new name:name; description:description.
+
+ "Created: / 04-04-2011 / 13:46:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultItem class methodsFor:'Instance creation'!
+
+subject: anObject
+
+ ^self new subject: anObject
+
+ "Created: / 06-04-2011 / 21:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultItem methodsFor:'accessing'!
+
+cursorColumnAfterComplete
+
+ "Answers a cursor column after completion. The number returned
+ is relative to the start of the text being replaced"
+
+ ^name size + 1
+
+ "Created: / 05-04-2011 / 17:05:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+description
+ ^ description
+!
+
+description:something
+ description := something.
+!
+
+icon
+
+ ^nil
+
+ "Created: / 04-04-2011 / 17:25:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+
+ label ifNil:[label := name].
+ ^label
+
+ "Created: / 07-04-2011 / 09:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+name
+ ^ name
+!
+
+name:something
+ name := something.
+!
+
+stringToComplete
+
+ "Answers a string to complete"
+
+ ^name
+
+ "Created: / 05-04-2011 / 16:48:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+subject
+ ^ subject
+!
+
+subject:something
+ subject := something.
+! !
+
+!SmallSenseResultItem methodsFor:'displaying'!
+
+displayOn:aGc x:x y:y opaque:opaque
+
+ | icon |
+ icon := self icon.
+ icon ifNotNil:[icon displayOn:aGc x:x y:y - icon height opaque:opaque].
+ self label displayOn:aGc x:x + 16 y:y opaque:opaque
+
+ "Created: / 04-04-2011 / 17:25:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 08-04-2011 / 22:36:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultItem methodsFor:'new'!
+
+name:nam description:desc
+ name := nam.
+ description := desc.
+
+ "Created: / 16-03-2011 / 16:31:13 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseResultItem methodsFor:'printing & storing'!
+
+printOn:aStream
+ "append a printed representation if the receiver to the argument, aStream"
+
+ super printOn:aStream.
+ aStream nextPut:$(.
+ name printOn:aStream.
+ aStream nextPut:$).
+
+ "Modified: / 04-04-2011 / 12:02:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultItem methodsFor:'queries'!
+
+startsWith: prefix
+
+ ^self stringToComplete startsWith: prefix
+
+ "Created: / 26-11-2011 / 19:25:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultItem methodsFor:'testing'!
+
+isSmallSenseClass
+ ^ false
+!
+
+isSmallSenseConstant
+ ^ false
+!
+
+isSmallSenseMethod
+ ^ false
+!
+
+isSmallSenseSnippet
+ ^ false
+!
+
+isSmallSenseVariable
+ ^ false
+! !
+
+!SmallSenseResultItem class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseResultItem.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseResultSet.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,154 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseResultSet
+ instanceVariableNames:'items position objectNameCollection selectedObjectIndex
+ selectedName'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseResultSet methodsFor:'accessing'!
+
+items
+
+ ^items
+
+ "Created: / 26-11-2011 / 19:06:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+objectCollection
+ ^ items
+!
+
+objectCollection:something
+ items := something.
+
+ "Modified: / 16-03-2011 / 16:42:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+objectNameCollection
+ ^ objectNameCollection
+
+ "Modified: / 06-04-2011 / 16:31:19 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+objectNameCollection:something
+ objectNameCollection := something.
+!
+
+position
+ ^ position
+!
+
+position:something
+ position := something.
+!
+
+selectedName
+ ^ selectedName
+!
+
+selectedName:something
+ self findByName:something.
+ selectedName := something.
+
+ "Modified: / 17-03-2011 / 12:10:57 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+selectedObjectDescription
+ ^ (items at:selectedObjectIndex) description.
+
+ "Modified: / 16-03-2011 / 18:17:38 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+selectedObjectIndex
+ ^ selectedObjectIndex
+!
+
+selectedObjectIndex:something
+ selectedObjectIndex := something.
+! !
+
+!SmallSenseResultSet methodsFor:'adding'!
+
+add:object
+ "Add senseResultObject to objectCollection and objectNameCollection"
+
+ |helperIndex|
+
+ self checkCollection.
+ (object notNil) ifTrue:[
+ helperIndex := objectNameCollection indexOf:(object name).
+ (helperIndex = 0) ifTrue:[
+ items add:object.
+ objectNameCollection add:(object name).
+ ].
+ ].
+
+ "Created: / 16-03-2011 / 16:43:10 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 13:48:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+join: collection
+ "joining two SmallSenseResultCollection"
+
+ (collection objectCollection isNil) ifTrue: [
+ ^ nil.
+ ].
+ collection objectCollection do: [:each |
+ self add: each.
+ ].
+
+ "Created: / 17-03-2011 / 12:11:39 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 17-03-2011 / 17:56:06 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 04-04-2011 / 13:49:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 27-11-2011 / 10:05:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultSet methodsFor:'checking'!
+
+checkCollection
+ (objectNameCollection isNil)
+ ifTrue:[ objectNameCollection := SortedCollection new. ].
+ (items isNil)
+ ifTrue:[ items := SortedCollection sortBlock:[:a :b|a name < b name]].
+
+ "Created: / 16-03-2011 / 16:46:39 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 07-04-2011 / 10:01:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultSet methodsFor:'finding'!
+
+findByName:name
+|index|
+index:=1.
+items do:[:each|
+(each asString startsWith:name)ifTrue:[
+ selectedObjectIndex:=index.
+ ^index
+].
+index:=index+1.
+].
+selectedObjectIndex:=1.
+^index.
+
+ "Created: / 16-03-2011 / 17:16:24 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 16-03-2011 / 18:16:55 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseResultSet methodsFor:'queries'!
+
+isEmpty
+
+ ^items isEmptyOrNil
+
+ "Created: / 27-11-2011 / 10:03:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseResultSet class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseResultSet.st 7826 2011-11-27 09:48:43Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseSelectorNode.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,91 @@
+"
+ 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: 'stx:libtool/smallsense' }"
+
+ParseNode subclass:#SmallSenseSelectorNode
+ instanceVariableNames:'receiver selectors selectorsPosition lines'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+!SmallSenseSelectorNode 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.
+"
+! !
+
+!SmallSenseSelectorNode methodsFor:'accessing'!
+
+lines
+ ^ lines
+!
+
+lines:something
+ lines := something.
+!
+
+receiver
+ ^ receiver
+!
+
+receiver:something
+ receiver := something.
+!
+
+selectors
+ ^ selectors
+!
+
+selectors:something
+ selectors := something.
+!
+
+selectorsPosition
+ ^ selectorsPosition
+!
+
+selectorsPosition:something
+ selectorsPosition := something.
+! !
+
+!SmallSenseSelectorNode methodsFor:'printing & storing'!
+
+printOn:aStream indent:i
+selectors printString printOn:aStream.
+
+ "Created: / 22-02-2011 / 22:01:05 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseSelectorNode methodsFor:'testing'!
+
+isSelector
+ ^ true
+
+ "Modified: / 08-04-2011 / 21:11:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseSelectorNode class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseSelectorNode.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseService.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,336 @@
+"
+ 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: 'stx:libtool/smallsense' }"
+
+Tools::BackgroundSourceProcessingService subclass:#SmallSenseService
+ instanceVariableNames:'rulesHolder rules highlighter'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Interface'
+!
+
+!SmallSenseService 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.
+"
+! !
+
+!SmallSenseService class methodsFor:'initialization'!
+
+initialize
+
+ "
+ | map |
+ map := Screen current keyboardMap.
+ map bindValue:#CodeCompletion to: #'Ctrl '.
+ map bindValue:#CodeCompletion to: #'Ctrlspace'.
+ "
+
+ 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: / 30-11-2011 / 12:42:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 30-11-2011 / 22:58:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService class methodsFor:'accessing'!
+
+label
+
+ "Answers short label - for UI"
+
+ ^'SmallSense'
+
+ "Created: / 07-03-2010 / 14:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-04-2011 / 23:08:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService methodsFor:'accessing'!
+
+syntaxHighlighter
+
+ ^highlighter
+
+ "Created: / 05-08-2011 / 10:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService 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.
+ ].
+! !
+
+!SmallSenseService methodsFor:'change & update'!
+
+update:something with:aParameter from:changedObject
+ "Invoked when an object that I depend upon sends a change notification."
+
+ changedObject == rulesHolder ifTrue:[
+ rules := rulesHolder value deepCopy.
+ highlighter rules: rules flattened.
+ self process.
+ ].
+
+ super update:something with:aParameter from:changedObject
+
+ "Modified: / 27-01-2012 / 17:03:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService methodsFor:'event handling'!
+
+keyPress: key x:x y:y in: view
+
+ "Handles an event in given view (a subview of codeView).
+ If the method returns true, the event will not be processed
+ by the view."
+
+ (view == textView and: [ key == #'CodeCompletion' ]) ifTrue: [
+ self complete. ^true
+ ].
+ ^false
+
+ "Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+viewRealized
+
+ | browser |
+
+ (browser := codeView browser) notNil ifTrue:[
+ browser navigationState canvasType ~~ #smallLintByRuleResultBrowserSpec ifTrue:[
+ self rulesHolder: browser smalllintRulesOrAllHolder.
+ ].
+ ].
+
+ "Created: / 23-01-2012 / 10:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService methodsFor:'initialization'!
+
+initialize
+
+ super initialize.
+
+ highlighter := Tools::LintHighlighter new
+
+ "Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService methodsFor:'private'!
+
+complete
+ |cls
+"/ crsrPos interval node checkedNode
+"/ char start stop selectorSoFar matchingSelectors
+ |
+
+ codeView languageHolder value == SmalltalkLanguage instance
+ ifFalse:[^self].
+
+ cls := codeView classHolder value.
+ cls isNil ifTrue:[
+ codeView showInfo:'No class'.
+ ^ self.
+ ].
+ UserInformation handle:[:ex |
+ codeView showInfo:(ex messageText).
+ ex proceed.
+ ] do:[
+ codeView withWaitCursorDo:[
+ textView keyRelease: #Control_L x:0 y:0.
+ SmallSenseWindow openForView: codeView class: cls.
+ ]
+ ].
+ ^ self.
+
+"/
+"/ interval := self selectedInterval.
+"/ interval isEmpty ifTrue:[
+"/ crsrPos := codeView characterPositionOfCursor - 1.
+"/ char := codeView characterUnderCursor.
+"/ [crsrPos > 1 and:[char isSeparator or:['.' includes:char]]] whileTrue:[
+"/ crsrPos := crsrPos - 1.
+"/ char := codeView characterAtCharacterPosition:crsrPos.
+"/ ].
+"/ interval := crsrPos to:crsrPos.
+"/ ].
+"/
+"/ node := self findNodeForInterval:interval allowErrors:true.
+"/ [node isNil] whileTrue:[
+"/ "/ expand to the left ...
+"/ interval start > 1 ifFalse:[
+"/ self showInfo:'No parseNode found'.
+"/ ^ self.
+"/ ].
+"/ interval start:(interval start - 1).
+"/ node := self findNodeForInterval:interval allowErrors:true.
+"/ ].
+"/
+"/ node isVariable ifTrue:[
+"/ self codeCompletionForVariable:node inClass:cls.
+"/ ^ self.
+"/ ].
+"/
+"/ checkedNode := node.
+"/ [checkedNode notNil] whileTrue:[
+"/ checkedNode isMessage ifTrue:[
+"/ self codeCompletionForMessage:checkedNode inClass:cls.
+"/ ^ self
+"/ ].
+"/ checkedNode isMethod ifTrue:[
+"/ self codeCompletionForMethod:checkedNode inClass:cls.
+"/ ^ self.
+"/ ].
+"/ checkedNode := checkedNode parent.
+"/ ].
+"/
+"/ self showInfo:'Node is neither variable nor message.'.
+
+ "Modified: / 04-07-2006 / 18:48:26 / fm"
+ "Modified: / 20-11-2006 / 12:30:59 / cg"
+ "Created: / 07-03-2010 / 09:37:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-04-2011 / 17:10:58 / 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 |
+
+ done := false.
+ modified := false.
+ cls := codeView klass.
+ cls isNil ifTrue:[^ self ].
+
+ (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.
+ "textView" modified ifFalse:[
+ oldCodeList isNil ifFalse:[
+ oldCode := oldCodeList asStringWithoutEmphasis.
+ "textView" modified ifFalse:[
+ Screen currentScreenQuerySignal answer:codeView device
+ do:[
+ Error handle:[:ex |
+ |errMsg|
+
+ errMsg := ex description asStringCollection first asString.
+
+ "/ Transcript topView raiseDeiconified.
+ "/ Transcript showCR:'ParseError: ', ex description.
+"/ self halt.
+ "/ self showInfo:(errMsg colorizeAllWith:Color red).
+ ] do:[
+ env := (SmallSenseUnacceptedMethodEnvironment onClass:cls methodSource: oldCode).
+ rules resetResult.
+ rules runOnEnvironment: 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>"
+!
+
+rehighlight
+
+ "Created: / 27-01-2012 / 16:44:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+rehighlight: delayed
+
+ | service |
+ service := self service: #'Tools::CodeHighlightingService'.
+ service notNil ifTrue:[
+ service process: delayed
+ ]
+
+ "Created: / 27-01-2012 / 17:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseService class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseService.st 7845 2012-01-27 21:20:42Z vranyj1 $'
+! !
+
+SmallSenseService initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseSnippet.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,21 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseResultItem subclass:#SmallSenseSnippet
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseSnippet methodsFor:'testing'!
+
+isSmallSenseSnippet
+ ^ true
+! !
+
+!SmallSenseSnippet class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseSnippet.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseTestCase.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,57 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+TestCase subclass:#SmallSenseTestCase
+ instanceVariableNames:'u v'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Tests'
+!
+
+
+!SmallSenseTestCase class methodsFor:'testing'!
+
+isAbstract
+
+ ^self == SmallSenseTestCase
+
+ "Created: / 03-04-2011 / 22:54:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTestCase methodsFor:'generate'!
+
+doForSource:src
+ |parser|
+
+ parser := SmallSenseParser new.
+ parser sourceText:('gen',src) asText.
+ parser
+ parseMethod:'gen' , src
+ in:self class
+ ignoreErrors:false
+ ignoreWarnings:false.
+ ^ parser.
+
+ "Created: / 16-03-2011 / 12:27:38 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 18-03-2011 / 21:57:21 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+processMethod: aCompiledMethod
+ "Fail by default. Needs to be overridden by subclasses to trigger the base testing backbone."
+
+ | collector |
+ collector := SmallSenseTypeCollector onClass: self class.
+ collector currentExtractedMethod: aCompiledMethod.
+ SmallSenseTypeCollector new newExtractor
+ extractInterfacesFrom: aCompiledMethod source class:aCompiledMethod mclass
+ addTo: collector.
+ ^collector
+
+ "Created: / 17-03-2011 / 16:56:07 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 03-04-2011 / 22:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTestCase class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseTestCase.st 7840 2011-12-16 08:48:11Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseType.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,178 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseType
+ instanceVariableNames:'trustfullness'
+ classVariableNames:'ObjectType'
+ poolDictionaries:''
+ category:'SmallSense-Types'
+!
+
+!SmallSenseType class methodsFor:'documentation'!
+
+documentation
+"
+ An object representing an inferred type.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!SmallSenseType class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ ObjectType := SmallSenseClassType new klass: Object
+
+ "Modified: / 16-12-2011 / 02:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType class methodsFor:'instance creation'!
+
+default
+
+ <resource: #obsolete>
+
+ ^self unknown
+
+ "Created: / 26-11-2011 / 16:40:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+unknown
+
+ ^SmallSenseTypeHolder with: SmallSenseUnknownType new
+
+ "Created: / 16-12-2011 / 09:42:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+withClass: aClass
+
+ ^SmallSenseTypeHolder with: (SmallSenseClassType new klass: aClass)
+
+ "Created: / 26-11-2011 / 14:14:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType methodsFor:'comparing'!
+
+= another
+
+ ^self subclassResponsibility
+
+ "Created: / 16-12-2011 / 13:35:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hash
+
+ ^self subclassResponsibility
+
+ "Created: / 16-12-2011 / 13:35:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType methodsFor:'enumerating'!
+
+classesDo: aBlock
+ "Enumerate all classes that this type represents"
+
+ self subclassResponsibility
+
+ "Created: / 16-12-2011 / 13:33:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+typesDo: aBlock
+
+ aBlock value: self
+
+ "Created: / 16-12-2011 / 02:16:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType methodsFor:'operations'!
+
+classSide
+
+ ^self subclassResponsibility
+
+ "Created: / 16-12-2011 / 13:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceSide
+
+ ^self subclassResponsibility
+
+ "Created: / 16-12-2011 / 13:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+union: anotherType
+
+ ^SmallSenseUnionType new
+ addType: self;
+ addType: anotherType;
+ yourself
+
+ "Created: / 16-12-2011 / 02:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType methodsFor:'printing & storing'!
+
+printOn:aStream
+
+ aStream nextPut:$<.
+ self printWithoutAnglesOn: aStream.
+ aStream nextPut:$>.
+
+ "Modified: / 16-12-2011 / 01:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+printWithoutAnglesOn: aStream
+
+ self subclassResponsibility
+
+ "Created: / 16-12-2011 / 01:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType methodsFor:'testing'!
+
+isClassType
+
+ ^false
+
+ "Created: / 16-12-2011 / 02:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isTypeHolder
+
+ ^false
+
+ "Created: / 16-12-2011 / 02:05:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isUnionType
+
+ ^false
+
+ "Created: / 16-12-2011 / 02:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isUnknownType
+
+ ^false
+
+ "Created: / 16-12-2011 / 13:29:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseType class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseType.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
+
+SmallSenseType initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseTypeCollector.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,131 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+TypeCollector subclass:#SmallSenseTypeCollector
+ instanceVariableNames:'master'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer'
+!
+
+
+!SmallSenseTypeCollector class methodsFor:'instance creation'!
+
+newForPlatform
+
+ ^SmallSenseTypeCollector basicNew
+
+ "Created: / 04-04-2011 / 22:28:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollector methodsFor:'* As yet uncategorized *'!
+
+type
+
+ | extractor |
+
+ extractor := self newExtractor.
+
+ theClass selectorsAndMethodsDo:
+ [:sel :method|
+ currentExtractedMethod := method.
+ extractor
+ extractInterfacesFrom:method source
+ class: method mclass
+ addTo:self.
+ ]
+
+ "
+ (SmallSenseTypeCollector onClass: SmallSenseTypeCollector) type
+ "
+
+ "Created: / 28-04-2011 / 22:10:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollector methodsFor:'accessing'!
+
+master
+ ^ master
+!
+
+master:aTypeCollector
+ master := aTypeCollector.
+
+ self typingResults do:[:myType| | masterType |
+ masterType := master typingResults detect:[:r|r ivarName = myType ivarName] ifNone: nil.
+ masterType ifNotNil:[myType addLinkedExtractedType: masterType].
+ ]
+
+ "Modified: / 29-04-2011 / 08:06:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+subCollector
+
+ ^(self class onClass: theClass) master: self
+
+ "Created: / 28-04-2011 / 22:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollector methodsFor:'heuristics'!
+
+assignmentTypeOf: val
+ val isBehavior ifTrue: [^val].
+ val isVariableBinding
+ ifTrue:
+ [val key == #instcreation
+ ifTrue: [^val value]
+ ifFalse: [^val value class]].
+ ^nil
+!
+
+langueSpecificPushSendOf:selector to:rec
+ selector == #blockCopy: ifTrue:[
+ ^ #block
+ ].
+ (#( #'//' #quo: #rem: #'\\' #ceiling #floor #rounded #roundTo: #truncated #truncateTo: #'/' #'+' #'-' #'*' #abs #negated #reciprocal )
+ includes:selector)
+ ifTrue:[
+ ^ self
+ tryUsing:rec
+ for:selector
+ ifNotUse:Number
+ ].
+ (selector = #yourself) ifTrue:[
+ ^ rec
+ ].
+ (rec = #self and:[ (theClass methodDict includesKey:selector) ]) ifTrue:[
+ ^ #return -> selector
+ ].
+ ^ nil.
+
+ "Created: / 14-12-2010 / 23:35:55 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+langueSpecificPushSendOf: selector to: rec args: args
+ selector == #blockCopy: ifTrue: [^#block].
+ (#(#// #quo: #rem: #\\ #ceiling #floor #rounded #roundTo: #truncated #truncateTo: #/ #+ #- #* #abs #negated #reciprocal)
+ includes: selector)
+ ifTrue:
+ [^self
+ tryUsing: rec
+ for: selector
+ ifNotUse: Number].
+ (selector = #yourself) ifTrue: [^rec].
+ (rec = #self and: [(theClass methodDict includesKey: selector)]) ifTrue: [^#return->selector].
+ ^nil
+
+ "Modified: / 14-12-2010 / 23:56:00 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+
+!SmallSenseTypeCollector methodsFor:'private'!
+
+newExtractor
+ ^SmallSenseInstvarInterfaceExtractor new
+
+ "Modified: / 03-04-2011 / 22:50:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollector class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseTypeCollector.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseTypeCollectorCache.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,85 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+CacheDictionary subclass:#SmallSenseTypeCollectorCache
+ instanceVariableNames:'typingJob'
+ classVariableNames:'SharedCache'
+ poolDictionaries:''
+ category:'SmallSense-Roel Typer'
+!
+
+
+!SmallSenseTypeCollectorCache class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ SharedCache := self new: 1024.
+ SharedCache startBackgroundTypingJob.
+
+ "Modified: / 28-04-2011 / 22:00:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollectorCache class methodsFor:'accessing'!
+
+shared
+
+ ^SharedCache
+
+ "Created: / 28-04-2011 / 19:48:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollectorCache methodsFor:'accessing'!
+
+at: class
+
+ self assert: class isBehavior.
+ ^self
+ at: class
+ ifAbsentPut:
+ [self newCollectorFor: class].
+ "
+ SmallSenseTypeCollectorCache shared removeAll.
+ SmallSenseTypeCollectorCache shared at: SmallSenseTypeCollector
+ "
+
+ "Created: / 28-04-2011 / 19:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 29-04-2011 / 08:06:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollectorCache methodsFor:'private'!
+
+newCollectorFor: class
+
+ | c sc |
+ c := SmallSenseTypeCollector onClass: class.
+ sc := class superclass
+ ifNil:[nil]
+ ifNotNil:[self at: class superclass].
+ sc ifNotNil:[c master: sc].
+ typingJob notNil ifTrue:[typingJob add: c].
+ ^c
+
+ "Created: / 28-04-2011 / 20:42:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 28-04-2011 / 23:03:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+startBackgroundTypingJob
+
+ typingJob := BackgroundQueueProcessingJob
+ named: 'Typing job'
+ on: [:collector|collector type].
+ "typingJob start"
+
+ "Created: / 28-04-2011 / 21:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 18-05-2011 / 23:31:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeCollectorCache class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseTypeCollectorCache.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
+
+SmallSenseTypeCollectorCache initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseTypeHolder.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,137 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+Object subclass:#SmallSenseTypeHolder
+ instanceVariableNames:'type'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Types'
+!
+
+
+!SmallSenseTypeHolder class methodsFor:'instance creation'!
+
+with: aSmallSenseType
+
+ ^self new type: aSmallSenseType; yourself
+
+ "Created: / 16-12-2011 / 01:42:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'accessing'!
+
+type
+ ^ type
+!
+
+type:aSmallSenseType
+
+ self assert: aSmallSenseType isTypeHolder not.
+ type := aSmallSenseType.
+
+ "Modified: / 16-12-2011 / 02:12:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'adding & removing'!
+
+addClass: aClass
+
+ self type: (type union: (SmallSenseClassType new klass: aClass)).
+
+ "Created: / 26-11-2011 / 14:04:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addClasses: aCollection
+
+ | union |
+ union := SmallSenseUnionType new.
+ union addType: type.
+ union addTypes: (aCollection collect: [:c|SmallSenseClassType new klass:c]).
+ self type: union
+
+ "Created: / 26-11-2011 / 14:04:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'enumerating'!
+
+classesDo: aBlock
+
+ type classesDo: aBlock
+
+ "Created: / 16-12-2011 / 13:34:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+typesDo: aBlock
+
+ type typesDo: aBlock
+
+ "Created: / 16-12-2011 / 02:17:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'operations'!
+
+classSide
+
+ ^self class with: type classSide
+
+ "Created: / 16-12-2011 / 13:24:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceSide
+
+ ^self class with: type instanceSide
+
+ "Created: / 16-12-2011 / 13:24:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+union: anotherType
+
+ self type: (type union: anotherType)
+
+ "Created: / 16-12-2011 / 02:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'printing & storing'!
+
+printOn:aStream
+ "append a printed representation if the receiver to the argument, aStream"
+
+ type printOn: aStream
+
+ "Modified: / 16-12-2011 / 01:46:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+printWithoutAnglesOn: aStream
+
+ self subclassResponsibility
+
+ "Created: / 16-12-2011 / 01:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder methodsFor:'testing'!
+
+isClassType
+
+ ^false
+
+ "Created: / 16-12-2011 / 02:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isTypeHolder
+
+ ^true
+
+ "Created: / 16-12-2011 / 02:05:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isUnionType
+
+ ^false
+
+ "Created: / 16-12-2011 / 02:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseTypeHolder class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseTypeHolder.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseUnacceptedMethodEnvironment.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,92 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+BrowserEnvironment subclass:#SmallSenseUnacceptedMethodEnvironment
+ instanceVariableNames:'class method'
+ classVariableNames:'UnacceptedSelector'
+ poolDictionaries:''
+ category:'SmallSense-Lint'
+!
+
+
+!SmallSenseUnacceptedMethodEnvironment 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>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment 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>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment 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: UnacceptedSelector
+
+ "Created: / 27-01-2012 / 15:50:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment methodsFor:'accessing-classes'!
+
+classesDo: aBlock
+
+ ^aBlock value: class.
+
+ "Created: / 27-01-2012 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment methodsFor:'initialization'!
+
+setMethod: anUnacceptedMethod
+
+ method := anUnacceptedMethod
+
+ "Created: / 23-01-2012 / 11:20:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+setupForClass: realClass source: source
+
+
+ class := RBClass existingNamed: realClass name.
+ method := RBMethod for: class source: source selector: UnacceptedSelector.
+ class addMethod: method.
+
+ "Created: / 27-01-2012 / 15:42:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment 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>"
+! !
+
+!SmallSenseUnacceptedMethodEnvironment class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseUnacceptedMethodEnvironment.st 7845 2012-01-27 21:20:42Z vranyj1 $'
+! !
+
+SmallSenseUnacceptedMethodEnvironment initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseUnionType.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,145 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseType subclass:#SmallSenseUnionType
+ instanceVariableNames:'types'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Types'
+!
+
+
+!SmallSenseUnionType methodsFor:'accessing'!
+
+types
+ ^ types ? #()
+
+ "Modified: / 16-12-2011 / 02:01:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+types:something
+ types := something.
+! !
+
+!SmallSenseUnionType methodsFor:'adding & removing'!
+
+addType: typeOrHolder
+
+ | type |
+ typeOrHolder isTypeHolder ifTrue:[
+ type := typeOrHolder type
+ ] ifFalse:[
+ type := typeOrHolder
+ ].
+
+ types isNil ifTrue:[types := OrderedCollection new].
+ type isUnionType ifTrue:[
+ self addTypes: type types.
+ ] ifFalse:[
+ type isUnknownType ifFalse:[
+ (types includes: type) ifFalse:[
+ types add: type.
+ ]
+ ]
+ ].
+
+ "Created: / 16-12-2011 / 01:50:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addTypes: someTypes
+
+ someTypes do:[:each|self addType: each].
+
+ "Created: / 16-12-2011 / 01:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType methodsFor:'comparing'!
+
+= another
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^self class == another class
+ and:[types size == another types size
+ and:[types = another types]]
+
+ "Modified: / 16-12-2011 / 13:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hash
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^types hash
+
+ "Modified: / 16-12-2011 / 13:39:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType methodsFor:'enumerating'!
+
+classesDo:aBlock
+ "Enumerate all classes that this type represents"
+
+ types notNil ifTrue:[
+ ^types do:[:t|t classesDo: aBlock]
+ ].
+
+ "Modified: / 16-12-2011 / 13:34:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+typesDo: aBlock
+
+ (types ? #()) do:[:each|
+ each typesDo: aBlock
+ ].
+
+ "Created: / 16-12-2011 / 02:17:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType methodsFor:'operations'!
+
+classSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new
+ types: (types ? #() collect:[:t|t classSide])
+
+ "Modified: / 16-12-2011 / 13:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new
+ types: (types ? #() collect:[:t|t instanceSide])
+
+ "Modified: / 16-12-2011 / 13:22:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType methodsFor:'printing & storing'!
+
+printWithoutAnglesOn:aStream
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ types isNil ifTrue:[
+ aStream nextPut: $?
+ ] ifFalse:[
+ types
+ do:[:each|each printWithoutAnglesOn:aStream]
+ separatedBy:[aStream nextPut:$|]
+ ]
+
+ "Modified: / 16-12-2011 / 01:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType methodsFor:'testing'!
+
+isUnionType
+
+ ^true
+
+ "Created: / 16-12-2011 / 02:01:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnionType class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseUnionType.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseUnknownType.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,121 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseType subclass:#SmallSenseUnknownType
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Types'
+!
+
+SmallSenseUnknownType class instanceVariableNames:'theOneAndOnlyInstance'
+
+"
+ No other class instance variables are inherited by this class.
+"
+!
+
+
+!SmallSenseUnknownType class methodsFor:'instance creation'!
+
+flushSingleton
+ "flushes the cached singleton"
+
+ theOneAndOnlyInstance := nil
+
+ "
+ self flushSingleton
+ "
+!
+
+new
+ "returns a singleton"
+
+ ^ self theOneAndOnlyInstance.
+!
+
+theOneAndOnlyInstance
+ "returns a singleton"
+
+ theOneAndOnlyInstance isNil ifTrue:[
+ theOneAndOnlyInstance := self basicNew initialize.
+ ].
+ ^ theOneAndOnlyInstance.
+! !
+
+!SmallSenseUnknownType methodsFor:'comparing'!
+
+= another
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^self == another
+
+ "Modified: / 16-12-2011 / 13:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hash
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self identityHash
+
+ "Modified: / 16-12-2011 / 13:37:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnknownType methodsFor:'enumerating'!
+
+classesDo:aBlock
+ "Enumerate all classes that this type represents"
+
+ ^ aBlock value: Object
+
+ "Modified: / 16-12-2011 / 13:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnknownType methodsFor:'operations'!
+
+classSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new
+
+ "Modified: / 16-12-2011 / 13:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceSide
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ self class new
+
+ "Modified: / 16-12-2011 / 13:21:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+union: anotherType
+
+ ^anotherType
+
+ "Created: / 16-12-2011 / 02:20:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnknownType methodsFor:'printing & storing'!
+
+printWithoutAnglesOn:aStream
+ "superclass SmallSenseType says that I am responsible to implement this method"
+
+ ^ aStream nextPut:$?
+
+ "Modified: / 16-12-2011 / 02:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnknownType methodsFor:'testing'!
+
+isUnknownType
+
+ ^true
+
+ "Created: / 16-12-2011 / 13:29:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseUnknownType class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseUnknownType.st 7841 2011-12-16 12:43:56Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseVariable.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,103 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SmallSenseResultItem subclass:#SmallSenseVariable
+ instanceVariableNames:'class type'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Core'
+!
+
+
+!SmallSenseVariable class methodsFor:'instance creation'!
+
+argument: name
+
+ ^self new name: name; type: #MethodArg
+
+ "Created: / 26-11-2011 / 18:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+classVariable: name in: class
+
+ ^self new name: name; type: #ClassVar; class: class
+
+ "Created: / 26-11-2011 / 18:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+globalVariable: name
+
+ ^self new name: name; type: #Global
+
+ "Created: / 26-11-2011 / 18:57:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+instanceVariable: name in: class
+
+ ^self new name: name; type: #InstanceVar; class: class
+
+ "Created: / 26-11-2011 / 18:45:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+variable: name
+
+ ^self new name: name; type: #MethodVar
+
+ "Created: / 26-11-2011 / 18:45:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseVariable methodsFor:'accessing'!
+
+class:something
+ class := something.
+
+ "Created: / 06-04-2011 / 16:51:42 / Jakub <zelenja7@fel.cvut.cz>"
+!
+
+stringToComplete
+
+ "Answers a string to complete"
+
+ ^name , ' '
+
+ "Created: / 20-05-2011 / 13:54:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+type:something
+ type := something.
+! !
+
+!SmallSenseVariable methodsFor:'displaying'!
+
+displayOn:aGC x:x y:y opaque:opaque
+
+ | lw cn cnw fg |
+
+ super displayOn:aGC x:x y:y opaque:opaque.
+
+ class isNil ifTrue:[^self].
+
+ lw := x + 16 + (self label widthOn: aGC).
+ cn := class nameWithoutPrefix.
+ cnw := aGC widthOfString: cn.
+
+ (aGC width > (lw + cnw + 5)) ifTrue:
+ [fg := aGC paint.
+ aGC paint: Color gray .
+ aGC displayString: cn x: aGC width - cnw - 5 y: y.
+ aGC paint: fg.
+ ]
+
+ "Created: / 21-05-2011 / 11:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseVariable methodsFor:'testing'!
+
+isSmallSenseVariable
+ ^ true
+! !
+
+!SmallSenseVariable class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseVariable.st 7825 2011-11-26 18:32:31Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSenseWindow.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,331 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+SimpleDialog subclass:#SmallSenseWindow
+ instanceVariableNames:'codeView result position textHolder selectionHolder
+ selectionUnambigous listHolder'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SmallSense-Interface'
+!
+
+
+!SmallSenseWindow class methodsFor:'interface opening'!
+
+openForView: codeView class: class
+
+ ^self new
+ initializeForView: codeView class: class;
+ completeOrOpen.
+
+ "Created: / 04-04-2011 / 11:54:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-11-2011 / 19:07:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:SmallSenseWindow andSelector:#windowSpec
+ SmallSenseWindow new openInterface:#windowSpec
+ SmallSenseWindow open
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(FullSpec
+ name: windowSpec
+ window:
+ (WindowSpec
+ label: 'SmallSenseMenu'
+ name: 'SmallSenseMenu'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 400 250)
+ returnIsOKInDialog: false
+ )
+ component:
+ (SpecCollection
+ collection: (
+ (SelectionInListModelViewSpec
+ name: 'Completions'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: selectionHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ miniScrollerHorizontal: true
+ backgroundColor: (Color 100.0 100.0 100.0)
+ listModel: listHolder
+ useIndex: false
+ highlightMode: line
+ postBuildCallback: postBuildList:
+ )
+ )
+
+ )
+ )
+! !
+
+!SmallSenseWindow methodsFor:'aspects'!
+
+listHolder
+
+
+ listHolder isNil
+ ifTrue:
+ [ listHolder := ValueHolder new].
+ ^ listHolder.
+
+ "Modified: / 04-04-2011 / 21:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectionHolder
+ <resource: #uiAspect>
+
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ selectionHolder isNil ifTrue:[
+ selectionHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/ selectionHolder addDependent:self.
+"/ selectionHolder onChangeSend:#selectionHolderChanged to:self.
+ ].
+ ^ selectionHolder.
+!
+
+textHolder
+ "return/create the 'textHolder' value holder (automatically generated)"
+
+ textHolder isNil ifTrue:[
+ textHolder := ValueHolder with:''.
+ textHolder onChangeSend:#updateList to: self.
+ ].
+ ^ textHolder
+
+ "Modified: / 26-11-2011 / 17:25:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow methodsFor:'change & update'!
+
+updateList
+
+ "Experiments with new UI"
+
+ | t |
+ result items size == 0 ifTrue:[^self].
+
+ t := self textHolder value.
+ self listHolder value isNil ifTrue:
+ [self listHolder value:result items].
+ [ t size > 0 ] whileTrue:[
+ result items withIndexDo: [:e :i|
+ (e startsWith: t) ifTrue: [
+ self selectionHolder value: e.
+ ^self
+ ]
+ ].
+ t := t allButLast.
+ ]
+
+ "
+ | t list |
+ t := self textHolder value.
+ list := (result objectCollection select:[:e|e stringToComplete startsWith: t]).
+ self listHolder value: list.
+ list size = 1 ifTrue:[self selectionHolder value: list anyOne].
+ "
+
+ "Created: / 04-04-2011 / 15:43:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-11-2011 / 19:25:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow methodsFor:'events'!
+
+complete
+ | selection text lineNo line |
+
+ selection := self selectionHolder value stringToComplete.
+ text := self textHolder value.
+ lineNo := codeView cursorLine.
+ line := codeView list at: (lineNo min: codeView list size).
+ line := ((line size < (codeView cursorCol - text size - 1))
+ ifTrue: [line , (String new: (codeView cursorCol - text size - 1 - line size))]
+ ifFalse:[line copyTo: codeView cursorCol - text size - 1])
+ , selection
+ , (line copyFrom: codeView cursorCol + 1).
+ codeView list at: lineNo put: line.
+ codeView cursorCol: codeView cursorCol - text size + self selectionHolder value cursorColumnAfterComplete.
+ codeView redrawLine:lineNo.
+
+ "Created: / 26-11-2011 / 19:10:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+handlesKeyPress:key inView:aView
+
+ "/Transcript showCR: 'SmallSenseWindow handlesKeyPress: ' , key.
+ key isCharacter ifTrue:[^true].
+ ^#(BackSpace Return) includes: key
+
+ "Created: / 04-04-2011 / 15:52:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 05-04-2011 / 00:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+keyPress:key x:x y:y view:aView
+
+ "/Transcript showCR: 'SmallSenseWindow keyPress: ' , key.
+
+ key isCharacter ifTrue:[self keyPressCharacter: key x:x y:y. ^self].
+ key == #BackSpace ifTrue:[self keyPressBackSpaceX:x y:y.^self].
+ key == #Return ifTrue:[self keyPressReturnX:x y:y.^self]
+
+ "Created: / 04-04-2011 / 15:51:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 05-04-2011 / 00:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+keyPressBackSpaceX:x y:y
+
+ | text |
+ codeView textView keyPress:#BackSpace x:x y:y.
+ text := self textHolder value.
+ text size == 0 ifTrue:[self close. ^self].
+ self textHolder value: (text copyTo: text size - 1).
+
+ "Created: / 04-04-2011 / 16:56:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 08-04-2011 / 22:49:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+keyPressCharacter: char x:x y:y
+
+ | text |
+ text := self textHolder value.
+ self textHolder value: (text , char).
+ codeView textView keyPress:char x:x y:y.
+
+ "Created: / 04-04-2011 / 16:56:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+keyPressReturnX:x y:y
+
+ self selectionHolder value isNil ifTrue:[self close.^self].
+ self complete.
+ self close.
+
+ "Created: / 04-04-2011 / 16:57:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 26-11-2011 / 19:11:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow methodsFor:'hooks'!
+
+postBuildList: listView
+
+ listView scrolledView
+ background: codeView background;
+ font: codeView font;
+ delegate: self.
+
+ "Created: / 03-04-2011 / 10:39:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-04-2011 / 15:50:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+postBuildWith: builder
+
+ builder window
+ windowGroup: codeView windowGroup;
+ bePopUpView;
+ beSlave.
+ builder window sensor setCtrlDown: false.
+
+ "Created: / 03-04-2011 / 10:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-06-2011 / 21:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow methodsFor:'initialization'!
+
+initializeForView: view class: class
+
+ | p node |
+
+ codeView := view.
+ p := codeView characterPositionOfCursor.
+ result := SmallSenseRecognizer
+ resultSetFor: codeView mode
+ source: codeView contents
+ class: class
+ line: codeView cursorLine
+ column: codeView cursorCol.
+
+ result isEmpty ifFalse:[
+ (p := result position) notNil ifTrue:[
+ node := p node.
+ node notNil ifTrue:[
+ (node isVariable and:[p inNode]) ifTrue:[
+ self textHolder value: node name
+ ] ifFalse:[node isMessage ifTrue:[
+ self textHolder value: node selector
+ ]].
+ ].
+ ].
+ self updateList
+ ].
+
+ "Created: / 04-04-2011 / 11:56:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 06-04-2011 / 17:37:25 / Jakub <zelenja7@fel.cvut.cz>"
+ "Modified: / 27-11-2011 / 10:06:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow methodsFor:'interface opening'!
+
+completeOrOpen
+
+ | text matching v|
+
+ result isEmpty ifTrue:[^self].
+
+ (text := textHolder value) notEmptyOrNil ifTrue:[
+ matching := result items select:[:item|item startsWith: text].
+ matching size == 1 ifTrue:[
+ v := matching anElement.
+ (v := selectionHolder value) notNil ifTrue:[
+ (v isSmallSenseVariable or:[v isSmallSenseClass]) ifTrue:[
+ self complete.
+ ^self.
+ ]
+ ].
+ ].
+ ].
+
+ self openModal.
+
+ "Created: / 26-11-2011 / 19:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+openModal
+
+ | p textView x y |
+
+ textView := codeView textView.
+ x := (textView xOfCol:textView cursorCol inVisibleLine:textView cursorLine)
+ - 16"icon" - (textView widthOfString: self textHolder value) - 5"magic constant".
+ y := textView yOfCursor + textView font maxHeight + 3.
+ p := (textView originRelativeTo: nil) + (x @ y).
+
+ self openInterfaceModal:#windowSpec at:p
+
+ "Created: / 04-04-2011 / 21:12:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmallSenseWindow class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: SmallSenseWindow.st 7826 2011-11-27 09:48:43Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/abbrev.stc Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,40 @@
+# automagically generated by the project definition
+# this file is needed for stc to be able to compile modules independently.
+# it provides information about a classes filename, category and especially namespace.
+SmallSenseBaseTestClass SmallSenseBaseTestClass stx:libtool/smallsense 'SmallSense-Tests' 1
+SmallSenseFinder SmallSenseFinder stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseFinderTests SmallSenseFinderTests stx:libtool/smallsense 'SmallSense-Tests' 1
+SmallSenseParser SmallSenseParser stx:libtool/smallsense 'SmallSense-Core' 3
+SmallSenseParserTests SmallSenseParserTests stx:libtool/smallsense 'SmallSense-Tests' 1
+SmallSenseRecognizer SmallSenseRecognizer stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseRecognizerTests SmallSenseRecognizerTests stx:libtool/smallsense 'SmallSense-Tests' 1
+SmallSenseResultItem SmallSenseResultItem stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseResultSet SmallSenseResultSet stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseSelectorNode SmallSenseSelectorNode stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseService SmallSenseService stx:libtool/smallsense 'SmallSense-Interface' 0
+SmallSenseTestCase SmallSenseTestCase stx:libtool/smallsense 'SmallSense-Tests' 1
+SmallSenseTypeCollector SmallSenseTypeCollector stx:libtool/smallsense 'SmallSense-Obsolete-Roel Typer' 0
+SmallSenseTypeCollectorCache SmallSenseTypeCollectorCache stx:libtool/smallsense 'SmallSense-Obsolete-Roel Typer' 0
+SmallSenseWindow SmallSenseWindow stx:libtool/smallsense 'SmallSense-Interface' 1
+stx_libtool_smallsense stx_libtool_smallsense stx:libtool/smallsense '* Projects & Packages *' 3
+SmallSenseAbstractInstvarInterfaceExtractor SmallSenseAbstractInstvarInterfaceExtractor stx:libtool/smallsense 'SmallSense-Obsolete-Roel Typer' 3
+SmallSenseClass SmallSenseClass stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseConstant SmallSenseConstant stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseMethod SmallSenseMethod stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseSnippet SmallSenseSnippet stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseVariable SmallSenseVariable stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseInstvarInterfaceExtractor SmallSenseInstvarInterfaceExtractor stx:libtool/smallsense 'SmallSense-Obsolete-Roel Typer' 3
+SmallSenseParseNodeInspector SmallSenseParseNodeInspector stx:libtool/smallsense 'Perseus-UI-AST Inspector' 1
+SmallSenseParseNodeVisitor SmallSenseParseNodeVisitor stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSensePosition SmallSensePosition stx:libtool/smallsense 'SmallSense-Core' 0
+SmallSenseType SmallSenseType stx:libtool/smallsense 'SmallSense-Types' 0
+SmallSenseInferencer SmallSenseInferencer stx:libtool/smallsense 'SmallSense-Inference' 0
+SmallSenseClassInfo SmallSenseClassInfo stx:libtool/smallsense 'SmallSense-Model' 0
+SmallSenseManager SmallSenseManager stx:libtool/smallsense 'SmallSense-Model' 0
+SmallSenseMethodInfo SmallSenseMethodInfo stx:libtool/smallsense 'SmallSense-Model' 0
+SmallSenseInfo SmallSenseInfo stx:libtool/smallsense 'SmallSense-Model' 0
+SmallSenseTypeHolder SmallSenseTypeHolder stx:libtool/smallsense 'SmallSense-Types' 0
+SmallSenseClassType SmallSenseClassType stx:libtool/smallsense 'SmallSense-Types' 0
+SmallSenseUnionType SmallSenseUnionType stx:libtool/smallsense 'SmallSense-Types' 0
+SmallSenseUnknownType SmallSenseUnknownType stx:libtool/smallsense 'SmallSense-Types' 1
+SmallSenseUnacceptedMethodEnvironment SmallSenseUnacceptedMethodEnvironment stx:libtool/smallsense 'SmallSense-Lint' 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/autopackage/default.apspec Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,85 @@
+# -*- shell-script -*-
+[Meta]
+ShortName:
+SoftwareVersion: 6.2.1.1
+DisplayName: Smalltalk/X Class library
+RootName: @exept.de/expecco:$SOFTWAREVERSION
+Summary: Smalltalk/X Class library
+Maintainer: eXept Software AG
+Packager: eXept Software AG
+PackageVersion: 1
+CPUArchitectures: x86
+AutopackageTarget: 1.0
+Type: Library
+License: Commercial
+
+[Description]
+Smalltalk/X Class library
+
+[BuildPrepare]
+# If you're using autotools, the default should be enough.
+# prepareBuild will set up apbuild and run configure for you. If you
+# need to pass arguments to configure, just add them to prepareBuild:
+# prepareBuild --enable-foo --disable-bar
+#prepareBuild
+
+[BuildUnprepare]
+# If you're using prepareBuild above, there is no need to change this!
+#unprepareBuild
+
+[Globals]
+# Variables declared in this section will be available in all other sections
+export APKG_BUILD_SKIP_CONFIGURE=1
+export APKG_BUILD_SKIP_MAKE=1
+export MYPREFIX=/opt/
+
+[Prepare]
+#recommend '@autopackage.org/autopackage-gtk' 1
+
+[Imports]
+import <<EOF
+$source_dir/
+$source_dir/resources
+$source_dir/keyboard.rc
+$source_dir/display.rc
+$source_dir/../doc
+$source_dir/../testsuites/webedition
+$source_dir/../projects/libraries
+$source_dir/../reportGenerator/tools
+$source_dir/../../pdf/afm
+$source_dir/../plugin/selenium/libexept_expecco_plugin_selenium.so
+$source_dir/../externalTools
+EOF
+
+for i in $source_dir/*.so
+do
+ echo $source_dir/$(readlink $i)
+done | import
+
+[Install]
+if [ "$PREFIX" != "/usr" ]
+then
+ export MYPREFIX=$PREFIX
+fi
+
+find . -type d \( -name CVS -or -name 'not_*' \) -print | xargs rm -rf
+mkdir -p $MYPREFIX
+copyFiles expecco *.rc resources $MYPREFIX/bin
+copyFiles *.so $MYPREFIX/lib
+copyFiles doc externalTools $MYPREFIX/packages/exept/expecco
+copyFiles webedition/projects libraries $MYPREFIX/testsuites
+copyFiles tools $MYPREFIX/packages/exept/expecco/reportGenerator
+copyFiles afm $MYPREFIX/packages/exept/pdf
+copyFiles libexept_expecco_plugin_selenium.so $MYPREFIX/plugin
+
+#installExe expecco
+#installLib *.so
+#installData resources
+#installData keyboard.rc
+#installData doc
+
+[Uninstall]
+# Leaving this at the default is safe unless you use custom commands in
+# "Install" to create files. All autopackage API functions
+# that installs files are logged.
+uninstallFromLog
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bc.mak Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,110 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libtool_smallsense at 2012-01-27 21:20:01.562.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# Notice, that the name bc.mak is historical (from times, when only borland c was supported).
+# This file contains make rules for the win32 platform using either borland-bcc or visual-c.
+# It shares common definitions with the unix-make in Make.spec.
+# The bc.mak supports the following targets:
+# bmake - compile all st-files to a classLib (dll)
+# bmake clean - clean all temp files
+# bmake clobber - clean all
+#
+# Historic Note:
+# this used to contain only rules to make with borland
+# (called via bmake, by "make.exe -f bc.mak")
+# this has changed; it is now also possible to build using microsoft visual c
+# (called via vcmake, by "make.exe -f bc.mak -DUSEVC")
+#
+TOP=..\..
+INCLUDE_TOP=$(TOP)\..
+
+
+
+!INCLUDE $(TOP)\rules\stdHeader_bc
+
+!INCLUDE Make.spec
+
+LIBNAME=libstx_libtool_smallsense
+RESFILES=smallsense.res
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\goodies\roeltyper -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libwidg2 -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers
+LOCALDEFINES=
+
+STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
+LOCALLIBS=
+
+OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
+
+ALL:: classLibRule
+
+classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
+
+!INCLUDE $(TOP)\rules\stdRules_bc
+
+# build all prerequisite packages for this package
+prereq:
+ pushd ..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\goodies\refactoryBrowser\helpers & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\goodies\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libboss & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\libwidg3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\goodies\roeltyper & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\librun & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)SmallSenseInfo.$(O) SmallSenseInfo.$(H): SmallSenseInfo.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseManager.$(O) SmallSenseManager.$(H): SmallSenseManager.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseParseNodeInspector.$(O) SmallSenseParseNodeInspector.$(H): SmallSenseParseNodeInspector.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)SmallSenseParseNodeVisitor.$(O) SmallSenseParseNodeVisitor.$(H): SmallSenseParseNodeVisitor.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseParser.$(O) SmallSenseParser.$(H): SmallSenseParser.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)SmallSensePosition.$(O) SmallSensePosition.$(H): SmallSensePosition.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseRecognizer.$(O) SmallSenseRecognizer.$(H): SmallSenseRecognizer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseResultItem.$(O) SmallSenseResultItem.$(H): SmallSenseResultItem.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseResultSet.$(O) SmallSenseResultSet.$(H): SmallSenseResultSet.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseSelectorNode.$(O) SmallSenseSelectorNode.$(H): SmallSenseSelectorNode.st $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseService.$(O) SmallSenseService.$(H): SmallSenseService.st $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseType.$(O) SmallSenseType.$(H): SmallSenseType.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseTypeCollector.$(O) SmallSenseTypeCollector.$(H): SmallSenseTypeCollector.st $(INCLUDE_TOP)\stx\goodies\roeltyper\TypeCollector.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseTypeCollectorCache.$(O) SmallSenseTypeCollectorCache.$(H): SmallSenseTypeCollectorCache.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)SmallSenseTypeHolder.$(O) SmallSenseTypeHolder.$(H): SmallSenseTypeHolder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnacceptedMethodEnvironment.$(O) SmallSenseUnacceptedMethodEnvironment.$(H): SmallSenseUnacceptedMethodEnvironment.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers\BrowserEnvironment.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseWindow.$(O) SmallSenseWindow.$(H): SmallSenseWindow.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)stx_libtool_smallsense.$(O) stx_libtool_smallsense.$(H): stx_libtool_smallsense.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseAbstractInstvarInterfaceExtractor.$(O) SmallSenseAbstractInstvarInterfaceExtractor.$(H): SmallSenseAbstractInstvarInterfaceExtractor.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseParser.$(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)SmallSenseClass.$(O) SmallSenseClass.$(H): SmallSenseClass.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseResultItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseClassInfo.$(O) SmallSenseClassInfo.$(H): SmallSenseClassInfo.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseInfo.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseClassType.$(O) SmallSenseClassType.$(H): SmallSenseClassType.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseConstant.$(O) SmallSenseConstant.$(H): SmallSenseConstant.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseResultItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseFinder.$(O) SmallSenseFinder.$(H): SmallSenseFinder.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseParseNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseInferencer.$(O) SmallSenseInferencer.$(H): SmallSenseInferencer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseParseNodeVisitor.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseMethod.$(O) SmallSenseMethod.$(H): SmallSenseMethod.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseResultItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseMethodInfo.$(O) SmallSenseMethodInfo.$(H): SmallSenseMethodInfo.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseInfo.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseSnippet.$(O) SmallSenseSnippet.$(H): SmallSenseSnippet.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseResultItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnionType.$(O) SmallSenseUnionType.$(H): SmallSenseUnionType.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseUnknownType.$(O) SmallSenseUnknownType.$(H): SmallSenseUnknownType.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseVariable.$(O) SmallSenseVariable.$(H): SmallSenseVariable.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseResultItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSenseInstvarInterfaceExtractor.$(O) SmallSenseInstvarInterfaceExtractor.$(H): SmallSenseInstvarInterfaceExtractor.st $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseAbstractInstvarInterfaceExtractor.$(H) $(INCLUDE_TOP)\stx\libtool\smallsense\SmallSenseParser.$(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\BlockNode.$(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\libtool\Tools_NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__VariableList.$(H) $(INCLUDE_TOP)\stx\libtool\Tools_BrowserList.$(H) $(INCLUDE_TOP)\stx\libtool\Tools_NavigatorModel.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(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) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bmake.bat Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using borland bcc
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak %*
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extensions.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,217 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+!
+
+!AssignmentNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+
+ aBlock value: #variable value: variable.
+ aBlock value: #expression value: expression.
+
+ "Modified: / 26-11-2011 / 10:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!AssignmentNode methodsFor:'accessing-SmallSense'!
+
+inferedType
+
+ ^ expression inferedType
+
+ "Created: / 26-11-2011 / 12:38:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!AssignmentNode methodsFor:'accessing-SmallSense'!
+
+inferedType: aSmallSenseType
+
+ ^ self shouldNotImplement
+
+ "Created: / 26-11-2011 / 12:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!BlockNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+ "superclass ParseNode says that I am responsible to implement this method"
+
+ statements notNil ifTrue:[
+ statements statementsWithIndexDo:[:stmt :index|
+ aBlock value: 'statement[', index printString, ']'
+ value: stmt
+ ]
+ ]
+
+ "Modified: / 26-11-2011 / 12:10:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!MessageNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+
+ aBlock value: #receiver value: receiver.
+ argArray notNil ifTrue:[
+ argArray withIndexDo:[:node :idx|
+ aBlock value: 'arg[' , idx printString , ']' value: node
+ ]
+ ]
+
+ "Modified: / 26-11-2011 / 12:10:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseErrorNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+ "superclass ParseNode says that I am responsible to implement this method"
+
+ ^ self shouldImplement
+! !
+!ParseErrorNode methodsFor:'accessing'!
+
+errorToken
+
+ ^self objectAttributeAt: #errorToken
+
+ "Created: / 27-11-2011 / 09:25:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseErrorNode methodsFor:'accessing'!
+
+errorToken:something
+
+ self objectAttributeAt: #errorToken put: something
+
+ "Created: / 27-11-2011 / 09:25:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo: aBlock
+
+ "Enumerates all direct children and evaluates a block
+ with its name (usually instVar name) and the node itself"
+
+ ^self subclassResponsibility
+
+ "Created: / 26-11-2011 / 10:38:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseNode methodsFor:'accessing-SmallSense'!
+
+inferedType
+
+ | t |
+ t := self objectAttributeAt:#inferedType.
+ t isNil ifTrue:[t := SmallSenseType default].
+ ^t
+
+ "Created: / 26-11-2011 / 12:38:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseNode methodsFor:'accessing-SmallSense'!
+
+inferedType: aSmallSenseType
+
+ ^ self objectAttributeAt:#inferedType put: aSmallSenseType
+
+ "Created: / 26-11-2011 / 12:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ParseNode methodsFor:'testing'!
+
+isSelector
+ "return true, if this is a node for an selctors"
+
+ ^ false
+
+ "Created: / 22-02-2011 / 21:44:45 / Jakub <zelenja7@fel.cvut.cz>"
+! !
+!PrimaryNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+
+ "Initionally left blank, primary nodes have no children"
+
+ "Modified: / 26-11-2011 / 11:49:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!StatementNode methodsFor:'enumeration'!
+
+childNamesAndValuesDo:aBlock
+
+ aBlock value: #expression value: expression
+
+ "Modified (comment): / 26-11-2011 / 12:11:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!StatementNode methodsFor:'accessing-SmallSense'!
+
+inferedType
+
+ ^ expression inferedType
+
+ "Created: / 26-11-2011 / 12:38:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!StatementNode methodsFor:'accessing-SmallSense'!
+
+inferedType: aSmallSenseType
+
+ ^ self shouldNotImplement
+
+ "Created: / 26-11-2011 / 12:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!Tools::NavigationState methodsFor:'aspects'!
+
+selectedClasses
+ "WARNING WARNING:
+ This is overwriten method from SmallSense!!!!!!
+ "
+ selectedClasses isNil ifTrue:[
+ selectedClasses := "SpecialValueHolder with:nil." nil asValue.
+ (ConfigurableFeatures includesFeature:'SmallSenseEnabled') ifTrue:[
+ selectedClasses onChangeEvaluate:[
+ selectedClasses value ? #() do:[:cls|
+ SmallSenseManager instance updateInfoForClass: cls.
+ ].
+ ]
+ ]
+ ].
+ ^ selectedClasses
+
+ "Modified: / 27-11-2011 / 17:50:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!UserPreferences methodsFor:'accessing-SmallSense'!
+
+smallSenseEnabled
+ "Return true if SmallSense is enabled"
+
+ ^self at:#smallSenseEnabled ifAbsent:[false]
+
+ "Created: / 27-11-2011 / 17:20:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!UserPreferences methodsFor:'accessing-SmallSense'!
+
+smallSenseEnabled: aBoolean
+
+ "Enables/disables SmallSense support"
+
+ self at:#smallSenseEnabled ifAbsentPut: aBoolean
+
+ "
+ UserPreferences current smallSenseEnabled
+ UserPreferences current smallSenseEnabled: true.
+ UserPreferences current smallSenseEnabled: false.
+ "
+
+ "Created: / 27-11-2011 / 17:21:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!VariableNode methodsFor:'queries'!
+
+isGlobalOrPrivateClass
+
+ ^ type == #GlobalVariable or:[type == #PrivateClass]
+
+ "Created: / 27-11-2011 / 16:31:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+!ConfigurableFeatures class methodsFor:'queries-features'!
+
+hasSmallSenseEnabled
+
+ ^UserPreferences current smallSenseEnabled
+
+
+ "
+ ConfigurableFeatures hasSmallSenseEnabled
+ ConfigurableFeatures includesFeature:'SmallSenseEnabled'
+ "
+
+ "Created: / 27-11-2011 / 17:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lcmake.bat Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USELCC=1 %1 %2
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libInit.cc Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,65 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_libtool_smallsense.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_libtool_smallsense_Init() INIT_TEXT_SECTION;
+// DLL_EXPORT void _libstx_libtool_smallsense_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+// void _libstx_libtool_smallsense_InitDefinition(pass, __pRT__, snd)
+// OBJ snd; struct __vmData__ *__pRT__; {
+// __BEGIN_PACKAGE2__("libstx_libtool_smallsense__DFN", _libstx_libtool_smallsense_InitDefinition, "stx:libtool/smallsense");
+// _stx_137libtool_137smallsense_Init(pass,__pRT__,snd);
+
+// __END_PACKAGE__();
+// }
+
+void _libstx_libtool_smallsense_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_libtool_smallsense", _libstx_libtool_smallsense_Init, "stx:libtool/smallsense");
+_SmallSenseInfo_Init(pass,__pRT__,snd);
+_SmallSenseManager_Init(pass,__pRT__,snd);
+_SmallSenseParseNodeInspector_Init(pass,__pRT__,snd);
+_SmallSenseParseNodeVisitor_Init(pass,__pRT__,snd);
+_SmallSenseParser_Init(pass,__pRT__,snd);
+_SmallSensePosition_Init(pass,__pRT__,snd);
+_SmallSenseRecognizer_Init(pass,__pRT__,snd);
+_SmallSenseResultItem_Init(pass,__pRT__,snd);
+_SmallSenseResultSet_Init(pass,__pRT__,snd);
+_SmallSenseSelectorNode_Init(pass,__pRT__,snd);
+_SmallSenseService_Init(pass,__pRT__,snd);
+_SmallSenseType_Init(pass,__pRT__,snd);
+_SmallSenseTypeCollector_Init(pass,__pRT__,snd);
+_SmallSenseTypeCollectorCache_Init(pass,__pRT__,snd);
+_SmallSenseTypeHolder_Init(pass,__pRT__,snd);
+_SmallSenseUnacceptedMethodEnvironment_Init(pass,__pRT__,snd);
+_SmallSenseWindow_Init(pass,__pRT__,snd);
+_stx_137libtool_137smallsense_Init(pass,__pRT__,snd);
+_SmallSenseAbstractInstvarInterfaceExtractor_Init(pass,__pRT__,snd);
+_SmallSenseClass_Init(pass,__pRT__,snd);
+_SmallSenseClassInfo_Init(pass,__pRT__,snd);
+_SmallSenseClassType_Init(pass,__pRT__,snd);
+_SmallSenseConstant_Init(pass,__pRT__,snd);
+_SmallSenseFinder_Init(pass,__pRT__,snd);
+_SmallSenseInferencer_Init(pass,__pRT__,snd);
+_SmallSenseMethod_Init(pass,__pRT__,snd);
+_SmallSenseMethodInfo_Init(pass,__pRT__,snd);
+_SmallSenseSnippet_Init(pass,__pRT__,snd);
+_SmallSenseUnionType_Init(pass,__pRT__,snd);
+_SmallSenseUnknownType_Init(pass,__pRT__,snd);
+_SmallSenseVariable_Init(pass,__pRT__,snd);
+_SmallSenseInstvarInterfaceExtractor_Init(pass,__pRT__,snd);
+
+_stx_137libtool_137smallsense_extensions_Init(pass,__pRT__,snd);
+__END_PACKAGE__();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smallsense.rc Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,37 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_libtool_smallsense.
+//
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 6,2,7843,7843
+ PRODUCTVERSION 6,2,1,1
+#if (__BORLANDC__)
+ FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VS_USER_DEFINED
+#endif
+
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "eXept Software AG\0"
+ VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
+ VALUE "FileVersion", "6.2.7843.7843\0"
+ VALUE "InternalName", "stx:libtool/smallsense\0"
+ VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
+ VALUE "ProductName", "Smalltalk/X\0"
+ VALUE "ProductVersion", "6.2.1.1\0"
+ VALUE "ProductDate", "Fri, 27 Jan 2012 21:20:13 GMT\0"
+ END
+
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN // Language | Translation
+ VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
+ END
+END
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/stx_libtool_smallsense.st Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,183 @@
+"{ Package: 'stx:libtool/smallsense' }"
+
+LibraryDefinition subclass:#stx_libtool_smallsense
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'* Projects & Packages *'
+!
+
+!stx_libtool_smallsense class methodsFor:'documentation'!
+
+extensionsVersion_SVN
+ ^ '$Id: stx_libtool_smallsense.st 7843 2012-01-23 11:58:43Z vranyj1 $'
+! !
+
+!stx_libtool_smallsense class methodsFor:'description'!
+
+excludedFromPreRequisites
+ "list all packages which should be ignored in the automatic
+ preRequisites scan. See #preRequisites for more."
+
+ ^ #(
+ )
+!
+
+preRequisites
+ "list all required packages.
+ This list can be maintained manually or (better) generated and
+ updated by scanning the superclass hierarchies and looking for
+ global variable accesses. (the browser has a menu function for that)
+ Howevery, often too much is found, and you may want to explicitely
+ exclude individual packages in the #excludedFromPrerequisites method."
+
+ ^ #(
+ #'stx:goodies/refactoryBrowser/helpers' "BrowserEnvironment - superclass of SmallSenseService::UnacceptedMethodEnvironment "
+ #'stx:goodies/roeltyper' "TypeCollector - superclass of SmallSenseTypeCollector "
+ #'stx:goodies/sunit'
+ #'stx:libbasic' "Object - superclass of SmallSenseResultSet "
+ #'stx:libbasic2' "CacheDictionary - superclass of SmallSenseTypeCollectorCache "
+ #'stx:libcomp' "SyntaxHighlighter - superclass of SmallSenseParser "
+ #'stx:libtool' "Tools::NavigatorModel - superclass of extended Tools::VariableList "
+ #'stx:libview' "Color - referenced by SmallSenseMethod>>displayOn:x:y:opaque: "
+ #'stx:libview2' "SimpleDialog - superclass of SmallSenseWindow "
+ #'stx:libwidg'
+ #'stx:libwidg2' "HierarchicalItem - superclass of SmallSenseParseNodeInspector::ParseNodeItem "
+ )
+! !
+
+!stx_libtool_smallsense class methodsFor:'description - contents'!
+
+classNamesAndAttributes
+ "lists the classes which are to be included in the project.
+ Each entry in the list may be: a single class-name (symbol),
+ or an array-literal consisting of class name and attributes.
+ Attributes are: #autoload or #<os> where os is one of win32, unix,..."
+
+ ^ #(
+ "<className> or (<className> attributes...) in load order"
+ (SmallSenseBaseTestClass autoload)
+ SmallSenseFinder
+ (SmallSenseFinderTests autoload)
+ SmallSenseParser
+ (SmallSenseParserTests autoload)
+ SmallSenseRecognizer
+ (SmallSenseRecognizerTests autoload)
+ SmallSenseResultItem
+ SmallSenseResultSet
+ SmallSenseSelectorNode
+ SmallSenseService
+ (SmallSenseTestCase autoload)
+ SmallSenseTypeCollector
+ SmallSenseTypeCollectorCache
+ SmallSenseWindow
+ #'stx_libtool_smallsense'
+ SmallSenseAbstractInstvarInterfaceExtractor
+ SmallSenseClass
+ SmallSenseConstant
+ SmallSenseMethod
+ SmallSenseSnippet
+ SmallSenseVariable
+ SmallSenseInstvarInterfaceExtractor
+ SmallSenseParseNodeInspector
+ SmallSenseParseNodeVisitor
+ SmallSensePosition
+ SmallSenseType
+ SmallSenseInferencer
+ SmallSenseClassInfo
+ SmallSenseManager
+ SmallSenseMethodInfo
+ SmallSenseInfo
+ SmallSenseTypeHolder
+ SmallSenseClassType
+ SmallSenseUnionType
+ SmallSenseUnknownType
+ )
+!
+
+extensionMethodNames
+ "lists the extension methods which are to be included in the project.
+ Entries are 2-element array literals, consisting of class-name and selector."
+
+ ^ #(
+ ParseNode isSelector
+ AssignmentNode childNamesAndValuesDo:
+ AssignmentNode inferedType
+ AssignmentNode inferedType:
+ BlockNode childNamesAndValuesDo:
+ MessageNode childNamesAndValuesDo:
+ ParseErrorNode childNamesAndValuesDo:
+ ParseErrorNode errorToken
+ ParseErrorNode errorToken:
+ ParseNode childNamesAndValuesDo:
+ ParseNode inferedType
+ ParseNode inferedType:
+ PrimaryNode childNamesAndValuesDo:
+ StatementNode childNamesAndValuesDo:
+ StatementNode inferedType
+ StatementNode inferedType:
+ #'Tools::NavigationState' selectedClasses
+ #'Tools::VariableList' listOfVariables
+ UserPreferences smallSenseEnabled
+ UserPreferences smallSenseEnabled:
+ VariableNode isGlobalOrPrivateClass
+ 'ConfigurableFeatures class' hasSmallSenseEnabled
+ #'Tools::VariableList' listEntryForClass:name:info:
+ )
+! !
+
+!stx_libtool_smallsense class methodsFor:'description - project information'!
+
+applicationIconFileName
+ "Return the name (without suffix) of an icon-file (the app's icon); will be included in the rc-resource file"
+
+ ^ nil
+ "/ ^ self applicationName
+!
+
+companyName
+ "Return a companyname which will appear in <lib>.rc"
+
+ ^ 'eXept Software AG'
+!
+
+description
+ "Return a description string which will appear in vc.def / bc.def"
+
+ ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+ "Return a copyright string which will appear in <lib>.rc"
+
+ ^ 'Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011'
+!
+
+productName
+ "Return a product name which will appear in <lib>.rc"
+
+ ^ 'Smalltalk/X'
+! !
+
+!stx_libtool_smallsense class methodsFor:'description - svn'!
+
+svnRepositoryUrlString
+ "Return a SVN repository URL of myself.
+ (Generated since 2011-04-08)
+ "
+
+ ^ '$URL: https://vranyj1@swing.fit.cvut.cz/svn/stx/libtool/branches/jv/smallsense/stx_libtool_smallsense.st $'
+!
+
+svnRevisionNr
+ "Return a SVN revision number of myself.
+ This number is updated after a commit"
+
+ ^ "$SVN-Revision:"'7841'"$"
+! !
+
+!stx_libtool_smallsense class methodsFor:'documentation'!
+
+version_SVN
+ ^ '$Id: stx_libtool_smallsense.st 7843 2012-01-23 11:58:43Z vranyj1 $'
+! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vcmake.bat Sun Jan 29 12:56:58 2012 +0000
@@ -0,0 +1,12 @@
+@REM -------
+@REM make using microsoft visual c
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+
+@if not defined VSINSTALLDIR (
+ call "C:\Program Files\Microsoft Visual Studio 10.0"\VC\bin\vcvars32.bat
+)
+make.exe -N -f bc.mak -DUSEVC %*
+
+