Merge
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 12 May 2015 01:33:33 +0100
changeset 460 87a3d30ab570
parent 458 a4da1c24d84a (diff)
parent 459 4751c407bb40 (current diff)
child 461 5986bf6d7d60
Merge
compiler/PPCCodeGenerator.st
compiler/PPCCompiler.st
compiler/PPCMethod.st
compiler/PPCTokenizingCodeGenerator.st
compiler/PPCTokenizingVisitor.st
compiler/benchmarks/PPCBenchmark.st
compiler/tests/PPCInliningVisitorTest.st
compiler/tests/PPCNodeTest.st
compiler/tests/PPCompiledExpressionGrammarResource.st
compiler/tests/extras/Make.proto
compiler/tests/extras/PPCResources.st
compiler/tests/extras/PPCSmalltalkTests.st
compiler/tests/extras/PPCompiledJavaSyntaxTest.st
compiler/tests/extras/PPCompiledSmalltalkVerificationTest.st
compiler/tests/extras/PPTokenizedSmalltalkGrammarResource.st
compiler/tests/extras/bc.mak
compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st
islands/PPWater.st
islands/stx_goodies_petitparser_islands.st
islands/tests/stx_goodies_petitparser_islands_tests.st
--- a/Make.proto	Tue May 12 01:24:03 2015 +0100
+++ b/Make.proto	Tue May 12 01:33:33 2015 +0100
@@ -21,7 +21,7 @@
 INCLUDE_TOP=$(TOP)/..
 
 # subdirectories where targets are to be made:
-SUBDIRS= analyzer tests
+SUBDIRS= analyzer tests parsers/smalltalk parsers/java compiler
 
 
 # subdirectories where Makefiles are to be made:
@@ -74,7 +74,7 @@
 		Class tryLocalSourceFirst: true.				\
 		Smalltalk packagePath add:'$(TOP)/..' .                       \
 		Smalltalk loadPackage:'stx:goodies/petitparser'.              \
-		(Smalltalk at: #'stx_goodies_petitparser') exportAsMczTo: 'mc'."
+		(Smalltalk at: #'stx_goodies_petitparser') monticelloExportTo: 'mc'."
 
 
 
--- a/bmake.bat	Tue May 12 01:24:03 2015 +0100
+++ b/bmake.bat	Tue May 12 01:33:33 2015 +0100
@@ -23,4 +23,25 @@
 @call bmake %1 %2 || exit /b "%errorlevel%"
 @popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/smalltalk
+@echo "***********************************"
+@pushd parsers\smalltalk
+@call bmake %1 %2 || exit /b "%errorlevel%"
+@popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/java
+@echo "***********************************"
+@pushd parsers\java
+@call bmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/compiler
+@echo "***********************************"
+@pushd compiler
+@call bmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+
--- a/compiler/PPCCodeGenerator.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/PPCCodeGenerator.st	Tue May 12 01:33:33 2015 +0100
@@ -189,7 +189,7 @@
     compiler codeReturn: 'failure'.
     compiler add: '].'.
 
-    "Modified: / 23-04-2015 / 15:59:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-05-2015 / 14:39:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitAndNode: node
@@ -299,7 +299,7 @@
     ].
     compiler add: '^ self error: ''no choice suitable'''.
 
-    "Modified: / 23-04-2015 / 21:40:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-05-2015 / 14:10:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitEndOfFileNode: node
--- a/compiler/PPCCompiler.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/PPCCompiler.st	Tue May 12 01:33:33 2015 +0100
@@ -71,12 +71,12 @@
 !PPCCompiler methodsFor:'cleaning'!
 
 clean: class
-"	Transcript crShow: 'Cleaning time: ',
+"	Transcript show: ('Cleaning time: ',
     [	
 "		self cleanGeneratedMethods: class.
         self cleanInstVars: class.
         self cleanConstants: class.
-"	] timeToRun asMilliSeconds asString, 'ms'."
+"	] timeToRun asMilliSeconds asString, 'ms'); cr. "
 !
 
 cleanConstants: class
--- a/compiler/PPCTokenizingCodeGenerator.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/PPCTokenizingCodeGenerator.st	Tue May 12 01:33:33 2015 +0100
@@ -17,11 +17,11 @@
 !
 
 tokenGenerator
-    ^ tokenGenerator isNil 
-        ifTrue: [ tokenGenerator := (PPCTokenCodeGenerator on: compiler)
-            arguments: arguments;
-            yourself ]
-        ifFalse: [ tokenGenerator ]
+    tokenGenerator isNil ifTrue: [ 
+        tokenGenerator := PPCTokenCodeGenerator on: compiler.
+        tokenGenerator arguments: arguments.
+    ].
+    ^ tokenGenerator
 !
 
 tokenGenerator: whatever
--- a/compiler/PPCTokenizingVisitor.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/PPCTokenizingVisitor.st	Tue May 12 01:33:33 2015 +0100
@@ -42,7 +42,8 @@
             yourself
     ].
     ^ parserNode
-    
+
+    "Modified: / 10-05-2015 / 07:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 eofToken
--- a/compiler/benchmarks/PPCBenchmark.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/benchmarks/PPCBenchmark.st	Tue May 12 01:33:33 2015 +0100
@@ -47,6 +47,12 @@
     "
     PPCBenchmark run: #benchmarkRBParserC
     "
+!
+
+spy: benchmark
+    ^ (BenchmarkInstance class:self selector:benchmark) spy
+
+    "Created: / 11-05-2015 / 16:31:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PPCBenchmark methodsFor:'benchmark support'!
@@ -586,6 +592,13 @@
 
 teardownSmalltalkGrammarTokenized
     parser class removeFromSystem.
+"       
+    size := input inject: 0 into: [:r :e | r + e size  ].
+    Transcript crShow: 'Compiled Grammar time: ', time asString.
+    Transcript crShow: 'Time per character: ', (time / size * 1000.0) asString, ' microseconds'.
+"
+
+    "Created: / 11-05-2015 / 16:33:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 teardownSmalltalkParserCompiled
--- a/compiler/tests/PPCInliningVisitorTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/PPCInliningVisitorTest.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,7 @@
 	category:'PetitCompiler-Tests-Visitors'
 !
 
+
 !PPCInliningVisitorTest methodsFor:'as yet unclassified'!
 
 assert: object type: class
@@ -171,3 +172,10 @@
     self assert: result child child type: PPCNilNode.
 ! !
 
+!PPCInliningVisitorTest class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/PPCLL1VisitorTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/PPCLL1VisitorTest.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,7 @@
 	category:'PetitCompiler-Tests-Visitors'
 !
 
+
 !PPCLL1VisitorTest methodsFor:'as yet unclassified'!
 
 setUp
@@ -139,3 +140,10 @@
     
 ! !
 
+!PPCLL1VisitorTest class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/PPCompiledExpressionGrammarResource.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/PPCompiledExpressionGrammarResource.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,7 @@
 	category:'PetitCompiler-Tests-ExpressionGrammar'
 !
 
+
 !PPCompiledExpressionGrammarResource methodsFor:'as yet unclassified'!
 
 setUp
@@ -20,7 +21,15 @@
     time := Time millisecondsToRun: [
         PPExpressionGrammar new compileWithConfiguration: configuration.
     ].
-    Transcript show: 'Expression grammar compiled in: ', time asString, 'ms'; cr.
-    
+    Transcript show: 'Exprssion grammar compiled in: '; show: time asString; show: 'ms'; cr.
+
+    "Modified: / 01-05-2015 / 14:40:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!PPCompiledExpressionGrammarResource class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/Make.proto	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/Make.proto	Tue May 12 01:33:33 2015 +0100
@@ -129,7 +129,18 @@
 
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)PPCCompiledJavaVerificationTest.$(O) PPCCompiledJavaVerificationTest.$(H): PPCCompiledJavaVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCResources.$(O) PPCResources.$(H): PPCResources.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCSmalltalkTests.$(O) PPCSmalltalkTests.$(H): PPCSmalltalkTests.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCSmalltalkVerificationTest.$(O) PPCSmalltalkVerificationTest.$(H): PPCSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledJavaResource.$(O) PPCompiledJavaResource.$(H): PPCompiledJavaResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkGrammarResource.$(O) PPCompiledSmalltalkGrammarResource.$(H): PPCompiledSmalltalkGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkGrammarTests.$(O) PPCompiledSmalltalkGrammarTests.$(H): PPCompiledSmalltalkGrammarTests.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkGrammarResource.$(O) PPTokenizedSmalltalkGrammarResource.$(H): PPTokenizedSmalltalkGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkGrammarTests.$(O) PPTokenizedSmalltalkGrammarTests.$(H): PPTokenizedSmalltalkGrammarTests.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)stx_goodies_petitparser_compiler_tests_extras.$(O) stx_goodies_petitparser_compiler_tests_extras.$(H): stx_goodies_petitparser_compiler_tests_extras.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkVerificationTest.$(O) PPCompiledSmalltalkVerificationTest.$(H): PPCompiledSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkVerificationTest.$(O) PPTokenizedSmalltalkVerificationTest.$(H): PPTokenizedSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/compiler/tests/extras/Make.spec	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/Make.spec	Tue May 12 01:33:33 2015 +0100
@@ -51,13 +51,35 @@
 STCWARNINGS=-warnNonStandard
 
 COMMON_CLASSES= \
