Commited a Smalltalk parser (MC package PetitSmalltalk)
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 07 Oct 2014 09:42:03 +0100
changeset 385 44a36ed4e484
parent 384 a613ecf5d2a1
child 386 a409905f7f2d
Commited a Smalltalk parser (MC package PetitSmalltalk) Name: PetitSmalltalk-JanKurs.71 Author: JanKurs Time: 19-08-2014, 02:18:05 AM UUID: d1d11836-f3e2-4709-abd3-e2ff3b72d7c4 Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main Ancestors: Fixes to be compatible with PPContext
Make.proto
parsers/smalltalk/Make.proto
parsers/smalltalk/Make.spec
parsers/smalltalk/Makefile.init
parsers/smalltalk/PPSmalltalkGrammar.st
parsers/smalltalk/PPSmalltalkParser.st
parsers/smalltalk/PPSmalltalkToken.st
parsers/smalltalk/PPSmalltalkTokenParser.st
parsers/smalltalk/abbrev.stc
parsers/smalltalk/bc.mak
parsers/smalltalk/bmake.bat
parsers/smalltalk/extensions.st
parsers/smalltalk/lccmake.bat
parsers/smalltalk/libInit.cc
parsers/smalltalk/mingwmake.bat
parsers/smalltalk/smalltalk.rc
parsers/smalltalk/stx_goodies_petitparser_parsers_smalltalk.st
parsers/smalltalk/tests/Make.proto
parsers/smalltalk/tests/Make.spec
parsers/smalltalk/tests/Makefile.init
parsers/smalltalk/tests/PPSmalltalkClassesTests.st
parsers/smalltalk/tests/PPSmalltalkGrammarTests.st
parsers/smalltalk/tests/PPSmalltalkParserTests.st
parsers/smalltalk/tests/abbrev.stc
parsers/smalltalk/tests/bc.mak
parsers/smalltalk/tests/bmake.bat
parsers/smalltalk/tests/lccmake.bat
parsers/smalltalk/tests/libInit.cc
parsers/smalltalk/tests/mingwmake.bat
parsers/smalltalk/tests/stx_goodies_petitparser_parsers_smalltalk_tests.st
parsers/smalltalk/tests/tests.rc
parsers/smalltalk/tests/vcmake.bat
parsers/smalltalk/vcmake.bat
petitparser.rc
stx_goodies_petitparser.st
tests/PPAbstractParserTest.st
tests/PPComposedTest.st
tests/PPScriptingTest.st
tests/tests.rc
--- a/Make.proto	Mon Oct 06 19:18:20 2014 +0100
+++ b/Make.proto	Tue Oct 07 09:42:03 2014 +0100
@@ -63,17 +63,17 @@
 
 all:: preMake classLibRule postMake
 
-pre_objs::  
+pre_objs::
 
 
 mc:
 	mkdir mc
 
 mcz: mc
