Added target `mcz` to export .mcz package out of Smalltalk/X package.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 05 Oct 2014 00:29:07 +0100
changeset 382 1825151d6455
parent 381 0bbbcf5da2d4
child 383 e9919f8e47de
Added target `mcz` to export .mcz package out of Smalltalk/X package.
Make.proto
PPLiteralSequenceParser.st
analyzer/Make.proto
analyzer/analyzer.rc
analyzer/bc.mak
analyzer/extensions.st
analyzer/stx_goodies_petitparser_analyzer.st
analyzer/tests/PPRewriterTest.st
analyzer/tests/stx_goodies_petitparser_analyzer_tests.st
analyzer/tests/tests.rc
bc.mak
petitparser.rc
stx_goodies_petitparser.st
tests/PPScriptingTest.st
tests/tests.rc
--- a/Make.proto	Sat Oct 04 21:26:15 2014 +0100
+++ b/Make.proto	Sun Oct 05 00:29:07 2014 +0100
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/monticello -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libscm/mercurial/monticello
 
 
 # if you need any additional defines for embedded C code,
@@ -66,6 +66,16 @@
 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'."
+
+
 
 
 # Update SVN revision in package definition class
--- a/PPLiteralSequenceParser.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/PPLiteralSequenceParser.st	Sun Oct 05 00:29:07 2014 +0100
@@ -53,6 +53,11 @@
     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPLiteralSequenceParser.st,v 1.3 2012-05-04 21:58:27 vrany Exp $'
 !
 
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_SVN
     ^ '§Id: PPLiteralSequenceParser.st 2 2010-12-17 18:44:23Z vranyj1 §'
 ! !
--- a/analyzer/Make.proto	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/Make.proto	Sun Oct 05 00:29:07 2014 +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/libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/tests -I$(INCLUDE_TOP)/stx/libbasic
 
 
 # if you need any additional defines for embedded C code,