+	PPCCompiledJavaVerificationTest \
+	PPCResources \
+	PPCSmalltalkTests \
+	PPCSmalltalkVerificationTest \
+	PPCompiledJavaResource \
+	PPCompiledSmalltalkGrammarResource \
+	PPCompiledSmalltalkGrammarTests \
+	PPTokenizedSmalltalkGrammarResource \
+	PPTokenizedSmalltalkGrammarTests \
 	stx_goodies_petitparser_compiler_tests_extras \
+	PPCompiledSmalltalkVerificationTest \
+	PPTokenizedSmalltalkVerificationTest \
 
 
 
 
 COMMON_OBJS= \
+    $(OUTDIR_SLASH)PPCCompiledJavaVerificationTest.$(O) \
+    $(OUTDIR_SLASH)PPCResources.$(O) \
+    $(OUTDIR_SLASH)PPCSmalltalkTests.$(O) \
+    $(OUTDIR_SLASH)PPCSmalltalkVerificationTest.$(O) \
+    $(OUTDIR_SLASH)PPCompiledJavaResource.$(O) \
+    $(OUTDIR_SLASH)PPCompiledSmalltalkGrammarResource.$(O) \
+    $(OUTDIR_SLASH)PPCompiledSmalltalkGrammarTests.$(O) \
+    $(OUTDIR_SLASH)PPTokenizedSmalltalkGrammarResource.$(O) \
+    $(OUTDIR_SLASH)PPTokenizedSmalltalkGrammarTests.$(O) \
     $(OUTDIR_SLASH)stx_goodies_petitparser_compiler_tests_extras.$(O) \
+    $(OUTDIR_SLASH)PPCompiledSmalltalkVerificationTest.$(O) \
+    $(OUTDIR_SLASH)PPTokenizedSmalltalkVerificationTest.$(O) \
 
 
 
--- a/compiler/tests/extras/PPCResources.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/PPCResources.st	Tue May 12 01:33:33 2015 +0100
@@ -58,7 +58,6 @@
 
     ^ cache at: #expressionSourcesBig
     
-!
 
 expressionSourcesMedium
     | sources |
@@ -127,7 +126,14 @@
 !PPCResources methodsFor:'private utilities'!
 
 files: files withExtension: extension