-	$(TOP)/projects/smalltalk/smalltalk --eval "                              \
-		 Smalltalk packagePath add:'$(TOP)' .                             \
-		 Smalltalk loadPackage:'stx:goodies/petitparser'.                 \
-		 (Smalltalk at: #'stx_goodies_petitparser') exportAsMczTo: 'mc'."
+	$(TOP)/projects/smalltalk/smalltalk --eval "                       \
+		Smalltalk packagePath add:'$(TOP)' .                             \
+		Smalltalk loadPackage:'stx:goodies/petitparser'.                 \
+		(Smalltalk at: #'stx_goodies_petitparser') exportAsMczTo: 'mc'."
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/Make.proto	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,135 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk.
+#
+# 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/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libcomp
+
+
+# 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_goodies_petitparser_parsers_smalltalk
+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::  
+
+
+
+
+
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
+stx_goodies_petitparser_parsers_smalltalk.$(O): $(shell hg root)/.hg/dirstate
+endif
+
+
+
+
+# run default testsuite for this package
+test: $(TOP)/goodies/builder/reports
+	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
+	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)
+
+
+
+# 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
+
+# build all mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	cd ../../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+# build all packages containing referenced classes for this package
+# they are nor needed to compile the package
+references:
+
+
+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)PPSmalltalkGrammar.$(O) PPSmalltalkGrammar.$(H): PPSmalltalkGrammar.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkToken.$(O) PPSmalltalkToken.$(H): PPSmalltalkToken.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPToken.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkTokenParser.$(O) PPSmalltalkTokenParser.$(H): PPSmalltalkTokenParser.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPFlattenParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPTokenParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)stx_goodies_petitparser_parsers_smalltalk.$(O) stx_goodies_petitparser_parsers_smalltalk.$(H): stx_goodies_petitparser_parsers_smalltalk.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkParser.$(O) PPSmalltalkParser.$(H): PPSmalltalkParser.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk/PPSmalltalkGrammar.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBToken.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueToken.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/Make.spec	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,71 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk.
+#
+# 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=goodies/petitparser/parsers/smalltalk
+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= \
+	PPSmalltalkGrammar \
+	PPSmalltalkToken \
+	PPSmalltalkTokenParser \
+	stx_goodies_petitparser_parsers_smalltalk \
+	PPSmalltalkParser \
+
+
+
+
+COMMON_OBJS= \
+    $(OUTDIR_SLASH)PPSmalltalkGrammar.$(O) \
+    $(OUTDIR_SLASH)PPSmalltalkToken.$(O) \
+    $(OUTDIR_SLASH)PPSmalltalkTokenParser.$(O) \
+    $(OUTDIR_SLASH)stx_goodies_petitparser_parsers_smalltalk.$(O) \
+    $(OUTDIR_SLASH)PPSmalltalkParser.$(O) \
+    $(OUTDIR_SLASH)extensions.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/Makefile.init	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+# MACOSX caveat:
+#   as filenames are not case sensitive (in a default setup),
+#   we cannot use the above trick. Therefore, this file is now named
+#   "Makefile.init", and you have to execute "make -f Makefile.init" to
+#   get the initial makefile.  This is now also done by the toplevel CONFIG
+#   script.
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile: mf
+
+mf:
+	$(TOP)/rules/stmkmf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/PPSmalltalkGrammar.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,446 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
+
+PPCompositeParser subclass:#PPSmalltalkGrammar
+	instanceVariableNames:'array arrayItem arrayLiteral arrayLiteralArray assignment
+		assignmentToken binary binaryExpression binaryMessage
+		binaryMethod binaryPragma binaryToken block blockArgument
+		blockArguments blockArgumentsWith blockArgumentsWithout blockBody
+		byteLiteral byteLiteralArray cascadeExpression cascadeMessage
+		char charLiteral charToken expression falseLiteral falseToken
+		identifier identifierToken keyword keywordExpression
+		keywordMessage keywordMethod keywordPragma keywordToken literal
+		message method methodDeclaration methodSequence multiword
+		nilLiteral nilToken number numberLiteral numberToken parens
+		period periodToken pragma pragmaMessage pragmas primary return
+		sequence startExpression startMethod statements string
+		stringLiteral stringToken symbol symbolLiteral symbolLiteralArray
+		temporaries trueLiteral trueToken unary unaryExpression
+		unaryMessage unaryMethod unaryPragma unaryToken variable'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Core'
+!
+
+PPSmalltalkGrammar comment:'A parser for Smalltalk methods and expressions.'
+!
+
+!PPSmalltalkGrammar class methodsFor:'accessing'!
+
+parseExpression: aString
+	^ self new parseExpression: aString
+!
+
+parseExpression: aString onError: aBlock
+	^ self new parseExpression: aString onError: aBlock
+!
+
+parseMethod: aString
+	^ self new parseMethod: aString
+!
+
+parseMethod: aString onError: aBlock
+	^ self new parseMethod: aString onError: aBlock
+! !
+
+!PPSmalltalkGrammar class methodsFor:'testing'!
+
+allowUnderscoreAssignment
+	^ (Scanner respondsTo: #allowUnderscoreAsAssignment) and: [ Scanner allowUnderscoreAsAssignment ]
+! !
+
+!PPSmalltalkGrammar methodsFor:'accessing'!
+
+start
+	"Default start production."
+
+	^ startMethod
+!
+
+startExpression
+	"Start production for the expression."
+
+	^ sequence end
+!
+
+startMethod
+	"Start production for the method."
+
+	^ method end
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar'!
+
+array
+	^ ${ asParser smalltalkToken , (expression delimitedBy: periodToken) optional , $} asParser smalltalkToken
+!
+
+assignment
+	^ variable , assignmentToken
+!
+
+expression
+	^ assignment star , cascadeExpression
+!
+
+literal
+	^ numberLiteral / stringLiteral / charLiteral / arrayLiteral / byteLiteral / symbolLiteral / nilLiteral / trueLiteral / falseLiteral
+!
+
+message
+	^ keywordMessage / binaryMessage / unaryMessage
+!
+
+method
+	^ methodDeclaration , methodSequence
+!
+
+methodDeclaration
+	^ keywordMethod / unaryMethod / binaryMethod
+!
+
+methodSequence
+	^ periodToken star , pragmas , periodToken star , temporaries , periodToken star , pragmas , periodToken star , statements
+!
+
+parens
+	^ $( asParser smalltalkToken , expression , $) asParser smalltalkToken
+!
+
+pragma
+	^ $< asParser smalltalkToken , pragmaMessage , $> asParser smalltalkToken
+!
+
+pragmas
+	^ pragma star
+!
+
+primary
+	^ literal / variable / block / parens / array
+!
+
+return
+	^ $^ asParser smalltalkToken , expression
+!
+
+sequence
+	^ temporaries , periodToken star , statements
+!
+
+statements
+	^ 	(expression wrapped , ((periodToken plus , statements ==> [ :nodes | nodes first , nodes last ])
+								/ periodToken star)
+			==> [ :nodes | (Array with: nodes first) , (nodes last) ])
+	/	(return , periodToken star
+			==> [ :nodes | (Array with: nodes first) , (nodes last) ])
+	/	(periodToken star)
+!
+
+temporaries
+	^ ($| asParser smalltalkToken , variable star , $| asParser smalltalkToken) optional ==> [ :nodes | nodes ifNil: [ #() ] ]
+!
+
+variable
+	^ identifierToken
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar-blocks'!
+
+block
+	^ $[ asParser smalltalkToken , blockBody , $] asParser smalltalkToken
+!
+
+blockArgument
+	^ $: asParser smalltalkToken , variable
+!
+
+blockArguments
+	^ blockArgumentsWith / blockArgumentsWithout
+!
+
+blockArgumentsWith
+	^ blockArgument plus , ($| asParser smalltalkToken / ($] asParser smalltalkToken and ==> [ :node | nil ]))
+!
+
+blockArgumentsWithout
+	^ nil asParser ==> [ :nodes | Array with: #() with: nil ]
+!
+
+blockBody
+	^ blockArguments , sequence
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar-literals'!
+
+arrayItem
+	^ literal / symbolLiteralArray / arrayLiteralArray / byteLiteralArray
+!
+
+arrayLiteral
+	^ '#(' asParser smalltalkToken , arrayItem star , $) asParser smalltalkToken
+!
+
+arrayLiteralArray
+	^ $( asParser smalltalkToken , arrayItem star , $) asParser smalltalkToken
+!
+
+byteLiteral
+	^ '#[' asParser smalltalkToken , numberLiteral star , $] asParser smalltalkToken
+!
+
+byteLiteralArray
+	^ $[ asParser smalltalkToken , numberLiteral star , $] asParser smalltalkToken
+!
+
+charLiteral
+	^ charToken
+!
+
+falseLiteral
+	^ falseToken
+!
+
+nilLiteral
+	^ nilToken
+!
+
+numberLiteral
+	^ numberToken
+!
+
+stringLiteral
+	^ stringToken
+!
+
+symbolLiteral
+	"This is totally fucked up: The Pharo compiler allows multiple #, arbitrary spaces between the # and the symbol, as well as comments inbetween. And yes, it is used."
+
+	^ $# asParser smalltalkToken plus , symbol smalltalkToken ==> [ :tokens | tokens first copyWith: tokens last ]
+!
+
+symbolLiteralArray
+	^ symbol smalltalkToken
+!
+
+trueLiteral
+	^ trueToken
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar-messages'!
+
+binaryExpression
+	^ unaryExpression , binaryMessage star
+!
+
+binaryMessage
+	^ (binaryToken , unaryExpression) ==> [ :nodes | 
+		Array 
+			with: (Array with: nodes first)
+			with: (Array with: nodes second) ]
+!
+
+cascadeExpression
+	^ keywordExpression , cascadeMessage star
+!
+
+cascadeMessage
+	^ $; asParser smalltalkToken , message
+!
+
+keywordExpression
+	^ binaryExpression , keywordMessage optional
+!
+
+keywordMessage
+	^ (keywordToken , binaryExpression) plus ==> [ :nodes | 
+		Array 
+			with: (nodes collect: [ :each | each first ])
+			with: (nodes collect: [ :each | each second ]) ]
+!
+
+unaryExpression
+	^ primary , unaryMessage star
+!
+
+unaryMessage
+	^ unaryToken ==> [ :node | 
+		Array 
+			with: (Array with: node)
+			with: Array new ]
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar-methods'!
+
+binaryMethod
+	^ (binaryToken , variable) ==> [ :nodes | 
+		Array 
+			with: (Array with: nodes first)
+			with: (Array with: nodes second) ]
+!
+
+keywordMethod
+	^ (keywordToken , variable) plus ==> [ :nodes | 
+		Array 
+			with: (nodes collect: [ :each | each first ])
+			with: (nodes collect: [ :each | each second ]) ]
+!
+
+unaryMethod
+	^ identifierToken ==> [ :node | 
+		Array 
+			with: (Array with: node)
+			with: Array new ]
+! !
+
+!PPSmalltalkGrammar methodsFor:'grammar-pragmas'!
+
+binaryPragma
+	^ (binaryToken , arrayItem) ==> [ :nodes | 
+		Array 
+			with: (Array with: nodes first)
+			with: (Array with: nodes second) ]
+!
+
+keywordPragma
+	^ (keywordToken , arrayItem) plus ==> [ :nodes | 
+		Array 
+			with: (nodes collect: [ :each | each first ])
+			with: (nodes collect: [ :each | each second ]) ]
+!
+
+pragmaMessage
+	^ keywordPragma / unaryPragma / binaryPragma
+!
+
+unaryPragma
+	^ identifierToken ==> [ :node | 
+		Array 
+			with: (Array with: node)
+			with: (Array new) ]
+! !
+
+!PPSmalltalkGrammar methodsFor:'parsing'!
+
+parseExpression: aString 
+	^ self parseExpression: aString onError: [ :msg :pos | self error: msg ]
+!
+
+parseExpression: aString onError: aBlock
+	^ startExpression parse: aString onError: aBlock
+!
+
+parseMethod: aString 
+	^ self parseMethod: aString onError: [ :msg :pos | self error: msg ]
+!
+
+parseMethod: aString onError: aBlock
+	^ startMethod parse: aString onError: aBlock
+! !
+
+!PPSmalltalkGrammar methodsFor:'primitives'!
+
+binary
+	^ (PPPredicateObjectParser anyOf: '!!%&*+,-/<=>?@\|~') plus
+!
+
+char
+	^ $$ asParser , #any asParser
+!
+
+identifier
+	^ self class allowUnderscoreAssignment
+		ifTrue: [ #letter asParser , #word asParser star ]
+		ifFalse: [
+			(PPPredicateObjectParser
+				on: [ :each | each isLetter or: [ each = $_ ] ]
+				message: 'letter expected') ,
+			(PPPredicateObjectParser
+				on: [ :each | each isAlphaNumeric or: [ each = $_ ] ]
+				message: 'letter or digit expected') star ]
+!
+
+keyword
+	^ identifier , $: asParser
+!
+
+multiword
+	^ keyword plus
+!
+
+number
+        ^ ($- asParser optional , #digit asParser) and , [ :context | 
+                [ (NumberParser on: context stream) nextNumber ] 
+                        on: Error
+                        do: [ :err | PPFailure message: err messageText at: context position ] ] 
+                                asParser
+
+    "Modified: / 07-10-2014 / 09:10:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+period
+	^ $. asParser
+!
+
+string
+	^ $' asParser , ('''''' asParser / $' asParser negate) star , $' asParser
+!
+
+symbol
+	^ unary / binary / multiword / string
+!
+
+unary
+	^ identifier , $: asParser not
+! !
+
+!PPSmalltalkGrammar methodsFor:'token'!
+
+assignmentToken
+	^ self class allowUnderscoreAssignment
+		ifTrue: [ (':=' asParser / '_' asParser) smalltalkToken ]
+		ifFalse: [ ':=' asParser smalltalkToken ]
+!
+
+binaryToken
+	^ binary smalltalkToken
+!
+
+charToken
+	^ char smalltalkToken
+!
+
+falseToken
+	^ ('false' asParser , #word asParser not) smalltalkToken
+!
+
+identifierToken
+	^ identifier smalltalkToken
+!
+
+keywordToken
+	^ keyword smalltalkToken
+!
+
+nilToken
+	^ ('nil' asParser , #word asParser not) smalltalkToken
+!
+
+numberToken
+	^ number smalltalkToken
+!
+
+periodToken
+	^ period smalltalkToken
+!
+
+stringToken
+	^ string smalltalkToken
+!
+
+trueToken
+	^ ('true' asParser , #word asParser not) smalltalkToken
+!
+
+unaryToken
+	^ unary smalltalkToken
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/PPSmalltalkParser.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,304 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
+
+PPSmalltalkGrammar subclass:#PPSmalltalkParser
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Core'
+!
+
+PPSmalltalkParser comment:'Enhances the Smalltalk grammar with production actions to build parse-tree nodes of the refactoring browser.'
+!
+
+!PPSmalltalkParser methodsFor:'accessing'!
+
+startExpression
+	"Make the sequence node has a method node as its parent and that the source is set."
+
+	^ ([ :stream | stream collection ] asParser and , super startExpression) map: [ :source :node | 
+		(RBMethodNode selector: #doIt body: node)
+			source: source.
+		(node statements size = 1 and: [ node temporaries isEmpty ])
+			ifTrue: [ node statements first ]
+			ifFalse: [ node ] ]
+!
+
+startMethod
+	"Make sure the method node has the source code properly set."
+	
+	^ ([ :stream | stream collection ] asParser and , super startMethod)
+		map: [ :source :node | node source: source ]
+! !
+
+!PPSmalltalkParser methodsFor:'grammar'!
+
+array
+	^ super array map: [ :openNode :statementNodes :closeNode |
+		(self buildArray: statementNodes)
+			left: openNode start;
+			right: closeNode start;
+			yourself ]
+!
+
+expression
+	^ super expression map: [ :variableNodes :expressionNodes | self build: expressionNodes assignment: variableNodes ]
+!
+
+method
+	^ super method map: [ :methodNode :bodyNode | 
+		methodNode pragmas: bodyNode first.
+		methodNode body: bodyNode second.
+		self buildMethod: methodNode ]
+!
+
+methodDeclaration
+	^ super methodDeclaration ==> [ :nodes |
+		RBMethodNode 
+			selectorParts: nodes first
+			arguments: nodes second ]
+!
+
+methodSequence
+	^ super methodSequence map: [ :periodNodes1 :pragmaNodes1 :periodNodes2 :tempNodes :periodNodes3 :pragmaNodes2 :periodNodes4 :statementNodes |
+		Array
+			with: pragmaNodes1 , pragmaNodes2
+			with: (self build: tempNodes sequence: periodNodes1 , periodNodes2 , periodNodes3 , periodNodes4 , statementNodes) ]
+!
+
+parens
+	^ super parens map: [ :openToken :expressionNode :closeToken | expressionNode addParenthesis: (openToken start to: closeToken start) ]
+!
+
+pragma
+	^ super pragma ==> [ :nodes | 
+		(RBPragmaNode selectorParts: nodes second first arguments: nodes second second)
+			addComments: nodes first comments;
+			addComments: nodes last comments;
+			left: nodes first start;
+			right: nodes last start;
+			yourself ]
+!
+
+return
+	^ super return map: [ :token :expressionNode | RBReturnNode return: token start value: expressionNode ]
+!
+
+sequence
+	^ super sequence map: [ :tempNodes :periodNodes :statementNodes | self build: tempNodes sequence: periodNodes , statementNodes ]
+!
+
+variable
+	^ super variable ==> [ :token | RBVariableNode identifierToken: token ]
+! !
+
+!PPSmalltalkParser methodsFor:'grammar-blocks'!
+
+block
+	^ super block map: [ :leftToken :blockNode :rightToken | blockNode left: leftToken start; right: rightToken start ]
+!
+
+blockArgument
+	^ super blockArgument ==> #second
+!
+
+blockBody
+	^ super blockBody
+		==> [ :nodes | 
+			| result |
+			result := RBBlockNode arguments: nodes first first body: nodes last.
+			nodes first last ifNotNil: [ result bar: nodes first last start ].
+			result ]
+! !
+
+!PPSmalltalkParser methodsFor:'grammar-literals'!
+
+arrayLiteral
+	^ super arrayLiteral ==> [ :nodes | RBLiteralArrayNode startPosition: nodes first start contents: nodes second stopPosition: nodes last start isByteArray: false ]
+!
+
+arrayLiteralArray
+	^ super arrayLiteralArray ==> [ :nodes | RBLiteralArrayNode startPosition: nodes first start contents: nodes second stopPosition: nodes last start isByteArray: false ]
+!
+
+byteLiteral
+	^ super byteLiteral ==> [ :nodes | RBLiteralArrayNode startPosition: nodes first start contents: nodes second stopPosition: nodes last start isByteArray: true ]
+!
+
+byteLiteralArray
+	^ super byteLiteralArray ==> [ :nodes | RBLiteralArrayNode startPosition: nodes first start contents: nodes second stopPosition: nodes last start isByteArray: true ]
+!
+
+charLiteral
+	^ super charLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: token inputValue second start: token start stop: token stop) comments: token comments; yourself) ]
+!
+
+falseLiteral
+	^ super falseLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: false start: token start stop: token stop) comments: token comments; yourself) ]
+!
+
+nilLiteral
+	^ super nilLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: nil start: token start stop: token stop) comments: token comments; yourself) ]
+!
+
+numberLiteral
+	^ super numberLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBNumberLiteralToken value: (Number readFrom: token inputValue) start: token start stop: token stop source: token inputValue) comments: token comments; yourself) ]
+!
+
+stringLiteral
+	^ super stringLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: (self buildString: token inputValue) start: token start stop: token stop) comments: token comments; yourself) ]
+!
+
+symbolLiteral
+	^ super symbolLiteral ==> [ :tokens | RBLiteralValueNode literalToken: ((RBLiteralToken value: (self buildString: tokens last inputValue) asSymbol start: tokens first start stop: tokens last stop) comments: tokens last comments; yourself) ]
+!
+
+symbolLiteralArray
+	^ super symbolLiteralArray ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: (self buildString: token inputValue) asSymbol start: token start stop: token stop) comments: token comments; yourself) ]
+!
+
+trueLiteral
+	^ super trueLiteral ==> [ :token | RBLiteralValueNode literalToken: ((RBLiteralToken value: true start: token start stop: token stop) comments: token comments; yourself) ]
+! !
+
+!PPSmalltalkParser methodsFor:'grammar-messages'!
+
+binaryExpression
+	^ super binaryExpression map: [ :receiverNode :messageNodes | self build: receiverNode messages: messageNodes ]
+!
+
+cascadeExpression
+	^ super cascadeExpression map: [ :receiverNode :messageNodes | self build: receiverNode cascade: messageNodes ]
+!
+
+keywordExpression
+	^ super keywordExpression map: [ :receiveNode :messageNode | self build: receiveNode messages: (Array with: messageNode) ]
+!
+
+unaryExpression
+	^ super unaryExpression map: [ :receiverNode :messageNodes | self build: receiverNode messages: messageNodes ]
+! !
+
+!PPSmalltalkParser methodsFor:'private'!
+
+addStatements: aCollection into: aNode
+	aCollection isNil 
+		ifTrue: [ ^ aNode ].
+	aCollection do: [ :each |
+		each class == PPSmalltalkToken
+			ifFalse: [ aNode addNode:  each ]
+			ifTrue: [
+				aNode statements isEmpty
+					ifTrue: [ aNode addComments: each comments ]
+					ifFalse: [ aNode statements last addComments: each comments ].
+				aNode periods: (aNode periods asOrderedCollection
+					addLast: each start;
+					yourself) ] ].
+	^ aNode
+!
+
+build: aNode assignment: anArray
+	^ anArray isEmpty
+		ifTrue: [ aNode ]
+		ifFalse: [
+			anArray reverse 
+				inject: aNode
+				into: [ :result :each |
+					RBAssignmentNode 
+						variable: each first
+						value: result
+						position: each second start ] ]
+!
+
+build: aNode cascade: anArray 
+	| messages semicolons |
+	^ (anArray isNil or: [ anArray isEmpty ]) 
+		ifTrue: [ aNode ]
+		ifFalse: [
+			messages := OrderedCollection new: anArray size + 1.
+			messages addLast: aNode.
+			semicolons := OrderedCollection new.
+			anArray do: [ :each | 
+				messages addLast: (self 
+					build: aNode receiver
+					messages: (Array with: each second)).
+				semicolons addLast: each first start ].
+			RBCascadeNode messages: messages semicolons: semicolons ]
+!
+
+build: aNode messages: anArray 
+	^ (anArray isNil or: [ anArray isEmpty ]) 
+		ifTrue: [ aNode ]
+		ifFalse: [
+			anArray 
+				inject: aNode
+				into: [ :rec :msg | 
+					msg isNil 
+						ifTrue: [ rec ]
+						ifFalse: [
+							RBMessageNode 
+								receiver: rec
+								selectorParts: msg first
+								arguments: msg second ] ] ]
+!
+
+build: aTempCollection sequence: aStatementCollection
+	| result |
+	result := self
+		addStatements: aStatementCollection
+		into: RBSequenceNode new.
+	aTempCollection isEmpty ifFalse: [
+		result
+			leftBar: aTempCollection first start
+			temporaries: aTempCollection second
+			rightBar: aTempCollection last start ].
+	^ result
+!
+
+buildArray: aStatementCollection
+	^ self addStatements: aStatementCollection into: RBArrayNode new
+!
+
+buildMethod: aMethodNode
+	aMethodNode selectorParts 
+		do: [ :each | aMethodNode addComments: each comments ].
+	aMethodNode arguments
+		do: [ :each | aMethodNode addComments: each token comments ].
+	aMethodNode pragmas do: [ :pragma |
+		aMethodNode addComments: pragma comments.
+		pragma selectorParts 
+			do: [ :each | aMethodNode addComments: each comments ].
+		pragma arguments do: [ :each | 
+			each isLiteralArray
+				ifFalse: [ aMethodNode addComments: each token comments ] ].
+		pragma comments: nil ].
+	^ aMethodNode
+!
+
+buildString: aString 
+	(aString isEmpty or: [ aString first ~= $' or: [ aString last ~= $' ] ])
+		ifTrue: [ ^ aString ].
+	^ (aString 
+		copyFrom: 2
+		to: aString size - 1) 
+		copyReplaceAll: ''''''
+		with: ''''
+! !
+
+!PPSmalltalkParser methodsFor:'token'!
+
+binaryToken
+	^ super binaryToken ==> [ :token | (RBBinarySelectorToken value: token inputValue start: token start) comments: token comments; yourself ]
+!
+
+identifierToken
+	^ super identifierToken ==> [ :token | (RBIdentifierToken value: token inputValue start: token start) comments: token comments; yourself ]
+!
+
+keywordToken
+	^ super keywordToken ==> [ :token | (RBKeywordToken value: token inputValue start: token start) comments: token comments; yourself ]
+!
+
+unaryToken
+	^ super unaryToken ==> [ :token | (RBIdentifierToken value: token inputValue start: token start) comments: token comments; yourself ]
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/PPSmalltalkToken.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,28 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
+
+PPToken subclass:#PPSmalltalkToken
+	instanceVariableNames:'comments'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Core'
+!
+
+PPSmalltalkToken comment:''
+!
+
+!PPSmalltalkToken methodsFor:'accessing'!
+
+comments
+	^ comments
+!
+
+comments: anArray
+	comments := anArray
+! !
+
+!PPSmalltalkToken methodsFor:'compatiblity'!
+
+length
+	^ self size
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/PPSmalltalkTokenParser.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,65 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
+
+PPTokenParser subclass:#PPSmalltalkTokenParser
+	instanceVariableNames:''
+	classVariableNames:'SeparatorPredicate'
+	poolDictionaries:''
+	category:'PetitSmalltalk-Core'
+!
+
+PPSmalltalkTokenParser comment:'A parser that knows how to skip comments and whitespace in Smalltalk and how to instantiate tokens.'
+!
+
+
+!PPSmalltalkTokenParser class methodsFor:'initialization'!
+
+initialize
+	SeparatorPredicate := PPCharSetPredicate on: [ :char | char isSeparator ]
+! !
+
+!PPSmalltalkTokenParser methodsFor:'parsing'!
+
+parseComments: anArray on: aPPContext
+	| start comments |
+	comments := anArray.
+	[ [ aPPContext atEnd not and: [ SeparatorPredicate value: aPPContext uncheckedPeek ] ]
+		whileTrue: [ aPPContext next ].
+	 aPPContext atEnd not and: [ aPPContext uncheckedPeek = $" ] ] whileTrue: [
+		aPPContext next.
+		start := aPPContext position.
+		aPPContext upTo: $".
+		comments := comments copyWith: (start to: aPPContext position) ].
+	^ comments
+!
+
+parseOn: aPPContext
+	| memento comments token |
+	memento := aPPContext remember.
+	comments := self
+		parseComments: #()
+		on: aPPContext.
+	token := super parseOn: aPPContext.
+	token isPetitFailure ifTrue: [
+		aPPContext restore: memento.
+		^ token ].
+	comments := self
+		parseComments: comments
+		on: aPPContext.
+	^ token comments: comments
+! !
+
+!PPSmalltalkTokenParser methodsFor:'private'!
+
+defaultTokenClass
+	^ PPSmalltalkToken
+! !
+
+!PPSmalltalkTokenParser class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
+
+PPSmalltalkTokenParser initialize!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/abbrev.stc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,8 @@
+# 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.
+PPSmalltalkGrammar PPSmalltalkGrammar stx:goodies/petitparser/parsers/smalltalk 'PetitSmalltalk-Core' 0
+PPSmalltalkToken PPSmalltalkToken stx:goodies/petitparser/parsers/smalltalk 'PetitSmalltalk-Core' 0
+PPSmalltalkTokenParser PPSmalltalkTokenParser stx:goodies/petitparser/parsers/smalltalk 'PetitSmalltalk-Core' 0
+stx_goodies_petitparser_parsers_smalltalk stx_goodies_petitparser_parsers_smalltalk stx:goodies/petitparser/parsers/smalltalk '* Projects & Packages *' 3
+PPSmalltalkParser PPSmalltalkParser stx:goodies/petitparser/parsers/smalltalk 'PetitSmalltalk-Core' 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/bc.mak	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,89 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk.
+#
+# 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_goodies_petitparser_parsers_smalltalk
+RESFILES=smalltalk.$(RES)
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libcomp
+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 mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	pushd ..\..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\.. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+
+
+
+test: $(TOP)\goodies\builder\reports\NUL
+	pushd $(TOP)\goodies\builder\reports & $(MAKE_BAT)
+	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)
+        
+clean::
+	del *.$(CSUFFIX)
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)PPSmalltalkGrammar.$(O) PPSmalltalkGrammar.$(H): PPSmalltalkGrammar.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkToken.$(O) PPSmalltalkToken.$(H): PPSmalltalkToken.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPToken.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkTokenParser.$(O) PPSmalltalkTokenParser.$(H): PPSmalltalkTokenParser.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPFlattenParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPTokenParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)stx_goodies_petitparser_parsers_smalltalk.$(O) stx_goodies_petitparser_parsers_smalltalk.$(H): stx_goodies_petitparser_parsers_smalltalk.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
+$(OUTDIR)PPSmalltalkParser.$(O) PPSmalltalkParser.$(H): PPSmalltalkParser.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk\PPSmalltalkGrammar.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBToken.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueToken.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
+# **Must be at end**
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+!IFDEF HGROOT
+$(OUTDIR)stx_goodies_petitparser_parsers_smalltalk.$(O): $(HGROOT)\.hg\dirstate
+!ENDIF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/bmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,12 @@
+@REM -------
+@REM make using Borland bcc32
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak  %DEFINES% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/extensions.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,28 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"!
+
+!PPParser methodsFor:'*petitsmalltalk-operations'!
+
+smalltalkToken
+	^ PPSmalltalkTokenParser on: self
+! !
+
+!RBProgramNode methodsFor:'*petitsmalltalk-accessing'!
+
+addComments: aCollectionOfIntervals
+	(aCollectionOfIntervals isNil or: [ aCollectionOfIntervals isEmpty ])
+		ifFalse: [ self comments: self comments , aCollectionOfIntervals ]
+! !
+
+!RBValueToken methodsFor:'*PetitSmalltalk-Test'!
+
+inputValue
+	self flag: 'ugly hack to deal with PPToken #value deprecation '.
+	^ self value
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'documentation'!
+
+extensionsVersion_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/lccmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lccmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak -DUSELCC=1 %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/libInit.cc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,38 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_goodies_petitparser_parsers_smalltalk_Init() INIT_TEXT_SECTION;
+DLL_EXPORT void _libstx_goodies_petitparser_parsers_smalltalk_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+void _libstx_goodies_petitparser_parsers_smalltalk_InitDefinition(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_petitparser_parsers_smalltalk__DFN", _libstx_goodies_petitparser_parsers_smalltalk_InitDefinition, "stx:goodies/petitparser/parsers/smalltalk");
+_stx_137goodies_137petitparser_137parsers_137smalltalk_Init(pass,__pRT__,snd);
+
+__END_PACKAGE__();
+}
+
+void _libstx_goodies_petitparser_parsers_smalltalk_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_petitparser_parsers_smalltalk", _libstx_goodies_petitparser_parsers_smalltalk_Init, "stx:goodies/petitparser/parsers/smalltalk");
+_PPSmalltalkGrammar_Init(pass,__pRT__,snd);
+_PPSmalltalkToken_Init(pass,__pRT__,snd);
+_PPSmalltalkTokenParser_Init(pass,__pRT__,snd);
+_stx_137goodies_137petitparser_137parsers_137smalltalk_Init(pass,__pRT__,snd);
+_PPSmalltalkParser_Init(pass,__pRT__,snd);
+
+_stx_137goodies_137petitparser_137parsers_137smalltalk_extensions_Init(pass,__pRT__,snd);
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/mingwmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,16 @@
+@REM -------
+@REM make using mingw gnu compiler
+@REM type mingwmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+
+@pushd ..\..\..\..\rules
+@call find_mingw.bat
+@popd
+make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/smalltalk.rc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,37 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     6,2,32767,32767
+  PRODUCTVERSION  6,2,4,0
+#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.32767.32767\0"
+      VALUE "InternalName", "stx:goodies/petitparser/parsers/smalltalk\0"
+      VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2014\nCopyright eXept Software AG 1998-2014\0"
+      VALUE "ProductName", "Smalltalk/X\0"
+      VALUE "ProductVersion", "6.2.4.0\0"
+      VALUE "ProductDate", "Tue, 07 Oct 2014 08:24:10 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/parsers/smalltalk/stx_goodies_petitparser_parsers_smalltalk.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,160 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"
+
+LibraryDefinition subclass:#stx_goodies_petitparser_parsers_smalltalk
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'accessing - monticello'!
+
+monticelloLastMergedVersionInfo
+    "The last merged version is: "
+
+    ^ '
+    Name: PetitSmalltalk-JanKurs.71
+    Author: JanKurs
+    Time: 19-08-2014, 02:18:05 AM
+    UUID: d1d11836-f3e2-4709-abd3-e2ff3b72d7c4          
+    Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main
+    '
+
+    "Created: / 03-10-2014 / 02:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2014 / 09:14:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+monticelloName
+    "Return name of the package for Monticello. This is used when package is exported"
+
+    ^ 'PetitSmalltalk'
+
+    "Created: / 03-10-2014 / 01:47:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2014 / 09:14:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'accessing - tests'!
+
+testSuite
+    "generate and return a testSuite containing all of my test-classes"
+
+    Smalltalk loadPackage: 'stx:goodies/petitparser/parsers/smalltalk'.
+    ^ 'stx:goodies/petitparser/parsers/smalltalk' asPackageId projectDefinitionClass testSuite
+
+    "Modified: / 07-10-2014 / 09:16:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list packages which are to be explicitely excluded from the automatic constructed
+     prerequisites list. If empty, everything that is found along the inheritance of any of
+     my classes is considered to be a prerequisite package."
+
+    ^ #(
+    )
+!
+
+mandatoryPreRequisites
+    "list packages which are mandatory as a prerequisite.
+     This are packages containing superclasses of my classes and classes which
+     are extended by myself.
+     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
+     This method is generated automatically,
+     by searching along the inheritance chain of all of my classes."
+
+    ^ #(
+        #'stx:goodies/petitparser'    "PPCompositeParser - superclass of PPSmalltalkGrammar"
+        #'stx:goodies/refactoryBrowser/parser'    "RBProgramNode - extended"
+        #'stx:libbasic'    "LibraryDefinition - superclass of stx_goodies_petitparser_parsers_smalltalk"
+    )
+!
+
+referencedPreRequisites
+    "list packages which are a prerequisite, because they contain
+     classes which are referenced by my classes.
+     We do not need these packages as a prerequisite for loading or compiling.
+     This method is generated automatically,
+     by searching all classes (and their packages) which are referenced by my classes."
+
+    ^ #(
+        #'stx:libcomp'    "Scanner - referenced by PPSmalltalkGrammar class>>allowUnderscoreAssignment"
+    )
+!
+
+subProjects
+    "list packages which are known as subprojects.
+     The generated makefile will enter those and make there as well.
+     However: they are not forced to be loaded when a package is loaded;
+     for those, redefine requiredPrerequisites."
+
+    ^ #(
+    )
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk 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"
+        PPSmalltalkGrammar
+        PPSmalltalkToken
+        PPSmalltalkTokenParser
+        #'stx_goodies_petitparser_parsers_smalltalk'
+        PPSmalltalkParser
+    )
+!
+
+extensionMethodNames
+    "list class/selector pairs of extensions.
+     A correponding method with real names must be present in my concrete subclasses"
+
+    ^ #(
+        PPParser smalltalkToken
+        RBProgramNode addComments:
+        RBValueToken inputValue
+    )
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'description - project information'!
+
+companyName
+    "Returns a company string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Returns a description string which will appear in nt.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Returns a copyright string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'Copyright Claus Gittinger 1988-2014\nCopyright eXept Software AG 1998-2014'
+!
+
+productName
+    "Returns a product name which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info.
+     This method is usually redefined in a concrete application definition"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'documentation'!
+
+version_HG
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/Make.proto	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,134 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk_tests.
+#
+# 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/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic
+
+
+# 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_goodies_petitparser_parsers_smalltalk_tests
+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::  
+
+
+
+
+
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
+stx_goodies_petitparser_parsers_smalltalk_tests.$(O): $(shell hg root)/.hg/dirstate
+endif
+
+
+
+
+# run default testsuite for this package
+test: $(TOP)/goodies/builder/reports
+	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
+	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)
+
+
+
+# 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
+
+# build all mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	cd ../../../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+# build all packages containing referenced classes for this package
+# they are nor needed to compile the package
+references:
+
+
+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)stx_goodies_petitparser_parsers_smalltalk_tests.$(O) stx_goodies_petitparser_parsers_smalltalk_tests.$(H): stx_goodies_petitparser_parsers_smalltalk_tests.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/Make.spec	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,62 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk_tests.
+#
+# 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=goodies/petitparser/parsers/smalltalk/tests
+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= \
+	stx_goodies_petitparser_parsers_smalltalk_tests \
+
+
+
+
+COMMON_OBJS= \
+    $(OUTDIR_SLASH)stx_goodies_petitparser_parsers_smalltalk_tests.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/Makefile.init	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+# MACOSX caveat:
+#   as filenames are not case sensitive (in a default setup),
+#   we cannot use the above trick. Therefore, this file is now named
+#   "Makefile.init", and you have to execute "make -f Makefile.init" to
+#   get the initial makefile.  This is now also done by the toplevel CONFIG
+#   script.
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile: mf
+
+mf:
+	$(TOP)/rules/stmkmf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/PPSmalltalkClassesTests.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,203 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk/tests' }"
+
+PPCompositeParserTest subclass:#PPSmalltalkClassesTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Tests'
+!
+
+PPSmalltalkClassesTests comment:'Evalaute the following code to verify the complete image.'
+!
+
+!PPSmalltalkClassesTests class methodsFor:'accessing'!
+
+packageNamesUnderTest
+	^ #('PetitSmalltalk')
+! !
+
+!PPSmalltalkClassesTests class methodsFor:'utilities'!
+
+benchmark: aParser
+	"self benchmark: PPSmalltalkGrammar new"
+	"self benchmark: PPSmalltalkParser new"
+	"self benchmark: RBParser"
+	
+	| sources |
+	sources := OrderedCollection new.
+	SequenceableCollection withAllSubclassesDo: [ :class |
+		class selectorsDo: [ :selector |
+			sources add: (class sourceCodeAt: selector) ] ].
+	^ self benchmark: aParser sources: sources asArray
+!
+
+benchmark: aParser sources: aCollection
+	| count start |
+	count := 0.
+	start := Time millisecondClockValue.
+	[  aCollection do: [ :each | aParser parseMethod: each ].
+		count := count + 1.
+		(Time millisecondsSince: start) < 10000 ] whileTrue.
+	^ (1000 * count * (aCollection detectSum: [ :each | each size ]) 
+		/ (Time millisecondsSince: start)) asInteger asString , ' characters/sec'
+!
+
+verifySystem
+	Smalltalk globals allClasses
+		inject: self new
+		into: [ :test :class | test verifyClass: class ]
+! !
+
+!PPSmalltalkClassesTests methodsFor:'accessing'!
+
+parserClass
+	^ PPSmalltalkParser
+! !
+
+!PPSmalltalkClassesTests methodsFor:'private'!
+
+assert: aBoolean description: aString 
+	self 
+		assert: aBoolean
+		description: aString
+		resumable: true
+!
+
+verifyClass: aClass 
+	aClass selectors 
+		do: [ :selector | self verifyClass: aClass selector: selector ].
+	aClass isMeta
+		ifFalse: [ self verifyClass: aClass class ]
+!
+
+verifyClass: aClass selector: aSelector 
+	"Verifies that the method aSelector in aClass parses the same using the standard refactoring parser and the petit smalltalk parser. Also make sure that the position information of all tokens and comments is equal."
+
+	| signature source original other checker |
+	signature := aClass name , '>>#' , aSelector.
+	source := aClass sourceCodeAt: aSelector.
+	source isNil ifTrue: [ ^ self ].
+	original := aClass parseTreeFor: aSelector.
+	original isNil ifTrue: [ ^ self ].
+	other := self parserInstance
+		parseMethod: source
+		onError: [ :err | self assert: false description: signature ].
+	self 
+		assert: original = other
+		description: 'Code in ' , signature.
+	checker := [ :node1 :node2 |
+		self 
+			assert: node1 sourceInterval = node2 sourceInterval 
+			description: 'Source intervals in ' , signature.
+		(node1 isArray or: [ node1 isBlock or: [ node1 isPragma ] ]) ifTrue: [
+			self
+				assert: node1 left = node2 left
+				description: 'Source position left in ' , signature.
+			self
+				assert: node1 right = node2 right
+				description: 'Source position right in ' , signature ].
+		(node1 isSequence) ifTrue: [
+			self
+				assert: node1 leftBar = node2 leftBar
+				description: 'Source position leftBar in ' , signature.
+			self
+				assert: node1 rightBar = node2 rightBar
+				description: 'Source position rightBar in ' , signature ].
+		(node1 isBlock) ifTrue: [
+			self
+				assert: node1 bar = node2 bar
+				description: 'Source position bar in ' , signature ].
+		(node1 isReturn) ifTrue: [
+			self
+				assert: node1 return = node2 return
+				description: 'Source position return in ' , signature ].
+		(node1 isAssignment) ifTrue: [
+			self
+				assert: node1 assignment = node2 assignment
+				description: 'Source position return in ' , signature ].
+		(node1 isCascade) ifTrue: [
+			self
+				assert: node1 semicolons asArray = node2 semicolons asArray
+				description: 'Source position semicolons in ' , signature ].
+		(node1 isArray or: [ node1 isSequence ]) ifTrue: [
+			self
+				assert: node1 periods asArray = node2 periods asArray
+				description: 'Source position periods in ' , signature ].
+		(node1 isMethod or: [ node1 isMessage or: [ node1 isPragma ] ]) ifTrue: [
+			node1 selectorParts with: node2 selectorParts do: [ :a :b |
+				self
+					assert: a start = b start
+					description: 'Source position selector parts in ' , signature ] ].
+		node1 children with: node2 children do: checker ].
+	checker value: original value: other
+! !
+
+!PPSmalltalkClassesTests methodsFor:'testing'!
+
+testCollection
+	self verifyClass: Collection.
+	self verifyClass: Array.
+	self verifyClass: Set.
+	self verifyClass: Dictionary.
+	self verifyClass: Bag.
+	self verifyClass: OrderedCollection.
+	self verifyClass: SortedCollection
+!
+
+testException
+	self verifyClass: Exception.
+	self verifyClass: Notification.
+	self verifyClass: Warning.
+	self verifyClass: Error
+!
+
+testFundamental
+	self verifyClass: Object.
+	self verifyClass: Boolean.
+	self verifyClass: True.
+	self verifyClass: False.
+	self verifyClass: Character
+
+
+!
+
+testMagnitude
+	self verifyClass: Magnitude.
+	self verifyClass: Number.
+	self verifyClass: Integer.
+	self verifyClass: Float.
+	self verifyClass: Fraction
+!
+
+testStream
+	self verifyClass: Stream.
+	self verifyClass: ReadStream.
+	self verifyClass: WriteStream
+! !
+
+!PPSmalltalkClassesTests methodsFor:'testing-protocol'!
+
+testParseExpression
+	result := self parserClass parseExpression: '1 + 2'.
+	self assert: result isMessage.
+	self assert: result source equals: '1 + 2'.
+	result := self parserClass parseExpression: '| a | 1 + a'.
+	self assert: result isSequence.
+	self assert: result source equals: '| a | 1 + a'.
+	result := self parserClass parseExpression: '1 + 2. ^ 3'.
+	self assert: result isSequence.
+	self assert: result source equals: '1 + 2. ^ 3'.
+	result := self parserClass parseExpression: '1 + ' onError: [ :err | true ].
+	self assert: result.
+	self should: [ self parserClass parseExpression: '1 + ' ] raise: Error
+!
+
+testParseMethod
+	result := self parserClass parseMethod: 'do 1 + 2'.
+	self assert: result isMethod.
+	self assert: result source equals: 'do 1 + 2'.
+	result := self parserClass parseMethod: 'do 1 +' onError: [ :err | true ].
+	self assert: result.
+	self should: [ self parserClass parseMethod: 'do 1 +' ] raise: Error
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/PPSmalltalkGrammarTests.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,897 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk/tests' }"
+
+PPCompositeParserTest subclass:#PPSmalltalkGrammarTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Tests'
+!
+
+PPSmalltalkGrammarTests comment:''
+!
+
+
+!PPSmalltalkGrammarTests class methodsFor:'accessing'!
+
+packageNamesUnderTest
+	^ #('PetitSmalltalk')
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'accessing'!
+
+parserClass
+	^ PPSmalltalkGrammar
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'testing'!
+
+testArray1
+	self 
+		parse: '{}'
+		rule: #array
+!
+
+testArray2
+	self 
+		parse: '{self foo}'
+		rule: #array
+!
+
+testArray3
+	self 
+		parse: '{self foo. self bar}'
+		rule: #array
+!
+
+testArray4
+	self 
+		parse: '{self foo. self bar.}'
+		rule: #array
+!
+
+testAssignment1
+	self 
+		parse: '1'
+		rule: #expression
+!
+
+testAssignment2
+	self 
+		parse: 'a := 1'
+		rule: #expression
+!
+
+testAssignment3
+	self 
+		parse: 'a := b := 1'
+		rule: #expression
+!
+
+testAssignment4
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifTrue: [ self parse: 'a _ 1' rule: #expression ]
+		ifFalse: [ self fail: 'a _ 1' rule: #expression ]
+!
+
+testAssignment5
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ]
+		ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ]
+!
+
+testAssignment6
+	self 
+		parse: 'a := (b := c)'
+		rule: #expression
+!
+
+testComment1
+	self 
+		parse: '1"one"+2'
+		rule: #expression
+!
+
+testComment2
+	self 
+		parse: '1 "one" +2'
+		rule: #expression
+!
+
+testComment3
+	self 
+		parse: '1"one"+"two"2'
+		rule: #expression
+!
+
+testComment4
+	self 
+		parse: '1"one""two"+2'
+		rule: #expression
+!
+
+testComment5
+	self 
+		parse: '1"one"	"two"+2'
+		rule: #expression
+!
+
+testCompleteness
+	"This test asserts that all subclasses override all test methods."
+	
+	self class allSubclasses do: [ :subclass |
+		self class testSelectors do: [ :selector |
+			self 
+				assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ])
+				description: subclass printString , ' does not test ' , selector printString ] ]
+!
+
+testMethod1
+	self 
+		parse: 'negated ^ 0 - self'
+		rule: #method
+!
+
+testMethod2
+	"Spaces at the beginning of the method."
+	self 
+		parse: '	  negated ^ 0 - self'
+		rule: #method
+!
+
+testMethod3
+	"Spaces at the end of the method."
+	self 
+		parse: '	negated ^ 0 - self  '
+		rule: #method
+!
+
+testSequence1
+	self 
+		parse: '| a | 1 . 2'
+		rule: #sequence
+!
+
+testStatements1
+	self 
+		parse: '1'
+		rule: #sequence
+!
+
+testStatements2
+	self 
+		parse: '1 . 2'
+		rule: #sequence
+!
+
+testStatements3
+	self 
+		parse: '1 . 2 . 3'
+		rule: #sequence
+!
+
+testStatements4
+	self 
+		parse: '1 . 2 . 3 .'
+		rule: #sequence
+!
+
+testStatements5
+	self 
+		parse: '1 . . 2'
+		rule: #sequence
+!
+
+testStatements6
+	self 
+		parse: '1. 2'
+		rule: #sequence
+!
+
+testStatements7
+	self 
+		parse: '. 1'
+		rule: #sequence
+!
+
+testStatements8
+	self 
+		parse: '.1'
+		rule: #sequence
+!
+
+testTemporaries1
+	self 
+		parse: '| a |'
+		rule: #sequence
+!
+
+testTemporaries2
+	self 
+		parse: '| a b |'
+		rule: #sequence
+!
+
+testTemporaries3
+	self 
+		parse: '| a b c |'
+		rule: #sequence
+!
+
+testVariable1
+	self 
+		parse: 'trueBinding'
+		rule: #primary
+!
+
+testVariable2
+	self 
+		parse: 'falseBinding'
+		rule: #primary
+!
+
+testVariable3
+	self 
+		parse: 'nilly'
+		rule: #primary
+!
+
+testVariable4
+	self 
+		parse: 'selfish'
+		rule: #primary
+!
+
+testVariable5
+	self 
+		parse: 'supernanny'
+		rule: #primary
+!
+
+testVariable6
+	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
+		self 
+			parse: 'super_nanny'
+			rule: #primary ]
+!
+
+testVariable7
+	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
+		self 
+			parse: '__gen_var_123__'
+			rule: #primary ]
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'testing-blocks'!
+
+testArgumentsBlock1
+	self 
+		parse: '[ :a | ]'
+		rule: #block
+!
+
+testArgumentsBlock2
+	self 
+		parse: '[ :a :b | ]'
+		rule: #block
+!
+
+testArgumentsBlock3
+	self 
+		parse: '[ :a :b :c | ]'
+		rule: #block
+!
+
+testComplexBlock1
+	self 
+		parse: '[ :a | | b | c ]'
+		rule: #block
+!
+
+testComplexBlock2
+	self 
+		parse: '[:a||b|c]'
+		rule: #block
+!
+
+testSimpleBlock1
+	self 
+		parse: '[ ]'
+		rule: #block
+!
+
+testSimpleBlock2
+	self 
+		parse: '[ nil ]'
+		rule: #block
+!
+
+testSimpleBlock3
+	self 
+		parse: '[ :a ]'
+		rule: #block
+!
+
+testStatementBlock1
+	self 
+		parse: '[ nil ]'
+		rule: #block
+!
+
+testStatementBlock2
+	self 
+		parse: '[ | a | nil ]'
+		rule: #block
+!
+
+testStatementBlock3
+	self 
+		parse: '[ | a b | nil ]'
+		rule: #block
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'testing-literals'!
+
+testArrayLiteral1
+	self 
+		parse: '#()'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral10
+	self 
+		parse: '#((1 2) #(1 2 3))'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral11
+	self 
+		parse: '#([1 2] #[1 2 3])'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral2
+	self 
+		parse: '#(1)'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral3
+	self 
+		parse: '#(1 2)'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral4
+	self 
+		parse: '#(true false nil)'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral5
+	self 
+		parse: '#($a)'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral6
+	self 
+		parse: '#(1.2)'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral7
+	self 
+		parse: '#(size #at: at:put: #''=='')'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral8
+	self 
+		parse: '#(''baz'')'
+		rule: #arrayLiteral
+!
+
+testArrayLiteral9
+	self 
+		parse: '#((1) 2)'
+		rule: #arrayLiteral
+!
+
+testByteLiteral1
+	self 
+		parse: '#[]'
+		rule: #byteLiteral
+!
+
+testByteLiteral2
+	self 
+		parse: '#[0]'
+		rule: #byteLiteral
+!
+
+testByteLiteral3
+	self 
+		parse: '#[255]'
+		rule: #byteLiteral
+!
+
+testByteLiteral4
+	self 
+		parse: '#[ 1 2 ]'
+		rule: #byteLiteral
+!
+
+testByteLiteral5
+	self 
+		parse: '#[ 2r1010 8r77 16rFF ]'
+		rule: #byteLiteral
+!
+
+testCharLiteral1
+	self 
+		parse: '$a'
+		rule: #charLiteral
+!
+
+testCharLiteral2
+	self 
+		parse: '$ '
+		rule: #charLiteral
+!
+
+testCharLiteral3
+	self 
+		parse: '$$'
+		rule: #charLiteral
+!
+
+testNumberLiteral1
+	self 
+		parse: '0'
+		rule: #numberLiteral
+!
+
+testNumberLiteral10
+	self 
+		parse: '10r10'
+		rule: #numberLiteral
+!
+
+testNumberLiteral11
+	self 
+		parse: '8r777'
+		rule: #numberLiteral
+!
+
+testNumberLiteral12
+	self 
+		parse: '16rAF'
+		rule: #numberLiteral
+!
+
+testNumberLiteral13
+	self 
+		parse: '16rCA.FE'
+		rule: #numberLiteral
+!
+
+testNumberLiteral14
+	self 
+		parse: '3r-22.2'
+		rule: #numberLiteral
+!
+
+testNumberLiteral15
+	self 
+		parse: '0.50s2'
+		rule: #numberLiteral
+!
+
+testNumberLiteral2
+	self 
+		parse: '0.1'
+		rule: #numberLiteral
+!
+
+testNumberLiteral3
+	self 
+		parse: '123'
+		rule: #numberLiteral
+!
+
+testNumberLiteral4
+	self 
+		parse: '123.456'
+		rule: #numberLiteral
+!
+
+testNumberLiteral5
+	self 
+		parse: '-0'
+		rule: #numberLiteral
+!
+
+testNumberLiteral6
+	self 
+		parse: '-0.1'
+		rule: #numberLiteral
+!
+
+testNumberLiteral7
+	self 
+		parse: '-123'
+		rule: #numberLiteral
+!
+
+testNumberLiteral8
+	self 
+		parse: '-123'
+		rule: #numberLiteral
+!
+
+testNumberLiteral9
+	self 
+		parse: '-123.456'
+		rule: #numberLiteral
+!
+
+testSpecialLiteral1
+	self 
+		parse: 'true'
+		rule: #trueLiteral
+!
+
+testSpecialLiteral2
+	self 
+		parse: 'false'
+		rule: #falseLiteral
+!
+
+testSpecialLiteral3
+	self 
+		parse: 'nil'
+		rule: #nilLiteral
+!
+
+testStringLiteral1
+	self 
+		parse: ''''''
+		rule: #stringLiteral
+!
+
+testStringLiteral2
+	self 
+		parse: '''ab'''
+		rule: #stringLiteral
+!
+
+testStringLiteral3
+	self 
+		parse: '''ab''''cd'''
+		rule: #stringLiteral
+!
+
+testSymbolLiteral1
+	self 
+		parse: '#foo'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral2
+	self 
+		parse: '#+'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral3
+	self 
+		parse: '#key:'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral4
+	self 
+		parse: '#key:value:'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral5
+	self 
+		parse: '#''testing-result'''
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral6
+	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
+		self 
+			parse: '#__gen__binding'
+			rule: #symbolLiteral ]
+!
+
+testSymbolLiteral7
+	self 
+		parse: '# fucker'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral8
+	self 
+		parse: '##fucker'
+		rule: #symbolLiteral
+!
+
+testSymbolLiteral9
+	self 
+		parse: '## fucker'
+		rule: #symbolLiteral
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'testing-messages'!
+
+testBinaryExpression1
+	self 
+		parse: '1 + 2'
+		rule: #expression
+!
+
+testBinaryExpression2
+	self 
+		parse: '1 + 2 + 3'
+		rule: #expression
+!
+
+testBinaryExpression3
+	self 
+		parse: '1 // 2'
+		rule: #expression
+!
+
+testBinaryExpression4
+	self 
+		parse: '1 -- 2'
+		rule: #expression
+!
+
+testBinaryExpression5
+	self 
+		parse: '1 ==> 2'
+		rule: #expression.
+!
+
+testBinaryMethod1
+	self 
+		parse: '+ a'
+		rule: #method
+!
+
+testBinaryMethod2
+	self 
+		parse: '+ a | b |'
+		rule: #method
+!
+
+testBinaryMethod3
+	self 
+		parse: '+ a b'
+		rule: #method
+!
+
+testBinaryMethod4
+	self 
+		parse: '+ a | b | c'
+		rule: #method
+!
+
+testBinaryMethod5
+	self 
+		parse: '-- a'
+		rule: #method
+!
+
+testCascadeExpression1
+	self 
+		parse: '1 abs; negated'
+		rule: #expression
+!
+
+testCascadeExpression2
+	self 
+		parse: '1 abs negated; raisedTo: 12; negated'
+		rule: #expression
+!
+
+testCascadeExpression3
+	self 
+		parse: '1 + 2; - 3'
+		rule: #expression
+!
+
+testKeywordExpression1
+	self 
+		parse: '1 to: 2'
+		rule: #expression
+!
+
+testKeywordExpression2
+	self 
+		parse: '1 to: 2 by: 3'
+		rule: #expression
+!
+
+testKeywordExpression3
+	self 
+		parse: '1 to: 2 by: 3 do: 4'
+		rule: #expression
+!
+
+testKeywordMethod1
+	self 
+		parse: 'to: a'
+		rule: #method
+!
+
+testKeywordMethod2
+	self 
+		parse: 'to: a do: b | c |'
+		rule: #method
+!
+
+testKeywordMethod3
+	self 
+		parse: 'to: a do: b by: c d'
+		rule: #method
+!
+
+testKeywordMethod4
+	self 
+		parse: 'to: a do: b by: c | d | e'
+		rule: #method
+!
+
+testUnaryExpression1
+	self 
+		parse: '1 abs'
+		rule: #expression
+!
+
+testUnaryExpression2
+	self 
+		parse: '1 abs negated'
+		rule: #expression
+!
+
+testUnaryMethod1
+	self 
+		parse: 'abs'
+		rule: #method
+!
+
+testUnaryMethod2
+	self 
+		parse: 'abs | a |'
+		rule: #method
+!
+
+testUnaryMethod3
+	self 
+		parse: 'abs a'
+		rule: #method
+!
+
+testUnaryMethod4
+	self 
+		parse: 'abs | a | b'
+		rule: #method
+!
+
+testUnaryMethod5
+	self 
+		parse: 'abs | a |'
+		rule: #method
+! !
+
+!PPSmalltalkGrammarTests methodsFor:'testing-pragmas'!
+
+testPragma1
+	self 
+		parse: 'method <foo>'
+		rule: #method
+!
+
+testPragma10
+	self 
+		parse: 'method <foo: bar>'
+		rule: #method
+!
+
+testPragma11
+	self 
+		parse: 'method <foo: true>'
+		rule: #method
+!
+
+testPragma12
+	self 
+		parse: 'method <foo: false>'
+		rule: #method
+!
+
+testPragma13
+	self 
+		parse: 'method <foo: nil>'
+		rule: #method
+!
+
+testPragma14
+	self 
+		parse: 'method <foo: ()>'
+		rule: #method
+!
+
+testPragma15
+	self 
+		parse: 'method <foo: #()>'
+		rule: #method
+!
+
+testPragma16
+	self 
+		parse: 'method < + 1 >'
+		rule: #method
+!
+
+testPragma2
+	self 
+		parse: 'method <foo> <bar>'
+		rule: #method
+!
+
+testPragma3
+	self 
+		parse: 'method | a | <foo>'
+		rule: #method
+!
+
+testPragma4
+	self 
+		parse: 'method <foo> | a |'
+		rule: #method
+!
+
+testPragma5
+	self 
+		parse: 'method <foo> | a | <bar>'
+		rule: #method
+!
+
+testPragma6
+	self 
+		parse: 'method <foo: 1>'
+		rule: #method
+!
+
+testPragma7
+	self 
+		parse: 'method <foo: 1.2>'
+		rule: #method
+!
+
+testPragma8
+	self 
+		parse: 'method <foo: ''bar''>'
+		rule: #method
+!
+
+testPragma9
+	self 
+		parse: 'method <foo: #''bar''>'
+		rule: #method
+! !
+
+!PPSmalltalkGrammarTests class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/PPSmalltalkParserTests.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,1301 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk/tests' }"
+
+PPSmalltalkGrammarTests subclass:#PPSmalltalkParserTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitSmalltalk-Tests'
+!
+
+PPSmalltalkParserTests comment:''
+!
+
+!PPSmalltalkParserTests methodsFor:'accessing'!
+
+parserClass
+	^ PPSmalltalkParser
+! !
+
+!PPSmalltalkParserTests methodsFor:'private'!
+
+assert: aNode format: aString
+	aNode isCollection
+		ifFalse: [ ^ self assert: (Array with: aNode) format: (Array with: aString) ].
+	self assert: aNode size equals: aString size.
+	aNode with: aString do: [ :node :string | self assert: (RBConfigurableFormatter format: node) equals: string ]
+! !
+
+!PPSmalltalkParserTests methodsFor:'testing'!
+
+testArray1
+	super testArray1.
+	self assert: result isArray.
+	self assert: result statements isEmpty.
+	self assert: result periods isEmpty
+!
+
+testArray2
+	super testArray2.
+	self assert: result isArray.
+	self assert: result periods isEmpty.
+	self assert: result statements size equals: 1.
+	self assert: result statements first isMessage.
+	self assert: result statements first selector equals: #foo
+!
+
+testArray3
+	super testArray3.
+	self assert: result isArray.
+	self assert: result periods size equals: 1.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isMessage.
+	self assert: result statements first selector equals: #foo.
+	self assert: result statements last isMessage.
+	self assert: result statements last selector equals: #bar
+!
+
+testArray4
+	super testArray4.
+	self assert: result isArray.
+	self assert: result periods size equals: 2.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isMessage.
+	self assert: result statements first selector equals: #foo.
+	self assert: result statements last isMessage.
+	self assert: result statements last selector equals: #bar
+!
+
+testAssignment1
+	super testAssignment1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 1
+!
+
+testAssignment2
+	super testAssignment2.
+	self assert: result isAssignment.
+	self assert: result variable isVariable.
+	self assert: result variable name equals: 'a'.
+	self assert: result value isLiteralNode.
+	self assert: result value value equals: 1
+!
+
+testAssignment3
+	super testAssignment3.
+	self assert: result isAssignment.
+	self assert: result variable isVariable.
+	self assert: result variable name equals: 'a'.
+	self assert: result value isAssignment.
+	self assert: result value variable isVariable.
+	self assert: result value variable name equals: 'b'.
+	self assert: result value value isLiteralNode.
+	self assert: result value value value equals: 1
+!
+
+testAssignment4
+	super testAssignment4.
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifFalse: [ ^ self ].
+	self assert: result isAssignment.
+	self assert: result variable isVariable.
+	self assert: result variable name equals: 'a'.
+	self assert: result value isLiteralNode.
+	self assert: result value value equals: 1
+!
+
+testAssignment5
+	super testAssignment5.
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifFalse: [ ^ self ].
+	self assert: result isAssignment.
+	self assert: result variable isVariable.
+	self assert: result variable name equals: 'a'.
+	self assert: result value isAssignment.
+	self assert: result value variable isVariable.
+	self assert: result value variable name equals: 'b'.
+	self assert: result value value isLiteralNode.
+	self assert: result value value value equals: 1
+!
+
+testAssignment6
+	super testAssignment6.
+	self assert: result isAssignment.
+	self assert: result variable isVariable.
+	self assert: result variable name equals: 'a'.
+	self assert: result value isAssignment.
+	self assert: result value variable isVariable.
+	self assert: result value variable name equals: 'b'.
+	self assert: result value value isVariable.
+	self assert: result value value name equals: 'c'
+!
+
+testComment1
+	super testComment1.
+	self assert: result isMessage.
+	self assert: result receiver isValue.
+	self assert: result selector equals: #+.
+	self assert: result arguments first isValue
+!
+
+testComment2
+	super testComment2.
+	self assert: result isMessage.
+	self assert: result receiver isValue.
+	self assert: result selector equals: #+.
+	self assert: result arguments first isValue
+!
+
+testComment3
+	super testComment3.
+	self assert: result isMessage.
+	self assert: result receiver isValue.
+	self assert: result selector equals: #+.
+	self assert: result arguments first isValue
+!
+
+testComment4
+	super testComment4.
+	self assert: result isMessage.
+	self assert: result receiver isValue.
+	self assert: result selector equals: #+.
+	self assert: result arguments first isValue
+!
+
+testComment5
+	super testComment5.
+	self assert: result isMessage.
+	self assert: result receiver isValue.
+	self assert: result selector equals: #+.
+	self assert: result arguments first isValue
+!
+
+testMethod1
+	super testMethod1.
+	self assert: result isMethod.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1.
+	self assert: result body statements first isReturn.
+	self assert: result body statements first value isMessage.
+	self assert: result body statements first value receiver isLiteralNode.
+	self assert: result body statements first value selector equals: #-.
+	self assert: result body statements first value arguments size equals: 1.
+	self assert: result body statements first value arguments first isVariable
+!
+
+testMethod2
+	super testMethod2.
+	self assert: result isMethod.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1.
+	self assert: result body statements first isReturn.
+	self assert: result body statements first value isMessage.
+	self assert: result body statements first value receiver isLiteralNode.
+	self assert: result body statements first value selector equals: #-.
+	self assert: result body statements first value arguments size equals: 1.
+	self assert: result body statements first value arguments first isVariable
+!
+
+testMethod3
+	super testMethod3.
+	self assert: result isMethod.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1.
+	self assert: result body statements first isReturn.
+	self assert: result body statements first value isMessage.
+	self assert: result body statements first value receiver isLiteralNode.
+	self assert: result body statements first value selector equals: #-.
+	self assert: result body statements first value arguments size equals: 1.
+	self assert: result body statements first value arguments first isVariable
+!
+
+testSequence1
+	super testSequence1.
+	self assert: result isSequence.
+	self assert: result temporaries size equals: 1.
+	self assert: result temporaries first isVariable.
+	self assert: result temporaries first name equals: 'a'.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2
+!
+
+testStatements1
+	super testStatements1.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 1.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger
+!
+
+testStatements2
+	super testStatements2.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2.
+	self assert: result statements second value isInteger
+!
+
+testStatements3
+	super testStatements3.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 3.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2.
+	self assert: result statements second value isInteger.
+	self assert: result statements third isLiteralNode.
+	self assert: result statements third value equals: 3.
+	self assert: result statements third value isInteger
+!
+
+testStatements4
+	super testStatements4.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 3.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2.
+	self assert: result statements second value isInteger.
+	self assert: result statements third isLiteralNode.
+	self assert: result statements third value equals: 3.
+	self assert: result statements third value isInteger
+!
+
+testStatements5
+	super testStatements5.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2.
+	self assert: result statements second value isInteger
+!
+
+testStatements6
+	super testStatements6.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 2.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger.
+	self assert: result statements second isLiteralNode.
+	self assert: result statements second value equals: 2.
+	self assert: result statements second value isInteger
+!
+
+testStatements7
+	super testStatements7.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 1.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger
+!
+
+testStatements8
+	super testStatements8.
+	self assert: result isSequence.
+	self assert: result temporaries isEmpty.
+	self assert: result statements size equals: 1.
+	self assert: result statements first isLiteralNode.
+	self assert: result statements first value equals: 1.
+	self assert: result statements first value isInteger
+!
+
+testTemporaries1
+	super testTemporaries1.
+	self assert: result isSequence.
+	self assert: result temporaries size equals: 1.
+	self assert: result temporaries first isVariable.
+	self assert: result temporaries first name equals: 'a'.
+	self assert: result statements isEmpty
+!
+
+testTemporaries2
+	super testTemporaries2.
+	self assert: result isSequence.
+	self assert: result temporaries size equals: 2.
+	self assert: result temporaries first isVariable.
+	self assert: result temporaries first name equals: 'a'.
+	self assert: result temporaries second isVariable.
+	self assert: result temporaries second name equals: 'b'.
+	self assert: result statements isEmpty
+!
+
+testTemporaries3
+	super testTemporaries3.
+	self assert: result isSequence.
+	self assert: result temporaries size equals: 3.
+	self assert: result temporaries first isVariable.
+	self assert: result temporaries first name equals: 'a'.
+	self assert: result temporaries second isVariable.
+	self assert: result temporaries second name equals: 'b'.
+	self assert: result temporaries third isVariable.
+	self assert: result temporaries third name equals: 'c'.
+	self assert: result statements isEmpty
+!
+
+testVariable1
+	super testVariable1.
+	self assert: result isVariable.
+	self assert: result name equals: 'trueBinding'
+!
+
+testVariable2
+	super testVariable2.
+	self assert: result isVariable.
+	self assert: result name equals: 'falseBinding'
+!
+
+testVariable3
+	super testVariable3.
+	self assert: result isVariable.
+	self assert: result name equals: 'nilly'
+!
+
+testVariable4
+	super testVariable4.
+	self assert: result isVariable.
+	self assert: result name equals: 'selfish'
+!
+
+testVariable5
+	super testVariable5.
+	self assert: result isVariable.
+	self assert: result name equals: 'supernanny'
+!
+
+testVariable6
+	super testVariable6.
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifTrue: [ ^ self ].
+	self assert: result isVariable.
+	self assert: result name equals: 'super_nanny'
+!
+
+testVariable7
+	super testVariable7.
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifTrue: [ ^ self ].
+	self assert: result isVariable.
+	self assert: result name equals: '__gen_var_123__'
+! !
+
+!PPSmalltalkParserTests methodsFor:'testing-blocks'!
+
+testArgumentsBlock1
+	super testArgumentsBlock1.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testArgumentsBlock2
+	super testArgumentsBlock2.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 2.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result arguments second isVariable.
+	self assert: result arguments second name equals: 'b'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testArgumentsBlock3
+	super testArgumentsBlock3.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 3.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result arguments second isVariable.
+	self assert: result arguments second name equals: 'b'.
+	self assert: result arguments third isVariable.
+	self assert: result arguments third name equals: 'c'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testComplexBlock1
+	super testComplexBlock1.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 1.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testComplexBlock2
+	super testComplexBlock2.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 1.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testSimpleBlock1
+	super testSimpleBlock1.
+	self assert: result isBlock.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testSimpleBlock2
+	super testSimpleBlock2.
+	self assert: result isBlock.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1
+!
+
+testSimpleBlock3
+	super testSimpleBlock3.
+	self assert: result isBlock.
+	self assert: result arguments size equals: 1.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testStatementBlock1
+	super testStatementBlock1.
+	self assert: result isBlock.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1
+!
+
+testStatementBlock2
+	super testStatementBlock2.
+	self assert: result isBlock.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testStatementBlock3
+	super testStatementBlock3.
+	self assert: result isBlock.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries size equals: 2.
+	self assert: result body statements size equals: 1
+! !
+
+!PPSmalltalkParserTests methodsFor:'testing-literals'!
+
+testArrayLiteral1
+	super testArrayLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #()
+!
+
+testArrayLiteral10
+	super testArrayLiteral10.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(#(1 2) #(1 2 3))
+!
+
+testArrayLiteral11
+	super testArrayLiteral11.
+	self assert: result isLiteralNode.
+	self assert: result value size equals: 2.
+	self assert: (result value first isKindOf: ByteArray).
+	self assert: result value first size equals: 2.
+	self assert: (result value last isKindOf: ByteArray).
+	self assert: result value last size equals: 3
+!
+
+testArrayLiteral2
+	super testArrayLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(1)
+!
+
+testArrayLiteral3
+	super testArrayLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(1 2)
+!
+
+testArrayLiteral4
+	super testArrayLiteral4.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(true false nil)
+!
+
+testArrayLiteral5
+	super testArrayLiteral5.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #($a)
+!
+
+testArrayLiteral6
+	super testArrayLiteral6.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(1.2)
+!
+
+testArrayLiteral7
+	super testArrayLiteral7.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(#size #at: #at:put: #==).
+	result value do: [ :each | self assert: each isSymbol ]
+!
+
+testArrayLiteral8
+	super testArrayLiteral8.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #('baz').
+	self assert: result value first isString.
+	self assert: result value first isSymbol not
+!
+
+testArrayLiteral9
+	super testArrayLiteral9.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #(#(1) 2)
+!
+
+testByteLiteral1
+	super testByteLiteral1.
+	self assert: result isLiteralNode.
+	self assert: (result value isKindOf: ByteArray).
+	self assert: result value isEmpty
+!
+
+testByteLiteral2
+	super testByteLiteral2.
+	self assert: result isLiteralNode.
+	self assert: (result value isKindOf: ByteArray).
+	self assert: result value size equals: 1.
+	self assert: result value first equals: 0
+!
+
+testByteLiteral3
+	super testByteLiteral3.
+	self assert: result isLiteralNode.
+	self assert: (result value isKindOf: ByteArray).
+	self assert: result value size equals: 1.
+	self assert: result value first equals: 255
+!
+
+testByteLiteral4
+	super testByteLiteral4.
+	self assert: result isLiteralNode.
+	self assert: (result value isKindOf: ByteArray).
+	self assert: result value size equals: 2.
+	self assert: result value first equals: 1.
+	self assert: result value last equals: 2
+!
+
+testByteLiteral5
+	super testByteLiteral5.
+	self assert: result isLiteralNode.
+	self assert: (result value isKindOf: ByteArray).
+	self assert: result value size equals: 3.
+	self assert: result value first equals: 10.
+	self assert: result value second equals: 63.
+	self assert: result value last equals: 255
+!
+
+testCharLiteral1
+	super testCharLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: $a
+!
+
+testCharLiteral2
+	super testCharLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: Character space
+!
+
+testCharLiteral3
+	super testCharLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: $$
+!
+
+testNumberLiteral1
+	super testNumberLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 0.
+	self assert: result value isInteger
+!
+
+testNumberLiteral10
+	super testNumberLiteral10.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 10.
+	self assert: result value isInteger
+!
+
+testNumberLiteral11
+	super testNumberLiteral11.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 511.
+	self assert: result value isInteger
+!
+
+testNumberLiteral12
+	super testNumberLiteral12.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 175.
+	self assert: result value isInteger
+!
+
+testNumberLiteral13
+	super testNumberLiteral13.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 202.9921875.
+	self assert: result value isFloat
+!
+
+testNumberLiteral14
+	super testNumberLiteral14.
+	self assert: result isLiteralNode.
+	self assert: result value floor equals: -9.
+	self assert: result value isFloat
+!
+
+testNumberLiteral15
+	super testNumberLiteral15.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 1 / 2
+!
+
+testNumberLiteral2
+	super testNumberLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 0.1.
+	self assert: result value isFloat
+!
+
+testNumberLiteral3
+	super testNumberLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 123.
+	self assert: result value isInteger
+!
+
+testNumberLiteral4
+	super testNumberLiteral4.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 123.456.
+	self assert: result value isFloat
+!
+
+testNumberLiteral5
+	super testNumberLiteral5.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 0.
+	self assert: result value isInteger
+!
+
+testNumberLiteral6
+	super testNumberLiteral6.
+	self assert: result isLiteralNode.
+	self assert: result value equals: -0.1.
+	self assert: result value isFloat
+!
+
+testNumberLiteral7
+	super testNumberLiteral7.
+	self assert: result isLiteralNode.
+	self assert: result value equals: -123.
+	self assert: result value isInteger
+!
+
+testNumberLiteral8
+	super testNumberLiteral8.
+	self assert: result isLiteralNode.
+	self assert: result value equals: -123.
+	self assert: result value isInteger
+!
+
+testNumberLiteral9
+	super testNumberLiteral9.
+	self assert: result isLiteralNode.
+	self assert: result value equals: -123.456.
+	self assert: result value isFloat
+!
+
+testSpecialLiteral1
+	super testSpecialLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: true
+!
+
+testSpecialLiteral2
+	super testSpecialLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: false
+!
+
+testSpecialLiteral3
+	super testSpecialLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: nil
+!
+
+testStringLiteral1
+	super testStringLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: ''
+!
+
+testStringLiteral2
+	super testStringLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 'ab'
+!
+
+testStringLiteral3
+	super testStringLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: 'ab''cd'
+!
+
+testSymbolLiteral1
+	super testSymbolLiteral1.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #foo.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral2
+	super testSymbolLiteral2.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #+.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral3
+	super testSymbolLiteral3.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #key:.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral4
+	super testSymbolLiteral4.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #key:value:.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral5
+	super testSymbolLiteral5.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #'testing-result'.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral6
+	super testSymbolLiteral6.
+	PPSmalltalkGrammar allowUnderscoreAssignment
+		ifTrue: [ ^ self ].
+	self assert: result isLiteralNode.
+	self assert: result value equals: #'__gen__binding'.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral7
+	super testSymbolLiteral7.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #fucker.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral8
+	super testSymbolLiteral8.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #fucker.
+	self assert: result value isSymbol
+!
+
+testSymbolLiteral9
+	super testSymbolLiteral9.
+	self assert: result isLiteralNode.
+	self assert: result value equals: #fucker.
+	self assert: result value isSymbol
+! !
+
+!PPSmalltalkParserTests methodsFor:'testing-messages'!
+
+testBinaryExpression1
+	super testBinaryExpression1.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result receiver value equals: 1.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2
+!
+
+testBinaryExpression2
+	super testBinaryExpression2.
+	self assert: result isMessage.
+	self assert: result receiver isMessage.
+	self assert: result receiver receiver isLiteralNode.
+	self assert: result receiver receiver value equals: 1.
+	self assert: result receiver arguments size equals: 1.
+	self assert: result receiver arguments first isLiteralNode.
+	self assert: result receiver arguments first value equals: 2.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 3
+!
+
+testBinaryExpression3
+	super testBinaryExpression3.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result receiver value equals: 1.
+	self assert: result selector equals: #//.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2
+!
+
+testBinaryExpression4
+	super testBinaryExpression4.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result receiver value equals: 1.
+	self assert: result selector equals: #--.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2
+!
+
+testBinaryExpression5
+        super testBinaryExpression5.
+        self assert: result isMessage.
+        self assert: result receiver isLiteralNode.
+        self assert: result receiver value equals: 1.
+        self assert: result selector equals: #'==>'.
+        self assert: result arguments size equals: 1.
+        self assert: result arguments first isLiteralNode.
+        self assert: result arguments first value equals: 2
+
+    "Created: / 07-10-2014 / 00:22:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+testBinaryMethod1
+	super testBinaryMethod1.
+	self assert: result isMethod.
+	self assert: result selector equals: #+.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testBinaryMethod2
+	super testBinaryMethod2.
+	self assert: result isMethod.
+	self assert: result selector equals: #+.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testBinaryMethod3
+	super testBinaryMethod3.
+	self assert: result isMethod.
+	self assert: result selector equals: #+.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1
+!
+
+testBinaryMethod4
+	super testBinaryMethod4.
+	self assert: result isMethod.
+	self assert: result selector equals: #+.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testBinaryMethod5
+	super testBinaryMethod5.
+	self assert: result isMethod.
+	self assert: result selector equals: #--.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testCascadeExpression1
+	super testCascadeExpression1.
+	self assert: result isCascade.
+	self assert: result receiver isLiteralNode.
+	self assert: result messages size equals: 2.
+	self assert: result messages first receiver equals: result receiver.
+	self assert: result messages first selector equals: #abs.
+	self assert: result messages second receiver equals: result receiver.
+	self assert: result messages second selector equals: #negated
+!
+
+testCascadeExpression2
+	super testCascadeExpression2.
+	self assert: result isCascade.
+	self assert: result receiver isMessage.
+	self assert: result receiver receiver isLiteralNode.
+	self assert: result receiver receiver value equals: 1.
+	self assert: result receiver selector equals: #abs.
+	self assert: result messages size equals: 3.
+	self assert: result messages first receiver equals: result receiver.
+	self assert: result messages first selector equals: #negated.
+	self assert: result messages second receiver equals: result receiver.
+	self assert: result messages second selector equals: #raisedTo:.
+	self assert: result messages third receiver equals: result receiver.
+	self assert: result messages third selector equals: #negated
+!
+
+testCascadeExpression3
+	super testCascadeExpression3.
+	self assert: result isCascade.
+	self assert: result receiver isLiteralNode.
+	self assert: result receiver value equals: 1.
+	self assert: result messages size equals: 2.
+	self assert: result messages first receiver equals: result receiver.
+	self assert: result messages first selector equals: #+.
+	self assert: result messages first arguments size equals: 1.
+	self assert: result messages second receiver equals: result receiver.
+	self assert: result messages second selector equals: #-.
+	self assert: result messages second arguments size equals: 1
+!
+
+testKeywordExpression1
+	super testKeywordExpression1.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result receiver value equals: 1.
+	self assert: result selector equals: #to:.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2
+!
+
+testKeywordExpression2
+	super testKeywordExpression2.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result selector equals: #to:by:.
+	self assert: result arguments size equals: 2.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2.
+	self assert: result arguments second isLiteralNode.
+	self assert: result arguments second value equals: 3
+!
+
+testKeywordExpression3
+	super testKeywordExpression3.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result selector equals: #to:by:do:.
+	self assert: result arguments size equals: 3.
+	self assert: result arguments first isLiteralNode.
+	self assert: result arguments first value equals: 2.
+	self assert: result arguments second isLiteralNode.
+	self assert: result arguments second value equals: 3.
+	self assert: result arguments third isLiteralNode.
+	self assert: result arguments third value equals: 4
+!
+
+testKeywordMethod1
+	super testKeywordMethod1.
+	self assert: result isMethod.
+	self assert: result selector equals: #to:.
+	self assert: result arguments size equals: 1.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testKeywordMethod2
+	super testKeywordMethod2.
+	self assert: result isMethod.
+	self assert: result selector equals: #to:do:.
+	self assert: result arguments size equals: 2.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result arguments second isVariable.
+	self assert: result arguments second name equals: 'b'.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testKeywordMethod3
+	super testKeywordMethod3.
+	self assert: result isMethod.
+	self assert: result selector equals: #to:do:by:.
+	self assert: result arguments size equals: 3.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result arguments second isVariable.
+	self assert: result arguments second name equals: 'b'.
+	self assert: result arguments third isVariable.
+	self assert: result arguments third name equals: 'c'.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1
+!
+
+testKeywordMethod4
+	super testKeywordMethod4.
+	self assert: result isMethod.
+	self assert: result selector equals: #to:do:by:.
+	self assert: result arguments size equals: 3.
+	self assert: result arguments first isVariable.
+	self assert: result arguments first name equals: 'a'.
+	self assert: result arguments second isVariable.
+	self assert: result arguments second name equals: 'b'.
+	self assert: result arguments third isVariable.
+	self assert: result arguments third name equals: 'c'.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testUnaryExpression1
+	super testUnaryExpression1.
+	self assert: result isMessage.
+	self assert: result receiver isLiteralNode.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty
+!
+
+testUnaryExpression2
+	super testUnaryExpression2.
+	self assert: result isMessage.
+	self assert: result receiver isMessage.
+	self assert: result receiver receiver isLiteralNode.
+	self assert: result receiver receiver value equals: 1.
+	self assert: result receiver selector equals: #abs.
+	self assert: result receiver arguments isEmpty.
+	self assert: result selector equals: #negated.
+	self assert: result arguments isEmpty
+!
+
+testUnaryMethod1
+	super testUnaryMethod1.
+	self assert: result isMethod.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testUnaryMethod2
+	super testUnaryMethod2.
+	self assert: result isMethod.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testUnaryMethod3
+	super testUnaryMethod3.
+	self assert: result isMethod.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements size equals: 1
+!
+
+testUnaryMethod4
+	super testUnaryMethod4.
+	self assert: result isMethod.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements size equals: 1
+!
+
+testUnaryMethod5
+	super testUnaryMethod5.
+	self assert: result isMethod.
+	self assert: result selector equals: #abs.
+	self assert: result arguments isEmpty.
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+! !
+
+!PPSmalltalkParserTests methodsFor:'testing-pragmas'!
+
+testPragma1
+	super testPragma1.
+	self 
+		assert: result pragmas
+		format: #('<foo>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma10
+	super testPragma10.
+	self 
+		assert: result pragmas
+		format: #('<foo: #bar>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma11
+	super testPragma11.
+	self 
+		assert: result pragmas
+		format: #('<foo: true>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma12
+	super testPragma12.
+	self 
+		assert: result pragmas
+		format: #('<foo: false>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma13
+	super testPragma13.
+	self 
+		assert: result pragmas
+		format: #('<foo: nil>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma14
+	super testPragma14.
+	self 
+		assert: result pragmas
+		format: #('<foo: #()>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma15
+	super testPragma15.
+	self 
+		assert: result pragmas
+		format: #('<foo: #()>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma16
+	super testPragma16.
+	self 
+		assert: result pragmas
+		format: #('< + 1>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma2
+	super testPragma2.
+	self 
+		assert: result pragmas
+		format: #('<foo>' '<bar>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma3
+	super testPragma3.
+	self assert: result pragmas format: #('<foo>').
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testPragma4
+	super testPragma4.
+	self assert: result pragmas format: #('<foo>').
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testPragma5
+	super testPragma5.
+	self assert: result pragmas format: #('<foo>' '<bar>').
+	self assert: result body temporaries size equals: 1.
+	self assert: result body statements isEmpty
+!
+
+testPragma6
+	super testPragma6.
+	self 
+		assert: result pragmas
+		format: #('<foo: 1>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma7
+	super testPragma7.
+	self 
+		assert: result pragmas
+		format: #('<foo: 1.2>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma8
+	super testPragma8.
+	self 
+		assert: result pragmas
+		format: #('<foo: ''bar''>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+!
+
+testPragma9
+	super testPragma9.
+	self 
+		assert: result pragmas
+		format: #('<foo: #bar>' ).
+	self assert: result body temporaries isEmpty.
+	self assert: result body statements isEmpty
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/abbrev.stc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,7 @@
+# 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.
+PPSmalltalkClassesTests PPSmalltalkClassesTests stx:goodies/petitparser/parsers/smalltalk/tests 'PetitSmalltalk-Tests' 1
+PPSmalltalkGrammarTests PPSmalltalkGrammarTests stx:goodies/petitparser/parsers/smalltalk/tests 'PetitSmalltalk-Tests' 1
+stx_goodies_petitparser_parsers_smalltalk_tests stx_goodies_petitparser_parsers_smalltalk_tests stx:goodies/petitparser/parsers/smalltalk/tests '* Projects & Packages *' 3
+PPSmalltalkParserTests PPSmalltalkParserTests stx:goodies/petitparser/parsers/smalltalk/tests 'PetitSmalltalk-Tests' 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/bc.mak	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,88 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk_tests.
+#
+# 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_goodies_petitparser_parsers_smalltalk_tests
+RESFILES=tests.$(RES)
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic
+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 mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	pushd ..\..\..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\.. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+
+
+
+test: $(TOP)\goodies\builder\reports\NUL
+	pushd $(TOP)\goodies\builder\reports & $(MAKE_BAT)
+	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)
+        
+clean::
+	del *.$(CSUFFIX)
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)stx_goodies_petitparser_parsers_smalltalk_tests.$(O) stx_goodies_petitparser_parsers_smalltalk_tests.$(H): stx_goodies_petitparser_parsers_smalltalk_tests.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
+# **Must be at end**
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+!IFDEF HGROOT
+$(OUTDIR)stx_goodies_petitparser_parsers_smalltalk_tests.$(O): $(HGROOT)\.hg\dirstate
+!ENDIF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/bmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,12 @@
+@REM -------
+@REM make using Borland bcc32
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak  %DEFINES% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/lccmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lccmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak -DUSELCC=1 %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/libInit.cc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,34 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk_tests.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_goodies_petitparser_parsers_smalltalk_tests_Init() INIT_TEXT_SECTION;
+DLL_EXPORT void _libstx_goodies_petitparser_parsers_smalltalk_tests_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+void _libstx_goodies_petitparser_parsers_smalltalk_tests_InitDefinition(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_petitparser_parsers_smalltalk_tests__DFN", _libstx_goodies_petitparser_parsers_smalltalk_tests_InitDefinition, "stx:goodies/petitparser/parsers/smalltalk/tests");
+_stx_137goodies_137petitparser_137parsers_137smalltalk_137tests_Init(pass,__pRT__,snd);
+
+__END_PACKAGE__();
+}
+
+void _libstx_goodies_petitparser_parsers_smalltalk_tests_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_petitparser_parsers_smalltalk_tests", _libstx_goodies_petitparser_parsers_smalltalk_tests_Init, "stx:goodies/petitparser/parsers/smalltalk/tests");
+_stx_137goodies_137petitparser_137parsers_137smalltalk_137tests_Init(pass,__pRT__,snd);
+
+
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/mingwmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,16 @@
+@REM -------
+@REM make using mingw gnu compiler
+@REM type mingwmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+
+@pushd ..\..\..\..\..\rules
+@call find_mingw.bat
+@popd
+make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/stx_goodies_petitparser_parsers_smalltalk_tests.st	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,146 @@
+"{ Package: 'stx:goodies/petitparser/parsers/smalltalk/tests' }"
+
+LibraryDefinition subclass:#stx_goodies_petitparser_parsers_smalltalk_tests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_goodies_petitparser_parsers_smalltalk_tests class methodsFor:'accessing - monticello'!
+
+monticelloLastMergedVersionInfo
+    "The last merged version is: "
+
+    ^ '
+    Name: PetitSmalltalk-JanKurs.71
+    Author: JanKurs
+    Time: 19-08-2014, 02:18:05 AM
+    UUID: d1d11836-f3e2-4709-abd3-e2ff3b72d7c4
+    Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main
+    '
+
+    "Created: / 03-10-2014 / 02:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2014 / 09:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+monticelloName
+    "Return name of the package for Monticello. This is used when package is exported"
+
+    ^ 'PetitSmalltalkTests'
+
+    "Created: / 03-10-2014 / 01:47:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2014 / 09:14:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk_tests class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list packages which are to be explicitely excluded from the automatic constructed
+     prerequisites list. If empty, everything that is found along the inheritance of any of
+     my classes is considered to be a prerequisite package."
+
+    ^ #(
+    )
+!
+
+mandatoryPreRequisites
+    "list packages which are mandatory as a prerequisite.
+     This are packages containing superclasses of my classes and classes which
+     are extended by myself.
+     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
+     This method is generated automatically,
+     by searching along the inheritance chain of all of my classes."
+
+    ^ #(
+	#'stx:goodies/petitparser/tests'    "PPAbstractParserTest - superclass of PPSmalltalkClassesTests"
+	#'stx:goodies/sunit'    "TestAsserter - superclass of PPSmalltalkClassesTests"
+	#'stx:libbasic'    "LibraryDefinition - superclass of stx_goodies_petitparser_parsers_smalltalk_tests"
+    )
+!
+
+referencedPreRequisites
+    "list packages which are a prerequisite, because they contain
+     classes which are referenced by my classes.
+     We do not need these packages as a prerequisite for loading or compiling.
+     This method is generated automatically,
+     by searching all classes (and their packages) which are referenced by my classes."
+
+    ^ #(
+	#'stx:goodies/petitparser/parsers/smalltalk'    "PPSmalltalkGrammar - referenced by PPSmalltalkGrammarTests>>parserClass"
+    )
+!
+
+subProjects
+    "list packages which are known as subprojects.
+     The generated makefile will enter those and make there as well.
+     However: they are not forced to be loaded when a package is loaded;
+     for those, redefine requiredPrerequisites."
+
+    ^ #(
+    )
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk_tests 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"
+	(PPSmalltalkClassesTests autoload)
+	(PPSmalltalkGrammarTests autoload)
+	#'stx_goodies_petitparser_parsers_smalltalk_tests'
+	(PPSmalltalkParserTests autoload)
+    )
+
+    "Modified: / 07-10-2014 / 09:22:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+extensionMethodNames
+    "list class/selector pairs of extensions.
+     A correponding method with real names must be present in my concrete subclasses"
+
+    ^ #(
+    )
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk_tests class methodsFor:'description - project information'!
+
+companyName
+    "Returns a company string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Returns a description string which will appear in nt.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Returns a copyright string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'Copyright Claus Gittinger 1988-2014\nCopyright eXept Software AG 1998-2014'
+!
+
+productName
+    "Returns a product name which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info.
+     This method is usually redefined in a concrete application definition"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_goodies_petitparser_parsers_smalltalk_tests class methodsFor:'documentation'!
+
+version_HG
+    ^ '$Changeset: <not expanded> $'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/tests/tests.rc	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,37 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_goodies_petitparser_parsers_smalltalk_tests.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     6,2,32767,32767
+  PRODUCTVERSION  6,2,4,0
+#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.32767.32767\0"
+      VALUE "InternalName", "stx:goodies/petitparser/parsers/smalltalk/tests\0"
+      VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2014\nCopyright eXept Software AG 1998-2014\0"
+      VALUE "ProductName", "Smalltalk/X\0"
+      VALUE "ProductVersion", "6.2.4.0\0"
+      VALUE "ProductDate", "Tue, 07 Oct 2014 08:24:12 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/parsers/smalltalk/tests/vcmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,20 @@
+@REM -------
+@REM make using Microsoft Visual C compiler
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+
+@if not defined VSINSTALLDIR (
+    pushd ..\..\..\..\..\rules
+    call vcsetup.bat
+    popd
+)
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/smalltalk/vcmake.bat	Tue Oct 07 09:42:03 2014 +0100
@@ -0,0 +1,20 @@
+@REM -------
+@REM make using Microsoft Visual C compiler
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+
+@if not defined VSINSTALLDIR (
+    pushd ..\..\..\..\rules
+    call vcsetup.bat
+    popd
+)
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
+
+
+
+
--- a/petitparser.rc	Mon Oct 06 19:18:20 2014 +0100
+++ b/petitparser.rc	Tue Oct 07 09:42:03 2014 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "(C) Lukas Renggli\0"
       VALUE "ProductName", "Petit Parser\0"
       VALUE "ProductVersion", "6.2.4.0\0"