@@ -135,7 +135,7 @@
 $(OUTDIR)PPSearcher.$(O) PPSearcher.$(H): PPSearcher.st $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/PPProcessor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)PPBlockReplaceRule.$(O) PPBlockReplaceRule.$(H): PPBlockReplaceRule.st $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/PPReplaceRule.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/PPRule.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)PPParserReplaceRule.$(O) PPParserReplaceRule.$(H): PPParserReplaceRule.st $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/PPReplaceRule.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/PPRule.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPActionParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPEpsilonParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPFailingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPFlattenParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPLimitedRepeatingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPListParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPLiteralParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPNotParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPOptionalParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPluggableParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPredicateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPredicateSequenceParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPRepeatingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPSequenceParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPTokenParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPActionParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPEpsilonParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPFailingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPFlattenParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPLimitedRepeatingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPListParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPLiteralParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPNotParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPOptionalParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPluggableParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPredicateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPPredicateSequenceParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPRepeatingParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPSequenceParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPTokenParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/analyzer/tests/stx_goodies_petitparser_analyzer_tests.$(H) $(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
 
--- a/analyzer/analyzer.rc	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/analyzer.rc	Sun Oct 05 00:29:07 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:20:15 GMT\0"
+      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:37 GMT\0"
     END
 
   END
--- a/analyzer/bc.mak	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/bc.mak	Sun Oct 05 00:29:07 2014 +0100
@@ -34,7 +34,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\tests -I$(INCLUDE_TOP)\stx\libbasic
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
@@ -81,7 +81,7 @@
 $(OUTDIR)PPSearcher.$(O) PPSearcher.$(H): PPSearcher.st $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\PPProcessor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)PPBlockReplaceRule.$(O) PPBlockReplaceRule.$(H): PPBlockReplaceRule.st $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\PPReplaceRule.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\PPRule.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)PPParserReplaceRule.$(O) PPParserReplaceRule.$(H): PPParserReplaceRule.st $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\PPReplaceRule.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\PPRule.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPActionParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPEpsilonParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPFailingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPFlattenParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPLimitedRepeatingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPListParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPLiteralParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPNotParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPOptionalParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPluggableParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPredicateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPredicateSequenceParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPRepeatingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPSequenceParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPTokenParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPActionParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPEpsilonParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPFailingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPFlattenParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPLimitedRepeatingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPListParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPLiteralParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPNotParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPOptionalParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPluggableParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPredicateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPPredicateSequenceParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPRepeatingParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPSequenceParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPTokenParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\analyzer\tests\stx_goodies_petitparser_analyzer_tests.$(H) $(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
 
--- a/analyzer/extensions.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/extensions.st	Sun Oct 05 00:29:07 2014 +0100
@@ -41,7 +41,7 @@
 	copies := OrderedCollection new.
 	parsers do: [ :each |
 		| result |
-		result := each 
+		result := each
 			copyInContext: aDictionary
 			seen: aSeenDictionary.
 		result isCollection
@@ -70,7 +70,7 @@
 !PPNotParser methodsFor:'*petitanalyzer-private'!
 
 firstSets: aFirstDictionary into: aSet
-	
+
 ! !
 
 !PPNotParser methodsFor:'*petitanalyzer-testing'!
@@ -101,7 +101,7 @@
 allNamedParsersDo: aBlock
 	"Iterate over all the named parse nodes of the receiver."
 
-	self allParsersDo: [ :each | 
+	self allParsersDo: [ :each |
 		each name notNil
 			ifTrue: [ aBlock value: each ] ]
 ! !
@@ -116,8 +116,8 @@
 
 copyInContext: aDictionary seen: aSeenDictionary
 	| copy |
-	aSeenDictionary 
-		at: self 
+	aSeenDictionary
+		at: self
 		ifPresent: [ :value | ^ value ].
 	copy := aSeenDictionary
 		at: self
@@ -133,7 +133,7 @@
 
 cycleSet
 	"Answer a set of all nodes that are within one or more cycles of left-recursion. This is generally not a problem if at least one of the nodes is memoized, but it might make the grammar very inefficient and should be avoided if possible."
-	
+
 	| cycles |
 	cycles := IdentitySet new.
 	self cycleSet: OrderedCollection new firstSets: self firstSets into: cycles.
@@ -155,7 +155,7 @@
 
 	| index |
 	self isTerminal
-		ifTrue: [ ^ self ].	
+		ifTrue: [ ^ self ].
 	(index := aStack indexOf: self) > 0
 		ifTrue: [ ^ aSet addAll: (aStack copyFrom: index to: aStack size) ].
 	aStack addLast: self.
@@ -168,7 +168,7 @@
 
 firstSet
 	"Answer the first-set of the receiver. Note, this implementation is inefficient when called on different receivers of the same grammar, instead use #firstSets to calculate the first-sets at once."
-	
+
 	^ self firstSets at: self
 ! !
 
@@ -176,7 +176,7 @@
 
 firstSets
 	"Answer a dictionary with all the parsers reachable from the receiver as key and their first-set as value. The first-set of a parser is the list of terminal parsers that begin the parser derivable from that parser."
-	
+
 	| firstSets |
 	firstSets := IdentityDictionary new.
 	self allParsersDo: [ :each |
@@ -215,7 +215,7 @@
 
 followSets
 	"Answer a dictionary with all the parsers reachable from the receiver as key and their follow-set as value. The follow-set of a parser is the list of terminal parsers that can appear immediately to the right of that parser."
-	
+
 	| current previous continue firstSets followSets |
 	current := previous := 0.
 	firstSets := self firstSets.
@@ -223,7 +223,7 @@
 	self allParsersDo: [ :each | followSets at: each put: IdentitySet new ].
 	(followSets at: self) add: PPSentinel instance.
 	[	followSets keysAndValuesDo: [ :parser :follow |
-			parser 
+			parser
 				followSets: followSets
 				firstSets: firstSets
 				into: follow ].
@@ -240,7 +240,7 @@
 
 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet
 	"PRIVATE: Try to add additional elements to the follow-set aSet of the receiver, use the incomplete aFollowDictionary and the complete aFirstDictionary."
-	
+
 	self children do: [ :parser | (aFollowDictionary at: parser) addAll: aSet ]
 ! !
 
@@ -267,7 +267,7 @@
 
 innerChildrenDo: aBlock seen: aSet
 	"Iterate over the inner children of the receiver."
-	
+
 	self children do: [ :each |
 		(aSet includes: each)
 			ifTrue: [ ^ self ].
@@ -289,7 +289,7 @@
 
 isNullable
 	"Answer true if the receiver is a nullable parser, e.g. it can successfully parse nothing."
-	
+
 	^ false
 ! !
 
@@ -335,9 +335,9 @@
 		currentIndex := parserIndex - 1.
 		[ currentDictionary := aDictionary copy.
 		currentSeen := aSet copy.
-		parserList size < currentIndex or: [ 
+		parserList size < currentIndex or: [
 			parsers := parserList copyFrom: parserIndex to: currentIndex.
-			(currentDictionary at: parser ifAbsentPut: [ parsers ]) = parsers and: [ 
+			(currentDictionary at: parser ifAbsentPut: [ parsers ]) = parsers and: [
 				(self
 					matchList: matchList
 					index: matchIndex + 1
@@ -345,7 +345,7 @@
 					index: currentIndex + 1
 					inContext: currentDictionary
 					seen: currentSeen)
-					ifTrue: [ 
+					ifTrue: [
 						currentDictionary keysAndValuesDo: [ :key :value | aDictionary at: key put: value ].
 						^ true ].
 				false ] ] ] whileFalse: [ currentIndex := currentIndex + 1 ].
@@ -386,7 +386,7 @@
 
 namedChildrenDo: aBlock seen: aSet
 	"Iterate over the named children of the receiver."
-	
+
 	self children do: [ :each |
 		(aSet includes: each)
 			ifTrue: [ ^ self ].
@@ -448,7 +448,7 @@
 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet
 	| firstSet |
 	super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet.
-	
+
 	firstSet := aFirstDictionary at: self.
 	self children do: [:p | (aFollowDictionary at: p) addAll: (firstSet reject: [:each | each isNullable]) ]
 ! !
@@ -500,13 +500,13 @@
 		index = parsers size
 			ifTrue: [ followSet addAll: aSet ]
 			ifFalse: [
-				(self class withAll: (parsers 
+				(self class withAll: (parsers
 					copyFrom: index + 1 to: parsers size))
 						firstSets: aFirstDictionary
 						into: (firstSet := IdentitySet new).
 				(firstSet anySatisfy: [ :each | each isNullable ])
 					ifTrue: [ followSet addAll: aSet ].
-				followSet addAll: (firstSet 
+				followSet addAll: (firstSet
 					reject: [ :each | each isNullable ]) ] ]
 ! !
 
--- a/analyzer/stx_goodies_petitparser_analyzer.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/stx_goodies_petitparser_analyzer.st	Sun Oct 05 00:29:07 2014 +0100
@@ -23,7 +23,7 @@
     Name: PetitAnalyzer-DiegoLont.46
     Author: DiegoLont
     Time: 02-09-2013, 12:37:58 PM
-    UUID: 89f155fa-89b4-4bb7-b76e-0f8485be4a56        
+    UUID: 89f155fa-89b4-4bb7-b76e-0f8485be4a56
     Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main
     '
 
@@ -58,7 +58,7 @@
 
     ^ #(
         #'stx:goodies/petitparser'    "PPActionParser - extended"
-        #'stx:libbasic'    "LibraryDefinition - superclass of stx_goodies_petitparser_analyzer"
+        #'stx:libbasic'    "LibraryDefinition - extended"
     )
 !
 
@@ -163,8 +163,6 @@
         PPParser isFirstSetTerminal
         PPRepeatingParser followSets:firstSets:into:
     )
-
-    "Modified: / 04-10-2014 / 21:20:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !stx_goodies_petitparser_analyzer class methodsFor:'description - project information'!
--- a/analyzer/tests/PPRewriterTest.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/tests/PPRewriterTest.st	Sun Oct 05 00:29:07 2014 +0100
@@ -157,5 +157,10 @@
 
 version_CVS
     ^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/tests/PPRewriterTest.st,v 1.1 2014-03-04 15:43:01 cg Exp $'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !
 
--- a/analyzer/tests/stx_goodies_petitparser_analyzer_tests.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/tests/stx_goodies_petitparser_analyzer_tests.st	Sun Oct 05 00:29:07 2014 +0100
@@ -7,6 +7,31 @@
 	category:'* Projects & Packages *'
 !
 
+!stx_goodies_petitparser_analyzer_tests class methodsFor:'accessing - monticello'!
+
+monticelloLastMergedVersionInfo
+    "The last merged version is: "
+
+    ^ '
+    Name: PetitAnalyzer-DiegoLont.46
+    Author: DiegoLont
+    Time: 02-09-2013, 12:37:58 PM
+    UUID: 89f155fa-89b4-4bb7-b76e-0f8485be4a56
+    Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main
+    '
+
+    "Created: / 03-10-2014 / 02:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+monticelloName
+    "Return name of the package for Monticello. This is used when package is exported"
+
+    ^ 'PetitAnalyzerTests'
+
+    "Created: / 03-10-2014 / 01:48:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2014 / 21:37:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 
 !stx_goodies_petitparser_analyzer_tests class methodsFor:'description'!
 
@@ -19,31 +44,30 @@
 !
 
 mandatoryPreRequisites
-    "list all required mandatory packages.
-     Packages are mandatory, if they contain superclasses of the package's classes
-     or classes which are extended by this package.
-     This list can be maintained manually or (better) generated and
-     updated by scanning the superclass hierarchies
-     (the browser has a menu function for that)"
+    "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 PPAnalyzerTest "
-        #'stx:goodies/sunit'    "TestAsserter - superclass of PPAnalyzerTest "
-        #'stx:libbasic'    "LibraryDefinition - superclass of stx_goodies_petitparser_analyzer_tests "
+        #'stx:goodies/petitparser/tests'    "PPAbstractParserTest - superclass of PPAnalyzerTest"
+        #'stx:goodies/sunit'    "TestAsserter - superclass of PPAnalyzerTest"
+        #'stx:libbasic'    "LibraryDefinition - superclass of stx_goodies_petitparser_analyzer_tests"
     )
 !
 
 referencedPreRequisites
-    "list all packages containing classes referenced by the packages's members.
-     This list can be maintained manually or (better) generated and
-     updated by looking for global variable accesses
-     (the browser has a menu function for that)
-     However, often too much is found, and you may want to explicitely
-     exclude individual packages in the #excludedFromPreRequisites method."
+    "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'    "PPAndParser - referenced by PPAnalyzerTest>>testIsNullable "
-        #'stx:goodies/petitparser/analyzer'    "PPListPattern - referenced by PPRewriterTest>>testDuplicationRemoval "
+        #'stx:goodies/petitparser'    "PPAndParser - referenced by PPAnalyzerTest>>testIsNullable"
+        #'stx:goodies/petitparser/analyzer'    "PPListPattern - referenced by PPRewriterTest>>testDuplicationRemoval"
     )
 !
 
@@ -75,8 +99,8 @@
 !
 
 extensionMethodNames
-    "lists the extension methods which are to be included in the project.
-     Entries are 2-element array literals, consisting of class-name and selector."
+    "list class/selector pairs of extensions.
+     A correponding method with real names must be present in my concrete subclasses"
 
     ^ #(
     )
--- a/analyzer/tests/tests.rc	Sat Oct 04 21:26:15 2014 +0100
+++ b/analyzer/tests/tests.rc	Sun Oct 05 00:29:07 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 23:04:00 GMT\0"
+      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:39 GMT\0"
     END
 
   END
--- a/bc.mak	Sat Oct 04 21:26:15 2014 +0100
+++ b/bc.mak	Sun Oct 05 00:29:07 2014 +0100
@@ -34,7 +34,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\monticello -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libscm\mercurial\monticello
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
--- a/petitparser.rc	Sat Oct 04 21:26:15 2014 +0100
+++ b/petitparser.rc	Sun Oct 05 00:29:07 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 23:03:54 GMT\0"
+      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:33 GMT\0"
     END
 
   END
--- a/stx_goodies_petitparser.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/stx_goodies_petitparser.st	Sun Oct 05 00:29:07 2014 +0100
@@ -7,6 +7,12 @@
 	category:'* Projects & Packages *'
 !
 
+!stx_goodies_petitparser class methodsFor:'documentation'!
+
+extensionsVersion_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
 
 !stx_goodies_petitparser class methodsFor:'accessing'!
 
@@ -84,6 +90,8 @@
      by searching all classes (and their packages) which are referenced by my classes."
 
     ^ #(
+        #'stx:goodies/monticello'    "MCDirectoryRepository - referenced by stx_goodies_petitparser class>>exportAsMczTo:"
+        #'stx:libscm/mercurial/monticello'    "HGMCVersionInfo - referenced by stx_goodies_petitparser class>>exportAsMczTo:"
     )
 !
 
@@ -116,6 +124,26 @@
     "Created: / 17-12-2010 / 19:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!stx_goodies_petitparser class methodsFor:'description - compilation'!
+
+additionalRules_make_dot_proto
+    "allows for additional rules to be added to the make.proto file."
+
+    ^ '
+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''."
+
+'
+
+    "Created: / 04-10-2014 / 21:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !stx_goodies_petitparser class methodsFor:'description - contents'!
 
 classNamesAndAttributes
@@ -272,6 +300,51 @@
     ^ "$SVN-Revision:"'11              '"$"
 ! !
 
+!stx_goodies_petitparser class methodsFor:'utilities - monticello'!
+
+exportAsMczTo: directory
+    "Export .mcz packages to given directory"
+
+    | packages exporter mcrepo |
+
+    Smalltalk loadPackage: 'stx:goodies/monticello'.
+    Smalltalk loadPackage: 'stx:libscm/mercurial/monticello'.
+    Class tryLocalSourceFirst: true.
+
+
+   packages := #(
+        'stx:goodies/petitparser'
+        'stx:goodies/petitparser/tests'
+        'stx:goodies/petitparser/analyzer'
+        'stx:goodies/petitparser/analyzer/tests'
+    ).
+
+    exporter := [:pkgnm|
+        | mcpkg mcwc mcvi mcversion |
+
+        Smalltalk loadPackage: pkgnm.
+        mcpkg := MCPackage named: pkgnm.
+        mcwc := mcpkg workingCopy.
+        mcvi := HGMCVersionInfo forPackage: pkgnm.
+        [
+           mcversion := mcwc newVersion
+        ] on: MCVersionNameAndMessageRequest do:[:ex |
+            ex resume: (Array with: mcvi name with: mcvi message)
+        ].
+        mcversion info: mcvi.
+        mcrepo storeVersion: mcversion.
+    ].
+
+    mcrepo := MCDirectoryRepository new directory: directory.
+    packages do: exporter.
+
+    "
+    stx_goodies_petitparser exportAsMczTo: '/tmp'
+    "
+
+    "Created: / 04-10-2014 / 21:30:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !stx_goodies_petitparser class methodsFor:'documentation'!
 
 version
--- a/tests/PPScriptingTest.st	Sat Oct 04 21:26:15 2014 +0100
+++ b/tests/PPScriptingTest.st	Sun Oct 05 00:29:07 2014 +0100
@@ -1,130 +1,1 @@
-"{ 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_SVN
-    ^ '$Id: PPScriptingTest.st,v 1.4 2014-03-04 14:34:23 cg Exp $'
-! !
-
+"{ 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
--- a/tests/tests.rc	Sat Oct 04 21:26:15 2014 +0100
+++ b/tests/tests.rc	Sun Oct 05 00:29:07 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 23:03:56 GMT\0"
+      VALUE "ProductDate", "Sat, 04 Oct 2014 20:46:35 GMT\0"
     END
 
   END