-    ^ files select: [ :f | f extension = extension ] 
+     ( (Smalltalk respondsTo: #isSmalltalkX) and:[ Smalltalk isSmalltalkX ] ) ifTrue:[ 
+        ^ files select: [ :f | f suffix = extension ] 
+    ] ifFalse:[ 
+        "Assuming Pharo..."   
+        ^ files select: [ :f | f extension = extension ] 
+    ]
+
+    "Modified: / 11-05-2015 / 16:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readDirectory: directory
@@ -164,7 +170,9 @@
     files := self readDirectory: directory.
     files := self files: files withExtension: 'st'.
     
-    ^ files collect: [ :f | (FileStream fileNamed: f) contents ]
+    ^ files collect: [ :f | (FileStream fileNamed: f) contents asString ]
+
+    "Modified: / 11-05-2015 / 16:38:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 smalltalkObjectMethods
@@ -180,3 +188,10 @@
     ^ (self smalltalkInDirectory: '../smalltalk-src/') copyFrom: 1 to: 5000.
 ! !
 
+!PPCResources class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPCompiledJavaSyntaxTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/PPCompiledJavaSyntaxTest.st	Tue May 12 01:33:33 2015 +0100
@@ -571,3 +571,10 @@
             rule: #methodDeclaration
 ! !
 
+!PPCompiledJavaSyntaxTest class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPCompiledSmalltalkVerificationTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/PPCompiledSmalltalkVerificationTest.st	Tue May 12 01:33:33 2015 +0100
@@ -37,3 +37,10 @@
     super testSmalltalkObject
 ! !
 
+!PPCompiledSmalltalkVerificationTest class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPTokenizedSmalltalkGrammarResource.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/PPTokenizedSmalltalkGrammarResource.st	Tue May 12 01:33:33 2015 +0100
@@ -9,7 +9,6 @@
 	category:'PetitCompiler-Extras-Tests-Smalltalk'
 !
 
-
 !PPTokenizedSmalltalkGrammarResource methodsFor:'as yet unclassified'!
 
 setUp
--- a/compiler/tests/extras/bc.mak	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/bc.mak	Tue May 12 01:33:33 2015 +0100
@@ -76,7 +76,18 @@
 
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)PPCCompiledJavaVerificationTest.$(O) PPCCompiledJavaVerificationTest.$(H): PPCCompiledJavaVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCResources.$(O) PPCResources.$(H): PPCResources.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCSmalltalkTests.$(O) PPCSmalltalkTests.$(H): PPCSmalltalkTests.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCSmalltalkVerificationTest.$(O) PPCSmalltalkVerificationTest.$(H): PPCSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledJavaResource.$(O) PPCompiledJavaResource.$(H): PPCompiledJavaResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkGrammarResource.$(O) PPCompiledSmalltalkGrammarResource.$(H): PPCompiledSmalltalkGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkGrammarTests.$(O) PPCompiledSmalltalkGrammarTests.$(H): PPCompiledSmalltalkGrammarTests.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkGrammarResource.$(O) PPTokenizedSmalltalkGrammarResource.$(H): PPTokenizedSmalltalkGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkGrammarTests.$(O) PPTokenizedSmalltalkGrammarTests.$(H): PPTokenizedSmalltalkGrammarTests.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)stx_goodies_petitparser_compiler_tests_extras.$(O) stx_goodies_petitparser_compiler_tests_extras.$(H): stx_goodies_petitparser_compiler_tests_extras.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
+$(OUTDIR)PPCompiledSmalltalkVerificationTest.$(O) PPCompiledSmalltalkVerificationTest.$(H): PPCompiledSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPTokenizedSmalltalkVerificationTest.$(O) PPTokenizedSmalltalkVerificationTest.$(H): PPTokenizedSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/compiler/tests/extras/libInit.cc	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/libInit.cc	Tue May 12 01:33:33 2015 +0100
@@ -27,7 +27,18 @@
 void _libstx_goodies_petitparser_compiler_tests_extras_Init(pass, __pRT__, snd)
 OBJ snd; struct __vmData__ *__pRT__; {
 __BEGIN_PACKAGE2__("libstx_goodies_petitparser_compiler_tests_extras", _libstx_goodies_petitparser_compiler_tests_extras_Init, "stx:goodies/petitparser/compiler/tests/extras");
+_PPCCompiledJavaVerificationTest_Init(pass,__pRT__,snd);
+_PPCResources_Init(pass,__pRT__,snd);
+_PPCSmalltalkTests_Init(pass,__pRT__,snd);
+_PPCSmalltalkVerificationTest_Init(pass,__pRT__,snd);
+_PPCompiledJavaResource_Init(pass,__pRT__,snd);
+_PPCompiledSmalltalkGrammarResource_Init(pass,__pRT__,snd);
+_PPCompiledSmalltalkGrammarTests_Init(pass,__pRT__,snd);
+_PPTokenizedSmalltalkGrammarResource_Init(pass,__pRT__,snd);
+_PPTokenizedSmalltalkGrammarTests_Init(pass,__pRT__,snd);
 _stx_137goodies_137petitparser_137compiler_137tests_137extras_Init(pass,__pRT__,snd);
+_PPCompiledSmalltalkVerificationTest_Init(pass,__pRT__,snd);
+_PPTokenizedSmalltalkVerificationTest_Init(pass,__pRT__,snd);
 
 
 __END_PACKAGE__();
--- a/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st	Tue May 12 01:24:03 2015 +0100
+++ b/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st	Tue May 12 01:33:33 2015 +0100
@@ -10,6 +10,32 @@
 !
 
 
+!stx_goodies_petitparser_compiler_tests_extras class methodsFor:'accessing'!
+
+additionalClassAttributesFor: aClass
+    "Answers additional set of class attributes for given class
+     Individual project definitions may override this method, but
+     overriding method should always merge its attributes with result
+     of 'super additionalClassAttributesFor: aClass'.
+
+     Here, we add #autoload attributes to all test cases and
+     test resources, as they are not neccessary for the package
+     and should not be compiled (because of unwanted dependency
+     on stx:goodies/sunit package)
+
+     But not make them autoloaded when the package is separate
+     test-package - by conventions such package should by named
+     #'module:package/subpackage/tests'
+    "
+    (TestCase notNil and:[aClass inheritsFrom: TestCase]) ifTrue:[^#()].
+    (TestResource notNil and:[aClass inheritsFrom: TestResource]) ifTrue:[^#()].
+
+
+    ^ super additionalClassAttributesFor: aClass
+
+    "Created: / 10-05-2015 / 14:17:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !stx_goodies_petitparser_compiler_tests_extras class methodsFor:'accessing - monticello'!
 
 monticelloLastMergedVersionInfo
@@ -103,22 +129,22 @@
 
     ^ #(
         "<className> or (<className> attributes...) in load order"
-        (PPCCompiledJavaVerificationTest autoload)
-        (PPCExpressionsVerificationTest autoload)
-        (PPCResources autoload)
-        (PPCSmalltalkTests autoload)
-        (PPCSmalltalkVerificationTest autoload)
-        (PPCompiledJavaResource autoload)
+        PPCCompiledJavaVerificationTest
+        PPCResources
+        PPCExpressionsVerificationTest
+        PPCSmalltalkTests
+        PPCSmalltalkVerificationTest
+        PPCompiledJavaResource
         (PPCompiledJavaSyntaxTest autoload)
-        (PPCompiledSmalltalkGrammarResource autoload)
-        (PPCompiledSmalltalkGrammarTests autoload)
-        (PPTokenizedSmalltalkGrammarResource autoload)
-        (PPTokenizedSmalltalkGrammarTests autoload)
+        PPCompiledSmalltalkGrammarResource
+        PPCompiledSmalltalkGrammarTests
+        PPTokenizedSmalltalkGrammarResource
+        PPTokenizedSmalltalkGrammarTests
         #'stx_goodies_petitparser_compiler_tests_extras'
-        (PPCompiledExpressionsVerificationTest autoload)
-        (PPCompiledSmalltalkVerificationTest autoload)
-        (PPTokenizedExpressionsVerificationTest autoload)
-        (PPTokenizedSmalltalkVerificationTest autoload)
+        PPCompiledSmalltalkVerificationTest
+        PPCompiledExpressionsVerificationTest
+        PPTokenizedSmalltalkVerificationTest
+        PPTokenizedExpressionsVerificationTest
     )
 !
 
--- a/islands/abbrev.stc	Tue May 12 01:24:03 2015 +0100
+++ b/islands/abbrev.stc	Tue May 12 01:33:33 2015 +0100
@@ -8,5 +8,5 @@
 stx_goodies_petitparser_islands stx_goodies_petitparser_islands stx:goodies/petitparser/islands '* Projects & Packages *' 3
 PPMemoizingIsland PPMemoizingIsland stx:goodies/petitparser/islands 'PetitIslands-Parsers' 0
 JavaParser JavaParser stx:goodies/petitparser/islands 'PetitIslands-Examples' 0
+XmlFeedParser XmlFeedParser stx:goodies/petitparser/islands 'PetitIslands-Examples' 0
 RobustXmlFeedParser RobustXmlFeedParser stx:goodies/petitparser/islands 'PetitIslands-Examples' 0
-XmlFeedParser XmlFeedParser stx:goodies/petitparser/islands 'PetitIslands-Examples' 0
--- a/lccmake.bat	Tue May 12 01:24:03 2015 +0100
+++ b/lccmake.bat	Tue May 12 01:33:33 2015 +0100
@@ -19,4 +19,25 @@
 @call lccmake %1 %2 || exit /b "%errorlevel%"
 @popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/smalltalk
+@echo "***********************************"
+@pushd parsers\smalltalk
+@call lccmake %1 %2 || exit /b "%errorlevel%"
+@popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/java
+@echo "***********************************"
+@pushd parsers\java
+@call lccmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/compiler
+@echo "***********************************"
+@pushd compiler
+@call lccmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+
--- a/mingwmake.bat	Tue May 12 01:24:03 2015 +0100
+++ b/mingwmake.bat	Tue May 12 01:33:33 2015 +0100
@@ -27,4 +27,25 @@
 @call mingwmake %1 %2 || exit /b "%errorlevel%"
 @popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/smalltalk
+@echo "***********************************"
+@pushd parsers\smalltalk
+@call mingwmake %1 %2 || exit /b "%errorlevel%"
+@popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/java
+@echo "***********************************"
+@pushd parsers\java
+@call mingwmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/compiler
+@echo "***********************************"
+@pushd compiler
+@call mingwmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+
--- a/parsers/java/Make.proto	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/Make.proto	Tue May 12 01:33:33 2015 +0100
@@ -34,7 +34,7 @@
 # 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/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/petitparser -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,
--- a/parsers/java/PJEndOfLineCommentsNode.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PJEndOfLineCommentsNode.st	Tue May 12 01:33:33 2015 +0100
@@ -23,7 +23,7 @@
 !
 
 printOn: aStream
-	.^	aStream 
+	^	aStream 
 		nextPutAll: 'EndOfLineComment value ==> ';
 		nextPutAll: self comment.
  
--- a/parsers/java/PJPackageDeclarationNode.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PJPackageDeclarationNode.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,7 @@
 	category:'PetitJava-AST'
 !
 
+
 !PJPackageDeclarationNode methodsFor:'accessing'!
 
 nameNode
@@ -26,3 +27,10 @@
 	aVisitor visitPackageDeclarationNode: self
 ! !
 
+!PJPackageDeclarationNode class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/parsers/java/PJSyntaxNode.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PJSyntaxNode.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,3 @@
 	category:'PetitJava-AST'
 !
 
-PJSyntaxNode comment:''
-!
-
--- a/parsers/java/PPJavaLexicon.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PPJavaLexicon.st	Tue May 12 01:33:33 2015 +0100
@@ -1,1 +1,547 @@
-"{ Package: 'stx:goodies/petitparser/parsers/java' }"

"{ NameSpace: Smalltalk }"

PPCompositeParser subclass:#PPJavaLexicon
	instanceVariableNames:'unicodeEscape rawInputCharacter unicodeMarker hexDigit
		lineTerminator unicodeInputCharacter inputElements sub
		inputElement whiteSpace comment javaToken keyword literal
		separator operator identifier traditionalComment endOfLineComment
		commentTail charactersInLine commentTailStar notStar
		notStarNotSlash inputCharacter booleanLiteral nullLiteral
		identifierChars javaLetter javaLetterOrDigit keywords
		floatingPointLiteral integerLiteral characterLiteral
		stringLiteral hexIntegerLiteral octalIntegerLiteral
		decimalIntegerLiteral decimalNumeral integerTypeSuffix hexNumeral
		octalNumeral nonZeroDigit digits hexDigits octalDigits octalDigit
		hexadecimalFloatingPointLiteral decimalFloatingPointLiteral
		exponentPart floatTypeSuffix exponentIndicator signedInteger sign
		hexSignificand binaryExponent binaryExponentIndicator
		escapeSequence singleCharacter stringCharacters stringCharacter
		octalEscape zeroToThree input operators separators trueToken
		falseToken nullToken'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitJava-Core'
!

PPJavaLexicon comment:'A parser with a definitions for some basic Java gramar parts

Grammar rules follow as closely as possible the specification found in "The Java Language Specification Third Edition"

URL = '
!


!PPJavaLexicon class methodsFor:'accessing'!

ignoredNames
	"Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."

	| newArray |	
	newArray := Array new: ((self namesToIgnore size) + (super ignoredNames size)).
	newArray
		replaceFrom: 1
		to: self namesToIgnore size
		with: self namesToIgnore.
	newArray
		replaceFrom: (self namesToIgnore size + 1)
		to: newArray size
		with: super ignoredNames.	
	^newArray
!

namesToIgnore

	^#('keywords' 'operators' 'separators')
! !

!PPJavaLexicon methodsFor:'accessing'!

start
	"Default start production."

	^ input end
! !

!PPJavaLexicon methodsFor:'grammar-comments'!

charactersInLine   

	^ inputCharacter plus
!

comment
	"traditional -> /*
	 endOfLine -> //"
	^ traditionalComment / endOfLineComment
!

commentTail

	^ 	('*' asParser , commentTailStar ) /
		(notStar , commentTail)
!

commentTailStar 

	^ ('/' asParser ) /
	  ('*' asParser , commentTailStar ) /
	  (notStarNotSlash , commentTail )
!

endOfLineComment 

	^ '//' asParser , charactersInLine optional
!

notStar

	^  ('*' asParser not , inputCharacter)/lineTerminator
!

notStarNotSlash  

	^ lineTerminator / ((PPPredicateObjectParser anyOf: '*/') not , inputCharacter )
!

traditionalComment

	^ '/*' asParser , commentTail
! !

!PPJavaLexicon methodsFor:'grammar-identifiers'!

identifier 

	^  self asToken: (((keyword not) , (booleanLiteral not) , (nullLiteral not) , identifierChars ))
!

identifierChars
	
	^ javaLetter plus , javaLetterOrDigit star
!

javaLetter

	^ (#letter asParser) / (PPPredicateObjectParser anyOf: '_$')
!

javaLetterOrDigit

	^ javaLetter / (#digit asParser)
! !

!PPJavaLexicon methodsFor:'grammar-input'!

input

	^ (inputElements optional) , (sub optional)
!

inputElement

	^ whiteSpace / comment / javaToken
!

inputElements

	^ inputElement plus
!

javaToken


	^ identifier / keyword / literal / separator / operator
!

sub

	^ (Character value: 26) asParser 
! !

!PPJavaLexicon methodsFor:'grammar-keywords'!

keyword

        | keywordParsers |
        
        keywordParsers := keywords keys asSortedCollection collect: [:eachKey | keywords at: eachKey ].
        ^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )

    "Modified (format): / 21-04-2015 / 15:27:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!PPJavaLexicon methodsFor:'grammar-lineTerminators'!

inputCharacter 

	^(lineTerminator not) , unicodeInputCharacter ==> #second
!

lineTerminator

    self flag: 'Hack alert - should be fixed immediately in PJTraditionalCommentsNode>>comment:'.

        ^ (((Character codePoint: 10) asParser) ==> [ :lf | Array with: lf with: nil ])
          / (((Character codePoint: 13) asParser , ((Character codePoint: 10) asParser ) optional )) ==> [ :nodes | Array with: nodes first with: nil ]

    "Modified: / 21-04-2015 / 17:16:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!PPJavaLexicon methodsFor:'grammar-literals'!

literal
	"a literal must be a single token. Whitespaces are not allowed inside the literal"
	
	^ nullLiteral / booleanLiteral / floatingPointLiteral / integerLiteral / characterLiteral / stringLiteral
! !

!PPJavaLexicon methodsFor:'grammar-literals-boolean'!

booleanLiteral 

 ^ trueToken / falseToken
!

falseToken
	^ ('false' asParser , #word asParser not) javaToken
!

nullToken
	^ ('null' asParser , #word asParser not) javaToken
!

trueToken
	^ ('true' asParser , #word asParser not) javaToken
! !

!PPJavaLexicon methodsFor:'grammar-literals-character'!

characterLiteral 

 ^ ($' asParser , ( escapeSequence / singleCharacter ), $' asParser) javaToken
!

singleCharacter 	

	^( PPPredicateObjectParser anyOf: '''\') not , inputCharacter ==> #second
! !

!PPJavaLexicon methodsFor:'grammar-literals-escape'!

escapeSequence 

	^ ($\ asParser , (PPPredicateObjectParser anyOf: 'btnfr""''\' ) ) /
	   octalEscape 
!

octalEscape

	^ $\ asParser , ( (zeroToThree , octalDigit , octalDigit) / (octalDigit , octalDigit optional) )
!

zeroToThree

	^PPPredicateObjectParser anyOf: '0123'
! !

!PPJavaLexicon methodsFor:'grammar-literals-floating'!

binaryExponent

 ^ binaryExponentIndicator , signedInteger
!

binaryExponentIndicator

  ^ PPPredicateObjectParser anyOf: 'pP'
!

decimalFloatingPointLiteral

	|dot|
	dot := $. asParser.

 ^ ( ( (dot , digits) 
        / 
        (digits , dot , digits optional)) , 
			exponentPart optional , floatTypeSuffix optional ) 
  	/ 
  	(digits , 
		( (exponentPart , floatTypeSuffix optional) 
		  /
		  (exponentPart optional , floatTypeSuffix) ))
!

exponentIndicator

  ^ PPPredicateObjectParser anyOf: 'eE'
!

exponentPart

 ^ exponentIndicator , signedInteger
!

floatTypeSuffix

	^ PPPredicateObjectParser anyOf: 'fFdD'
!

floatingPointLiteral

  ^ (hexadecimalFloatingPointLiteral / decimalFloatingPointLiteral) javaToken
!

hexSignificand 
	|dot|
	dot := $. asParser.

 ^  (hexNumeral , dot optional) /
    ($0 asParser , (PPPredicateObjectParser anyOf: 'xX') , hexDigits optional , dot , hexDigits )
!

hexadecimalFloatingPointLiteral

 ^ hexSignificand , binaryExponent , floatTypeSuffix optional
!

sign

  ^PPPredicateObjectParser anyOf: '-+'
!

signedInteger

  ^ sign optional , digits
! !

!PPJavaLexicon methodsFor:'grammar-literals-integer'!

decimalIntegerLiteral

 ^ decimalNumeral , (integerTypeSuffix optional)
!

decimalNumeral 

	^($0 asParser) / (nonZeroDigit , digits optional) 
!

digits 
	"digit is already defined, no need to redefine it"
	^#digit asParser plus
!

hexDigits 

	^hexDigit plus
!

hexIntegerLiteral 

  ^ hexNumeral , (integerTypeSuffix optional)
!

hexNumeral 

	^$0 asParser, (PPPredicateObjectParser anyOf: 'xX' ), hexDigits
!

integerLiteral

  ^ (hexIntegerLiteral / octalIntegerLiteral / decimalIntegerLiteral) javaToken
!

integerTypeSuffix

	^ PPPredicateObjectParser anyOf: 'lL'
!

nonZeroDigit 

	^PPPredicateObjectParser anyOf: '123456789'.
!

octalDigit 

	^PPPredicateObjectParser anyOf: '01234567'
!

octalDigits

	^ octalDigit plus
!

octalIntegerLiteral 

 ^ octalNumeral , (integerTypeSuffix optional)
!

octalNumeral 

	^($0 asParser) , octalDigits
! !

!PPJavaLexicon methodsFor:'grammar-literals-null'!

nullLiteral 

 ^ nullToken
! !

!PPJavaLexicon methodsFor:'grammar-literals-string'!

stringCharacter
		
	^ ( ( PPPredicateObjectParser anyOf: '"\') not , inputCharacter ==> #second ) /
	   escapeSequence 
!

stringCharacters

	^ stringCharacter plus
!

stringLiteral 

 ^ ($" asParser , stringCharacters optional , $" asParser) javaToken
! !

!PPJavaLexicon methodsFor:'grammar-operators'!

operator
        | operatorParsers |
        
        operatorParsers := operators keys asSortedCollection collect: [:eachKey | operators at: eachKey ].                                                
        ^self asToken:  (operatorParsers reduce: [ :a :b | a / b ])

    "Modified: / 21-04-2015 / 15:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!PPJavaLexicon methodsFor:'grammar-separators'!

separator	
	^self asToken: (PPPredicateObjectParser anyOf: '(){}[];,.' )
! !

!PPJavaLexicon methodsFor:'grammar-unicode-escapes'!

hexDigit 

	^#hex asParser
!

rawInputCharacter

	^#any asParser
!

unicodeEscape

	^ $\ asParser , unicodeMarker , hexDigit , hexDigit , hexDigit , hexDigit
!

unicodeInputCharacter
	 ^ unicodeEscape / rawInputCharacter
!

unicodeMarker

	^$u asParser plus
! !

!PPJavaLexicon methodsFor:'grammar-whiteSpace'!

whiteSpace

	^ (Character space asParser ) /
	  (Character tab asParser ) /
	  ((Character value: 12) asParser ) /
		lineTerminator 
! !

!PPJavaLexicon methodsFor:'initialization'!

initialize

	super initialize.
	
	self initializeKeywords.
	self initializeOperators.
	self initializeSeparators.
!

initializeKeywords

	| values |
	keywords := Dictionary new.
	values := #('abstract' 'assert' 'boolean' 'break' 'byte' 'case'  'catch' 'char' 'class' 'const'
	   'continue' 'default' 'do' 'double' 'else' 'enum' 'extends' 'final'  'finally' 'float'
	   'for' 'if' 'goto' 'implements' 'import' 'instanceof' 'int' 'interface' 'long' 'native'
	   'new' 'package' 'private' 'protected' 'public' 'return' 'short' 'static' 'strictfp' 'super'
	   'switch' 'synchronized' 'this' 'throw' 'throws' 'transient' 'try' 'void' 'volatile' 'while').
	
	values do: [:eachKeyword |
		keywords at: eachKeyword 
			put: (PPUnresolvedParser named: ('keyword', eachKeyword first asUppercase asString , eachKeyword allButFirst))		
		].
	
	keywords keysAndValuesDo:  [:key :value |
		(keywords at: key) def: (key asParser ,  #word asParser not)]
!

initializeOperators

	| values |
	operators := Dictionary new.
	values := #(	'>>>=' '>>>' '>>=' '>>' '>=' '>'	'<<=' '<<' '<=' '<'	'++' '+=' '+'	'--' '-=' '-'	'&&' '&=' '&'
					'||' '|=' '|'	'*=' '*'	'%=' '%'	'/=' '/'	'^=' '^'	'!!=' '!!'	'==' '='	'~'	'?'	':'	'@' ).
	" @ ? perhaps for annotation but not in the doc "
	values do: [:eachOperator |
		operators at: eachOperator 
			put: (PPUnresolvedParser named: ('operator', eachOperator asString))		
		].
	
	operators  keysAndValuesDo:  [:key :value |
		(operators at: key) def: (key asParser)]
!

initializeSeparators

	| values |
	separators := Dictionary new.
	values := #( '(' ')' '{' '}' '[' ']' ';' ',' '.' ).
	
	values do: [:eachSeparator |
		separators at: eachSeparator 
			put: (PPUnresolvedParser named: ('separator', eachSeparator asString))		
		].
	
	separators  keysAndValuesDo:  [:key :value |
		(separators at: key) def: (key asParser)]
! !

!PPJavaLexicon methodsFor:'utility'!

asToken: aParser

	^aParser javaToken
!

emptySquaredParenthesis

	^ self asToken: (((self tokenFor: '['), (self tokenFor: ']')))
!

tokenFor: aString

	^self asToken: (keywords at: aString 
						ifAbsent: [separators at: aString 
							ifAbsent: [operators at: aString] ])
! !

!PPJavaLexicon class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !
\ No newline at end of file
+"{ Package: 'stx:goodies/petitparser/parsers/java' }"
+
+"{ NameSpace: Smalltalk }"
+
+PPCompositeParser subclass:#PPJavaLexicon
+	instanceVariableNames:'unicodeEscape rawInputCharacter unicodeMarker hexDigit
+		lineTerminator unicodeInputCharacter inputElements sub
+		inputElement whiteSpace comment javaToken keyword literal
+		separator operator identifier traditionalComment endOfLineComment
+		commentTail charactersInLine commentTailStar notStar
+		notStarNotSlash inputCharacter booleanLiteral nullLiteral
+		identifierChars javaLetter javaLetterOrDigit keywords
+		floatingPointLiteral integerLiteral characterLiteral
+		stringLiteral hexIntegerLiteral octalIntegerLiteral
+		decimalIntegerLiteral decimalNumeral integerTypeSuffix hexNumeral
+		octalNumeral nonZeroDigit digits hexDigits octalDigits octalDigit
+		hexadecimalFloatingPointLiteral decimalFloatingPointLiteral
+		exponentPart floatTypeSuffix exponentIndicator signedInteger sign
+		hexSignificand binaryExponent binaryExponentIndicator
+		escapeSequence singleCharacter stringCharacters stringCharacter
+		octalEscape zeroToThree input operators separators trueToken
+		falseToken nullToken'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitJava-Core'
+!
+
+PPJavaLexicon comment:'A parser with a definitions for some basic Java gramar parts

Grammar rules follow as closely as possible the specification found in "The Java Language Specification Third Edition"

URL = '
+!
+
+
+!PPJavaLexicon class methodsFor:'accessing'!
+
+ignoredNames
+	"Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."
+
+	| newArray |	
+	newArray := Array new: ((self namesToIgnore size) + (super ignoredNames size)).
+	newArray
+		replaceFrom: 1
+		to: self namesToIgnore size
+		with: self namesToIgnore.
+	newArray
+		replaceFrom: (self namesToIgnore size + 1)
+		to: newArray size
+		with: super ignoredNames.	
+	^newArray
+!
+
+namesToIgnore
+
+	^#('keywords' 'operators' 'separators')
+! !
+
+!PPJavaLexicon methodsFor:'accessing'!
+
+start
+	"Default start production."
+
+	^ input end
+! !
+
+!PPJavaLexicon methodsFor:'grammar-comments'!
+
+charactersInLine   
+
+	^ inputCharacter plus
+!
+
+comment
+	"traditional -> /*
+	 endOfLine -> //"
+	^ traditionalComment / endOfLineComment
+!
+
+commentTail
+
+	^ 	('*' asParser , commentTailStar ) /
+		(notStar , commentTail)
+!
+
+commentTailStar 
+
+	^ ('/' asParser ) /
+	  ('*' asParser , commentTailStar ) /
+	  (notStarNotSlash , commentTail )
+!
+
+endOfLineComment 
+
+	^ '//' asParser , charactersInLine optional
+!
+
+notStar
+
+	^  ('*' asParser not , inputCharacter)/lineTerminator
+!
+
+notStarNotSlash  
+
+	^ lineTerminator / ((PPPredicateObjectParser anyOf: '*/') not , inputCharacter )
+!
+
+traditionalComment
+
+	^ '/*' asParser , commentTail
+! !
+
+!PPJavaLexicon methodsFor:'grammar-identifiers'!
+
+identifier 
+
+	^  self asToken: (((keyword not) , (booleanLiteral not) , (nullLiteral not) , identifierChars ))
+!
+
+identifierChars
+	
+	^ javaLetter plus , javaLetterOrDigit star
+!
+
+javaLetter
+
+	^ (#letter asParser) / (PPPredicateObjectParser anyOf: '_$')
+!
+
+javaLetterOrDigit
+
+	^ javaLetter / (#digit asParser)
+! !
+
+!PPJavaLexicon methodsFor:'grammar-input'!
+
+input
+
+	^ (inputElements optional) , (sub optional)
+!
+
+inputElement
+
+	^ whiteSpace / comment / javaToken
+!
+
+inputElements
+
+	^ inputElement plus
+!
+
+javaToken
+
+
+	^ identifier / keyword / literal / separator / operator
+!
+
+sub
+
+	^ (Character value: 26) asParser 
+! !
+
+!PPJavaLexicon methodsFor:'grammar-keywords'!
+
+keyword
+
+        | keywordParsers |
+        
+        keywordParsers := keywords keys asSortedCollection collect: [:eachKey | keywords at: eachKey ].
+        ^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )
+
+    "Modified (format): / 21-04-2015 / 15:27:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPJavaLexicon methodsFor:'grammar-lineTerminators'!
+
+inputCharacter 
+
+	^(lineTerminator not) , unicodeInputCharacter ==> #second
+!
+
+lineTerminator
+
+    self flag: 'Hack alert - should be fixed immediately in PJTraditionalCommentsNode>>comment:'.
+
+        ^ (((Character codePoint: 10) asParser) ==> [ :lf | Array with: lf with: nil ])
+          / (((Character codePoint: 13) asParser , ((Character codePoint: 10) asParser ) optional )) ==> [ :nodes | Array with: nodes first with: nil ]
+
+    "Modified: / 21-04-2015 / 17:16:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals'!
+
+literal
+	"a literal must be a single token. Whitespaces are not allowed inside the literal"
+	
+	^ nullLiteral / booleanLiteral / floatingPointLiteral / integerLiteral / characterLiteral / stringLiteral
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-boolean'!
+
+booleanLiteral 
+
+ ^ trueToken / falseToken
+!
+
+falseToken
+	^ ('false' asParser , #word asParser not) javaToken
+!
+
+nullToken
+	^ ('null' asParser , #word asParser not) javaToken
+!
+
+trueToken
+	^ ('true' asParser , #word asParser not) javaToken
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-character'!
+
+characterLiteral 
+
+ ^ ($' asParser , ( escapeSequence / singleCharacter ), $' asParser) javaToken
+!
+
+singleCharacter 	
+
+	^( PPPredicateObjectParser anyOf: '''\') not , inputCharacter ==> #second
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-escape'!
+
+escapeSequence 
+
+	^ ($\ asParser , (PPPredicateObjectParser anyOf: 'btnfr""''\' ) ) /
+	   octalEscape 
+!
+
+octalEscape
+
+	^ $\ asParser , ( (zeroToThree , octalDigit , octalDigit) / (octalDigit , octalDigit optional) )
+!
+
+zeroToThree
+
+	^PPPredicateObjectParser anyOf: '0123'
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-floating'!
+
+binaryExponent
+
+ ^ binaryExponentIndicator , signedInteger
+!
+
+binaryExponentIndicator
+
+  ^ PPPredicateObjectParser anyOf: 'pP'
+!
+
+decimalFloatingPointLiteral
+
+	|dot|
+	dot := $. asParser.
+
+ ^ ( ( (dot , digits) 
+        / 
+        (digits , dot , digits optional)) , 
+			exponentPart optional , floatTypeSuffix optional ) 
+  	/ 
+  	(digits , 
+		( (exponentPart , floatTypeSuffix optional) 
+		  /
+		  (exponentPart optional , floatTypeSuffix) ))
+!
+
+exponentIndicator
+
+  ^ PPPredicateObjectParser anyOf: 'eE'
+!
+
+exponentPart
+
+ ^ exponentIndicator , signedInteger
+!
+
+floatTypeSuffix
+
+	^ PPPredicateObjectParser anyOf: 'fFdD'
+!
+
+floatingPointLiteral
+
+  ^ (hexadecimalFloatingPointLiteral / decimalFloatingPointLiteral) javaToken
+!
+
+hexSignificand 
+	|dot|
+	dot := $. asParser.
+
+ ^  (hexNumeral , dot optional) /
+    ($0 asParser , (PPPredicateObjectParser anyOf: 'xX') , hexDigits optional , dot , hexDigits )
+!
+
+hexadecimalFloatingPointLiteral
+
+ ^ hexSignificand , binaryExponent , floatTypeSuffix optional
+!
+
+sign
+
+  ^PPPredicateObjectParser anyOf: '-+'
+!
+
+signedInteger
+
+  ^ sign optional , digits
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-integer'!
+
+decimalIntegerLiteral
+
+ ^ decimalNumeral , (integerTypeSuffix optional)
+!
+
+decimalNumeral 
+
+	^($0 asParser) / (nonZeroDigit , digits optional) 
+!
+
+digits 
+	"digit is already defined, no need to redefine it"
+	^#digit asParser plus
+!
+
+hexDigits 
+
+	^hexDigit plus
+!
+
+hexIntegerLiteral 
+
+  ^ hexNumeral , (integerTypeSuffix optional)
+!
+
+hexNumeral 
+
+	^$0 asParser, (PPPredicateObjectParser anyOf: 'xX' ), hexDigits
+!
+
+integerLiteral
+
+  ^ (hexIntegerLiteral / octalIntegerLiteral / decimalIntegerLiteral) javaToken
+!
+
+integerTypeSuffix
+
+	^ PPPredicateObjectParser anyOf: 'lL'
+!
+
+nonZeroDigit 
+
+	^PPPredicateObjectParser anyOf: '123456789'.
+!
+
+octalDigit 
+
+	^PPPredicateObjectParser anyOf: '01234567'
+!
+
+octalDigits
+
+	^ octalDigit plus
+!
+
+octalIntegerLiteral 
+
+ ^ octalNumeral , (integerTypeSuffix optional)
+!
+
+octalNumeral 
+
+	^($0 asParser) , octalDigits
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-null'!
+
+nullLiteral 
+
+ ^ nullToken
+! !
+
+!PPJavaLexicon methodsFor:'grammar-literals-string'!
+
+stringCharacter
+		
+	^ ( ( PPPredicateObjectParser anyOf: '"\') not , inputCharacter ==> #second ) /
+	   escapeSequence 
+!
+
+stringCharacters
+
+	^ stringCharacter plus
+!
+
+stringLiteral 
+
+ ^ ($" asParser , stringCharacters optional , $" asParser) javaToken
+! !
+
+!PPJavaLexicon methodsFor:'grammar-operators'!
+
+operator
+        | operatorParsers |
+        
+        operatorParsers := operators keys asSortedCollection collect: [:eachKey | operators at: eachKey ].                                                
+        ^self asToken:  (operatorParsers reduce: [ :a :b | a / b ])
+
+    "Modified: / 21-04-2015 / 15:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPJavaLexicon methodsFor:'grammar-separators'!
+
+separator	
+	^self asToken: (PPPredicateObjectParser anyOf: '(){}[];,.' )
+! !
+
+!PPJavaLexicon methodsFor:'grammar-unicode-escapes'!
+
+hexDigit 
+
+	^#hex asParser
+!
+
+rawInputCharacter
+
+	^#any asParser
+!
+
+unicodeEscape
+
+	^ $\ asParser , unicodeMarker , hexDigit , hexDigit , hexDigit , hexDigit
+!
+
+unicodeInputCharacter
+	 ^ unicodeEscape / rawInputCharacter
+!
+
+unicodeMarker
+
+	^$u asParser plus
+! !
+
+!PPJavaLexicon methodsFor:'grammar-whiteSpace'!
+
+whiteSpace
+
+	^ (Character space asParser ) /
+	  (Character tab asParser ) /
+	  ((Character value: 12) asParser ) /
+		lineTerminator 
+! !
+
+!PPJavaLexicon methodsFor:'initialization'!
+
+initialize
+
+	super initialize.
+	
+	self initializeKeywords.
+	self initializeOperators.
+	self initializeSeparators.
+!
+
+initializeKeywords
+
+	| values |
+	keywords := Dictionary new.
+	values := #('abstract' 'assert' 'boolean' 'break' 'byte' 'case'  'catch' 'char' 'class' 'const'
+	   'continue' 'default' 'do' 'double' 'else' 'enum' 'extends' 'final'  'finally' 'float'
+	   'for' 'if' 'goto' 'implements' 'import' 'instanceof' 'int' 'interface' 'long' 'native'
+	   'new' 'package' 'private' 'protected' 'public' 'return' 'short' 'static' 'strictfp' 'super'
+	   'switch' 'synchronized' 'this' 'throw' 'throws' 'transient' 'try' 'void' 'volatile' 'while').
+	
+	values do: [:eachKeyword |
+		keywords at: eachKeyword 
+			put: (PPUnresolvedParser named: ('keyword', eachKeyword first asUppercase asString , eachKeyword allButFirst))		
+		].
+	
+	keywords keysAndValuesDo:  [:key :value |
+		(keywords at: key) def: (key asParser ,  #word asParser not)]
+!
+
+initializeOperators
+
+	| values |
+	operators := Dictionary new.
+	values := #(	'>>>=' '>>>' '>>=' '>>' '>=' '>'	'<<=' '<<' '<=' '<'	'++' '+=' '+'	'--' '-=' '-'	'&&' '&=' '&'
+					'||' '|=' '|'	'*=' '*'	'%=' '%'	'/=' '/'	'^=' '^'	'!!=' '!!'	'==' '='	'~'	'?'	':'	'@' ).
+	" @ ? perhaps for annotation but not in the doc "
+	values do: [:eachOperator |
+		operators at: eachOperator 
+			put: (PPUnresolvedParser named: ('operator', eachOperator asString))		
+		].
+	
+	operators  keysAndValuesDo:  [:key :value |
+		(operators at: key) def: (key asParser)]
+!
+
+initializeSeparators
+
+	| values |
+	separators := Dictionary new.
+	values := #( '(' ')' '{' '}' '[' ']' ';' ',' '.' ).
+	
+	values do: [:eachSeparator |
+		separators at: eachSeparator 
+			put: (PPUnresolvedParser named: ('separator', eachSeparator asString))		
+		].
+	
+	separators  keysAndValuesDo:  [:key :value |
+		(separators at: key) def: (key asParser)]
+! !
+
+!PPJavaLexicon methodsFor:'utility'!
+
+asToken: aParser
+
+	^aParser javaToken
+!
+
+emptySquaredParenthesis
+
+	^ self asToken: (((self tokenFor: '['), (self tokenFor: ']')))
+!
+
+tokenFor: aString
+
+	^self asToken: (keywords at: aString 
+						ifAbsent: [separators at: aString 
+							ifAbsent: [operators at: aString] ])
+! !
+
+!PPJavaLexicon class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/parsers/java/PPJavaTokenParser.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PPJavaTokenParser.st	Tue May 12 01:33:33 2015 +0100
@@ -12,29 +12,31 @@
 !PPJavaTokenParser methodsFor:'parsing'!
 
 parseComments: anArray on: aStream
-	
-	| start comments |
-	comments := anArray.
-	[ 
-		| peekTwice |
-	[ aStream atEnd not and: [ aStream peek isSeparator ] ]
-		whileTrue: [ aStream next ].
-	peekTwice := aStream peekTwice.	
-	  ((peekTwice  first = $/) and: 
-		[ (peekTwice second = $*) or: [peekTwice second = $/]])] whileTrue: [
-"		
-		Transcript show: ('position ', aStream position asString, ' char ', aStream next asString); cr.
-"		
-		aStream next.
-		start := aStream position.
-		(aStream next = $*) 
-			ifTrue: [ aStream upToAll: '*/' ]
-			ifFalse: [ 
-				| position |
-				position := aStream position.
-				aStream upToAnyOf: CharacterSet crlf].
-		comments := comments copyWith: (start to: aStream position) ].
-	^ comments
+        
+        | start comments |
+        comments := anArray.
+        [ 
+                | peekTwice |
+        [ aStream atEnd not and: [ aStream peek isSeparator ] ]
+                whileTrue: [ aStream next ].
+        peekTwice := aStream peekTwice. 
+          ((peekTwice  first = $/) and: 
+                [ (peekTwice second = $*) or: [peekTwice second = $/]])] whileTrue: [
+"               
+                Transcript show: ('position ', aStream position asString, ' char ', aStream next asString); cr.
+"               
+                aStream next.
+                start := aStream position.
+                (aStream next = $*) 
+                        ifTrue: [ aStream upToAll: '*/' ]
+                        ifFalse: [ 
+                                | position |
+                                position := aStream position.
+                                aStream upToAnyOf: (String with: (Character codePoint: 13) with: (Character codePoint: 10))].
+                comments := comments copyWith: (start to: aStream position) ].
+        ^ comments
+
+    "Modified: / 21-04-2015 / 17:23:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 parseOn: aPPContext
--- a/parsers/java/PPJavaWhitespaceParser.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/PPJavaWhitespaceParser.st	Tue May 12 01:33:33 2015 +0100
@@ -9,6 +9,7 @@
 	category:'PetitJava-Core'
 !
 
+
 !PPJavaWhitespaceParser methodsFor:'as yet unclassified'!
 
 acceptsEpsilon
@@ -36,25 +37,27 @@
 !
 
 parseOn: context
-	
-	| start |
+        
+        | start |
 
-	[ 
-		| peekTwice |
-		[ context atEnd not and: [ context peek isSeparator ] ]
-			whileTrue: [ context next ].
-		peekTwice := context peekTwice.	
-	  	((peekTwice  first = $/) and: 
-		[ (peekTwice second = $*) or: [peekTwice second = $/]])
-	] whileTrue: [
-		context next.
-		start := context position.
-		(context next = $*) 
-			ifTrue: [ context upToAll: '*/' ]
-			ifFalse: [ 
-				| position |
-				position := context position.
-				context upToAnyOf: CharacterSet crlf].
-	 ].
+        [ 
+                | peekTwice |
+                [ context atEnd not and: [ context peek isSeparator ] ]
+                        whileTrue: [ context next ].
+                peekTwice := context peekTwice. 
+                ((peekTwice  first = $/) and: 
+                [ (peekTwice second = $*) or: [peekTwice second = $/]])
+        ] whileTrue: [
+                context next.
+                start := context position.
+                (context next = $*) 
+                        ifTrue: [ context upToAll: '*/' ]
+                        ifFalse: [ 
+                                | position |
+                                position := context position.
+                                context upToAnyOf: String crlf].
+         ].
+
+    "Modified: / 10-05-2015 / 07:57:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
--- a/parsers/java/abbrev.stc	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/abbrev.stc	Tue May 12 01:33:33 2015 +0100
@@ -22,7 +22,6 @@
 PJTypeNode PJTypeNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJVariableDeclaratorNode PJVariableDeclaratorNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PPJavaSyntax PPJavaSyntax stx:goodies/petitparser/parsers/java 'PetitJava-Core' 0
-PPJavaSyntaxTest PPJavaSyntaxTest stx:goodies/petitparser/parsers/java 'PetitJava-Tests' 1
 PJAbstractTypeDeclarationNode PJAbstractTypeDeclarationNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJAnnotationNode PJAnnotationNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJArrayTypeNode PJArrayTypeNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
@@ -45,7 +44,6 @@
 PJStringLiteralNode PJStringLiteralNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJWhileStatementNode PJWhileStatementNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PPJavaParser PPJavaParser stx:goodies/petitparser/parsers/java 'PetitJava-Core' 0
-PPJavaParserTest PPJavaParserTest stx:goodies/petitparser/parsers/java 'PetitJava-Tests' 1
 PJConstructorDeclarationNode PJConstructorDeclarationNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJEndOfLineCommentsNode PJEndOfLineCommentsNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJMethodDeclarationNode PJMethodDeclarationNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 1
@@ -53,3 +51,5 @@
 PJSimpleNameNode PJSimpleNameNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJTraditionalCommentsNode PJTraditionalCommentsNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
 PJTypeDeclarationNode PJTypeDeclarationNode stx:goodies/petitparser/parsers/java 'PetitJava-AST' 0
+PPJavaParserTest PPJavaParserTest stx:goodies/petitparser/parsers/java 'PetitJava-Tests' 1
+PPJavaSyntaxTest PPJavaSyntaxTest stx:goodies/petitparser/parsers/java 'PetitJava-Tests' 1
--- a/parsers/java/bc.mak	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/bc.mak	Tue May 12 01:33:33 2015 +0100
@@ -35,7 +35,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -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)
--- a/parsers/java/extensions.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/extensions.st	Tue May 12 01:33:33 2015 +0100
@@ -11,10 +11,14 @@
 				ifFalse: [ aString ]])
 ! !
 
-!PPParser methodsFor:'*petitjava-operations'!
+!PPParser methodsFor:'*petitcompiler'!
 
 javaToken
-	^ PPJavaTokenParser on: self
+    | ws |
+    ws := PPJavaWhitespaceParser new.
+    ^ ((ws, ((PPTokenParser on: self) tokenClass: PPJavaToken; yourself), ws) ==> #second)
+        propertyAt: #'trimmingToken' put: true;
+        yourself
 ! !
 
 !stx_goodies_petitparser_parsers_java class methodsFor:'documentation'!
--- a/parsers/java/stx_goodies_petitparser_parsers_java.st	Tue May 12 01:24:03 2015 +0100
+++ b/parsers/java/stx_goodies_petitparser_parsers_java.st	Tue May 12 01:33:33 2015 +0100
@@ -73,7 +73,6 @@
      by searching all classes (and their packages) which are referenced by my classes."
 
     ^ #(
-        #'stx:libbasic2'    "CharacterSet - referenced by PPJavaTokenParser>>parseComments:on:"
     )
 !
 
@@ -126,7 +125,6 @@
         PJTypeNode
         PJVariableDeclaratorNode
         PPJavaSyntax
-        (PPJavaSyntaxTest autoload)
         PJAbstractTypeDeclarationNode
         PJAnnotationNode
         PJArrayTypeNode
@@ -149,7 +147,6 @@
         PJStringLiteralNode
         PJWhileStatementNode
         PPJavaParser
-        (PPJavaParserTest autoload)
         PJConstructorDeclarationNode
         PJEndOfLineCommentsNode
         PJMethodDeclarationNode
@@ -157,6 +154,8 @@
         PJSimpleNameNode
         PJTraditionalCommentsNode
         PJTypeDeclarationNode
+        (PPJavaParserTest autoload)
+        (PPJavaSyntaxTest autoload)
     )
 !
 
--- a/stx_goodies_petitparser.st	Tue May 12 01:24:03 2015 +0100
+++ b/stx_goodies_petitparser.st	Tue May 12 01:33:33 2015 +0100
@@ -112,7 +112,10 @@
     ^ #(
         #'stx:goodies/petitparser/analyzer'
         #'stx:goodies/petitparser/tests'
-    )
+        #'stx:goodies/parsers/smalltalk'
+        #'stx:goodies/parsers/java'
+        #'stx:goodies/compiler'
+)
 ! !
 
 !stx_goodies_petitparser class methodsFor:'description - compilation'!
@@ -129,7 +132,7 @@
 		Class tryLocalSourceFirst: true.				\
 		Smalltalk packagePath add:''$(TOP)/..'' .                       \
 		Smalltalk loadPackage:''stx:goodies/petitparser''.              \
-		(Smalltalk at: #''stx_goodies_petitparser'') exportAsMczTo: ''mc''."
+		(Smalltalk at: #''stx_goodies_petitparser'') monticelloExportTo: ''mc''."
 
 '
 
@@ -286,7 +289,7 @@
 
 !stx_goodies_petitparser class methodsFor:'utilities - monticello'!
 
-exportAsMczTo: directory
+monticelloExportTo: directory
     "Export .mcz packages to given directory"
 
     | packages exporter mcrepo |
@@ -301,10 +304,14 @@
         'stx:goodies/petitparser/tests'
         'stx:goodies/petitparser/analyzer'
         'stx:goodies/petitparser/analyzer/tests'
+
         'stx:goodies/petitparser/parsers/smalltalk'
         'stx:goodies/petitparser/parsers/smalltalk/tests'
+        'stx:goodies/petitparser/parsers/java'
+
         'stx:goodies/petitparser/compiler'
         'stx:goodies/petitparser/compiler/tests'
+        'stx:goodies/petitparser/compiler/tests/extras'
         'stx:goodies/petitparser/compiler/benchmarks'
     ).
 
@@ -317,7 +324,8 @@
         mcwc := mcpkg workingCopy.
         mcvi := HGMCVersionInfo forPackage: pkgnm.
         [
-           mcversion := mcwc newVersion
+           mcversion := mcwc newVersion.
+           mcversion snapshot includeExtrasForSTX: false.
         ] on: MCVersionNameAndMessageRequest do:[:ex |
             ex resume: (Array with: mcvi name with: mcvi message)
         ].
@@ -329,7 +337,7 @@
     packages do: exporter.
 
     "
-    stx_goodies_petitparser exportAsMczTo: '/tmp'
+    stx_goodies_petitparser monticelloExportTo: '/tmp'
     "
 
     "Created: / 04-10-2014 / 21:30:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
--- a/tests/PPArithmeticParserTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPArithmeticParserTest.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 PPCompositeParserTest subclass:#PPArithmeticParserTest
 	instanceVariableNames:''
 	classVariableNames:''
--- a/tests/PPCompositeParserTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPCompositeParserTest.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 PPAbstractParserTest subclass:#PPCompositeParserTest
 	instanceVariableNames:'parser result'
 	classVariableNames:''
--- a/tests/PPExpressionParserTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPExpressionParserTest.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 PPArithmeticParserTest subclass:#PPExpressionParserTest
 	instanceVariableNames:''
 	classVariableNames:''
--- a/tests/PPLambdaParserTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPLambdaParserTest.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 PPCompositeParserTest subclass:#PPLambdaParserTest
 	instanceVariableNames:''
 	classVariableNames:''
--- a/tests/PPParserResource.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPParserResource.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 TestResource subclass:#PPParserResource
 	instanceVariableNames:'parsers'
 	classVariableNames:''
--- a/tests/PPScriptingTest.st	Tue May 12 01:24:03 2015 +0100
+++ b/tests/PPScriptingTest.st	Tue May 12 01:33:33 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/tests' }"
 
+"{ NameSpace: Smalltalk }"
+
 PPAbstractParserTest subclass:#PPScriptingTest
 	instanceVariableNames:''
 	classVariableNames:''
--- a/vcmake.bat	Tue May 12 01:24:03 2015 +0100
+++ b/vcmake.bat	Tue May 12 01:33:33 2015 +0100
@@ -31,4 +31,25 @@
 @call vcmake %1 %2 || exit /b "%errorlevel%"
 @popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/smalltalk
+@echo "***********************************"
+@pushd parsers\smalltalk
+@call vcmake %1 %2 || exit /b "%errorlevel%"
+@popd
 
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/parsers/java
+@echo "***********************************"
+@pushd parsers\java
+@call vcmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+@echo "***********************************"
+@echo "Buildung stx/goodies/petitparser/compiler
+@echo "***********************************"
+@pushd compiler
+@call vcmake %1 %2 || exit /b "%errorlevel%"
+@popd
+
+