-      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:33 GMT\0"
+      VALUE "ProductDate", "Tue, 07 Oct 2014 08:24:04 GMT\0"
     END
 
   END
--- a/stx_goodies_petitparser.st	Mon Oct 06 19:18:20 2014 +0100
+++ b/stx_goodies_petitparser.st	Tue Oct 07 09:42:03 2014 +0100
@@ -33,7 +33,7 @@
     Name: PetitParser-JanKurs.250
     Author: JanKurs
     Time: 01-10-2014, 04:44:04 AM
-    UUID: c46eea20-51a0-4deb-8fd5-8cb99810a8b4            
+    UUID: c46eea20-51a0-4deb-8fd5-8cb99810a8b4
     Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main
     '
 
@@ -122,7 +122,7 @@
 
     ^ '
 mc:
-    	mkdir mc
+	mkdir mc
 
 mcz: mc
     	$(TOP)/projects/smalltalk/smalltalk --eval "                                \
--- a/tests/PPAbstractParserTest.st	Mon Oct 06 19:18:20 2014 +0100
+++ b/tests/PPAbstractParserTest.st	Tue Oct 07 09:42:03 2014 +0100
@@ -103,5 +103,10 @@
 
 version_CVS
     ^ '$Header: /cvs/stx/stx/goodies/petitparser/tests/PPAbstractParserTest.st,v 1.2 2014-03-04 20:31:52 cg Exp $'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !
 
