PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
--- a/compiler/Make.proto Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/Make.proto Mon Sep 07 08:20:46 2015 +0100
@@ -145,7 +145,7 @@
$(OUTDIR)PPCCompilationError.$(O) PPCCompilationError.$(H): PPCCompilationError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCCompilationOptions.$(O) PPCCompilationOptions.$(H): PPCCompilationOptions.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCCompilationWarning.$(O) PPCCompilationWarning.$(H): PPCCompilationWarning.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/UserNotification.$(H) $(INCLUDE_TOP)/stx/libbasic/Warning.$(H) $(STCHDR)
-$(OUTDIR)PPCConfiguration.$(O) PPCConfiguration.$(H): PPCConfiguration.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)PPCCompiler.$(O) PPCCompiler.$(H): PPCCompiler.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCContext.$(O) PPCContext.$(H): PPCContext.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/PeekableStream.$(H) $(INCLUDE_TOP)/stx/libbasic/PositionableStream.$(H) $(INCLUDE_TOP)/stx/libbasic/ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(STCHDR)
$(OUTDIR)PPCContextMemento.$(O) PPCContextMemento.$(H): PPCContextMemento.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCDistinctScanner.$(O) PPCDistinctScanner.$(H): PPCDistinctScanner.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/compiler/Make.spec Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/Make.spec Mon Sep 07 08:20:46 2015 +0100
@@ -71,7 +71,7 @@
PPCCompilationError \
PPCCompilationOptions \
PPCCompilationWarning \
- PPCConfiguration \
+ PPCCompiler \
PPCContext \
PPCContextMemento \
PPCDistinctScanner \
@@ -203,7 +203,7 @@
$(OUTDIR_SLASH)PPCCompilationError.$(O) \
$(OUTDIR_SLASH)PPCCompilationOptions.$(O) \
$(OUTDIR_SLASH)PPCCompilationWarning.$(O) \
- $(OUTDIR_SLASH)PPCConfiguration.$(O) \
+ $(OUTDIR_SLASH)PPCCompiler.$(O) \
$(OUTDIR_SLASH)PPCContext.$(O) \
$(OUTDIR_SLASH)PPCContextMemento.$(O) \
$(OUTDIR_SLASH)PPCDistinctScanner.$(O) \
--- a/compiler/PPCCompilationContext.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/PPCCompilationContext.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCCompilationContext
- instanceVariableNames:'options configuration parserClass scannerClass'
+ instanceVariableNames:'options compiler parserClass scannerClass'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Core'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/PPCCompiler.st Mon Sep 07 08:20:46 2015 +0100
@@ -0,0 +1,304 @@
+"{ Package: 'stx:goodies/petitparser/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+Object subclass:#PPCCompiler
+ instanceVariableNames:'context ir history passes'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'PetitCompiler-Core'
+!
+
+
+!PPCCompiler class methodsFor:'as yet unclassified'!
+
+default
+ ^ self universal
+!
+
+new
+ ^ self basicNew
+ initialize;
+ yourself
+!
+
+tokenizing
+ | options |
+
+ options := PPCCompilationOptions default.
+ options tokenize:true.
+ ^ (PPCCompiler new)
+ options:options;
+ yourself
+
+ "Modified: / 04-09-2015 / 16:21:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+universal
+ | options |
+
+ options := PPCCompilationOptions default.
+ options tokenize:false.
+ ^ (PPCCompiler new)
+ options:options;
+ yourself
+
+ "Modified: / 04-09-2015 / 16:21:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'accessing'!
+
+context
+ ^ context
+!
+
+options
+ ^ context options
+
+ "Modified: / 26-08-2015 / 19:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+options: aPPCCompilationOptions
+ context options: aPPCCompilationOptions
+
+ "Created: / 26-08-2015 / 19:56:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+passes
+ ^ passes
+!
+
+passes:aCollection
+ passes := aCollection asOrderedCollection
+
+ "Modified: / 04-09-2015 / 14:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'accessing - defaults'!
+
+defaultPassesForTokenizingParser
+ ^ {
+ PPCTokenDetector .
+ PPCCacheFirstFollowPass .
+ PPCLL1Visitor .
+ PPCTokenizingVisitor .
+ PPCMergingVisitor .
+ PPCSpecializingVisitor .
+ PPCInliningVisitor .
+ PPCMergingVisitor .
+ PPCCheckingVisitor .
+ PPCCacheFirstFollowPass .
+ PPCTokenizingCodeGenerator .
+ PPCFSAVisitor .
+ PPCTokenCodeGenerator .
+ PPCScannerCodeGenerator .
+ } asOrderedCollection.
+
+ "Created: / 04-09-2015 / 15:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+defaultPassesForUniversalParser
+ ^ {
+ PPCTokenDetector.
+ PPCCacheFirstFollowPass.
+ PPCSpecializingVisitor .
+ PPCRecognizerComponentDetector .
+ PPCSpecializingVisitor .
+ PPCInliningVisitor .
+ PPCMergingVisitor .
+ PPCCheckingVisitor .
+ PPCUniversalCodeGenerator
+ } asOrderedCollection.
+
+ "Created: / 04-09-2015 / 15:56:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'adding / removing passes'!
+
+removePass: pass
+ | index |
+
+ self initializePassesIfNotAlready.
+ [
+ index := passes indexOf: pass.
+ index ~~ 0
+ ] whileTrue:[
+ passes removeAtIndex: index
+ ].
+
+ "Created: / 04-09-2015 / 11:24:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 04-09-2015 / 16:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'compiling'!
+
+compile: aPPParser
+ | time |
+ self input: aPPParser.
+
+ time := [ self compile ] timeToRun.
+ ((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifFalse:[
+ "Assume Pharo"
+ time := time asMilliSeconds.
+ ].
+ self reportTime: time.
+
+ ^ ir
+
+ "Modified: / 17-08-2015 / 13:06:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'initialization'!
+
+initialize
+ history := OrderedCollection new.
+ context := PPCCompilationContext new.
+
+ "Modified: / 04-09-2015 / 15:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+initializePassesIfNotAlready
+ passes isNil ifTrue:[
+ context options tokenize ifTrue:[
+ passes := self defaultPassesForTokenizingParser
+ ] ifFalse:[
+ passes := self defaultPassesForUniversalParser
+ ].
+ ].
+
+ "Created: / 04-09-2015 / 16:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'private'!
+
+buildClass: clazz
+ | builder |
+ builder := PPCClassBuilder new.
+
+ builder compiledClassName: clazz name.
+ builder compiledSuperclass: clazz superclass.
+ builder methodDictionary: clazz methodDictionary.
+ builder constants: clazz constants.
+
+ ^ builder compileClass.
+!
+
+compile
+ self runPasses.
+ self generateScanner.
+ self generateParser.
+
+ "Modified: / 07-09-2015 / 07:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+copyTree: somethingTransformable
+ ^ somethingTransformable transform: [ :e | e copy ]
+!
+
+generateParser
+ | parserClass parserSuper rootMethod |
+
+ context options generate ifFalse:[
+ ^ self
+ ].
+ context parserClass methodDictionary isEmpty ifTrue:[
+ ^ self
+ ].
+
+ parserSuper := context options parserSuperclass.
+ parserSuper isNil ifTrue:[
+ parserSuper := context options tokenize
+ ifTrue:[ PPTokenizingCompiledParser ]
+ ifFalse:[ PPCompiledParser ]
+ ].
+ rootMethod := context parserClass propertyAt:#rootMethod.
+ context parserClass name:context options parserName.
+ context parserClass superclass: parserSuper.
+ parserClass := self buildClass:context parserClass.
+ parserClass startSymbol:rootMethod methodName.
+ self remember:parserClass as:#parser.
+ ir := parserClass new
+
+ "Modified: / 25-08-2015 / 00:05:49 / Jan Vrany"
+ "Modified: / 04-09-2015 / 16:07:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+generateScanner
+ | scanner |
+
+ context options generate ifFalse:[
+ ^ self
+ ].
+ context scannerClass methodDictionary isEmpty ifTrue:[
+ ^ self
+ ].
+
+ context scannerClass name:context options scannerName.
+ context scannerClass superclass:context options scannerSuperclass.
+ scanner := (self buildClass:context scannerClass).
+ context parserClass addConstant:scanner as:#scannerClass.
+ ir := scanner.
+ self remember:scanner as:#scanner
+
+ "Modified: / 25-08-2015 / 00:06:49 / Jan Vrany"
+ "Modified: / 04-09-2015 / 15:33:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+input: aPPParser
+ ir := aPPParser asCompilerTree.
+ self remember: (self copyTree: ir) as: #input
+
+ "Modified (format): / 29-08-2015 / 07:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+ir
+ ^ ir
+!
+
+ir: whatever
+ ir := whatever
+!
+
+remember: value as: key
+ context options debug ifTrue: [
+ history add: key -> value.
+ ]
+
+ "Modified: / 28-08-2015 / 14:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+reportTime: timeInMs
+ context options profile ifTrue: [
+ Transcript show: 'Time to compile: '; show: timeInMs asString; show: ' ms'; cr.
+ ]
+
+ "Modified: / 07-09-2015 / 07:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+runPasses
+ self initializePassesIfNotAlready.
+ passes do:[:each | self runPass: each ]
+
+ "Created: / 07-09-2015 / 07:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler methodsFor:'running'!
+
+runPass: pass
+ | p |
+
+ p := pass asPPCPass.
+ ir := p run: ir in: context.
+ self remember:(self copyTree:ir) as:p class name
+
+ "Created: / 26-08-2015 / 22:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 29-08-2015 / 07:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!PPCCompiler class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/PPCConfiguration.st Mon Sep 07 08:03:02 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-"{ Package: 'stx:goodies/petitparser/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-Object subclass:#PPCConfiguration
- instanceVariableNames:'context ir history passes'
- classVariableNames:''
- poolDictionaries:''
- category:'PetitCompiler-Core'
-!
-
-
-!PPCConfiguration class methodsFor:'as yet unclassified'!
-
-default
- ^ self universal
-!
-
-new
- ^ self basicNew
- initialize;
- yourself
-!
-
-tokenizing
- | options |
-
- options := PPCCompilationOptions default.
- options tokenize: true.
- ^ PPCConfiguration new
- options: options;
- yourself
-
- "Modified: / 04-09-2015 / 16:21:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-universal
- | options |
-
- options := PPCCompilationOptions default.
- options tokenize: false.
- ^ PPCConfiguration new
- options: options;
- yourself
-
- "Modified: / 04-09-2015 / 16:21:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'accessing'!
-
-context
- ^ context
-!
-
-options
- ^ context options
-
- "Modified: / 26-08-2015 / 19:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-options: aPPCCompilationOptions
- context options: aPPCCompilationOptions
-
- "Created: / 26-08-2015 / 19:56:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-passes
- ^ passes
-!
-
-passes:aCollection
- passes := aCollection asOrderedCollection
-
- "Modified: / 04-09-2015 / 14:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'accessing - defaults'!
-
-defaultPassesForTokenizingParser
- ^ {
- PPCTokenDetector .
- PPCCacheFirstFollowPass .
- PPCLL1Visitor .
- PPCTokenizingVisitor .
- PPCMergingVisitor .
- PPCSpecializingVisitor .
- PPCInliningVisitor .
- PPCMergingVisitor .
- PPCCheckingVisitor .
- PPCCacheFirstFollowPass .
- PPCTokenizingCodeGenerator .
- PPCFSAVisitor .
- PPCTokenCodeGenerator .
- PPCScannerCodeGenerator .
- } asOrderedCollection.
-
- "Created: / 04-09-2015 / 15:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-defaultPassesForUniversalParser
- ^ {
- PPCTokenDetector.
- PPCCacheFirstFollowPass.
- PPCSpecializingVisitor .
- PPCRecognizerComponentDetector .
- PPCSpecializingVisitor .
- PPCInliningVisitor .
- PPCMergingVisitor .
- PPCCheckingVisitor .
- PPCUniversalCodeGenerator
- } asOrderedCollection.
-
- "Created: / 04-09-2015 / 15:56:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'adding / removing passes'!
-
-removePass: pass
- | index |
-
- self initializePassesIfNotAlready.
- [
- index := passes indexOf: pass.
- index ~~ 0
- ] whileTrue:[
- passes removeAtIndex: index
- ].
-
- "Created: / 04-09-2015 / 11:24:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 04-09-2015 / 16:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'compiling'!
-
-compile: aPPParser
- | time |
- self input: aPPParser.
-
- time := [ self compile ] timeToRun.
- ((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifFalse:[
- "Assume Pharo"
- time := time asMilliSeconds.
- ].
- self reportTime: time.
-
- ^ ir
-
- "Modified: / 17-08-2015 / 13:06:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'initialization'!
-
-initialize
- history := OrderedCollection new.
- context := PPCCompilationContext new.
-
- "Modified: / 04-09-2015 / 15:56:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-initializePassesIfNotAlready
- passes isNil ifTrue:[
- context options tokenize ifTrue:[
- passes := self defaultPassesForTokenizingParser
- ] ifFalse:[
- passes := self defaultPassesForUniversalParser
- ].
- ].
-
- "Created: / 04-09-2015 / 16:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'private'!
-
-buildClass: clazz
- | builder |
- builder := PPCClassBuilder new.
-
- builder compiledClassName: clazz name.
- builder compiledSuperclass: clazz superclass.
- builder methodDictionary: clazz methodDictionary.
- builder constants: clazz constants.
-
- ^ builder compileClass.
-!
-
-compile
- self runPasses.
- self generateScanner.
- self generateParser.
-
- "Modified: / 07-09-2015 / 07:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-copyTree: somethingTransformable
- ^ somethingTransformable transform: [ :e | e copy ]
-!
-
-generateParser
- | parserClass parserSuper rootMethod |
-
- context options generate ifFalse:[
- ^ self
- ].
- context parserClass methodDictionary isEmpty ifTrue:[
- ^ self
- ].
-
- parserSuper := context options parserSuperclass.
- parserSuper isNil ifTrue:[
- parserSuper := context options tokenize
- ifTrue:[ PPTokenizingCompiledParser ]
- ifFalse:[ PPCompiledParser ]
- ].
- rootMethod := context parserClass propertyAt:#rootMethod.
- context parserClass name:context options parserName.
- context parserClass superclass: parserSuper.
- parserClass := self buildClass:context parserClass.
- parserClass startSymbol:rootMethod methodName.
- self remember:parserClass as:#parser.
- ir := parserClass new
-
- "Modified: / 25-08-2015 / 00:05:49 / Jan Vrany"
- "Modified: / 04-09-2015 / 16:07:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-generateScanner
- | scanner |
-
- context options generate ifFalse:[
- ^ self
- ].
- context scannerClass methodDictionary isEmpty ifTrue:[
- ^ self
- ].
-
- context scannerClass name:context options scannerName.
- context scannerClass superclass:context options scannerSuperclass.
- scanner := (self buildClass:context scannerClass).
- context parserClass addConstant:scanner as:#scannerClass.
- ir := scanner.
- self remember:scanner as:#scanner
-
- "Modified: / 25-08-2015 / 00:06:49 / Jan Vrany"
- "Modified: / 04-09-2015 / 15:33:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-input: aPPParser
- ir := aPPParser asCompilerTree.
- self remember: (self copyTree: ir) as: #input
-
- "Modified (format): / 29-08-2015 / 07:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-ir
- ^ ir
-!
-
-ir: whatever
- ir := whatever
-!
-
-remember: value as: key
- context options debug ifTrue: [
- history add: key -> value.
- ]
-
- "Modified: / 28-08-2015 / 14:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-reportTime: timeInMs
- context options profile ifTrue: [
- Transcript show: 'Time to compile: '; show: timeInMs asString; show: ' ms'; cr.
- ]
-
- "Modified: / 07-09-2015 / 07:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-runPasses
- self initializePassesIfNotAlready.
- passes do:[:each | self runPass: each ]
-
- "Created: / 07-09-2015 / 07:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration methodsFor:'running'!
-
-runPass: pass
- | p |
-
- p := pass asPPCPass.
- ir := p run: ir in: context.
- self remember:(self copyTree:ir) as:p class name
-
- "Created: / 26-08-2015 / 22:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 29-08-2015 / 07:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!PPCConfiguration class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-! !
-
--- a/compiler/PPCRecognizerComponentDetector.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/PPCRecognizerComponentDetector.st Mon Sep 07 08:20:46 2015 +0100
@@ -9,6 +9,7 @@
category:'PetitCompiler-Visitors'
!
+
!PPCRecognizerComponentDetector methodsFor:'visiting'!
visitNotNode: node
@@ -94,3 +95,10 @@
^ retval
! !
+!PPCRecognizerComponentDetector class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/abbrev.stc Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/abbrev.stc Mon Sep 07 08:20:46 2015 +0100
@@ -21,7 +21,7 @@
PPCCompilationError PPCCompilationError stx:goodies/petitparser/compiler 'PetitCompiler-Exceptions' 1
PPCCompilationOptions PPCCompilationOptions stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
PPCCompilationWarning PPCCompilationWarning stx:goodies/petitparser/compiler 'PetitCompiler-Exceptions' 1
-PPCConfiguration PPCConfiguration stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
+PPCCompiler PPCCompiler stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
PPCContext PPCContext stx:goodies/petitparser/compiler 'PetitCompiler-Context' 0
PPCContextMemento PPCContextMemento stx:goodies/petitparser/compiler 'PetitCompiler-Context' 0
PPCDistinctScanner PPCDistinctScanner stx:goodies/petitparser/compiler 'PetitCompiler-Scanner' 0
--- a/compiler/bc.mak Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/bc.mak Mon Sep 07 08:20:46 2015 +0100
@@ -92,7 +92,7 @@
$(OUTDIR)PPCCompilationError.$(O) PPCCompilationError.$(H): PPCCompilationError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCCompilationOptions.$(O) PPCCompilationOptions.$(H): PPCCompilationOptions.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCCompilationWarning.$(O) PPCCompilationWarning.$(H): PPCCompilationWarning.st $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\UserNotification.$(H) $(INCLUDE_TOP)\stx\libbasic\Warning.$(H) $(STCHDR)
-$(OUTDIR)PPCConfiguration.$(O) PPCConfiguration.$(H): PPCConfiguration.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)PPCCompiler.$(O) PPCCompiler.$(H): PPCCompiler.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCContext.$(O) PPCContext.$(H): PPCContext.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PositionableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(STCHDR)
$(OUTDIR)PPCContextMemento.$(O) PPCContextMemento.$(H): PPCContextMemento.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCDistinctScanner.$(O) PPCDistinctScanner.$(H): PPCDistinctScanner.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/compiler/benchmarks/Make.proto Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/Make.proto Mon Sep 07 08:20:46 2015 +0100
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/jv/calipel/s -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)/jv/calipel/s -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk/tests -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic
# if you need any additional defines for embedded C code,
@@ -104,8 +104,13 @@
cd ../../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../parsers/smalltalk && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../parsers/smalltalk/tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/compiler/benchmarks/PPCBenchmark.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/PPCBenchmark.st Mon Sep 07 08:20:46 2015 +0100
@@ -4,7 +4,7 @@
Object subclass:#PPCBenchmark
instanceVariableNames:'sources report contextClass compile parser context input
- configuration profile repetitions'
+ compiler profile repetitions'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Benchmarks-Core'
@@ -322,16 +322,22 @@
benchmarkSmalltalkParserCompiled
| time |
-
- configuration := PPCConfiguration default.
- parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+
+ compiler := PPCCompiler default.
+ parser := PPSmalltalkParser new compileUsingCompiler:compiler.
context := PPCContext new.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources smalltalkSourcesBig.
-
- time := [ input do: [ :source | parser parse: source withContext: context ]] timeToRun asMilliSeconds.
-
- self reportInput: input time: time name: 'Smalltalk Parser Compiled'.
+ time := [
+ input do:[:source |
+ parser parse:source withContext:context
+ ]
+ ] timeToRun
+ asMilliSeconds.
+ self
+ reportInput:input
+ time:time
+ name:'Smalltalk Parser Compiled'.
! !
!PPCBenchmark methodsFor:'benchmarks-CalipeL'!
@@ -547,24 +553,22 @@
!
setupExpressionGrammarCompiled
-
- configuration := PPCConfiguration universal.
- configuration options parserName: #PPCompiledExpressionGrammar.
- configuration options scannerName: #PPCompiledExpressionScanner.
- parser := PPExpressionGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ compiler options parserName:#PPCompiledExpressionGrammar.
+ compiler options scannerName:#PPCompiledExpressionScanner.
+ parser := PPExpressionGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources expressionSourcesMedium.
!
setupExpressionGrammarTokenized
-
- configuration := PPCConfiguration tokenizing.
- configuration options parserName: #PPTokenizedExpressionGrammar.
- configuration options scannerName: #PPTokenizedExpressionScanner.
- parser := PPExpressionGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler tokenizing.
+ compiler options parserName:#PPTokenizedExpressionGrammar.
+ compiler options scannerName:#PPTokenizedExpressionScanner.
+ parser := PPExpressionGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources expressionSourcesMedium.
!
@@ -598,24 +602,22 @@
!
setupLL1ExpressionGrammarCompiled
-
- configuration := PPCConfiguration universal.
- configuration options parserName: #PPCompiledLL1ExpressionGrammar.
- configuration options scannerName: #PPCompiledLL1ExpressionScanner.
- parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ compiler options parserName:#PPCompiledLL1ExpressionGrammar.
+ compiler options scannerName:#PPCompiledLL1ExpressionScanner.
+ parser := PPLL1ExpressionGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources expressionSourcesBig.
!
setupLL1ExpressionGrammarTokenized
-
- configuration := PPCConfiguration tokenizing.
- configuration options parserName: #PPTokenizedLL1ExpressionGrammar.
- configuration options scannerName: #PPTokenizedLL1ExpressionScanner.
- parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler tokenizing.
+ compiler options parserName:#PPTokenizedLL1ExpressionGrammar.
+ compiler options scannerName:#PPTokenizedLL1ExpressionScanner.
+ parser := PPLL1ExpressionGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources expressionSourcesBig.
!
@@ -630,11 +632,10 @@
!
setupLRPParserCompiled
-
- configuration := PPCConfiguration universal.
- parser := PPCLRPParser new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ parser := PPCLRPParser new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := PPCLRPSourcesResource current sources
"Created: / 18-08-2015 / 16:35:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -664,56 +665,49 @@
!
setupSmalltalkGrammarCompiled
-
- configuration := PPCConfiguration universal.
- configuration options parserName: #PPSmalltalkGrammarC_Unviersal.
- configuration options profile: profile.
-
- parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ compiler options parserName:#'PPSmalltalkGrammarC_Unviersal'.
+ compiler options profile:profile.
+ parser := PPSmalltalkGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
-
- profile ifTrue: [
- input := sources smalltalkSourcesSmall.
- ] ifFalse: [
- input := sources smalltalkSourcesBig.
+ context initializeFor:parser.
+ profile ifTrue:[
+ input := sources smalltalkSourcesSmall.
+ ] ifFalse:[
+ input := sources smalltalkSourcesBig.
]
!
setupSmalltalkGrammarTokenized
-
- configuration := PPCConfiguration tokenizing.
- configuration options parserName: #PPSmalltalkGrammarC_Tokenizing.
- configuration options scannerName: #PPSmalltalkGrammarC_Scanner.
- configuration options profile: profile.
-
- parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
+ compiler := PPCCompiler tokenizing.
+ compiler options parserName:#'PPSmalltalkGrammarC_Tokenizing'.
+ compiler options scannerName:#'PPSmalltalkGrammarC_Scanner'.
+ compiler options profile:profile.
+ parser := PPSmalltalkGrammar new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
- profile ifTrue: [
- input := sources smalltalkSourcesSmall.
- ] ifFalse: [
- input := sources smalltalkSourcesBig.
+ context initializeFor:parser.
+ profile ifTrue:[
+ input := sources smalltalkSourcesSmall.
+ ] ifFalse:[
+ input := sources smalltalkSourcesBig.
]
!
setupSmalltalkNoopParserCompiled
-
- configuration := PPCConfiguration universal.
- parser := PPCSmalltalkNoopParser new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ parser := PPCSmalltalkNoopParser new compileUsingCompiler:compiler.
context := PPCContext new.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources smalltalkSourcesBig.
"Created: / 16-05-2015 / 09:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
setupSmalltalkNoopParserTokenized
-
- configuration := PPCConfiguration tokenizing.
- parser := PPCSmalltalkNoopParser new compileWithConfiguration: configuration.
+ compiler := PPCCompiler tokenizing.
+ parser := PPCSmalltalkNoopParser new compileUsingCompiler:compiler.
context := PPCContext new.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources smalltalkSourcesBig.
"Created: / 16-05-2015 / 09:44:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -728,20 +722,18 @@
!
setupSmalltalkParserCompiled
-
- configuration := PPCConfiguration universal.
- parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+ compiler := PPCCompiler universal.
+ parser := PPSmalltalkParser new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources smalltalkSourcesBig.
!
setupSmalltalkParserTokenized
-
- configuration := PPCConfiguration tokenizing.
- parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+ compiler := PPCCompiler tokenizing.
+ parser := PPSmalltalkParser new compileUsingCompiler:compiler.
context := self context.
- context initializeFor: parser.
+ context initializeFor:parser.
input := sources smalltalkSourcesBig.
!
--- a/compiler/benchmarks/PPCLRPParser_johanfabry_39.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/PPCLRPParser_johanfabry_39.st Mon Sep 07 08:20:46 2015 +0100
@@ -13,6 +13,7 @@
category:'PetitCompiler-Benchmarks-Core'
!
+
!PPCLRPParser_johanfabry_39 class methodsFor:'accessing'!
ignoredNames
@@ -396,3 +397,10 @@
]
! !
+!PPCLRPParser_johanfabry_39 class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/benchmarks/abbrev.stc Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/abbrev.stc Mon Sep 07 08:20:46 2015 +0100
@@ -4,5 +4,5 @@
PPCBenchmark PPCBenchmark stx:goodies/petitparser/compiler/benchmarks 'PetitCompiler-Benchmarks-Core' 0
PPCLRPParser_johanfabry_39 PPCLRPParser_johanfabry_39 stx:goodies/petitparser/compiler/benchmarks 'PetitCompiler-Benchmarks-Core' 0
PPCSmalltalkNoopParser PPCSmalltalkNoopParser stx:goodies/petitparser/compiler/benchmarks 'PetitCompiler-Benchmarks-Parsers' 0
+PPCSmalltalkNoopParserTests PPCSmalltalkNoopParserTests stx:goodies/petitparser/compiler/benchmarks 'PetitCompiler-Benchmarks-Parsers-Tests' 1
stx_goodies_petitparser_compiler_benchmarks stx_goodies_petitparser_compiler_benchmarks stx:goodies/petitparser/compiler/benchmarks '* Projects & Packages *' 3
-PPCSmalltalkNoopParserTests PPCSmalltalkNoopParserTests stx:goodies/petitparser/compiler/benchmarks 'PetitCompiler-Benchmarks-Parsers-Tests' 1
--- a/compiler/benchmarks/bc.mak Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/bc.mak Mon Sep 07 08:20:46 2015 +0100
@@ -35,7 +35,7 @@
-LOCALINCLUDES= -I$(INCLUDE_TOP)\jv\calipel\s -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)\jv\calipel\s -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk\tests -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -54,8 +54,13 @@
pushd ..\..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\.. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\parsers\smalltalk & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\parsers\smalltalk\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
--- a/compiler/benchmarks/stx_goodies_petitparser_compiler_benchmarks.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/stx_goodies_petitparser_compiler_benchmarks.st Mon Sep 07 08:20:46 2015 +0100
@@ -61,7 +61,10 @@
^ #(
#'stx:goodies/petitparser' "PPCompositeParser - superclass of PPCLRPParser_johanfabry_39"
#'stx:goodies/petitparser/parsers/smalltalk' "PPSmalltalkGrammar - superclass of PPCSmalltalkNoopParser"
- #'stx:libbasic' "Autoload - superclass of PPCSmalltalkNoopParserTests"
+ #'stx:goodies/petitparser/parsers/smalltalk/tests' "PPSmalltalkGrammarTests - superclass of PPCSmalltalkNoopParserTests"
+ #'stx:goodies/petitparser/tests' "PPAbstractParserTest - superclass of PPCSmalltalkNoopParserTests"
+ #'stx:goodies/sunit' "TestAsserter - superclass of PPCSmalltalkNoopParserTests"
+ #'stx:libbasic' "LibraryDefinition - superclass of stx_goodies_petitparser_compiler_benchmarks"
)
!
@@ -77,7 +80,7 @@
^ #(
#'jv:calipel/s' "BenchmarkInstance - referenced by PPCBenchmark class>>run:"
- #'stx:goodies/petitparser/compiler' "PPCConfiguration - referenced by PPCBenchmark>>benchmarkSmalltalkParserCompiled"
+ #'stx:goodies/petitparser/compiler' "PPCCompiler - referenced by PPCBenchmark>>benchmarkSmalltalkParserCompiled"
#'stx:goodies/petitparser/compiler/tests/extras' "PPCLRPErrorNode - referenced by PPCLRPParser_johanfabry_39>>errorNode"
#'stx:goodies/petitparser/parsers/java' "PPJavaSyntax - referenced by PPCBenchmark>>benchmarkJavaSyntax"
#'stx:goodies/refactoryBrowser/parser' "RBArrayNode - referenced by PPCSmalltalkNoopParser>>buildArray:"
@@ -107,8 +110,8 @@
PPCBenchmark
#'PPCLRPParser_johanfabry_39'
PPCSmalltalkNoopParser
+ (PPCSmalltalkNoopParserTests autoload)
#'stx_goodies_petitparser_compiler_benchmarks'
- (PPCSmalltalkNoopParserTests autoload)
)
!
--- a/compiler/extensions.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/extensions.st Mon Sep 07 08:20:46 2015 +0100
@@ -406,14 +406,13 @@
!PPParser methodsFor:'*petitcompiler'!
-compile: options
- | configuration |
+compile:options
+ | compiler |
- self assert: (options isKindOf: PPCCompilationOptions).
-
- configuration := PPCConfiguration default.
- configuration context options: options.
- ^ configuration compile: self
+ self assert:(options isKindOf:PPCCompilationOptions).
+ compiler := PPCCompiler default.
+ compiler context options:options.
+ ^ compiler compile:self
"Modified: / 28-08-2015 / 14:25:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
@@ -439,15 +438,16 @@
!PPParser methodsFor:'*petitcompiler'!
compileTokenizing
- | configuration |
- configuration := PPCConfiguration tokenizing.
- ^ self compileWithConfiguration: configuration
+ | compiler |
+
+ compiler := PPCCompiler tokenizing.
+ ^ self compileUsingCompiler: compiler
! !
!PPParser methodsFor:'*petitcompiler'!
-compileWithConfiguration: configuration
- ^ configuration compile: self
+compileUsingCompiler:aPPCCompiler
+ ^ aPPCCompiler compile:self
! !
!PPParser methodsFor:'*petitcompiler'!
--- a/compiler/libInit.cc Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/libInit.cc Mon Sep 07 08:20:46 2015 +0100
@@ -47,7 +47,7 @@
_PPCCompilationError_Init(pass,__pRT__,snd);
_PPCCompilationOptions_Init(pass,__pRT__,snd);
_PPCCompilationWarning_Init(pass,__pRT__,snd);
-_PPCConfiguration_Init(pass,__pRT__,snd);
+_PPCCompiler_Init(pass,__pRT__,snd);
_PPCContext_Init(pass,__pRT__,snd);
_PPCContextMemento_Init(pass,__pRT__,snd);
_PPCDistinctScanner_Init(pass,__pRT__,snd);
--- a/compiler/stx_goodies_petitparser_compiler.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/stx_goodies_petitparser_compiler.st Mon Sep 07 08:20:46 2015 +0100
@@ -130,7 +130,7 @@
PPCCompilationError
PPCCompilationOptions
PPCCompilationWarning
- PPCConfiguration
+ PPCCompiler
PPCContext
PPCContextMemento
PPCDistinctScanner
@@ -342,7 +342,6 @@
PPContext methodInvoked:
PPContext setWs
PPParser compileAs:
- PPParser compileWithConfiguration:
PPParser javaToken
PPContext skipSeparators
PPEndOfInputParser asCompilerNode
@@ -363,6 +362,7 @@
RBLiteralValueNode isLiteralNumber
RBProgramNode isLiteralNumber
UndefinedObject codePoint
+ PPParser compileUsingCompiler:
)
! !
--- a/compiler/tests/PEGFsaGeneratorTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PEGFsaGeneratorTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -368,10 +368,14 @@
!
testAAAorA_Astar
- <skip> "/ JK: please remove this once fixed...
+
| parser |
+ " JK: please remove this once fixed... "
+ ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ])
+ ifTrue:[ self skipIf: true description: 'never worked, JK?' ].
+
parser := (('aaa' asParser / 'a' asParser), 'a' asParser) star.
node := parser asCompilerTree.
@@ -390,7 +394,7 @@
self assert: fsa fail: 'aaa'.
self assert: fsa fail: 'a'.
- "Modified (format): / 17-08-2015 / 22:34:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 07-09-2015 / 07:48:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testAAAstar_AA
--- a/compiler/tests/PEGFsaMinimizationTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PEGFsaMinimizationTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -133,9 +133,13 @@
!
testMinimze4
- <skip> "/ JK: please remove this once fixed...
+ | merged |
- | merged |
+ " JK: please remove this once fixed... "
+ ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ])
+ ifTrue:[ self skipIf: true description: 'never worked, JK?' ].
+
+
fsa addState: a.
fsa addState: b.
fsa addState: c.
@@ -164,7 +168,7 @@
self assert: merged transitions size = 1.
self assert: merged destination isFinal.
- "Modified: / 17-08-2015 / 22:34:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 07-09-2015 / 07:48:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testStateEquals
--- a/compiler/tests/PPCCodeGeneratorTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCCodeGeneratorTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCCodeGeneratorTest
- instanceVariableNames:'visitor node result compiler parser context configuration options'
+ instanceVariableNames:'visitor node result parser context compiler options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Visitors'
@@ -13,7 +13,7 @@
!PPCCodeGeneratorTest methodsFor:'generating'!
compileTree: root
- parser := configuration compile: root.
+ parser := compiler compile: root.
! !
@@ -24,18 +24,16 @@
!
setUp
- options := PPCCompilationOptions default
- tokenize: false;
- profile: true;
- yourself.
-
- configuration := PPCConfiguration new passes:
- {
- PPCCacheFirstFollowPass.
- PPCCheckingVisitor .
- PPCUniversalCodeGenerator .
- }.
- configuration options: options.
+ options := (PPCCompilationOptions default)
+ tokenize:false;
+ profile:true;
+ yourself.
+ compiler := PPCCompiler new passes:{
+ PPCCacheFirstFollowPass.
+ PPCCheckingVisitor.
+ PPCUniversalCodeGenerator
+ }.
+ compiler options:options.
"Modified: / 04-09-2015 / 16:22:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
@@ -928,7 +926,7 @@
!
testStarAnyNode
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
node := PPCStarAnyNode new
child: PPCNilNode new;
yourself.
@@ -942,7 +940,7 @@
!
testStarCharSetPredicateNode
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
node := PPCStarCharSetPredicateNode new
predicate: (PPCharSetPredicate on: [:e | e = $a ]);
child: PPCSentinelNode new;
@@ -960,7 +958,7 @@
!
testStarMessagePredicateNode
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
node := PPCStarMessagePredicateNode new
message: #isLetter;
child: PPCSentinelNode new;
@@ -1039,7 +1037,7 @@
message: #isLetter;
child: PPCSentinelNode new;
yourself.
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
options guards: false.
self compileTree: node.
@@ -1066,7 +1064,7 @@
node := PPCForwardNode new
child: starNode;
yourself.
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
self compileTree: node.
self assert: parser class methodDictionary size = 2.
@@ -1088,7 +1086,7 @@
node := PPCForwardNode new
child: starNode;
yourself.
- configuration removePass: PPCCacheFirstFollowPass.
+ compiler removePass: PPCCacheFirstFollowPass.
self compileTree: node.
self assert: parser class methodDictionary size = 1.
--- a/compiler/tests/PPCDistinctScannerTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCDistinctScannerTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCDistinctScannerTest
- instanceVariableNames:'configuration scanner'
+ instanceVariableNames:'compiler scanner'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Tokenizing'
@@ -53,14 +53,14 @@
!
setUp
- configuration := PPCConfiguration tokenizing.
+ compiler := PPCCompiler tokenizing.
!
testConsumeToken
| parser |
parser := self fooToken, self overlappingToken.
- parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ parser compileUsingCompiler:compiler.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foobaz' asPetitStream.
scanner perform: #'consume_foo'.
@@ -75,8 +75,8 @@
testConsumeToken2
| parser |
parser := self fooToken, self barToken.
- parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ parser compileUsingCompiler:compiler.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foobar' asPetitStream.
scanner perform: #'consume_foo'.
@@ -91,9 +91,9 @@
testScan
| parser |
parser := self aToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'a' asPetitStream.
scanner perform: #'scan_token'.
@@ -108,9 +108,9 @@
testScan2
| parser |
parser := self fooToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foo' asPetitStream.
scanner perform: #'scan_foo'.
@@ -125,9 +125,9 @@
testScan3
| parser |
parser := self fooToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'bar' asPetitStream.
scanner perform: #'scan_foo'.
@@ -142,9 +142,9 @@
testScan4
| parser |
parser := self fooToken, self idToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foothere' asPetitStream.
scanner perform: #'scan_foo'.
@@ -165,9 +165,9 @@
testSequence
| parser result |
parser := self fooTrimmingToken, self idTrimmingToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foo there ' asPetitStream.
scanner perform: #'foo'.
@@ -195,9 +195,9 @@
testToken
| parser |
parser := self fooToken, self idTrimmingToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foo there' asPetitStream.
scanner perform: #'foo'.
@@ -213,9 +213,9 @@
testTrimmingScan
| parser |
parser := self fooTrimmingToken, self idTrimmingToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foo there' asPetitStream.
scanner perform: #'scan_foo'.
@@ -230,9 +230,9 @@
testTrimmingToken
| parser result |
parser := self fooTrimmingToken, self idTrimmingToken.
- parser compileWithConfiguration: configuration.
+ parser compileUsingCompiler:compiler.
- scanner := (Smalltalk at: configuration context options scannerName) new.
+ scanner := (Smalltalk at: compiler context options scannerName) new.
scanner stream: 'foo there' asPetitStream.
result := scanner perform: #'foo'.
--- a/compiler/tests/PPCLTokenizingOptimizationTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCLTokenizingOptimizationTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCLTokenizingOptimizationTest
- instanceVariableNames:'configuration parser result'
+ instanceVariableNames:'compiler parser result'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Tokenizing'
@@ -16,18 +16,18 @@
self assert: (object isKindOf: class)
!
-configuration
- configuration := PPCConfiguration new.
- configuration context options
- generate: false;
- tokenize: true.
- ^ configuration
+compiler
+ compiler := PPCCompiler new.
+ (compiler context options)
+ generate:false;
+ tokenize:true.
+ ^ compiler
- "Modified: / 04-09-2015 / 16:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 07-09-2015 / 10:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
optimize: aPPParser
- ^ self configuration compile: aPPParser.
+ ^ self compiler compile: aPPParser.
!
testCompileToken
--- a/compiler/tests/PPCNodeFirstFollowNextTests.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCNodeFirstFollowNextTests.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCNodeFirstFollowNextTests
- instanceVariableNames:'tree first node followSet configuration'
+ instanceVariableNames:'tree first node followSet compiler'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Nodes'
@@ -24,8 +24,8 @@
!PPCNodeFirstFollowNextTests methodsFor:'setup'!
setUp
- configuration := PPCConfiguration default.
- configuration context options generate: false.
+ compiler := PPCCompiler default.
+ compiler context options generate:false.
"Modified: / 28-08-2015 / 14:17:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
@@ -75,7 +75,9 @@
!
treeFrom: parser
- ^ parser compileWithConfiguration: configuration
+ ^ parser compileUsingCompiler: compiler
+
+ "Modified: / 07-09-2015 / 10:08:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCNodeFirstFollowNextTests methodsFor:'testing - first'!
@@ -164,7 +166,7 @@
!
testFirstNegate1
- configuration removePass: PPCSpecializingVisitor.
+ compiler removePass: PPCSpecializingVisitor.
tree := self treeFrom: ('a' asParser negate, 'b' asParser).
first := self first: tree.
@@ -187,7 +189,7 @@
!
testFirstNot2
- configuration removePass: PPCSpecializingVisitor.
+ compiler removePass: PPCSpecializingVisitor.
tree := self treeFrom: (#letter asParser not star, #letter asParser).
first := self first: tree.
@@ -329,7 +331,7 @@
!
testFirstSequence6
- configuration removePass: PPCSpecializingVisitor.
+ compiler removePass: PPCSpecializingVisitor.
tree := self treeFrom: #space asParser star, 'a' asParser.
tree firstFollowCache: nil.
@@ -667,7 +669,7 @@
testFollowTrimmingToken
| token1 token2 |
- configuration removePass: PPCSpecializingVisitor.
+ compiler removePass: PPCSpecializingVisitor.
token1 := #letter asParser plus trimmingToken name: 'token1'; yourself.
token2 := #letter asParser plus trimmingToken name: 'token2'; yourself.
--- a/compiler/tests/PPCNodeTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCNodeTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCNodeTest
- instanceVariableNames:'node configuration'
+ instanceVariableNames:'node compiler'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Nodes'
@@ -147,14 +147,16 @@
!
setUp
- configuration := PPCConfiguration default.
- configuration context options generate: false.
+ compiler := PPCCompiler default.
+ compiler context options generate:false.
"Modified: / 28-08-2015 / 14:19:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
treeFrom: parser
- ^ parser compileWithConfiguration: configuration
+ ^ parser compileUsingCompiler: compiler
+
+ "Modified: / 07-09-2015 / 10:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCNodeTest methodsFor:'tests - converting'!
--- a/compiler/tests/PPCOptimizeChoicesTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCOptimizeChoicesTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCOptimizeChoicesTest
- instanceVariableNames:'node result visitor configuration'
+ instanceVariableNames:'node result visitor compiler'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Visitors'
@@ -12,27 +12,24 @@
!PPCOptimizeChoicesTest methodsFor:'as yet unclassified'!
asPPCTree: parser
- ^ parser compileWithConfiguration: configuration
+ ^ parser compileUsingCompiler: compiler
+
+ "Modified: / 07-09-2015 / 10:08:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
setUp
| options |
+
super setUp.
-
visitor := PPCOptimizeChoices new.
-
- options := PPCCompilationOptions default
- profile: true;
- generate: false;
- tokenize: false;
- yourself.
-
- configuration := PPCConfiguration new.
- configuration passes:
- {
- PPCCacheFirstFollowPass.
- }.
- configuration options: options.
+ options := (PPCCompilationOptions default)
+ profile:true;
+ generate:false;
+ tokenize:false;
+ yourself.
+ compiler := PPCCompiler new.
+ compiler passes:{ PPCCacheFirstFollowPass }.
+ compiler options:options.
"Modified: / 04-09-2015 / 16:21:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
--- a/compiler/tests/PPCOverlappingTokensTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCOverlappingTokensTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCOverlappingTokensTest
- instanceVariableNames:'parser result context node options configuration fooToken idToken
+ instanceVariableNames:'parser result context node options compiler fooToken idToken
keywordToken p unaryToken assignmentToken'
classVariableNames:''
poolDictionaries:''
@@ -34,7 +34,9 @@
!
compile: aPPParser
- parser := aPPParser compileWithConfiguration: configuration
+ parser := aPPParser compileUsingCompiler: compiler
+
+ "Modified: / 07-09-2015 / 10:08:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
context
@@ -42,21 +44,28 @@
!
setUp
- options := PPCCompilationOptions default
- profile: true;
- tokenize: true;
- yourself.
-
- configuration := PPCConfiguration new.
- configuration context options: options.
-
+ options := (PPCCompilationOptions default)
+ profile:true;
+ tokenize:true;
+ yourself.
+ compiler := PPCCompiler new.
+ compiler context options:options.
self cleanClass.
-
- fooToken := 'foo' asParser token trim name: 'foo'; yourself.
- idToken := (#word asParser plus) token trim name: 'id'; yourself.
- unaryToken := (#word asParser plus, $: asParser not) token trim name: 'unary'; yourself.
- keywordToken := (#word asParser plus, $: asParser) token trim name: 'kw'; yourself.
- assignmentToken := (':=' asParser) token trim name: 'assignment'; yourself.
+ fooToken := ('foo' asParser token trim)
+ name:'foo';
+ yourself.
+ idToken := ((#word asParser plus) token trim)
+ name:'id';
+ yourself.
+ unaryToken := ((#word asParser plus , $: asParser not) token trim)
+ name:'unary';
+ yourself.
+ keywordToken := ((#word asParser plus , $: asParser) token trim)
+ name:'kw';
+ yourself.
+ assignmentToken := ((':=' asParser) token trim)
+ name:'assignment';
+ yourself.
"Modified: / 04-09-2015 / 16:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
--- a/compiler/tests/PPCTokenizingCodeGeneratorTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCTokenizingCodeGeneratorTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -4,7 +4,7 @@
PPAbstractParserTest subclass:#PPCTokenizingCodeGeneratorTest
instanceVariableNames:'visitor node result compiler parser context options tokenizer
- whitespace configuration'
+ whitespace'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Visitors'
@@ -26,7 +26,7 @@
!
compileTree: root
- parser := configuration compile: root.
+ parser := compiler compile: root.
!
@@ -35,23 +35,20 @@
!
setUp
- options := PPCCompilationOptions default
- profile: true;
- tokenize: true;
- yourself.
-
+ options := (PPCCompilationOptions default)
+ profile:true;
+ tokenize:true;
+ yourself.
self cleanClass.
-
- configuration := PPCConfiguration new.
- configuration passes: {
- PPCCacheFirstFollowPass.
- PPCTokenizingCodeGenerator.
- PPCFSAVisitor.
- PPCTokenCodeGenerator.
- PPCScannerCodeGenerator.
- }.
-
- configuration options: options.
+ compiler := PPCCompiler new.
+ compiler passes:{
+ PPCCacheFirstFollowPass.
+ PPCTokenizingCodeGenerator.
+ PPCFSAVisitor.
+ PPCTokenCodeGenerator.
+ PPCScannerCodeGenerator
+ }.
+ compiler options:options.
"Modified: / 04-09-2015 / 16:21:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
--- a/compiler/tests/PPCTokenizingTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCTokenizingTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,8 +3,8 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCTokenizingTest
- instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- options configuration'
+ instanceVariableNames:'parser result context node id node2 id2 id1 node1 node3 options
+ compiler'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Tokenizing'
@@ -44,14 +44,12 @@
!
setUp
- options := PPCCompilationOptions default
- profile: true;
- tokenize: true;
- yourself.
-
- configuration := PPCConfiguration new.
- configuration context options: options.
-
+ options := (PPCCompilationOptions default)
+ profile:true;
+ tokenize:true;
+ yourself.
+ compiler := PPCCompiler new.
+ compiler context options:options.
self cleanClass.
"Modified: / 04-09-2015 / 16:21:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -69,7 +67,7 @@
p1 := a1 star.
p2 := a2.
- parser := p1 / p2 compileWithConfiguration: configuration.
+ parser := p1 / p2 compileUsingCompiler:compiler.
self assert: parser parse: ''.
self assert: result isEmpty.
@@ -89,10 +87,8 @@
!
testChoiceOrder
- parser := (
- 'a' asParser token, 'b' asParser token /
- 'a' asParser token)
- compileWithConfiguration: configuration.
+ parser := (('a' asParser token , 'b' asParser token) / 'a' asParser token)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: result first inputValue = 'a'.
@@ -110,7 +106,7 @@
p1 := 'a' asParser token, 'b' asParser token.
p2 := 'b' asParser token / 'a' asParser token.
- parser := p1 / p2 compileWithConfiguration: configuration.
+ parser := p1 / p2 compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: result first inputValue = 'a'.
@@ -134,7 +130,7 @@
p1 := a1, 'b' asParser token.
p2 := a2.
- parser := p1 / p2 compileWithConfiguration: configuration.
+ parser := p1 / p2 compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: result first inputValue = 'a'.
@@ -155,7 +151,7 @@
p1 := a1, 'b' asParser token.
p2 := 'b' asParser token / a2.
- parser := p1 / p2 compileWithConfiguration: configuration.
+ parser := p1 / p2 compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: result first inputValue = 'a'.
@@ -172,15 +168,16 @@
!
testCompileAnd
- parser := (('foo' asParser token and) / ('bar' asParser token and)), 'bar' asParser token
- compileWithConfiguration: configuration.
+ parser := (('foo' asParser token and) / ('bar' asParser token and))
+ , 'bar' asParser token compileUsingCompiler:compiler.
self assert: parser parse: 'bar'.
self assert: result second inputValue = 'bar'.
!
testCompileChoice
- parser := ('foo' asParser / 'bar' asParser) token compileWithConfiguration: configuration.
+ parser := ('foo' asParser / 'bar' asParser) token
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -191,7 +188,8 @@
!
testCompileChoice2
- parser := ('foo' asParser token trim / 'bar' asParser token trim) compileWithConfiguration: configuration.
+ parser := ('foo' asParser token trim / 'bar' asParser token trim)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -202,8 +200,9 @@
!
testCompileComplex1
- parser := ('foo' asParser token, 'bar' asParser token) /
- ('foo' asParser token, 'baz' asParser token) compileWithConfiguration: configuration.
+ parser := ('foo' asParser token , 'bar' asParser token)
+ / ('foo' asParser token , 'baz' asParser token)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobar'.
self assert: result second inputValue = 'bar'.
@@ -216,8 +215,8 @@
!
testCompileComplex2
- parser := ('foo' asParser token, 'bar' asParser token) star, 'foo' asParser token
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser token , 'bar' asParser token) star , 'foo' asParser token
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobarfoobarfoo'.
self assert: parser parse: 'foo'.
@@ -227,9 +226,9 @@
!
testCompileComplex3
- parser := ('foo' asParser token, 'bar' asParser token) star, 'foo' asParser token /
- ('foo' asParser token, 'baz' asParser token)
- compileWithConfiguration: configuration.
+ parser := (('foo' asParser token , 'bar' asParser token) star , 'foo' asParser token)
+ / ('foo' asParser token , 'baz' asParser token)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobarfoobarfoo'.
self assert: parser parse: 'foo'.
@@ -245,7 +244,7 @@
epsilon := '' asParser token.
self should: [
- (start, epsilon, stop) compileWithConfiguration: configuration.
+ (start , epsilon , stop) compileUsingCompiler:compiler.
] raise: Exception.
"
self assert: parser parse: '()'.
@@ -254,7 +253,7 @@
!
testCompileLiteral
- parser := 'foo' asParser token compileWithConfiguration: configuration.
+ parser := 'foo' asParser token compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -262,8 +261,8 @@
!
testCompileSequence
- parser := ('foo' asParser token), ('bar' asParser token)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser token) , ('bar' asParser token)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobar'.
self assert: result first inputValue = 'foo'.
@@ -271,8 +270,8 @@
!
testCompileSequence2
- parser := ('foo' asParser trimmingToken), ('bar' asParser trimmingToken)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser trimmingToken) , ('bar' asParser trimmingToken)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobar'.
self assert: result first inputValue = 'foo'.
@@ -288,10 +287,8 @@
!
testCompileSequence3
- parser := ('foo' asParser trimmingToken),
- ('bar' asParser trimmingToken),
- ('baz' asParser trimmingToken)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser trimmingToken) , ('bar' asParser trimmingToken)
+ , ('baz' asParser trimmingToken) compileUsingCompiler:compiler.
self assert: parser parse: 'foobarbaz'.
self assert: result first inputValue = 'foo'.
@@ -304,7 +301,7 @@
!
testCompileStar
- parser := 'foo' asParser token star compileWithConfiguration: configuration.
+ parser := 'foo' asParser token star compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result first inputValue = 'foo'.
@@ -314,7 +311,8 @@
!
testCompileStar2
- parser := ('foo' asParser token, 'bar' asParser token) star compileWithConfiguration: configuration.
+ parser := ('foo' asParser token , 'bar' asParser token) star
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobar'.
self assert: context tokenReads size = 1.
@@ -326,8 +324,8 @@
!
testCompileStar3
- parser := 'a' asParser trimmingToken star, 'b' asParser trimmingToken
- compileWithConfiguration: configuration.
+ parser := 'a' asParser trimmingToken star , 'b' asParser trimmingToken
+ compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: parser parse: 'aaab'.
@@ -348,7 +346,7 @@
name: 'optionsWith';
yourself.
- parser := optionsWith compileWithConfiguration: configuration.
+ parser := optionsWith compileUsingCompiler:compiler.
self assert: parser parse: '|'.
self assert: parser parse: ']' end: 0.
@@ -374,7 +372,7 @@
tricky := (a1 asParser, choice1) / (b2 asParser, choice2).
- parser := tricky compileWithConfiguration: configuration.
+ parser := tricky compileUsingCompiler:compiler.
self assert: parser parse: '||'.
self assert: parser parse: '|]'.
@@ -411,7 +409,7 @@
arrayItem := arrayLiteral / symbolLiteral.
- parser := arrayItem compileWithConfiguration: configuration.
+ parser := arrayItem compileUsingCompiler:compiler.
self assert: parser parse: '#(foo)'.
self assert: parser parse: '#foo'.
@@ -420,7 +418,7 @@
!
testCompileTrim
- parser := 'foo' asParser token trim end compileWithConfiguration: configuration.
+ parser := 'foo' asParser token trim end compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -441,8 +439,7 @@
testTokenCharacter
| token |
token := $a asParser token.
- parser := token plus
- compileWithConfiguration: configuration.
+ parser := token plus compileUsingCompiler:compiler.
self assert: parser parse: 'a'.
self assert: result first inputValue = 'a'.
@@ -455,8 +452,7 @@
testTokenCharacter2
| token |
token := $a asParser token.
- parser := token plus
- compileWithConfiguration: configuration.
+ parser := token plus compileUsingCompiler:compiler.
self assert: parser parse: 'aaa'.
self assert: result first inputValue = 'a'.
@@ -471,8 +467,7 @@
testTokenName
| token |
token := 'foo' asParser token name: 'fooToken'; yourself.
- parser := token plus
- compileWithConfiguration: configuration.
+ parser := token plus compileUsingCompiler:compiler.
self assert: parser parse: 'foofoo'.
self assert: result first inputValue = 'foo'.
@@ -484,15 +479,14 @@
testWhitespace
| token ws trimmingToken |
- configuration removePass: PPCInliningVisitor.
+ compiler removePass: PPCInliningVisitor.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
trimmingToken := ((ws, token, ws) ==> #second)
propertyAt: 'trimmingToken' put: true;
yourself.
- parser := trimmingToken plus
- compileWithConfiguration: configuration.
+ parser := trimmingToken plus compileUsingCompiler:compiler.
self assert: parser parse: ' foo '.
self assert: result first inputValue = 'foo'.
@@ -505,15 +499,14 @@
testWhitespace2
| token ws trimmingToken |
- configuration removePass: PPCInliningVisitor.
+ compiler removePass: PPCInliningVisitor.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
trimmingToken := ((ws, token, ws) ==> #second)
propertyAt: 'trimmingToken' put: true;
yourself.
- parser := trimmingToken plus
- compileWithConfiguration: configuration.
+ parser := trimmingToken plus compileUsingCompiler:compiler.
self assert: parser parse: ' foo foo '.
self assert: result first inputValue = 'foo'.
@@ -527,15 +520,14 @@
testWhitespace3
| token ws trimmingToken |
- configuration removePass: PPCInliningVisitor.
+ compiler removePass: PPCInliningVisitor.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
trimmingToken := ((ws, token, ws) ==> #second)
propertyAt: 'trimmingToken' put: true;
yourself.
- parser := trimmingToken plus
- compileWithConfiguration: configuration.
+ parser := trimmingToken plus compileUsingCompiler:compiler.
self assert: parser parse: ' foo foo foo '.
self assert: result first inputValue = 'foo'.
--- a/compiler/tests/PPCUnivarsalGuardTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCUnivarsalGuardTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -4,7 +4,7 @@
PPAbstractParserTest subclass:#PPCUnivarsalGuardTest
instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- options configuration'
+ options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Universal'
@@ -22,13 +22,12 @@
!
setUp
- options := PPCCompilationOptions default
- profile: true;
- tokenize: false;
- yourself.
-
- configuration := PPCConfiguration new.
- configuration context options: options
+ options := (PPCCompilationOptions default)
+ profile:true;
+ tokenize:false;
+ yourself.
+ compiler := PPCCompiler new.
+ compiler context options:options
"Modified: / 04-09-2015 / 16:21:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
@@ -45,8 +44,8 @@
!PPCUnivarsalGuardTest methodsFor:'tests - guard'!
testChoiceGuard
- parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken / $d asParser trimmingToken plus)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken
+ / $d asParser trimmingToken plus) compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -70,8 +69,8 @@
!
testEmptyChoiceGuard
- parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken / $d asParser trimmingToken star)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken
+ / $d asParser trimmingToken star) compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -91,7 +90,8 @@
!
testGuardSmalltlakToken
- parser := (#letter asParser, #word asParser star) smalltalkToken compileWithConfiguration: configuration.
+ parser := (#letter asParser , #word asParser star) smalltalkToken
+ compileUsingCompiler:compiler.
self assert: parser parse: 'bar'.
self assert: (context invocations anySatisfy: [ :e | e beginsWith: 'seq' ]).
@@ -101,7 +101,8 @@
!
testSequenceGuard
- parser := ((#any asParser, #any asParser) wrapped, (#any asParser, #any asParser)) compileWithConfiguration: configuration.
+ parser := ((#any asParser , #any asParser) wrapped , (#any asParser , #any asParser))
+ compileUsingCompiler:compiler.
self assert: parser parse: 'fooo' to: #(#($f $o) #($o $o)).
self assert: parser parse: 'fo oo' to: #(#($f $o) #($ $o)) end: 4.
@@ -110,7 +111,7 @@
!
testTrimmerGuard
- parser := $a asParser trim, $b asParser compileWithConfiguration: configuration.
+ parser := $a asParser trim , $b asParser compileUsingCompiler:compiler.
self assert: parser parse: 'ab'.
self assert: parser parse: ' ab'.
--- a/compiler/tests/PPCUniversalOptimizationTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCUniversalOptimizationTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCUniversalOptimizationTest
- instanceVariableNames:'configuration'
+ instanceVariableNames:'compiler'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Universal'
@@ -16,16 +16,15 @@
!
optimize: aPPParser
- ^ aPPParser compileWithConfiguration: configuration.
+ ^ aPPParser compileUsingCompiler:compiler.
!
setUp
super setUp.
-
- configuration := PPCConfiguration new.
- configuration context options
- generate: false;
- tokenize: false.
+ compiler := PPCCompiler new.
+ (compiler context options)
+ generate:false;
+ tokenize:false.
"Modified: / 04-09-2015 / 16:21:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/PPCUniversalTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/PPCUniversalTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -4,7 +4,7 @@
PPAbstractParserTest subclass:#PPCUniversalTest
instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- options configuration'
+ options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Universal'
@@ -41,7 +41,7 @@
!PPCUniversalTest methodsFor:'tests - compiling'!
testCompileAnd
- parser := #digit asParser and compileWithConfiguration: configuration.
+ parser := #digit asParser and compileUsingCompiler:compiler.
self assert: parser parse: '1' to: $1 end: 0.
self assert: parser fail: 'a'.
@@ -61,7 +61,7 @@
!
testCompileAnyStar
- parser := #any asParser star compileWithConfiguration: configuration.
+ parser := #any asParser star compileUsingCompiler:compiler.
self assert: parser parse: 'aaa' to: { $a. $a . $a }.
@@ -71,7 +71,7 @@
testCompileBlock
parser := (#letter asParser) plus ==> [ :res | res collect: [:each | each asUppercase ]].
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: { $F . $O . $O}.
self assert: parser parse: 'bar' to: { $B . $A . $R}.
@@ -79,17 +79,17 @@
!
testCompileCharacter
- parser := $a asParser compileWithConfiguration: configuration.
+ parser := $a asParser compileUsingCompiler:compiler.
self assert: parser parse: 'a' to: $a.
self assert: parser fail: 'b'.
- parser := $# asParser compileWithConfiguration: configuration.
+ parser := $# asParser compileUsingCompiler:compiler.
self assert: parser parse: '#'.
!
testCompileChoice
- parser := (#digit asParser / #letter asParser) compileWithConfiguration: configuration.
+ parser := (#digit asParser / #letter asParser) compileUsingCompiler:compiler.
self assert: parser parse: '1' to: $1.
self assert: parser parse: 'a' to: $a.
@@ -98,7 +98,7 @@
!
testCompileChoice2
- parser := ('true' asParser / 'false' asParser) compileWithConfiguration: configuration.
+ parser := ('true' asParser / 'false' asParser) compileUsingCompiler:compiler.
self assert: parser parse: 'true' to: 'true'.
self assert: parser parse: 'false' to: 'false'.
@@ -107,26 +107,26 @@
!
testCompileLiteral
- parser := 'foo' asParser compileWithConfiguration: configuration.
+ parser := 'foo' asParser compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: 'foo'.
self assert: parser parse: 'foobar' to: 'foo' end: 3.
self assert: parser fail: 'boo'.
- parser := '#[' asParser compileWithConfiguration: configuration.
+ parser := '#[' asParser compileUsingCompiler:compiler.
self assert: parser parse: '#[1]' to: '#[' end: 2.
!
testCompileLiteral2
| quote |
quote := '''' asParser.
- parser := (quote, $a asParser ) compileWithConfiguration: configuration.
+ parser := (quote , $a asParser) compileUsingCompiler:compiler.
self assert: parser parse: '''a' to: {'''' . $a}.
!
testCompileNegate
parser := #letter asParser negate star, #letter asParser.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: '...a' to: { { $. . $. . $. } . $a }.
self assert: parser parse: 'aaa' to: { {} . $a } end: 1.
@@ -134,7 +134,7 @@
!
testCompileNil
- parser := nil asParser compileWithConfiguration: configuration.
+ parser := nil asParser compileUsingCompiler:compiler.
self assert: parser parse: 'a' to: nil end: 0.
self assert: parser parse: '' to: nil end: 0.
@@ -144,23 +144,23 @@
!
testCompileNot
- parser := #digit asParser not compileWithConfiguration: configuration.
+ parser := #digit asParser not compileUsingCompiler:compiler.
self assert: parser parse: 'a' to: nil end: 0.
self assert: parser fail: '1'.
self assert: parser parse: '' to: nil end: 0.
parser := 'foo' asParser, $: asParser not.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: { 'foo'. nil } end: 3.
parser := 'foo' asParser, $: asParser not, 'bar' asParser.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: 'foobar' to: { 'foo'. nil . 'bar' } end: 6.
!
testCompileNot2
- parser := ($a asParser, $b asParser) not compileWithConfiguration: configuration.
+ parser := ($a asParser , $b asParser) not compileUsingCompiler:compiler.
self assert: parser parse: '' to: nil end: 0.
self assert: parser parse: 'a' to: nil end: 0.
@@ -169,14 +169,14 @@
!
testCompileNot3
- parser := ('foo' asParser not, 'fee' asParser) compileWithConfiguration: configuration.
+ parser := ('foo' asParser not , 'fee' asParser) compileUsingCompiler:compiler.
self assert: parser parse: 'fee' to: #(nil 'fee').
self assert: parser fail: 'foo'.
!
testCompileNotLiteral
- parser := 'foo' asParser not compileWithConfiguration: configuration.
+ parser := 'foo' asParser not compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 1.
self assert: parser parse: 'bar' to: nil end: 0.
@@ -201,7 +201,7 @@
!
testCompileOptional
- parser := #digit asParser optional compileWithConfiguration: configuration.
+ parser := #digit asParser optional compileUsingCompiler:compiler.
self assert: parser parse: '1' to: $1.
self assert: parser parse: 'a' to: nil end: 0.
@@ -212,7 +212,7 @@
!
testCompilePlus
- parser := #letter asParser plus compileWithConfiguration: configuration.
+ parser := #letter asParser plus compileUsingCompiler:compiler.
self assert: parser parse: 'lorem' to: {$l. $o. $r. $e. $m} .
self assert: parser parse: 'a123' to: {$a} end: 1.
@@ -223,7 +223,7 @@
!
testCompilePredicate
- parser := #digit asParser compileWithConfiguration: configuration.
+ parser := #digit asParser compileUsingCompiler:compiler.
self assert: parser parse: '1' to: $1.
self assert: parser parse: '0' to: $0.
@@ -231,14 +231,14 @@
!
testCompilePredicate2
- parser := #space asParser compileWithConfiguration: configuration.
+ parser := #space asParser compileUsingCompiler:compiler.
self assert: parser parse: ' ' to: Character space.
self assert: parser fail: 'a'.
!
testCompileSequence
- parser := (#digit asParser, #letter asParser) compileWithConfiguration: configuration.
+ parser := (#digit asParser , #letter asParser) compileUsingCompiler:compiler.
self assert: parser parse: '1a' to: {$1 .$a}.
@@ -246,7 +246,8 @@
!
testCompileSequence2
- parser := (#digit asParser, #space asParser, #letter asParser) compileWithConfiguration: configuration.
+ parser := (#digit asParser , #space asParser , #letter asParser)
+ compileUsingCompiler:compiler.
self assert: parser parse: '9 c' to: {$9 . Character space. $c }.
self assert: parser fail: '9c'.
@@ -254,7 +255,8 @@
!
testCompileSequence3
- parser := (#any asParser, #any asParser, #any asParser) compileWithConfiguration: configuration.
+ parser := (#any asParser , #any asParser , #any asParser)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: #($f $o $o).
self assert: parser fail: 'fo'.
@@ -262,7 +264,7 @@
!
testCompileStar
- parser := #letter asParser star compileWithConfiguration: configuration.
+ parser := #letter asParser star compileUsingCompiler:compiler.
self assert: parser parse: 'lorem' to: {$l. $o. $r. $e. $m} .
self assert: parser parse: '' to: {}.
@@ -271,7 +273,7 @@
!
testCompileStarLiteral
- parser := 'foo' asParser star compileWithConfiguration: configuration.
+ parser := 'foo' asParser star compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: #('foo' ) .
self assert: parser parse: 'foofoo' to: #('foo' 'foo') .
@@ -281,7 +283,7 @@
!
testCompileStarPredicate
- parser := #letter asParser star compileWithConfiguration: configuration.
+ parser := #letter asParser star compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: #($f $o $o ) .
self assert: parser parse: '' to: #().
@@ -290,7 +292,7 @@
testCompileSymbolBlock
parser := (#letter asParser) plus ==> #second.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: $o.
self assert: parser parse: 'bar' to: $a.
@@ -299,7 +301,7 @@
!
testCompileTrim
- parser := $a asParser trim compileWithConfiguration: configuration.
+ parser := $a asParser trim compileUsingCompiler:compiler.
self assert: parser fail: ''.
self assert: parser parse: 'a' to: $a.
@@ -313,7 +315,7 @@
token1 := (#letter asParser) plus trimmingToken.
token2 := (#letter asParser) plus trimmingToken.
- parser := (token1, token2) compileWithConfiguration: configuration.
+ parser := (token1 , token2) compileUsingCompiler:compiler.
self assert: parser parse: 'foo bar'.
self assert: parser parse: ' foo bar '.
@@ -324,7 +326,7 @@
token1 := (#letter asParser) plus trimmingToken.
token2 := (#letter asParser) plus trimmingToken / 'foo' asParser trimmingToken.
- parser := (token1, token2) compileWithConfiguration: configuration.
+ parser := (token1 , token2) compileUsingCompiler:compiler.
self assert: parser parse: 'foo bar'.
self assert: parser parse: ' foo bar '.
@@ -335,7 +337,7 @@
token1 := ($a asParser, $b asParser) trimmingToken name: 'token1'.
token2 := (token1 not, $c asParser) trimmingToken name: 'token2'.
- parser := (token1 / token2) compileWithConfiguration: configuration.
+ parser := (token1 / token2) compileUsingCompiler:compiler.
self assert: (parser class methodDictionary includesKey: #'token1').
self assert: (parser class methodDictionary includesKey: #'token1_fast').
@@ -353,7 +355,8 @@
!PPCUniversalTest methodsFor:'tests - extra'!
testCompileSmalltalkToken
- parser := (#letter asParser, ((#letter asParser / #digit asParser) star)) smalltalkToken compileWithConfiguration: configuration.
+ parser := (#letter asParser , ((#letter asParser / #digit asParser) star))
+ smalltalkToken compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -388,14 +391,15 @@
block := ${ asParser, p1, $} asParser / nil asParser.
p1 setParser: block.
- parser := block compileWithConfiguration: configuration.
+ parser := block compileUsingCompiler:compiler.
self assert: parser parse: '{}' to: { ${. nil . $} }.
self assert: parser parse: '{{}}' to: { ${. { ${ . nil . $} } . $} }.
!
testSmalltalkToken
- parser := (#letter asParser, (#digit asParser / #letter asParser) star) smalltalkToken compileWithConfiguration: configuration.
+ parser := (#letter asParser , (#digit asParser / #letter asParser) star)
+ smalltalkToken compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 5.
self assert: parser parse: 'foo'.
@@ -415,14 +419,15 @@
name: 'kw';
yourself.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser parse: 'foo:'.
self assert: result inputValue = 'foo:'.
!
testToken
- parser := (#letter asParser, (#digit asParser / #letter asParser) star) flatten compileWithConfiguration: configuration.
+ parser := (#letter asParser , (#digit asParser / #letter asParser) star) flatten
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foo' to: 'foo'.
self assert: parser parse: 'a' to: 'a'.
@@ -431,7 +436,8 @@
!
testToken2
- parser := (#letter asParser, (#digit asParser / #letter asParser) star) token compileWithConfiguration: configuration.
+ parser := (#letter asParser , (#digit asParser / #letter asParser) star) token
+ compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 4.
self assert: parser parse: 'foo'.
@@ -443,7 +449,8 @@
!
testTrimmingToken
- parser := (#letter asParser, (#digit asParser / #letter asParser) star) trimmingToken compileWithConfiguration: configuration.
+ parser := (#letter asParser , (#digit asParser / #letter asParser) star)
+ trimmingToken compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 4.
self assert: parser parse: 'foo'.
@@ -472,8 +479,8 @@
testTrimmingToken2
- parser := 'foo' asParser trimmingToken, 'bar' asParser trimmingToken
- compileWithConfiguration: configuration.
+ parser := 'foo' asParser trimmingToken , 'bar' asParser trimmingToken
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foobar'.
self assert: result first inputValue = 'foo'.
@@ -494,8 +501,8 @@
testTrimmingToken3
- parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken)
- compileWithConfiguration: configuration.
+ parser := ('foo' asParser trimmingToken / 'bar' asParser trimmingToken)
+ compileUsingCompiler:compiler.
self assert: parser parse: 'foo'.
self assert: result inputValue = 'foo'.
@@ -520,7 +527,7 @@
identifier := (kw not, (#letter asParser, #word asParser star)) trimmingToken name: #identifier.
parser := identifier / kw.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 5.
self assert: parser parse: 'foo'.
@@ -536,7 +543,7 @@
identifier := (kw not, (#letter asParser, #word asParser star)) trimmingToken name: #identifier.
parser := identifier / kw.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 5.
self assert: parser parse: 'foo'.
@@ -552,7 +559,7 @@
identifier := (kw not, (#letter asParser, #word asParser star)) trimmingToken name: #identifier.
parser := identifier / kw.
- parser := parser compileWithConfiguration: configuration.
+ parser := parser compileUsingCompiler:compiler.
self assert: parser class methodDictionary size = 8.
self assert: (parser class methodDictionary values anySatisfy: [ :m | m selector = #kw ]).
self assert: (parser class methodDictionary values anySatisfy: [ :m | m selector = #kw_fast ]).
@@ -569,14 +576,13 @@
!PPCUniversalTest methodsFor:'tests - ids'!
setUp
- options := PPCCompilationOptions default
- profile: true;
- debug: true;
- tokenize: false;
- yourself.
-
- configuration := PPCConfiguration new.
- configuration context options: options
+ options := (PPCCompilationOptions default)
+ profile:true;
+ debug:true;
+ tokenize:false;
+ yourself.
+ compiler := PPCCompiler new.
+ compiler context options:options
"Modified: / 04-09-2015 / 16:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/Make.proto Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/Make.proto Mon Sep 07 08:20:46 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/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk/tests -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2
# if you need any additional defines for embedded C code,
@@ -109,6 +109,7 @@
cd ../../../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../../../parsers/java && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+ cd ../../../parsers/smalltalk/tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/compiler/tests/extras/PPCAbstractParserTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCAbstractParserTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -42,7 +42,7 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
@@ -54,9 +54,9 @@
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -99,13 +99,13 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
- configuration options scannerName: self compiledScannerClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
+ compiler options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCCompositeParserTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCCompositeParserTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -118,14 +118,14 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -168,12 +168,12 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCExpressionGrammarTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCExpressionGrammarTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -40,14 +40,14 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -86,12 +86,12 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCExpressionGrammarTest_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCExpressionGrammarTest_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -12,8 +12,8 @@
!PPCExpressionGrammarTest_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration tokenizing
+compiler
+ ^ PPCCompiler tokenizing
! !
!PPCExpressionGrammarTest_Tokenized class methodsFor:'documentation'!
--- a/compiler/tests/extras/PPCExpressionGrammarTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCExpressionGrammarTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCExpressionGrammarTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration universal
+compiler
+ ^ PPCCompiler universal
! !
--- a/compiler/tests/extras/PPCLL1ExpressionGrammarTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -40,14 +40,14 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -86,12 +86,12 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCLL1ExpressionGrammarTest_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration tokenizing
+compiler
+ ^ PPCCompiler tokenizing
! !
--- a/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -12,8 +12,8 @@
!PPCLL1ExpressionGrammarTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration universal
+compiler
+ ^ PPCCompiler universal
! !
!PPCLL1ExpressionGrammarTest_Universal class methodsFor:'documentation'!
--- a/compiler/tests/extras/PPCLRPCompiledParserSmokeTest.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLRPCompiledParserSmokeTest.st Mon Sep 07 08:20:46 2015 +0100
@@ -42,15 +42,15 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration options tokenize) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler options tokenize) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 04-09-2015 / 15:44:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -83,12 +83,12 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCLRPCompiledParserSmokeTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLRPCompiledParserSmokeTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCLRPCompiledParserSmokeTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration universal
+compiler
+ ^ PPCCompiler universal
! !
--- a/compiler/tests/extras/PPCLRPTimeoutTransition.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCLRPTimeoutTransition.st Mon Sep 07 08:20:46 2015 +0100
@@ -9,6 +9,7 @@
category:'PetitCompiler-Extras-Tests-LRP'
!
+
!PPCLRPTimeoutTransition methodsFor:'printing'!
printOn: aStream
@@ -23,3 +24,10 @@
aStream nextPutAll: self eventname asString.
! !
+!PPCLRPTimeoutTransition class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPCSmalltalkGrammarTests.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarTests.st Mon Sep 07 08:20:46 2015 +0100
@@ -40,7 +40,7 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
@@ -51,9 +51,9 @@
^ (self petitParserClass name , 'C_Scanner') asSymbol
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -92,14 +92,14 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
- configuration options scannerName: self compiledScannerClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
+ compiler options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCSmalltalkGrammarTests_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarTests_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCSmalltalkGrammarTests_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration tokenizing
+compiler
+ ^ PPCCompiler tokenizing
! !
--- a/compiler/tests/extras/PPCSmalltalkGrammarTests_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarTests_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCSmalltalkGrammarTests_Universal methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration universal
+compiler
+ ^ PPCCompiler universal
! !
--- a/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,10 +11,10 @@
!PPCSmalltalkGrammarVerificationTest_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^ PPCConfiguration tokenizing
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler tokenizing
"Created: / 29-07-2015 / 19:54:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,10 +11,10 @@
!PPCSmalltalkGrammarVerificationTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^ PPCConfiguration universal
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler universal
"Created: / 29-07-2015 / 19:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/PPCSmalltalkParserTests.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserTests.st Mon Sep 07 08:20:46 2015 +0100
@@ -40,7 +40,7 @@
^ (self petitParserClass name , 'C_' ,
"This is bit hacky!!"
- ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
+ (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
"Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
@@ -51,9 +51,9 @@
^ (self petitParserClass name , 'C_Scanner') asSymbol
!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
^ self subclassResponsibility
"Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -92,14 +92,14 @@
setUpBefore
"Called before any of my tests is run (when resources are set up)"
- | time configuration |
+ | time compiler |
- configuration := self compilerConfiguration.
- configuration options parserName: self compiledParserClassName.
- configuration options scannerName: self compiledScannerClassName.
+ compiler := self compiler.
+ compiler options parserName: self compiledParserClassName.
+ compiler options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
- self petitParser compileWithConfiguration: configuration.
+ self petitParser compileUsingCompiler:compiler.
].
Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
--- a/compiler/tests/extras/PPCSmalltalkParserTests_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserTests_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCSmalltalkParserTests_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration tokenizing
+compiler
+ ^ PPCCompiler tokenizing
! !
--- a/compiler/tests/extras/PPCSmalltalkParserTests_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserTests_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,7 +11,7 @@
!PPCSmalltalkParserTests_Universal methodsFor:'accessing'!
-compilerConfiguration
- ^ PPCConfiguration universal
+compiler
+ ^ PPCCompiler universal
! !
--- a/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,10 +11,10 @@
!PPCSmalltalkParserVerificationTest_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^ PPCConfiguration tokenizing
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler tokenizing
"Created: / 29-07-2015 / 19:54:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,10 +11,10 @@
!PPCSmalltalkParserVerificationTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^ PPCConfiguration universal
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler universal
"Created: / 29-07-2015 / 19:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/PPCSmalltalkTests.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkTests.st Mon Sep 07 08:20:46 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCSmalltalkTests
- instanceVariableNames:'configuration options result'
+ instanceVariableNames:'compiler options result'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Extras-Tests-Smalltalk'
@@ -21,14 +21,14 @@
profile: true;
yourself.
- configuration := PPCTokenizingConfiguration new
+ compiler := PPCTokenizingConfiguration new
options: options;
yourself.
!
testSmalltakToken
| token1 |
- token1 := 'a' asParser smalltalkToken compileWithConfiguration: configuration.
+ token1 := 'a' asParser smalltalkToken compileUsingCompiler:compiler.
self assert: ((token1 parse: 'a') class == PPSmalltalkToken).
self assert: (token1 parse: '"comment" a "another comment"') inputValue = 'a'
@@ -37,7 +37,7 @@
testSmalltakToken2
| parser compiled |
parser := 'a' asParser smalltalkToken, 'b' asParser smalltalkToken.
- compiled := parser compileWithConfiguration: configuration.
+ compiled := parser compileUsingCompiler:compiler.
self assert: compiled parse: 'ab'.
self assert: compiled parse: '"comment" a "another comment" b '.
--- a/compiler/tests/extras/PPCompiledJavaResource.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPCompiledJavaResource.st Mon Sep 07 08:20:46 2015 +0100
@@ -12,15 +12,17 @@
!PPCompiledJavaResource methodsFor:'as yet unclassified'!
setUp
- | time configuration |
-
- configuration := PPCConfiguration universal.
- configuration options parserName:#PPCompiledJavaSyntax.
-
- time := Time millisecondsToRun: [
- PPJavaSyntax new compileWithConfiguration: configuration.
- ].
- Transcript show: 'Java Syntax compiled in: '; show: time asString; show: 'ms'; cr.
+ | time compiler |
+
+ compiler := PPCCompiler universal.
+ compiler options parserName:#PPCompiledJavaSyntax.
+ time := Time
+ millisecondsToRun:[ PPJavaSyntax new compileUsingCompiler:compiler. ].
+ Transcript
+ show:'Java Syntax compiled in: ';
+ show:time asString;
+ show:'ms';
+ cr.
"Modified: / 10-05-2015 / 07:45:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/PPExpressionGrammarVerificationTest_Tokenized.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPExpressionGrammarVerificationTest_Tokenized.st Mon Sep 07 08:20:46 2015 +0100
@@ -9,13 +9,21 @@
category:'PetitCompiler-Extras-Tests-Expressions'
!
+
!PPExpressionGrammarVerificationTest_Tokenized methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^ PPCConfiguration tokenizing
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler tokenizing
"Modified: / 29-07-2015 / 17:07:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!PPExpressionGrammarVerificationTest_Tokenized class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPExpressionGrammarVerificationTest_Universal.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/PPExpressionGrammarVerificationTest_Universal.st Mon Sep 07 08:20:46 2015 +0100
@@ -11,10 +11,10 @@
!PPExpressionGrammarVerificationTest_Universal methodsFor:'accessing'!
-compilerConfiguration
- "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
-
- ^PPCConfiguration universal
+compiler
+ "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
+
+ ^ PPCCompiler universal
"Modified: / 29-07-2015 / 17:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/tests/extras/abbrev.stc Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/abbrev.stc Mon Sep 07 08:20:46 2015 +0100
@@ -1,15 +1,43 @@
# automagically generated by the project definition
# this file is needed for stc to be able to compile modules independently.
# it provides information about a classes filename, category and especially namespace.
+PPCAbstractParserTest PPCAbstractParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
+PPCCompiledJavaVerificationTest PPCCompiledJavaVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
+PPCCompositeParserTest PPCCompositeParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
+PPCJavaTests PPCJavaTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
PPCLRPNode PPCLRPNode stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPParser PPCLRPParser stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPParserSmokeTest PPCLRPParserSmokeTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 1
PPCLRPSourcesResource PPCLRPSourcesResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 1
+PPCResources PPCResources stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
+PPCSetUpBeforeTearDownAfterResource PPCSetUpBeforeTearDownAfterResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 2
+PPCSmalltalkGrammarTests PPCSmalltalkGrammarTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserTests PPCSmalltalkParserTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkTests PPCSmalltalkTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCompiledJavaResource PPCompiledJavaResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
+PPCompiledJavaSyntaxTest PPCompiledJavaSyntaxTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
+PPExpressionGrammar PPExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0
+PPExpressionGrammarTest PPExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPLL1ExpressionGrammar PPLL1ExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0
+PPLL1ExpressionGrammarTest PPLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
stx_goodies_petitparser_compiler_tests_extras stx_goodies_petitparser_compiler_tests_extras stx:goodies/petitparser/compiler/tests/extras '* Projects & Packages *' 3
+PPCExpressionGrammarTest PPCExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPCExpressionGrammarVerificationTest PPCExpressionGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPCLL1ExpressionGrammarTest PPCLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
PPCLRPAction PPCLRPAction stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPCompiledParserSmokeTest PPCLRPCompiledParserSmokeTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 1
PPCLRPContainedElement PPCLRPContainedElement stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPSpawn PPCLRPSpawn stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
+PPCSmalltalkGrammarTests_Tokenized PPCSmalltalkGrammarTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkGrammarTests_Universal PPCSmalltalkGrammarTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkGrammarVerificationTest PPCSmalltalkGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserTests_Tokenized PPCSmalltalkParserTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserTests_Universal PPCSmalltalkParserTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserVerificationTest PPCSmalltalkParserVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCExpressionGrammarTest_Tokenized PPCExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPCExpressionGrammarTest_Universal PPCExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPCLL1ExpressionGrammarTest_Tokenized PPCLL1ExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPCLL1ExpressionGrammarTest_Universal PPCLL1ExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
PPCLRPComment PPCLRPComment stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPCompiledParserSmokeTest_Universal PPCLRPCompiledParserSmokeTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 1
PPCLRPErrorNode PPCLRPErrorNode stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
@@ -21,40 +49,12 @@
PPCLRPState PPCLRPState stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPTransition PPCLRPTransition stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPVariable PPCLRPVariable stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
+PPCSmalltalkGrammarVerificationTest_Tokenized PPCSmalltalkGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkGrammarVerificationTest_Universal PPCSmalltalkGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserVerificationTest_Tokenized PPCSmalltalkParserVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPCSmalltalkParserVerificationTest_Universal PPCSmalltalkParserVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
+PPExpressionGrammarVerificationTest_Tokenized PPExpressionGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
+PPExpressionGrammarVerificationTest_Universal PPExpressionGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
PPCLRPEpsilonTransition PPCLRPEpsilonTransition stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPTimeoutTransition PPCLRPTimeoutTransition stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
PPCLRPWildcardTransition PPCLRPWildcardTransition stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-LRP' 0
-PPCAbstractParserTest PPCAbstractParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
-PPCCompiledJavaVerificationTest PPCCompiledJavaVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
-PPCCompositeParserTest PPCCompositeParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
-PPCExpressionGrammarTest PPCExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCExpressionGrammarTest_Tokenized PPCExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCExpressionGrammarTest_Universal PPCExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCExpressionGrammarVerificationTest PPCExpressionGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCJavaTests PPCJavaTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
-PPCLL1ExpressionGrammarTest PPCLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCLL1ExpressionGrammarTest_Tokenized PPCLL1ExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCLL1ExpressionGrammarTest_Universal PPCLL1ExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPCResources PPCResources stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1
-PPCSetUpBeforeTearDownAfterResource PPCSetUpBeforeTearDownAfterResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 2
-PPCSmalltalkGrammarTests PPCSmalltalkGrammarTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkGrammarTests_Tokenized PPCSmalltalkGrammarTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkGrammarTests_Universal PPCSmalltalkGrammarTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkGrammarVerificationTest PPCSmalltalkGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkGrammarVerificationTest_Tokenized PPCSmalltalkGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkGrammarVerificationTest_Universal PPCSmalltalkGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserTests PPCSmalltalkParserTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserTests_Tokenized PPCSmalltalkParserTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserTests_Universal PPCSmalltalkParserTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserVerificationTest PPCSmalltalkParserVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserVerificationTest_Tokenized PPCSmalltalkParserVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkParserVerificationTest_Universal PPCSmalltalkParserVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCSmalltalkTests PPCSmalltalkTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1
-PPCompiledJavaResource PPCompiledJavaResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
-PPCompiledJavaSyntaxTest PPCompiledJavaSyntaxTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1
-PPExpressionGrammar PPExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0
-PPExpressionGrammarTest PPExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPExpressionGrammarVerificationTest_Tokenized PPExpressionGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPExpressionGrammarVerificationTest_Universal PPExpressionGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
-PPLL1ExpressionGrammar PPLL1ExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0
-PPLL1ExpressionGrammarTest PPLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1
--- a/compiler/tests/extras/bc.mak Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/bc.mak Mon Sep 07 08:20:46 2015 +0100
@@ -35,7 +35,7 @@
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk\tests -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -59,6 +59,7 @@
pushd ..\..\..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\..\parsers\java & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+ pushd ..\..\..\parsers\smalltalk\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
--- a/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st Mon Sep 07 08:20:46 2015 +0100
@@ -84,10 +84,11 @@
^ #(
#'stx:goodies/petitparser' "PPCompositeParser - superclass of PPCLRPParser"
- #'stx:goodies/petitparser/parsers/java' "PPJavaWhitespaceParser - extended"
- #'stx:goodies/petitparser/tests' "PPAbstractParserTest - superclass of PPCLRPCompiledParserSmokeTest"
- #'stx:goodies/sunit' "TestAsserter - superclass of PPCLRPCompiledParserSmokeTest"
- #'stx:libbasic' "Autoload - superclass of PPCAbstractParserTest"
+ #'stx:goodies/petitparser/parsers/java' "PPJavaLexiconTest - superclass of PPCompiledJavaSyntaxTest"
+ #'stx:goodies/petitparser/parsers/smalltalk/tests' "PPSmalltalkGrammarTests - superclass of PPCSmalltalkGrammarTests"
+ #'stx:goodies/petitparser/tests' "PPAbstractParserTest - superclass of PPCAbstractParserTest"
+ #'stx:goodies/sunit' "TestAsserter - superclass of PPCAbstractParserTest"
+ #'stx:libbasic' "LibraryDefinition - superclass of stx_goodies_petitparser_compiler_tests_extras"
)
!
@@ -102,8 +103,9 @@
by searching all classes (and their packages) which are referenced by my classes."
^ #(
- #'stx:goodies/petitparser/compiler' "PPCConfiguration - referenced by PPCLRPCompiledParserSmokeTest_Universal>>compilerConfiguration"
- #'stx:goodies/petitparser/parsers/smalltalk' "PPSmalltalkParser - referenced by PPCLRPParser>>methodizeBlock:withArguments:"
+ #'stx:goodies/petitparser/compiler' "PPCCompiler - referenced by PPCExpressionGrammarTest_Tokenized>>compiler"
+ #'stx:goodies/petitparser/parsers/smalltalk' "PPSmalltalkGrammar - referenced by PPCSmalltalkGrammarTests>>petitParserClass"
+ #'stx:libbasic2' "Random - referenced by PPCResources>>expressionOfSize:stream:"
)
!
@@ -127,15 +129,43 @@
^ #(
"<className> or (<className> attributes...) in load order"
+ (PPCAbstractParserTest autoload)
+ (PPCCompiledJavaVerificationTest autoload)
+ (PPCCompositeParserTest autoload)
+ (PPCJavaTests autoload)
PPCLRPNode
PPCLRPParser
PPCLRPParserSmokeTest
PPCLRPSourcesResource
+ (PPCResources autoload)
+ (PPCSetUpBeforeTearDownAfterResource autoload)
+ (PPCSmalltalkGrammarTests autoload)
+ (PPCSmalltalkParserTests autoload)
+ (PPCSmalltalkTests autoload)
+ (PPCompiledJavaResource autoload)
+ (PPCompiledJavaSyntaxTest autoload)
+ (PPExpressionGrammar autoload)
+ (PPExpressionGrammarTest autoload)
+ (PPLL1ExpressionGrammar autoload)
+ (PPLL1ExpressionGrammarTest autoload)
(#'stx_goodies_petitparser_compiler_tests_extras' autoload)
+ (PPCExpressionGrammarTest autoload)
+ (PPCExpressionGrammarVerificationTest autoload)
+ (PPCLL1ExpressionGrammarTest autoload)
PPCLRPAction
PPCLRPCompiledParserSmokeTest
PPCLRPContainedElement
PPCLRPSpawn
+ (#'PPCSmalltalkGrammarTests_Tokenized' autoload)
+ (#'PPCSmalltalkGrammarTests_Universal' autoload)
+ (PPCSmalltalkGrammarVerificationTest autoload)
+ (#'PPCSmalltalkParserTests_Tokenized' autoload)
+ (#'PPCSmalltalkParserTests_Universal' autoload)
+ (PPCSmalltalkParserVerificationTest autoload)
+ (#'PPCExpressionGrammarTest_Tokenized' autoload)
+ (#'PPCExpressionGrammarTest_Universal' autoload)
+ (#'PPCLL1ExpressionGrammarTest_Tokenized' autoload)
+ (#'PPCLL1ExpressionGrammarTest_Universal' autoload)
PPCLRPComment
#'PPCLRPCompiledParserSmokeTest_Universal'
PPCLRPErrorNode
@@ -147,43 +177,15 @@
PPCLRPState
PPCLRPTransition
PPCLRPVariable
+ (#'PPCSmalltalkGrammarVerificationTest_Tokenized' autoload)
+ (#'PPCSmalltalkGrammarVerificationTest_Universal' autoload)
+ (#'PPCSmalltalkParserVerificationTest_Tokenized' autoload)
+ (#'PPCSmalltalkParserVerificationTest_Universal' autoload)
+ (#'PPExpressionGrammarVerificationTest_Tokenized' autoload)
+ (#'PPExpressionGrammarVerificationTest_Universal' autoload)
PPCLRPEpsilonTransition
PPCLRPTimeoutTransition
PPCLRPWildcardTransition
- (PPCAbstractParserTest autoload)
- (PPCCompiledJavaVerificationTest autoload)
- (PPCCompositeParserTest autoload)
- (PPCExpressionGrammarTest autoload)
- (#'PPCExpressionGrammarTest_Tokenized' autoload)
- (#'PPCExpressionGrammarTest_Universal' autoload)
- (PPCExpressionGrammarVerificationTest autoload)
- (PPCJavaTests autoload)
- (PPCLL1ExpressionGrammarTest autoload)
- (#'PPCLL1ExpressionGrammarTest_Tokenized' autoload)
- (#'PPCLL1ExpressionGrammarTest_Universal' autoload)
- (PPCResources autoload)
- (PPCSetUpBeforeTearDownAfterResource autoload)
- (PPCSmalltalkGrammarTests autoload)
- (#'PPCSmalltalkGrammarTests_Tokenized' autoload)
- (#'PPCSmalltalkGrammarTests_Universal' autoload)
- (PPCSmalltalkGrammarVerificationTest autoload)
- (#'PPCSmalltalkGrammarVerificationTest_Tokenized' autoload)
- (#'PPCSmalltalkGrammarVerificationTest_Universal' autoload)
- (PPCSmalltalkParserTests autoload)
- (#'PPCSmalltalkParserTests_Tokenized' autoload)
- (#'PPCSmalltalkParserTests_Universal' autoload)
- (PPCSmalltalkParserVerificationTest autoload)
- (#'PPCSmalltalkParserVerificationTest_Tokenized' autoload)
- (#'PPCSmalltalkParserVerificationTest_Universal' autoload)
- (PPCSmalltalkTests autoload)
- (PPCompiledJavaResource autoload)
- (PPCompiledJavaSyntaxTest autoload)
- (PPExpressionGrammar autoload)
- (PPExpressionGrammarTest autoload)
- (#'PPExpressionGrammarVerificationTest_Tokenized' autoload)
- (#'PPExpressionGrammarVerificationTest_Universal' autoload)
- (PPLL1ExpressionGrammar autoload)
- (PPLL1ExpressionGrammarTest autoload)
)
!