--- a/tests/PPComposedTest.st	Mon Oct 06 19:18:20 2014 +0100
+++ b/tests/PPComposedTest.st	Tue Oct 07 09:42:03 2014 +0100
@@ -410,6 +410,11 @@
     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPComposedTest.st,v 1.5 2014-03-04 14:34:10 cg Exp $'
 !
 
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_SVN
     ^ '$Id: PPComposedTest.st,v 1.5 2014-03-04 14:34:10 cg Exp $'
 ! !
--- a/tests/PPScriptingTest.st	Mon Oct 06 19:18:20 2014 +0100
+++ b/tests/PPScriptingTest.st	Tue Oct 07 09:42:03 2014 +0100
@@ -1,1 +1,135 @@
-"{ Package: 'stx:goodies/petitparser/tests' }"

PPAbstractParserTest subclass:#PPScriptingTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitTests-Tests'
!

PPScriptingTest comment:'These are some simple demo-scripts of parser combinators for the compiler construction course.
http://www.iam.unibe.ch/~scg/Teaching/CC/index.html'
!


!PPScriptingTest methodsFor:'examples'!

expressionInterpreter
        "Same as #expressionInterpreter but with semantic actions."
        
        | mul prim add dec |
        add := PPUnresolvedParser new.
        mul := PPUnresolvedParser new.
        prim := PPUnresolvedParser new.
        dec := (Interval from: $0 to: $9) asParser ==> [ :token | token codePoint - $0 codePoint ].
        add def: ((mul , $+ asParser , add) ==> [ :nodes | (nodes at: 1) + (nodes at: 3) ])
                / mul.
        mul def: ((prim , $* asParser , mul) ==> [ :nodes | (nodes at: 1) * (nodes at: 3) ])
                / prim.
        prim def: (($( asParser , add , $) asParser) ==> [ :nodes | nodes at: 2 ])
                / dec.
        ^ add end

    "Modified: / 05-10-2014 / 00:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

expressionParser
        "Simple demo of scripting an expression parser."
        
        | mul prim add dec |
        add := PPUnresolvedParser new.
        mul := PPUnresolvedParser new.
        prim := PPUnresolvedParser new.
        dec := (Interval from: $0 to: $9) asParser.
        add def: (mul , $+ asParser , add)
                / mul.
        mul def: (prim , $* asParser , mul)
                / prim.
        prim def: ($( asParser , add , $) asParser)
                / dec.
        ^ add end

    "Modified: / 05-10-2014 / 00:03:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

straightLineParser
        | goal stm stmList id char dec exp expList mulExp primExp nonzero num lower upper |
        goal := PPUnresolvedParser new.
        stmList := PPUnresolvedParser new.
        stm := PPUnresolvedParser new.
        exp := PPUnresolvedParser new.
        expList := PPUnresolvedParser new.
        mulExp := PPUnresolvedParser new.
        primExp := PPUnresolvedParser new.
        
        lower := (Interval from: $a to: $z) asParser.
        upper := (Interval from: $A to: $Z) asParser.
        char := lower / upper.
        nonzero := (Interval from: $1 to: $9) asParser.
        dec := (Interval from: $0 to: $9) asParser.
        id := char, ( char / dec ) star.
        num := $0 asParser / ( nonzero, dec star).

        goal def: stmList end.
        stmList def: stm , ( $; asParser, stm ) star.
        stm def: ( id, ':=' asParser, exp )
                / ( 'print' asParser, $( asParser, expList, $) asParser ). 
        exp def: mulExp, ( ( $+ asParser / $- asParser ), mulExp ) star.
        expList def: exp, ( $, asParser, exp ) star.
        mulExp def: primExp, ( ( $* asParser / $/ asParser ), primExp ) star.
        primExp def: id
                / num
                / ( $( asParser, stmList, $, asParser, exp, $) asParser ).
        ^ goal

    "Modified: / 05-10-2014 / 00:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!PPScriptingTest methodsFor:'tests'!

testExpressionInterpreter
	self 
		assert: self expressionInterpreter
		parse: '2*(3+4)'
		to: 14
!

testExpressionParser
	self
		assert: self expressionParser
		parse: '2*(3+4)'
		to: #($2 $* ($( ($3 $+ $4) $)))
!

testSLassign
	
	self assert: self straightLineParser
		parse: 'abc:=1'
		to: #(#($a #($b $c) ':=' #(#(#($1 #()) #()) #())) #())
!

testSLprint
	self 
		assert: self straightLineParser
		parse: 'print(3,4)'
		to: #(('print' $( ((($3 ()) ()) () (($, ((($4 ()) ()) ())))) $)) ())
! !

!PPScriptingTest class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '$Id: PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
! !
\ No newline at end of file
+"{ Package: 'stx:goodies/petitparser/tests' }"
+
+PPAbstractParserTest subclass:#PPScriptingTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitTests-Tests'
+!
+
+PPScriptingTest comment:'These are some simple demo-scripts of parser combinators for the compiler construction course.
http://www.iam.unibe.ch/~scg/Teaching/CC/index.html'
+!
+
+
+!PPScriptingTest methodsFor:'examples'!
+
+expressionInterpreter
+        "Same as #expressionInterpreter but with semantic actions."
+        
+        | mul prim add dec |
+        add := PPUnresolvedParser new.
+        mul := PPUnresolvedParser new.
+        prim := PPUnresolvedParser new.
+        dec := (Interval from: $0 to: $9) asParser ==> [ :token | token codePoint - $0 codePoint ].
+        add def: ((mul , $+ asParser , add) ==> [ :nodes | (nodes at: 1) + (nodes at: 3) ])
+                / mul.
+        mul def: ((prim , $* asParser , mul) ==> [ :nodes | (nodes at: 1) * (nodes at: 3) ])
+                / prim.
+        prim def: (($( asParser , add , $) asParser) ==> [ :nodes | nodes at: 2 ])
+                / dec.
+        ^ add end
+
+    "Modified: / 05-10-2014 / 00:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+expressionParser
+        "Simple demo of scripting an expression parser."
+        
+        | mul prim add dec |
+        add := PPUnresolvedParser new.
+        mul := PPUnresolvedParser new.
+        prim := PPUnresolvedParser new.
+        dec := (Interval from: $0 to: $9) asParser.
+        add def: (mul , $+ asParser , add)
+                / mul.
+        mul def: (prim , $* asParser , mul)
+                / prim.
+        prim def: ($( asParser , add , $) asParser)
+                / dec.
+        ^ add end
+
+    "Modified: / 05-10-2014 / 00:03:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+straightLineParser
+        | goal stm stmList id char dec exp expList mulExp primExp nonzero num lower upper |
+        goal := PPUnresolvedParser new.
+        stmList := PPUnresolvedParser new.
+        stm := PPUnresolvedParser new.
+        exp := PPUnresolvedParser new.
+        expList := PPUnresolvedParser new.
+        mulExp := PPUnresolvedParser new.
+        primExp := PPUnresolvedParser new.
+        
+        lower := (Interval from: $a to: $z) asParser.
+        upper := (Interval from: $A to: $Z) asParser.
+        char := lower / upper.
+        nonzero := (Interval from: $1 to: $9) asParser.
+        dec := (Interval from: $0 to: $9) asParser.
+        id := char, ( char / dec ) star.
+        num := $0 asParser / ( nonzero, dec star).
+
+        goal def: stmList end.
+        stmList def: stm , ( $; asParser, stm ) star.
+        stm def: ( id, ':=' asParser, exp )
+                / ( 'print' asParser, $( asParser, expList, $) asParser ). 
+        exp def: mulExp, ( ( $+ asParser / $- asParser ), mulExp ) star.
+        expList def: exp, ( $, asParser, exp ) star.
+        mulExp def: primExp, ( ( $* asParser / $/ asParser ), primExp ) star.
+        primExp def: id
+                / num
+                / ( $( asParser, stmList, $, asParser, exp, $) asParser ).
+        ^ goal
+
+    "Modified: / 05-10-2014 / 00:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPScriptingTest methodsFor:'tests'!
+
+testExpressionInterpreter
+	self 
+		assert: self expressionInterpreter
+		parse: '2*(3+4)'
+		to: 14
+!
+
+testExpressionParser
+	self
+		assert: self expressionParser
+		parse: '2*(3+4)'
+		to: #($2 $* ($( ($3 $+ $4) $)))
+!
+
+testSLassign
+	
+	self assert: self straightLineParser
+		parse: 'abc:=1'
+		to: #(#($a #($b $c) ':=' #(#(#($1 #()) #()) #())) #())
+!
+
+testSLprint
+	self 
+		assert: self straightLineParser
+		parse: 'print(3,4)'
+		to: #(('print' $( ((($3 ()) ()) () (($, ((($4 ()) ()) ())))) $)) ())
+! !
+
+!PPScriptingTest class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+    ^ '$Id: PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
+! !
+
--- a/tests/tests.rc	Mon Oct 06 19:18:20 2014 +0100
+++ b/tests/tests.rc	Tue Oct 07 09:42:03 2014 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2014\nCopyright eXept Software AG 1998-2014\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.4.0\0"
-      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:35 GMT\0"
+      VALUE "ProductDate", "Tue, 07 Oct 2014 08:24:05 GMT\0"
     END
 
   END